diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index f61055efd42..82bf4e23a57 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.13.0 + uses: s4u/setup-maven-action@v1.14.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.13.0 + uses: s4u/setup-maven-action@v1.14.0 with: java-version: 11 maven-version: 3.8.8 diff --git a/.github/workflows/maven-plugin-tests.yaml b/.github/workflows/maven-plugin-tests.yaml index 4844576096b..171cf42d7e6 100644 --- a/.github/workflows/maven-plugin-tests.yaml +++ b/.github/workflows/maven-plugin-tests.yaml @@ -39,6 +39,7 @@ jobs: run: | ./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet clean install -f modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 6070ca97d95..45baea95da7 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -151,7 +151,24 @@ jobs: 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 + + rm -rf samples/client/petstore/csharp/generichost/net4.8/AllOf + rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOf + rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare + rm -rf samples/client/petstore/csharp/generichost/net4.8/FormModels + rm -rf samples/client/petstore/csharp/generichost/net4.8/OneOf + rm -rf samples/client/petstore/csharp/generichost/net4.8/Petstore + rm -rf samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate + + rm -rf samples/client/petstore/csharp/generichost/net4.7/AllOf + rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOf + rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare + rm -rf samples/client/petstore/csharp/generichost/net4.7/FormModels + rm -rf samples/client/petstore/csharp/generichost/net4.7/OneOf + rm -rf samples/client/petstore/csharp/generichost/net4.7/Petstore + rm -rf samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate - name: Generate samples run: | bash bin/generate-samples.sh diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml index 567ab1e1c87..b885f4dbe7c 100644 --- a/.github/workflows/samples-cpp-qt-client.yaml +++ b/.github/workflows/samples-cpp-qt-client.yaml @@ -3,10 +3,10 @@ name: Samples cpp qt client on: push: branches: - - 'samples/client/petstore/cpp-qt/**' + - "samples/client/petstore/cpp-qt/**" pull_request: paths: - - 'samples/client/petstore/cpp-qt/**' + - "samples/client/petstore/cpp-qt/**" env: GRADLE_VERSION: 6.9 @@ -16,9 +16,6 @@ jobs: name: Build cpp qt client strategy: matrix: - qt-version: - - '5.15.2' - - '6.5.3' os: - ubuntu-latest - macOS-latest @@ -29,8 +26,8 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@v4 with: - version: ${{ matrix.qt-version }} - tools: ${{ matrix.tools }} + version: "6.7.1" + target: "desktop" - name: Build working-directory: "samples/client/petstore/cpp-qt" run: cmake . && cmake --build . diff --git a/.github/workflows/samples-dotnet-fx.yaml b/.github/workflows/samples-dotnet-fx.yaml new file mode 100644 index 00000000000..94cd8ea40e0 --- /dev/null +++ b/.github/workflows/samples-dotnet-fx.yaml @@ -0,0 +1,42 @@ +name: Samples C# .Net Framework Clients + +on: + push: + paths: + - samples/client/petstore/csharp/generichost/net4.7/** + - samples/client/petstore/csharp/generichost/net4.8/** + pull_request: + paths: + - samples/client/petstore/csharp/generichost/net4.7/** + - samples/client/petstore/csharp/generichost/net4.8/** +jobs: + build: + name: Build .Net projects + runs-on: windows-2019 + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/csharp/generichost/net4.7/AllOf + - samples/client/petstore/csharp/generichost/net4.7/AnyOf + - samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare + - samples/client/petstore/csharp/generichost/net4.7/FormModels + - samples/client/petstore/csharp/generichost/net4.7/OneOf + - samples/client/petstore/csharp/generichost/net4.7/Petstore + - samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate + + - samples/client/petstore/csharp/generichost/net4.8/AllOf + - samples/client/petstore/csharp/generichost/net4.8/AnyOf + - samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare + - samples/client/petstore/csharp/generichost/net4.8/FormModels + - samples/client/petstore/csharp/generichost/net4.8/OneOf + - samples/client/petstore/csharp/generichost/net4.8/Petstore + - samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate + steps: + - uses: actions/checkout@v4 + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/.github/workflows/samples-dotnet-standard.yaml b/.github/workflows/samples-dotnet-standard.yaml index fb34e0108ff..dae16d82d60 100644 --- a/.github/workflows/samples-dotnet-standard.yaml +++ b/.github/workflows/samples-dotnet-standard.yaml @@ -28,7 +28,7 @@ jobs: # - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 3.1.* - name: Build diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index 9481be79501..24b44c7d92a 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -34,7 +34,7 @@ jobs: - samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '8.0.x' - name: Build diff --git a/.github/workflows/samples-dotnet6-client-echo-api.yaml b/.github/workflows/samples-dotnet6-client-echo-api.yaml index 6aefe16aecb..2aff7759f4f 100644 --- a/.github/workflows/samples-dotnet6-client-echo-api.yaml +++ b/.github/workflows/samples-dotnet6-client-echo-api.yaml @@ -19,7 +19,7 @@ jobs: - samples/client/echo_api/csharp-restsharp/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '6.0.x' - name: Run echo server diff --git a/.github/workflows/samples-dotnet6-client.yaml b/.github/workflows/samples-dotnet6-client.yaml index 794611b9b53..da359f76f69 100644 --- a/.github/workflows/samples-dotnet6-client.yaml +++ b/.github/workflows/samples-dotnet6-client.yaml @@ -18,7 +18,7 @@ jobs: - samples/client/petstore/csharp/restsharp/net6/ParameterMappings/ steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '6.0.x' - name: Build diff --git a/.github/workflows/samples-dotnet6-server.yaml b/.github/workflows/samples-dotnet6-server.yaml index bfdca34f50e..a72f0ac5b95 100644 --- a/.github/workflows/samples-dotnet6-server.yaml +++ b/.github/workflows/samples-dotnet6-server.yaml @@ -25,7 +25,7 @@ jobs: - samples/server/petstore/aspnetcore-6.0-useSwashBuckle steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4.0.0 + - uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: '6.0.x' - name: Build diff --git a/.github/workflows/samples-dotnet8-server.yaml b/.github/workflows/samples-dotnet8-server.yaml new file mode 100644 index 00000000000..817455aa4d7 --- /dev/null +++ b/.github/workflows/samples-dotnet8-server.yaml @@ -0,0 +1,36 @@ +name: Samples C# .Net 8 Server + +on: + push: + paths: + - samples/server/petstore/aspnetcore-8.0/** + - samples/server/petstore/aspnetcore-8.0-*/** + pull_request: + paths: + - samples/server/petstore/aspnetcore-8.0/** + - samples/server/petstore/aspnetcore-8.0-*/** +jobs: + build: + name: Build .Net 8 servers + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/server/petstore/aspnetcore-8.0 + - samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse + - samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes + - samples/server/petstore/aspnetcore-8.0-pocoModels + - samples/server/petstore/aspnetcore-8.0-project4Models + - samples/server/petstore/aspnetcore-8.0-useSwashBuckle + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4.0.1 + with: + dotnet-version: '8.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/.github/workflows/samples-elm.yaml b/.github/workflows/samples-elm.yaml index 33f6f120000..a9dad78925a 100644 --- a/.github/workflows/samples-elm.yaml +++ b/.github/workflows/samples-elm.yaml @@ -22,7 +22,7 @@ jobs: - samples/openapi3/client/elm steps: - uses: actions/checkout@v4 - - uses: jorelali/setup-elm@v5 + - uses: jorelali/setup-elm@v6 with: elm-version: 0.19.1 - name: Build diff --git a/.github/workflows/samples-haskell.yaml b/.github/workflows/samples-haskell.yaml index a1d7d3940fc..16f8e1ffa76 100644 --- a/.github/workflows/samples-haskell.yaml +++ b/.github/workflows/samples-haskell.yaml @@ -5,11 +5,13 @@ on: paths: - samples/server/petstore/haskell-yesod/** - samples/server/petstore/haskell-servant/** + - samples/server/others/haskell-servant-ping/** - samples/client/petstore/haskell-http-client/** pull_request: paths: - samples/server/petstore/haskell-yesod/** - samples/server/petstore/haskell-servant/** + - samples/server/others/haskell-servant-ping/** - samples/client/petstore/haskell-http-client/** jobs: build: @@ -22,6 +24,7 @@ jobs: # servers - samples/server/petstore/haskell-yesod/ - samples/server/petstore/haskell-servant/ + - samples/server/others/haskell-servant-ping/ - samples/client/petstore/haskell-http-client/ steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml index 96635a4d3f9..5e27029ee35 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml @@ -43,4 +43,4 @@ jobs: (cd http-echo-server && npm install && npm start &) - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml index 3c193ea204f..ddbbfcd9de6 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk17.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml @@ -3,10 +3,10 @@ name: Java Client (Echo API) JDK17 on: push: paths: - - samples/client/echo_api/java/restclient + - samples/client/echo_api/java/** pull_request: paths: - - samples/client/echo_api/java/restclient + - samples/client/echo_api/java/** jobs: build: name: Build Java Client JDK17 @@ -16,6 +16,11 @@ jobs: matrix: sample: # clients + - samples/client/echo_api/java/apache-httpclient + - samples/client/echo_api/java/native + - samples/client/echo_api/java/feign-gson + - samples/client/echo_api/java/resttemplate + - samples/client/echo_api/java/resteasy - samples/client/echo_api/java/restclient steps: - uses: actions/checkout@v4 @@ -39,4 +44,4 @@ jobs: (cd http-echo-server && npm install && npm start &) - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-client-echo-api-jdk8.yaml b/.github/workflows/samples-java-client-echo-api-jdk8.yaml index 2c5cbb93711..40deef1c721 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk8.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk8.yaml @@ -50,4 +50,4 @@ jobs: (cd http-echo-server && npm install && npm start &) - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 15994e5b749..6c002712d01 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -97,4 +97,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml index b43fee7981c..04e261cad6f 100644 --- a/.github/workflows/samples-java-client-jdk17.yaml +++ b/.github/workflows/samples-java-client-jdk17.yaml @@ -42,7 +42,7 @@ jobs: - name: Build with Maven working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress - name: Cache gradle dependencies uses: actions/cache@v4 diff --git a/.github/workflows/samples-java-helidon-v3.yaml b/.github/workflows/samples-java-helidon-v3.yaml index 7f2bce545c7..976c7f59cb7 100644 --- a/.github/workflows/samples-java-helidon-v3.yaml +++ b/.github/workflows/samples-java-helidon-v3.yaml @@ -38,4 +38,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml index 3b2bc66ec90..b13977d4691 100644 --- a/.github/workflows/samples-java-helidon-v4.yaml +++ b/.github/workflows/samples-java-helidon-v4.yaml @@ -36,4 +36,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-play-framework.yaml b/.github/workflows/samples-java-play-framework.yaml index f4e6d8e8597..bab74f9d3d0 100644 --- a/.github/workflows/samples-java-play-framework.yaml +++ b/.github/workflows/samples-java-play-framework.yaml @@ -44,4 +44,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml index 56694212c96..67f3d6e7b67 100644 --- a/.github/workflows/samples-java-server-jdk8.yaml +++ b/.github/workflows/samples-java-server-jdk8.yaml @@ -3,8 +3,6 @@ name: Samples Java Server on: push: paths: - # java-camel is tested locally for the time being - #- 'samples/server/petstore/java-camel/**' - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-pkmst/**' @@ -13,7 +11,6 @@ on: - 'samples/server/petstore/java-microprofile/**' pull_request: paths: - #- 'samples/server/petstore/java-camel/**' - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-pkmst/**' @@ -28,7 +25,6 @@ jobs: matrix: sample: # servers - #- samples/server/petstore/java-camel/ - samples/server/petstore/java-vertx-web/ - samples/server/petstore/java-inflector/ - samples/server/petstore/java-pkmst/ @@ -50,4 +46,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-java-wiremock.yaml b/.github/workflows/samples-java-wiremock.yaml index 4398c723236..7ce35801516 100644 --- a/.github/workflows/samples-java-wiremock.yaml +++ b/.github/workflows/samples-java-wiremock.yaml @@ -32,4 +32,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-jaxrs-jdk11.yaml b/.github/workflows/samples-jaxrs-jdk11.yaml index 0af4e77544a..a11a93e5134 100644 --- a/.github/workflows/samples-jaxrs-jdk11.yaml +++ b/.github/workflows/samples-jaxrs-jdk11.yaml @@ -33,4 +33,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml index 3e709c111d9..70f0346045d 100644 --- a/.github/workflows/samples-jaxrs.yaml +++ b/.github/workflows/samples-jaxrs.yaml @@ -53,4 +53,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index f013cd851c0..e96bfc1ca29 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -9,8 +9,10 @@ on: - samples/client/petstore/spring-http-interface-reactive/** - samples/client/petstore/spring-http-interface/** - samples/client/petstore/java/webclient-jakarta/** + - samples/client/petstore/java/microprofile-rest-client-outer-enum/** # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/java-camel/** - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** pull_request: @@ -22,8 +24,10 @@ on: - samples/client/petstore/spring-http-interface-reactive/** - samples/client/petstore/spring-http-interface/** - samples/client/petstore/java/webclient-jakarta/** + - samples/client/petstore/java/microprofile-rest-client-outer-enum/** # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/java-camel/** - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** jobs: @@ -41,8 +45,10 @@ jobs: - samples/client/petstore/spring-http-interface-reactive - samples/client/petstore/spring-http-interface - samples/client/petstore/java/webclient-jakarta + - samples/client/petstore/java/microprofile-rest-client-outer-enum # servers - samples/openapi3/server/petstore/springboot-3 + - samples/server/petstore/java-camel/ - samples/server/petstore/java-helidon-server/v3/mp/ - samples/server/petstore/java-helidon-server/v3/se - samples/client/petstore/spring-http-interface-reactive @@ -63,4 +69,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-jdk21.yaml b/.github/workflows/samples-jdk21.yaml index e09a4485348..9910b86a0eb 100644 --- a/.github/workflows/samples-jdk21.yaml +++ b/.github/workflows/samples-jdk21.yaml @@ -40,4 +40,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-julia.yaml b/.github/workflows/samples-julia.yaml index 2cb5ed8de05..c9c62f77210 100644 --- a/.github/workflows/samples-julia.yaml +++ b/.github/workflows/samples-julia.yaml @@ -30,7 +30,7 @@ jobs: # Using develop mode to install package so that it is easier to modify the package test files julia -e "using Pkg; Pkg.develop(\"OpenAPI\");" cd ~/.julia/dev/OpenAPI - git checkout v0.1.14 + git checkout v0.1.25 cd $currdir rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore diff --git a/.github/workflows/samples-kotlin-server-jdk17.yaml b/.github/workflows/samples-kotlin-server-jdk17.yaml index dbe7420e681..6d45bcdf419 100644 --- a/.github/workflows/samples-kotlin-server-jdk17.yaml +++ b/.github/workflows/samples-kotlin-server-jdk17.yaml @@ -1,16 +1,18 @@ -name: Samples Kotlin server +name: Samples Kotlin server (jdk17) on: push: branches: - 'samples/server/petstore/kotlin-springboot-3*/**' - 'samples/server/petstore/kotlin-server/javalin/**' + - 'samples/server/petstore/kotlin-server/javalin-6/**' # comment out due to gradle build failure # - samples/server/petstore/kotlin-spring-default/** pull_request: paths: - 'samples/server/petstore/kotlin-springboot-3*/**' - 'samples/server/petstore/kotlin-server/javalin/**' + - 'samples/server/petstore/kotlin-server/javalin-6/**' # comment out due to gradle build failure # - samples/server/petstore/kotlin-spring-default/** @@ -27,8 +29,11 @@ jobs: sample: # server - samples/server/petstore/kotlin-springboot-3 + - samples/server/petstore/kotlin-springboot-delegate-nodefaults - samples/server/petstore/kotlin-springboot-request + - samples/server/petstore/kotlin-springboot-request-cookie - samples/server/petstore/kotlin-server/javalin + - samples/server/petstore/kotlin-server/javalin-6 # comment out due to gradle build failure # - samples/server/petstore/kotlin-spring-default/ steps: diff --git a/.github/workflows/samples-kotlin-server-jdk21.yaml b/.github/workflows/samples-kotlin-server-jdk21.yaml new file mode 100644 index 00000000000..98656961d16 --- /dev/null +++ b/.github/workflows/samples-kotlin-server-jdk21.yaml @@ -0,0 +1,45 @@ +name: Samples Kotlin server (jdk21) + +on: + push: + branches: + - 'samples/server/petstore/kotlin-server/javalin-6/**' + pull_request: + paths: + - 'samples/server/petstore/kotlin-server/javalin-6/**' + +env: + GRADLE_VERSION: 8.8 + +jobs: + build: + name: Build Kotlin server + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/server/petstore/kotlin-server/javalin-6 + 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: | + ~/.gradle + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - 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 + working-directory: ${{ matrix.sample }} + run: ./gradlew build -x test diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index b98d4c69532..be8be39d2f5 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -29,6 +29,7 @@ jobs: sample: # server - samples/server/petstore/kotlin-springboot + - samples/server/petstore/kotlin-springboot-multipart-request-model - samples/server/petstore/kotlin-springboot-bigdecimal-default - samples/server/petstore/kotlin-springboot-delegate - samples/server/petstore/kotlin-springboot-modelMutable diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml index de1870e311b..24c4fd3e945 100644 --- a/.github/workflows/samples-python-client-echo-api.yaml +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -4,6 +4,7 @@ on: pull_request: paths: - samples/client/echo_api/python/** + - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/** - .github/workflows/samples-python-client-echo-api.yaml jobs: build: @@ -17,11 +18,11 @@ jobs: - samples/client/echo_api/python - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -41,7 +42,7 @@ jobs: - name: Test working-directory: ${{ matrix.sample }} - run: python -m pytest + run: python -m unittest discover - name: mypy working-directory: ${{ matrix.sample }} diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml index c04b857a4ba..118c91f84f2 100644 --- a/.github/workflows/samples-python-petstore.yaml +++ b/.github/workflows/samples-python-petstore.yaml @@ -15,7 +15,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/.github/workflows/samples-python-pydantic-v1-petstore.yaml b/.github/workflows/samples-python-pydantic-v1-petstore.yaml index 1d3ff587860..17969c9fc97 100644 --- a/.github/workflows/samples-python-pydantic-v1-petstore.yaml +++ b/.github/workflows/samples-python-pydantic-v1-petstore.yaml @@ -15,7 +15,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/.github/workflows/samples-spring-jdk17.yaml b/.github/workflows/samples-spring-jdk17.yaml index b78083f4e61..c418575347f 100644 --- a/.github/workflows/samples-spring-jdk17.yaml +++ b/.github/workflows/samples-spring-jdk17.yaml @@ -4,11 +4,17 @@ on: push: paths: - samples/openapi3/client/petstore/spring-cloud-3-with-optional + - samples/openapi3/server/petstore/springboot-3 + - samples/server/petstore/springboot-lombok-data + - samples/server/petstore/springboot-lombok-tostring + - samples/server/petstore/springboot-file-delegate-optional pull_request: paths: - samples/openapi3/client/petstore/spring-cloud-3-with-optional + - samples/openapi3/server/petstore/springboot-3 - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-lombok-tostring + - samples/server/petstore/springboot-file-delegate-optional jobs: build: name: Build Java Spring (JDK17) @@ -20,8 +26,10 @@ jobs: # clients - samples/openapi3/client/petstore/spring-cloud-3-with-optional # servers + - samples/openapi3/server/petstore/springboot-3 - samples/server/petstore/springboot-lombok-data - samples/server/petstore/springboot-lombok-tostring + - samples/server/petstore/springboot-file-delegate-optional steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -38,4 +46,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 598b59b163d..7b114a35ae9 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -25,40 +25,40 @@ jobs: sample: # clients - samples/client/petstore/spring-cloud - - samples/openapi3/client/petstore/spring-cloud + - samples/client/petstore/spring-cloud-auth - samples/client/petstore/spring-cloud-date-time + - samples/client/petstore/spring-cloud-deprecated + - samples/client/petstore/spring-cloud-tags + - samples/openapi3/client/petstore/spring-cloud + - samples/openapi3/client/petstore/spring-cloud-async - samples/openapi3/client/petstore/spring-cloud-date-time - samples/openapi3/client/petstore/spring-cloud-http-basic + - samples/openapi3/client/petstore/spring-cloud-spring-pageable - samples/openapi3/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs-skip-default-interface - - samples/openapi3/client/petstore/spring-cloud-async - - samples/openapi3/client/petstore/spring-cloud-spring-pageable - - samples/client/petstore/spring-cloud-tags - - samples/client/petstore/spring-cloud-auth - - samples/client/petstore/spring-cloud-deprecated # servers - - samples/server/petstore/springboot - samples/openapi3/server/petstore/springboot - - samples/server/petstore/springboot-beanvalidation - - samples/server/petstore/springboot-useoptional - - samples/server/petstore/springboot-reactive - - samples/server/petstore/springboot-reactive-noResponseEntity - - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - - samples/server/petstore/springboot-delegate - - samples/server/petstore/springboot-delegate-no-response-entity - samples/openapi3/server/petstore/springboot-delegate + - samples/openapi3/server/petstore/spring-boot-oneof - samples/server/petstore/spring-boot-nullable-set - samples/server/petstore/spring-boot-defaultInterface-unhandledException - - samples/openapi3/server/petstore/spring-boot-oneof - - samples/server/petstore/springboot-virtualan + - samples/server/petstore/springboot + - samples/server/petstore/springboot-beanvalidation + - samples/server/petstore/springboot-delegate + - samples/server/petstore/springboot-delegate-no-response-entity + - samples/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-implicitHeaders-annotationLibrary + - samples/server/petstore/springboot-lombok-data + - samples/server/petstore/springboot-reactive + - samples/server/petstore/springboot-reactive-noResponseEntity - samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 - samples/server/petstore/springboot-spring-pageable-delegatePattern - samples/server/petstore/springboot-spring-pageable-without-j8 - samples/server/petstore/springboot-spring-pageable - samples/server/petstore/springboot-spring-provide-args - - samples/server/petstore/springboot-lombok-data + - samples/server/petstore/springboot-useoptional + - samples/server/petstore/springboot-virtualan steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -75,4 +75,4 @@ jobs: key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Build working-directory: ${{ matrix.sample }} - run: mvn clean package + run: mvn clean package --no-transfer-progress diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 7387aba6203..f990d269722 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.13.0 + uses: s4u/setup-maven-action@v1.14.0 with: java-version: ${{ matrix.java }} maven-version: 3.8.8 diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 06e2f163e4e..e2fb1a6e83a 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -39,11 +39,19 @@ elif [ "$NODE_INDEX" = "2" ]; then export PATH="/usr/local/go1.18/go/bin:$PATH" go version + # install cpprestsdk + sudo apt-get install libcpprest-dev + wget "https://github.com/aminya/setup-cpp/releases/download/v0.37.0/setup-cpp-x64-linux" + chmod +x ./setup-cpp-x64-linux + sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true + source ~/.cpprc # activate cpp environment variables + # run go integration tests (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) + (cd samples/client/petstore/cpp-restsdk/client && mvn integration-test) elif [ "$NODE_INDEX" = "3" ]; then @@ -71,6 +79,7 @@ elif [ "$NODE_INDEX" = "3" ]; then (cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test) (cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test) (cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test) + (cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test) (cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test) diff --git a/Dockerfile b/Dockerfile index 163f62d45d4..543bc169f06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,16 @@ COPY ./LICENSE ${GEN_DIR} # Required to compile openapi-generator COPY ./google_checkstyle.xml ${GEN_DIR} +# All poms are copied, then we go offline, to allow for better caching of code changes without fetching all dependencies each time +COPY ./modules/openapi-generator-gradle-plugin/pom.xml ${GEN_DIR}/modules/openapi-generator-gradle-plugin/ +COPY ./modules/openapi-generator-maven-plugin/pom.xml ${GEN_DIR}/modules/openapi-generator-maven-plugin/ +COPY ./modules/openapi-generator-online/pom.xml ${GEN_DIR}/modules/openapi-generator-online/ +COPY ./modules/openapi-generator-cli/pom.xml ${GEN_DIR}/modules/openapi-generator-cli/ +COPY ./modules/openapi-generator-core/pom.xml ${GEN_DIR}/modules/openapi-generator-core/ +COPY ./modules/openapi-generator/pom.xml ${GEN_DIR}/modules/openapi-generator/ +COPY ./pom.xml ${GEN_DIR} +RUN mvn dependency:go-offline + # Modules are copied individually here to allow for caching of docker layers between major.minor versions COPY ./modules/openapi-generator-gradle-plugin ${GEN_DIR}/modules/openapi-generator-gradle-plugin COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin @@ -17,7 +27,6 @@ COPY ./modules/openapi-generator-online ${GEN_DIR}/modules/openapi-generator-onl COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli COPY ./modules/openapi-generator-core ${GEN_DIR}/modules/openapi-generator-core COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator -COPY ./pom.xml ${GEN_DIR} # Pre-compile openapi-generator-cli RUN mvn -B -am -pl "modules/openapi-generator-cli" package diff --git a/README.md b/README.md index 6f963522835..68195c87435 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.7.0`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.8.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) @@ -70,6 +70,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa [](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) +[](https://konghq.com/products/kong-konnect?utm_medium=referral&utm_source=github&utm_campaign=platform&utm_content=openapi-generator) #### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity @@ -83,13 +84,13 @@ If you find OpenAPI Generator useful for work, please consider asking your compa OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification) (both 2.0 and 3.0 are supported). Currently, the following languages/frameworks are supported: -| | 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** ([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** | +| | 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, Spring 6 RestClient, 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 - 18.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** ([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** | ## Table of contents @@ -127,8 +128,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI Generator Version | Release Date | Notes | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | -| 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) | +| 7.8.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.8.0-SNAPSHOT/) | 09.08.2024 | Minor release with breaking changes (with fallback) | +| [7.7.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.7.0) (latest stable release) | 02.07.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) | @@ -191,16 +192,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.6.0/openapi-generator-cli-7.6.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.0.jar` For **Mac/Linux** users: ```sh -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 +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.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.6.0/openapi-generator-cli-7.6.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.0.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -598,6 +599,7 @@ Here is a list of community-contributed IDE plug-ins that integrate with OpenAPI Here are some companies/projects (alphabetical order) using OpenAPI Generator in production. To add your company/project to the list, please visit [README.md](README.md) and click on the icon to edit the page. - [Aalborg University](https://www.aau.dk) +- [act coding](https://github.com/actcoding) - [Adaptant Solutions AG](https://www.adaptant.io/) - [adesso SE](https://www.adesso.de/) - [Adyen](https://www.adyen.com/) @@ -931,6 +933,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2023-06-28 - [Generate API contract using OpenAPI Generator Maven plugin](https://huongdanjava.com/generate-api-contract-using-openapi-generator-maven-plugin.html) by [Khanh Nguyen](https://huongdanjava.com/) - 2023-06-30 - [Generate Client SDKs with OpenApi Generator in Springboot](https://medium.com/@ramavathvinayak/generate-client-sdks-with-openapi-generator-in-springboot-f9f012e73c0b) by [Vinayak Ramavath](https://medium.com/@ramavathvinayak) - 2023-12-10 - [UnityでOpenAPI Generatorを使う](https://www.youtube.com/watch?v=CbNwKVV5LRM) by [Soup Tori](https://www.youtube.com/@souptori8417) +- 2024-01-24 - [Comment générer des stubs wiremock avec openapi generator](https://www.youtube.com/watch?v=0jhONfBrcKw) by [Alexis Couvreur](https://github.com/acouvreur) - 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) @@ -995,6 +998,7 @@ Here is a list of template creators: * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (Spring 5 WebClient): @daonomic + * Java (Spring 6 RestClient): @nicklas2751 * Java (RESTEasy): @gayathrigs * Java (Vertx): @lopesmcc * Java (Google APIs Client Library): @charlescapps @@ -1083,6 +1087,7 @@ Here is a list of template creators: * Java Vert.x: @lwlee2608 * Java Micronaut: @andriy-dmytruk * Java Helidon: @spericas @tjquinno @tvallin + * Java WireMock: [@acouvreur](https://github.com/acouvreur) * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard diff --git a/appveyor.yml b/appveyor.yml index b0d30b217bf..ae17c012c1f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -54,8 +54,25 @@ test_script: - dotnet test samples\client\petstore\csharp\generichost\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp\generichost\net8\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp\generichost\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + + - dotnet test samples\client\petstore\csharp\generichost\net4.7\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\generichost\net4.7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + - dotnet test samples\client\petstore\csharp\httpclient\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj diff --git a/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml b/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml new file mode 100644 index 00000000000..24c1a5a92a9 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-NewtonsoftFalse.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useNewtonsoft: false diff --git a/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml b/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml new file mode 100644 index 00000000000..8f346e92d5d --- /dev/null +++ b/bin/configs/aspnetcore-8.0-nullableReferenceTypes.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + nullableReferenceTypes: true \ No newline at end of file diff --git a/bin/configs/aspnetcore-8.0-pocoModels.yaml b/bin/configs/aspnetcore-8.0-pocoModels.yaml new file mode 100644 index 00000000000..799ed7e6296 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-pocoModels.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-pocoModels +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + pocoModels: true diff --git a/bin/configs/aspnetcore-8.0-project4Models.yaml b/bin/configs/aspnetcore-8.0-project4Models.yaml new file mode 100644 index 00000000000..e4781826be1 --- /dev/null +++ b/bin/configs/aspnetcore-8.0-project4Models.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-project4Models +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useSeparateModelProject: true diff --git a/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml b/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml new file mode 100644 index 00000000000..951da2a219f --- /dev/null +++ b/bin/configs/aspnetcore-8.0-useSwashBuckle.yaml @@ -0,0 +1,11 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0-useSwashBuckle +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useSwashBuckle: false + buildTarget: library + isLibrary: true diff --git a/bin/configs/aspnetcore-8.0.yaml b/bin/configs/aspnetcore-8.0.yaml new file mode 100644 index 00000000000..205fa554e55 --- /dev/null +++ b/bin/configs/aspnetcore-8.0.yaml @@ -0,0 +1,8 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-8.0 +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "8.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' diff --git a/bin/configs/csharp-generichost-net4.7-allOf.yaml b/bin/configs/csharp-generichost-net4.7-allOf.yaml new file mode 100644 index 00000000000..ab7a40a46b4 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-allOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/AllOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 diff --git a/bin/configs/csharp-generichost-net4.7-anyOf.yaml b/bin/configs/csharp-generichost-net4.7-anyOf.yaml new file mode 100644 index 00000000000..5552241d942 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-anyOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/AnyOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 diff --git a/bin/configs/csharp-generichost-net4.7-anyOfNoCompare.yaml b/bin/configs/csharp-generichost-net4.7-anyOfNoCompare.yaml new file mode 100644 index 00000000000..7ebaa683576 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-anyOfNoCompare.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare +inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: false + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 diff --git a/bin/configs/csharp-generichost-net4.7-formModels.yaml b/bin/configs/csharp-generichost-net4.7-formModels.yaml new file mode 100644 index 00000000000..6634d259f96 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-formModels.yaml @@ -0,0 +1,17 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/FormModels +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 + skipFormModel: false + modelPropertySorting: alphabetical +inlineSchemaOptions: + RESOLVE_INLINE_ENUMS: true diff --git a/bin/configs/csharp-generichost-net4.7-oneOf.yaml b/bin/configs/csharp-generichost-net4.7-oneOf.yaml new file mode 100644 index 00000000000..353b288ca67 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-oneOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/OneOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 diff --git a/bin/configs/csharp-generichost-net4.7-useDateTimeForDate.yaml b/bin/configs/csharp-generichost-net4.7-useDateTimeForDate.yaml new file mode 100644 index 00000000000..ca299c4849c --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7-useDateTimeForDate.yaml @@ -0,0 +1,11 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}' + useDateTimeForDate: true + targetFramework: net47 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net4.7.yaml b/bin/configs/csharp-generichost-net4.7.yaml new file mode 100644 index 00000000000..0eb928f3e2b --- /dev/null +++ b/bin/configs/csharp-generichost-net4.7.yaml @@ -0,0 +1,14 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.7/Petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net47 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net4.8-allOf.yaml b/bin/configs/csharp-generichost-net4.8-allOf.yaml new file mode 100644 index 00000000000..3618129e933 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-allOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/AllOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 diff --git a/bin/configs/csharp-generichost-net4.8-anyOf.yaml b/bin/configs/csharp-generichost-net4.8-anyOf.yaml new file mode 100644 index 00000000000..846d3957b55 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-anyOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/AnyOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 diff --git a/bin/configs/csharp-generichost-net4.8-anyOfNoCompare.yaml b/bin/configs/csharp-generichost-net4.8-anyOfNoCompare.yaml new file mode 100644 index 00000000000..760f3cc0ed9 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-anyOfNoCompare.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare +inputSpec: modules/openapi-generator/src/test/resources/3_0/anyOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: false + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 diff --git a/bin/configs/csharp-generichost-net4.8-formModels.yaml b/bin/configs/csharp-generichost-net4.8-formModels.yaml new file mode 100644 index 00000000000..ca16d286f19 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-formModels.yaml @@ -0,0 +1,17 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/FormModels +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 + skipFormModel: false + modelPropertySorting: alphabetical +inlineSchemaOptions: + RESOLVE_INLINE_ENUMS: true diff --git a/bin/configs/csharp-generichost-net4.8-oneOf.yaml b/bin/configs/csharp-generichost-net4.8-oneOf.yaml new file mode 100644 index 00000000000..89f61765db6 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-oneOf.yaml @@ -0,0 +1,13 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/OneOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 diff --git a/bin/configs/csharp-generichost-net4.8-useDateTimeForDate.yaml b/bin/configs/csharp-generichost-net4.8-useDateTimeForDate.yaml new file mode 100644 index 00000000000..cf88bb71536 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8-useDateTimeForDate.yaml @@ -0,0 +1,11 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/dates-api.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}' + useDateTimeForDate: true + targetFramework: net48 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net4.8.yaml b/bin/configs/csharp-generichost-net4.8.yaml new file mode 100644 index 00000000000..8e33e8b54a1 --- /dev/null +++ b/bin/configs/csharp-generichost-net4.8.yaml @@ -0,0 +1,14 @@ +# for csharp generichost +generatorName: csharp +outputDir: samples/client/petstore/csharp/generichost/net4.8/Petstore +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +library: generichost +templateDir: modules/openapi-generator/src/main/resources/csharp +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + nullableReferenceTypes: false + equatable: true + targetFramework: net48 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net8-formModels.yaml b/bin/configs/csharp-generichost-net8-formModels.yaml index 14f15ca5710..48f677f318c 100644 --- a/bin/configs/csharp-generichost-net8-formModels.yaml +++ b/bin/configs/csharp-generichost-net8-formModels.yaml @@ -12,5 +12,6 @@ additionalProperties: equatable: true targetFramework: net8.0 skipFormModel: false + modelPropertySorting: alphabetical inlineSchemaOptions: RESOLVE_INLINE_ENUMS: true diff --git a/bin/configs/csharp-generichost-net8-nrt-useSourceGeneration.yaml b/bin/configs/csharp-generichost-net8-nrt-useSourceGeneration.yaml index 98c05dd48bc..8901f9cfa9b 100644 --- a/bin/configs/csharp-generichost-net8-nrt-useSourceGeneration.yaml +++ b/bin/configs/csharp-generichost-net8-nrt-useSourceGeneration.yaml @@ -11,3 +11,4 @@ additionalProperties: useSourceGeneration: true equatable: true targetFramework: net8.0 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net8-nrt.yaml b/bin/configs/csharp-generichost-net8-nrt.yaml index f3e328fff31..c9cccf5f590 100644 --- a/bin/configs/csharp-generichost-net8-nrt.yaml +++ b/bin/configs/csharp-generichost-net8-nrt.yaml @@ -11,3 +11,4 @@ additionalProperties: nullableReferenceTypes: true equatable: true targetFramework: net8.0 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net8-useDateTimeForDate.yaml b/bin/configs/csharp-generichost-net8-useDateTimeForDate.yaml index 1f986e61afc..72f89ad2f26 100644 --- a/bin/configs/csharp-generichost-net8-useDateTimeForDate.yaml +++ b/bin/configs/csharp-generichost-net8-useDateTimeForDate.yaml @@ -8,3 +8,4 @@ additionalProperties: packageGuid: '{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}' useDateTimeForDate: true targetFramework: net8.0 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-net8.yaml b/bin/configs/csharp-generichost-net8.yaml index 04870438f3b..790a7bfeb0e 100644 --- a/bin/configs/csharp-generichost-net8.yaml +++ b/bin/configs/csharp-generichost-net8.yaml @@ -11,3 +11,4 @@ additionalProperties: nullableReferenceTypes: false equatable: true targetFramework: net8.0 + modelPropertySorting: alphabetical diff --git a/bin/configs/csharp-generichost-netstandard2.0.yaml b/bin/configs/csharp-generichost-netstandard2.0.yaml index 3450bcc67af..085f4f44276 100644 --- a/bin/configs/csharp-generichost-netstandard2.0.yaml +++ b/bin/configs/csharp-generichost-netstandard2.0.yaml @@ -10,3 +10,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false targetFramework: netstandard2.0 equatable: true + modelPropertySorting: alphabetical diff --git a/bin/configs/haskell-servant-ping.yaml b/bin/configs/haskell-servant-ping.yaml new file mode 100644 index 00000000000..11bc935b188 --- /dev/null +++ b/bin/configs/haskell-servant-ping.yaml @@ -0,0 +1,4 @@ +generatorName: haskell +outputDir: samples/server/others/haskell-servant-ping +inputSpec: modules/openapi-generator/src/test/resources/3_0/ping.yaml +templateDir: modules/openapi-generator/src/main/resources/haskell-servant diff --git a/bin/configs/java-microprofile-rest-client-outer-enum.yaml b/bin/configs/java-microprofile-rest-client-outer-enum.yaml new file mode 100644 index 00000000000..c5d0466e4f5 --- /dev/null +++ b/bin/configs/java-microprofile-rest-client-outer-enum.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/microprofile-rest-client-outer-enum +library: microprofile +inputSpec: modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: microprofile-rest-client + configKeyFromClassName: true diff --git a/bin/configs/k6.yaml b/bin/configs/k6.yaml index 9933744e314..91756873de5 100644 --- a/bin/configs/k6.yaml +++ b/bin/configs/k6.yaml @@ -1,6 +1,6 @@ generatorName: k6 outputDir: samples/client/petstore/k6 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/k6/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/k6 additionalProperties: appName: PetstoreClient diff --git a/bin/configs/kotlin-model-prefix-type-mapping.yaml b/bin/configs/kotlin-model-prefix-type-mapping.yaml index 841b5af060d..15b0d3d885e 100644 --- a/bin/configs/kotlin-model-prefix-type-mapping.yaml +++ b/bin/configs/kotlin-model-prefix-type-mapping.yaml @@ -11,5 +11,6 @@ additionalProperties: library: jvm-retrofit2 enumPropertyNaming: UPPERCASE serializationLibrary: gson + generateOneOfAnyOfWrappers: true openapiNormalizer: SIMPLIFY_ONEOF_ANYOF: false diff --git a/bin/configs/kotlin-server-javalin-6.yaml b/bin/configs/kotlin-server-javalin-6.yaml new file mode 100644 index 00000000000..395da5f035f --- /dev/null +++ b/bin/configs/kotlin-server-javalin-6.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin-server +outputDir: samples/server/petstore/kotlin-server/javalin-6 +library: javalin6 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-server +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/kotlin-spring-boot-3.yaml b/bin/configs/kotlin-spring-boot-3.yaml index 609efd31f25..8a1a8e317c6 100644 --- a/bin/configs/kotlin-spring-boot-3.yaml +++ b/bin/configs/kotlin-spring-boot-3.yaml @@ -11,3 +11,4 @@ additionalProperties: serializableModel: "true" beanValidations: "true" useSpringBoot3: "true" + requestMappingMode: api_interface diff --git a/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml new file mode 100644 index 00000000000..bf22ad329a7 --- /dev/null +++ b/bin/configs/kotlin-spring-boot-delegate-nodefaults.yaml @@ -0,0 +1,14 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-delegate-nodefaults +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + documentationProvider: none + annotationLibrary: swagger2 + useSwaggerUI: "true" + delegatePattern: "true" + skipDefaultInterface: "true" + beanValidations: "true" + requestMappingMode: "api_interface" + useSpringBoot3: "true" diff --git a/bin/configs/kotlin-spring-boot-delegate.yaml b/bin/configs/kotlin-spring-boot-delegate.yaml index 56adfb9f46c..38fdee37dc7 100644 --- a/bin/configs/kotlin-spring-boot-delegate.yaml +++ b/bin/configs/kotlin-spring-boot-delegate.yaml @@ -8,4 +8,6 @@ additionalProperties: annotationLibrary: swagger2 useSwaggerUI: "true" delegatePattern: "true" + appendRequestToHandler: "true" beanValidations: "true" + requestMappingMode: none diff --git a/bin/configs/kotlin-spring-boot-integer-enum.yaml b/bin/configs/kotlin-spring-boot-integer-enum.yaml new file mode 100644 index 00000000000..8298ce6be08 --- /dev/null +++ b/bin/configs/kotlin-spring-boot-integer-enum.yaml @@ -0,0 +1,13 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-integer-enum +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring +additionalProperties: + interfaceOnly: "true" + skipDefaultInterface: "true" + useTags: "true" + useSpringBoot3: "true" + annotationLibrary: none + documentationProvider: none + enumPropertyNaming: UPPERCASE diff --git a/bin/configs/kotlin-spring-boot-multipart-request-model.yaml b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml new file mode 100644 index 00000000000..63d0b59fd5b --- /dev/null +++ b/bin/configs/kotlin-spring-boot-multipart-request-model.yaml @@ -0,0 +1,5 @@ +generatorName: kotlin-spring +outputDir: samples/server/petstore/kotlin-springboot-multipart-request-model +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-spring diff --git a/bin/configs/kotlin-spring-boot.yaml b/bin/configs/kotlin-spring-boot.yaml index e727be7ebdf..bea19cc18f9 100644 --- a/bin/configs/kotlin-spring-boot.yaml +++ b/bin/configs/kotlin-spring-boot.yaml @@ -10,3 +10,4 @@ additionalProperties: serviceImplementation: "true" serializableModel: "true" beanValidations: "true" + requestMappingMode: controller diff --git a/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml b/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml index 8b15af490da..4d4ab8e891c 100644 --- a/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml +++ b/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml @@ -5,3 +5,4 @@ templateDir: modules/openapi-generator/src/main/resources/python additionalProperties: hideGenerationTimestamp: "true" disallowAdditionalPropertiesIfNotPresent: "true" + setEnsureAsciiToFalse: true diff --git a/bin/configs/python-flask.yaml b/bin/configs/python-flask.yaml index 570206be2bc..32c5659ab43 100644 --- a/bin/configs/python-flask.yaml +++ b/bin/configs/python-flask.yaml @@ -1,4 +1,4 @@ generatorName: python-flask outputDir: samples/server/petstore/python-flask -inputSpec: modules/openapi-generator/src/test/resources/2_0/python-flask/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/python-flask/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/python-flask diff --git a/bin/configs/rust-hyper0x-petstore.yaml b/bin/configs/rust-hyper0x-petstore.yaml new file mode 100644 index 00000000000..adaf9b7e373 --- /dev/null +++ b/bin/configs/rust-hyper0x-petstore.yaml @@ -0,0 +1,8 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/hyper0x/petstore +library: hyper0x +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: petstore-hyper0x diff --git a/bin/configs/spring-boot-file-delegate-optional.yaml b/bin/configs/spring-boot-file-delegate-optional.yaml new file mode 100644 index 00000000000..68c15c54043 --- /dev/null +++ b/bin/configs/spring-boot-file-delegate-optional.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-file-delegate-optional +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue18345.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + delegatePattern: true + useOptional: true + useSpringBoot3: true + artifactId: spring-boot-use-optional + hideGenerationTimestamp: "true" diff --git a/bin/configs/typescript-angular-v18-provided-in-root.yaml b/bin/configs/typescript-angular-v18-provided-in-root.yaml new file mode 100644 index 00000000000..97694998317 --- /dev/null +++ b/bin/configs/typescript-angular-v18-provided-in-root.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 18.0.0 + supportsES6: true diff --git a/bin/configs/typescript-fetch-oneOf.yaml b/bin/configs/typescript-fetch-oneOf.yaml new file mode 100644 index 00000000000..a6e57df4cd7 --- /dev/null +++ b/bin/configs/typescript-fetch-oneOf.yaml @@ -0,0 +1,4 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/oneOf +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch diff --git a/bin/configs/typescript-fetch-self-import-issue.yaml b/bin/configs/typescript-fetch-self-import-issue.yaml new file mode 100644 index 00000000000..d4312e93291 --- /dev/null +++ b/bin/configs/typescript-fetch-self-import-issue.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-fetch +outputDir: samples/client/others/typescript-fetch/self-import-issue +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +additionalProperties: + typescriptThreePlus: "true" + legacyDiscriminatorBehavior: "false" diff --git a/docs/generators.md b/docs/generators.md index bb058761aea..1fe95d2ad93 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -34,7 +34,7 @@ The following generators are available: * [java-micronaut-client (beta)](generators/java-micronaut-client.md) * [javascript](generators/javascript.md) * [javascript-apollo-deprecated (deprecated)](generators/javascript-apollo-deprecated.md) -* [javascript-closure-angular](generators/javascript-closure-angular.md) +* [javascript-closure-angular (beta)](generators/javascript-closure-angular.md) * [javascript-flowtyped](generators/javascript-flowtyped.md) * [jaxrs-cxf-client](generators/jaxrs-cxf-client.md) * [jetbrains-http-client (experimental)](generators/jetbrains-http-client.md) diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 5dbedb169c5..9a028ed2977 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -18,7 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
**2.0**
ASP.NET Core 2.0
**2.1**
ASP.NET Core 2.1
**2.2**
ASP.NET Core 2.2
**3.0**
ASP.NET Core 3.0
**3.1**
ASP.NET Core 3.1
**5.0**
ASP.NET Core 5.0
**6.0**
ASP.NET Core 6.0
|3.1| +|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|
**2.0**
ASP.NET Core 2.0
**2.1**
ASP.NET Core 2.1
**2.2**
ASP.NET Core 2.2
**3.0**
ASP.NET Core 3.0
**3.1**
ASP.NET Core 3.1
**5.0**
ASP.NET Core 5.0
**6.0**
ASP.NET Core 6.0
**7.0**
ASP.NET Core 7.0
**8.0**
ASP.NET Core 8.0
|8.0| |buildTarget|Target to build an application or library|
**program**
Generate code for a standalone server
**library**
Generate code for a server abstract class library
|program| |classModifier|Class Modifier for controller classes: Empty string or abstract.| || |compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2| @@ -45,7 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|
**3.0.0**
Swashbuckle 3.0.0
**4.0.0**
Swashbuckle 4.0.0
**5.0.0**
Swashbuckle 5.0.0
**6.4.0**
Swashbuckle 6.4.0
|3.0.0| +|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|
**3.0.0**
Swashbuckle 3.0.0
**4.0.0**
Swashbuckle 4.0.0
**5.0.0**
Swashbuckle 5.0.0
**6.4.0**
Swashbuckle 6.4.0
|6.4.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeForDate|Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index aef6bfe1c39..f8095ede910 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -249,7 +249,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Union|✗|OAS3 |allOf|✗|OAS2,OAS3 |anyOf|✗|OAS3 -|oneOf|✗|OAS3 +|oneOf|✓|OAS3 |not|✗|OAS3 ### Security Feature diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 97122c15677..8e6cd6abb7d 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -31,9 +31,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |library|HTTP library template (sub-template) to use|
**generichost**
HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)
**httpclient**
HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)
**unityWebRequest**
UnityWebRequest (...) (Experimental. Subject to breaking changes without notice.)
**restsharp**
RestSharp (https://github.com/restsharp/RestSharp)
|restsharp| |licenseId|The identifier of the license| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| +|modelPropertySorting|One of legacy, alphabetical, default (only `generichost` library supports this option).| |legacy| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| |nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer. Starting in .NET 6.0 the default is true.| |false| +|operationParameterSorting|One of legacy, alphabetical, default (only `generichost` library supports this option).| |legacy| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| |optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index b13adcbad45..bc1a7a9beb8 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -68,9 +68,22 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • __ENV__
  • __FILE__
  • __MODULE__
  • +
  • __struct__
  • +
  • after
  • +
  • and
  • +
  • catch
  • +
  • do
  • +
  • else
  • +
  • end
  • false
  • +
  • fn
  • +
  • in
  • nil
  • +
  • not
  • +
  • or
  • +
  • rescue
  • true
  • +
  • when
  • ## FEATURE SET diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 12bc9a24ae9..5407b0b894e 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -80,7 +80,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 1c7efa14ec8..e77c38151eb 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -120,11 +120,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null |x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null |x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false |x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null -|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD|null +|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index 7f60cf91dbd..a274c0e0307 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -77,7 +77,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|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 diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index 2035bb8c6fb..a34d62118c1 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -80,7 +80,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index c97cc488b15..8b8b35ea29d 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -82,7 +82,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index f8c968280ec..1d3c4c201bd 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -103,7 +103,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 9cb2ad4dbbc..a848e57254a 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -102,7 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md index dada45f96d5..1a6d6369a0a 100644 --- a/docs/generators/java-microprofile.md +++ b/docs/generators/java-microprofile.md @@ -60,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
    **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| +|library|library template (sub-template) to use|
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1
    **jersey3**
    HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1
    **feign**
    HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1 (Retrofit 2.5.0) or Jackson 2.17.1. Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 5.3.33 (6.1.5 if `useJakartaEe=true`). JSON processing: Jackson 2.17.1
    **webclient**
    HTTP client: Spring WebClient 5.1.18. JSON processing: Jackson 2.17.1
    **restclient**
    HTTP client: Spring RestClient 6.1.6. JSON processing: Jackson 2.17.1
    **resteasy**
    HTTP client: Resteasy client 4.7.6. JSON processing: Jackson 2.17.1
    **vertx**
    HTTP client: VertX client 3.5.2. JSON processing: Jackson 2.17.1
    **google-api-client**
    HTTP client: Google API client 2.2.0. JSON processing: Jackson 2.17.1
    **rest-assured**
    HTTP client: rest-assured 5.3.2. JSON processing: Gson 2.10.1 or Jackson 2.17.1. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.17.1. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 2.0 (default, set desired version via `microprofileRestClientVersion=x.x.x`). JSON processing: JSON-B 1.0.2 or Jackson 2.17.1
    **apache-httpclient**
    HTTP client: Apache httpclient 5.2.1. JSON processing: Jackson 2.17.1
    |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| @@ -114,7 +114,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|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 diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 52455c5fea1..d321b030be8 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -88,7 +88,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 6ecb576ac90..4a96c9d89d9 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -89,7 +89,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index bfdef88970f..1e4efaaeae5 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -92,7 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 202f013209d..ca484ad146e 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -82,7 +82,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 3144df23e1a..8c98816db81 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -82,7 +82,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 4592996516e..9720c15d8bd 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -85,7 +85,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md index 081a1296745..09fb082309e 100644 --- a/docs/generators/java-wiremock.md +++ b/docs/generators/java-wiremock.md @@ -82,7 +82,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/java.md b/docs/generators/java.md index 028280b4562..816f4f2228a 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -60,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
    **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| +|library|library template (sub-template) to use|
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1
    **jersey3**
    HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1
    **feign**
    HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1 (Retrofit 2.5.0) or Jackson 2.17.1. Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 5.3.33 (6.1.5 if `useJakartaEe=true`). JSON processing: Jackson 2.17.1
    **webclient**
    HTTP client: Spring WebClient 5.1.18. JSON processing: Jackson 2.17.1
    **restclient**
    HTTP client: Spring RestClient 6.1.6. JSON processing: Jackson 2.17.1
    **resteasy**
    HTTP client: Resteasy client 4.7.6. JSON processing: Jackson 2.17.1
    **vertx**
    HTTP client: VertX client 3.5.2. JSON processing: Jackson 2.17.1
    **google-api-client**
    HTTP client: Google API client 2.2.0. JSON processing: Jackson 2.17.1
    **rest-assured**
    HTTP client: rest-assured 5.3.2. JSON processing: Gson 2.10.1 or Jackson 2.17.1. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.17.1. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 2.0 (default, set desired version via `microprofileRestClientVersion=x.x.x`). JSON processing: JSON-B 1.0.2 or Jackson 2.17.1
    **apache-httpclient**
    HTTP client: Apache httpclient 5.2.1. JSON processing: Jackson 2.17.1
    |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| @@ -114,7 +114,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|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 diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 452a628eb94..860b2f523f5 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -7,11 +7,11 @@ title: Documentation for the javascript-closure-angular Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | javascript-closure-angular | pass this to the generate command after -g | -| generator stability | STABLE | | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Javascript | | | generator default templating engine | mustache | | -| helpTxt | Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | +| helpTxt | Generates a Javascript AngularJS client library annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | ## 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. @@ -217,6 +217,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Name | Supported | Defined By | | ---- | --------- | ---------- | |JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 |PROTOBUF|✗|ToolingExtension |Custom|✗|OAS2,OAS3 diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index f990de40ddb..d911fd30b0f 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -96,7 +96,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 68d153daf20..04ae1cfee4e 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -87,7 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index f72c477c3b7..8c34c65d146 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -110,7 +110,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 89caf27c7ad..12deda54824 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -105,7 +105,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index d3b30f001e4..0965570fdde 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -88,7 +88,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 8645361f843..6973aecf1db 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -89,7 +89,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index af6e8c0aa2d..f48428ba1c9 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -88,7 +88,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index f1ff6d31bb6..6f9fb5a4062 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -96,7 +96,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index e8bcf88662c..9e8c7c2291d 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -32,7 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |featureResources|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |interfaceOnly|Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.| |false| -|library|library template (sub-template)|
    **ktor**
    ktor framework
    **jaxrs-spec**
    JAX-RS spec only
    **javalin5**
    Javalin 5
    |ktor| +|library|library template (sub-template)|
    **ktor**
    ktor framework
    **jaxrs-spec**
    JAX-RS spec only
    **javalin5**
    Javalin 5
    **javalin6**
    Javalin 6
    |ktor| |modelMutable|Create mutable models| |false| |omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false| |packageName|Generated artifact package name.| |org.openapitools.server| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 3df8e4781ff..b40ecbbc5f0 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -41,11 +41,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| +|requestMappingMode|Where to generate the class level @RequestMapping annotation.|
    **api_interface**
    Generate the @RequestMapping annotation on the generated Api Interface.
    **controller**
    Generate the @RequestMapping annotation on the generated Api Controller Implementation.
    **none**
    Do not add a class level @RequestMapping annotation.
    |controller| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| |serverPort|configuration the port in which the sever is to run on| |8080| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| |serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| -|skipDefaultInterface|Whether to skip generation of default implementations for interfaces| |false| +|skipDefaultInterface|Whether to skip generation of default implementations for interfaces (Api interfaces or Delegate interfaces depending on the delegatePattern option)| |false| |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| @@ -56,6 +57,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|Whether to use tags for creating interface and controller class names| |false| +## SUPPORTED VENDOR EXTENSIONS + +| Extension name | Description | Applicable for | Default value | +| -------------- | ----------- | -------------- | ------------- | +|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null +|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null +|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null +|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL| +|x-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null +|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null + + ## IMPORT MAPPING | Type/Alias | Imports | diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 136f31d1871..060b0d2c626 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |collectionType|Option. Collection type to use|
    **array**
    kotlin.Array
    **list**
    kotlin.collections.List
    |list| |dateLibrary|Option. Date library to use|
    **threetenbp-localdatetime**
    Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
    **kotlinx-datetime**
    kotlinx-datetime (preferred for multiplatform)
    **string**
    String
    **java8-localdatetime**
    Java 8 native JSR310 (jvm only, for legacy app only)
    **java8**
    Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
    **threetenbp**
    Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
    |java8| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original| +|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers.| |false| |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 92b0ce78680..0beee68d757 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • except
  • exec
  • false
  • +
  • field
  • finally
  • float
  • for
  • diff --git a/docs/generators/python.md b/docs/generators/python.md index 736de837ede..fc2e686a275 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| |recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| +|setEnsureAsciiToFalse|When set to true, add `ensure_ascii=False` in json.dumps when creating the HTTP request body.| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| ## IMPORT MAPPING diff --git a/docs/generators/rust.md b/docs/generators/rust.md index 5da5f95b342..1b4ff6f400d 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |bestFitInt|Use best fitting integer type where minimum or maximum is set| |false| |enumNameSuffix|Suffix that will be appended to all enum names.| || |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|library|library template (sub-template) to use.|
    **hyper**
    HTTP client: Hyper.
    **reqwest**
    HTTP client: Reqwest.
    |reqwest| +|library|library template (sub-template) to use.|
    **hyper**
    HTTP client: Hyper (v1.x).
    **hyper0x**
    HTTP client: Hyper (v0.x).
    **reqwest**
    HTTP client: Reqwest.
    |reqwest| |packageName|Rust package name (convention: lowercase).| |openapi| |packageVersion|Rust package version.| |1.0.0| |preferUnsignedInt|Prefer unsigned integers where minimum value is >= 0| |false| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 6ae3b647ac6..b71cefb3c12 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -113,11 +113,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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-field-extra-annotation|List of custom annotations to be added to property|FIELD, OPERATION_PARAMETER|null |x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null |x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false |x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null -|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD|null +|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null ## IMPORT MAPPING diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 3e62082c095..16542b6a36d 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -11,7 +11,7 @@ title: Documentation for the typescript-angular Generator | generator type | CLIENT | | | generator language | Typescript | | | generator default templating engine | mustache | | -| helpTxt | Generates a TypeScript Angular (9.x - 17.x) client library. | | +| helpTxt | Generates a TypeScript Angular (9.x - 18.x) 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. @@ -32,7 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| -|ngVersion|The version of Angular. (At least 9.0.0)| |17.0.0| +|ngVersion|The version of Angular. (At least 9.0.0)| |18.0.0| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| @@ -50,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| +|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 253dbb0801c..f4a70222200 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -20,6 +20,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| +|axiosVersion|Use this property to override the axios version in package.json| |^1.6.1| |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| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| @@ -40,6 +41,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| |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| +|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| |withNodeImports|Setting this property to true adds imports for NodeJS| |false| |withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes. This requires in addition a value for 'apiPackage' and 'modelPackage'| |false| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 63a97cf5360..e5216325d81 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -43,6 +43,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| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true| +|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| |withoutRuntimeChecks|Setting this property to true will remove any runtime checks on the request and response payloads. Payloads will be casted to their expected types.| |false| diff --git a/docs/installation.md b/docs/installation.md index 40c792c779d..69e59a70523 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -103,18 +103,18 @@ docker run --rm \ 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.2.0/openapi-generator-cli-7.2.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.0.jar` For **Mac/Linux** users: ```bash -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.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. ```powershell -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.0.jar ``` diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 3fb9501a504..d12181edd84 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -6,7 +6,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml 4.0.0 openapi-generator-cli diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java index 7c8cc543bcd..b59c458e4b0 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java @@ -19,16 +19,12 @@ package org.openapitools.codegen.cmd; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier; import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.util.TokenBuffer; import io.airlift.airline.Arguments; diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java index 52043e2ce0c..a0ec3e314d7 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Meta.java @@ -28,7 +28,6 @@ import io.airlift.airline.Command; import io.airlift.airline.Option; import org.apache.commons.io.FileUtils; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.TemplateManager; import org.openapitools.codegen.api.TemplatePathLocator; @@ -40,7 +39,6 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; -import java.io.Reader; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java index 4826464ad91..a8a7f1b0ba2 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/AuthorTemplateTest.java @@ -9,7 +9,6 @@ import org.testng.annotations.Test; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; public class AuthorTemplateTest { Path outputDirectory; diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java index ce446523f1e..9988ccf989d 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java @@ -6,7 +6,6 @@ import org.openapitools.codegen.config.Context; import org.openapitools.codegen.config.GeneratorSettings; import org.openapitools.codegen.config.WorkflowSettings; import org.testng.ITestContext; -import org.testng.TestRunner; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java index 5b013006739..3c459b04075 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java @@ -24,7 +24,6 @@ import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.Generator; import org.openapitools.codegen.SpecValidationException; import org.openapitools.codegen.config.CodegenConfigurator; -import org.testng.TestException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index b18f685300a..d22dda49cc7 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -8,7 +8,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml 4.0.0 diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java index dda611e4740..e5479d51ed6 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/DocumentationFeature.java @@ -38,5 +38,5 @@ public enum DocumentationFeature { * Generated output includes documentation for all generated APIs. */ @ToolingExtension - Api; + Api } diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 804d41c4a69..7d1c43c6bda 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.5.0" + id "org.openapi.generator" version "7.7.0" } ---- @@ -113,7 +113,7 @@ buildscript { // url "https://plugins.gradle.org/m2/" } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:7.2.0" + classpath "org.openapitools:openapi-generator-gradle-plugin:7.7.0" } } @@ -174,6 +174,11 @@ apply plugin: 'org.openapi.generator' |None |The template directory holding a custom template. +|templateResourcePath +|String +|None +|Directory with mustache templates via resource path. This option will overwrite any option defined in `templateDir` + |auth |String |None @@ -754,7 +759,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' - classpath('org.openapitools:openapi-generator-gradle-plugin:7.2.0') { + classpath('org.openapitools:openapi-generator-gradle-plugin:7.7.0') { exclude group: 'com.google.guava' } } diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 5d82081e5ea..c86ac39b259 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,9 +1,5 @@ # 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/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 0ea4bf9bbfc..34e0980473f 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -6,7 +6,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml 4.0.0 diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md index a9009fc4984..24744744420 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -19,5 +19,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: ```bash -gradle -PopenApiGeneratorVersion=7.2.0 openApiValidate +gradle -PopenApiGeneratorVersion=7.7.0 openApiValidate ``` 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 40cc6251ebe..e9ca0983084 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,11 +1,3 @@ # 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/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 46d6cfcc690..f1b1d9e74ed 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 @@ -100,6 +100,7 @@ class OpenApiGeneratorPlugin : Plugin { inputSpecRootDirectory.set(generate.inputSpecRootDirectory) remoteInputSpec.set(generate.remoteInputSpec) templateDir.set(generate.templateDir) + templateResourcePath.set(generate.templateResourcePath) auth.set(generate.auth) globalProperties.set(generate.globalProperties) configFile.set(generate.configFile) 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 b80ffbcdd69..48c5e88259f 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 @@ -69,6 +69,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) { */ val templateDir = project.objects.property() + /** + * The template location (which may be a directory or a classpath location) holding custom templates. + */ + val templateResourcePath = project.objects.property() + /** * Adds authorization headers when fetching the OpenAPI definitions remotely. * Pass in a URL-encoded string of name:header with a comma separating multiple values 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 193cdbed15d..6733f61476a 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 @@ -133,6 +133,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac @PathSensitive(PathSensitivity.RELATIVE) val templateDir = project.objects.property() + /** + * Resource path containing template files. + */ + @Optional + @Input + val templateResourcePath = project.objects.property() + /** * Adds authorization headers when fetching the OpenAPI definitions remotely. * Pass in a URL-encoded string of name:header with a comma separating multiple values @@ -707,6 +714,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac configurator.setTemplateDir(value) } + templateResourcePath.ifNotEmpty { value -> + templateDir.ifNotEmpty { + logger.warn("Both templateDir and templateResourcePath were configured. templateResourcePath overwrites templateDir.") + } + configurator.setTemplateDir(value) + } + packageName.ifNotEmpty { value -> configurator.setPackageName(value) } diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index a3d45bd2c38..5f9123afff6 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.5.0 + 7.7.0 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index 8c966d98687..b5c0170b0c3 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -27,9 +27,15 @@ sample-schema ${project.parent.version} + + ${project.groupId} + sample-external-ref-schema + ${project.parent.version} + + default generate @@ -48,6 +54,30 @@ joda + + jersey2 + + + + external-ref + + generate + + + + external-ref/petstore.yaml + + + java + + + + + + joda + + jersey2 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml new file mode 100644 index 00000000000..0b766820d84 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + org.openapitools + sample-external-ref-schema + jar + 1.0-SNAPSHOT + sample-external-ref-schema + https://maven.apache.org + + + + diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/petstore.yaml b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/petstore.yaml new file mode 100644 index 00000000000..88b99532757 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/petstore.yaml @@ -0,0 +1,105 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: Sample file with just two endpoints and one schema (defined in an external file $ref) + version: 1.0.0 + title: OpenAPI Petstore +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' + '/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: [] + 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' +components: + requestBodies: + Pet: + content: + application/json: + schema: + $ref: 'schemas/Pet.yaml' + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + description: Pet object that needs to be added to the store + required: true + schemas: + Pet: + $ref: 'schemas/Pet.yaml' diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/schemas/Pet.yaml b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/schemas/Pet.yaml new file mode 100644 index 00000000000..8f93f9075f3 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/src/main/resources/external-ref/schemas/Pet.yaml @@ -0,0 +1,29 @@ +title: a Pet +description: A pet for sale in the pet store +type: object +required: + - name + - photoUrls +properties: + id: + type: integer + format: int64 + 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 + enum: + - available + - pending + - sold +xml: + name: Pet \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 83773ed26bf..2d6117ca48a 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -7,7 +7,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml openapi-generator-maven-plugin openapi-generator (maven-plugin) 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 372b9aeb47e..7fa87c39968 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 @@ -17,40 +17,15 @@ package org.openapitools.codegen.plugin; -import static org.apache.commons.lang3.StringUtils.isNotEmpty; -import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*; - +import com.google.common.hash.Hashing; +import com.google.common.io.Files; +import io.swagger.parser.OpenAPIParser; import io.swagger.v3.core.util.Json; import io.swagger.v3.core.util.Yaml; import io.swagger.v3.parser.OpenAPIResolver; import io.swagger.v3.parser.OpenAPIV3Parser; -import io.swagger.v3.parser.core.models.AuthorizationValue; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -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; -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; -import java.util.Map; -import java.util.Set; - -import com.google.common.io.ByteSource; -import com.google.common.io.CharSource; import io.swagger.v3.parser.core.models.ParseOptions; -import io.swagger.v3.parser.util.ClasspathHelper; +import lombok.Setter; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; @@ -58,36 +33,34 @@ 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.ResolutionScope; +import org.apache.maven.plugins.annotations.*; import org.apache.maven.project.MavenProject; - import org.apache.maven.project.MavenProjectHelper; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.auth.AuthParser; +import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.config.MergedSpecBuilder; -import org.sonatype.plexus.build.incremental.BuildContext; -import org.sonatype.plexus.build.incremental.DefaultBuildContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.sonatype.plexus.build.incremental.BuildContext; +import org.sonatype.plexus.build.incremental.DefaultBuildContext; -import com.google.common.hash.Hashing; -import com.google.common.io.Files; +import java.io.File; +import java.io.IOException; +import java.net.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.text.MessageFormat; +import java.util.*; + +import static org.apache.commons.lang3.StringUtils.isNotEmpty; +import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*; /** * Goal which generates client/server code from a OpenAPI json/yaml definition. */ @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) -@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) +@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) public class CodeGenMojo extends AbstractMojo { private final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class); @@ -96,6 +69,7 @@ public class CodeGenMojo extends AbstractMojo { * The build context is only avail when running from within eclipse. * It is used to update the eclipse-m2e-layer when the plugin is executed inside the IDE. */ + @Setter @Component private BuildContext buildContext = new DefaultBuildContext(); @@ -556,10 +530,6 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(readonly = true, required = true, defaultValue = "${project}") private MavenProject project; - public void setBuildContext(BuildContext buildContext) { - this.buildContext = buildContext; - } - @Override public void execute() throws MojoExecutionException { if (StringUtils.isBlank(inputSpec) && StringUtils.isBlank(inputSpecRootDirectory)) { @@ -611,19 +581,11 @@ public class CodeGenMojo extends AbstractMojo { } if (Boolean.TRUE.equals(skipIfSpecIsUnchanged)) { - File storedInputSpecHashFile = getHashFile(inputSpecFile); + final File storedInputSpecHashFile = getHashFile(inputSpecFile); if (storedInputSpecHashFile.exists()) { - String inputSpecHash = null; - try { - inputSpecHash = calculateInputSpecHash(inputSpecFile); - } catch (IOException ex) { - ex.printStackTrace(); - } - @SuppressWarnings("UnstableApiUsage") String storedInputSpecHash = Files.asCharSource(storedInputSpecHashFile, StandardCharsets.UTF_8).read(); - if (storedInputSpecHash.equals(inputSpecHash)) { - getLog().info( - "Code generation is skipped because input was unchanged"); + if (storedInputSpecHash.equals(calculateInputSpecHash(inputSpec))) { + getLog().info("Code generation is skipped because input was unchanged"); return; } } @@ -661,13 +623,7 @@ public class CodeGenMojo extends AbstractMojo { } if (isNotEmpty(inputSpec)) { - URL url = inputSpecRemoteUrl(); - - if ((! inputSpecFile.exists()) && url != null) { - configurator.setInputSpec(url.toString()); - } else { - configurator.setInputSpec(inputSpec); - } + configurator.setInputSpec(inputSpec); } if (isNotEmpty(gitHost)) { @@ -1012,8 +968,6 @@ public class CodeGenMojo extends AbstractMojo { // Store a checksum of the input spec File storedInputSpecHashFile = getHashFile(inputSpecFile); - String inputSpecHash = calculateInputSpecHash(inputSpecFile); - if (storedInputSpecHashFile.getParent() != null && !new File(storedInputSpecHashFile.getParent()).exists()) { File parent = new File(storedInputSpecHashFile.getParent()); if (!parent.mkdirs()) { @@ -1021,8 +975,8 @@ public class CodeGenMojo extends AbstractMojo { " to store the checksum of the input spec."); } } - Files.asCharSink(storedInputSpecHashFile, StandardCharsets.UTF_8).write(inputSpecHash); + Files.asCharSink(storedInputSpecHashFile, StandardCharsets.UTF_8).write(calculateInputSpecHash(inputSpec)); } catch (Exception e) { // Maven logs exceptions thrown by plugins only if invoked with -e // I find it annoying to jump through hoops to get basic diagnostic information, @@ -1037,77 +991,33 @@ public class CodeGenMojo extends AbstractMojo { } /** - * Calculate openapi specification file hash. If specification is hosted on remote resource it is downloaded first + * Calculate an SHA256 hash for the openapi specification. + * If the specification is hosted on a remote resource it is downloaded first. * - * @param inputSpecFile - Openapi specification input file to calculate its hash. - * Does not take into account if input spec is hosted on remote resource - * @return openapi specification file hash - * @throws IOException + * @param inputSpec - Openapi specification input file. Can denote a URL or file path. + * @return openapi specification hash */ - private String calculateInputSpecHash(File inputSpecFile) throws IOException { - - URL inputSpecRemoteUrl = inputSpecRemoteUrl(); - - File inputSpecTempFile = inputSpecFile; - - if (inputSpecRemoteUrl != null) { - inputSpecTempFile = java.nio.file.Files.createTempFile("openapi-spec", ".tmp").toFile(); - - URLConnection conn = inputSpecRemoteUrl.openConnection(); - if (isNotEmpty(auth)) { - List authList = AuthParser.parse(auth); - for (AuthorizationValue a : authList) { - conn.setRequestProperty(a.getKeyName(), a.getValue()); - } - } - try (ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream())) { - FileChannel fileChannel; - try (FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile)) { - fileChannel = fileOutputStream.getChannel(); - fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE); - } - } - } - - ByteSource inputSpecByteSource = - inputSpecTempFile.exists() - ? Files.asByteSource(inputSpecTempFile) - : CharSource.wrap(ClasspathHelper.loadFileFromClasspath(inputSpecTempFile.toString().replaceAll("\\\\","/"))) - .asByteSource(StandardCharsets.UTF_8); - - return inputSpecByteSource.hash(Hashing.sha256()).toString(); + private String calculateInputSpecHash(String inputSpec) { + final ParseOptions parseOptions = new ParseOptions(); + parseOptions.setResolve(true); + + final URL remoteUrl = inputSpecRemoteUrl(); + return Hashing.sha256().hashBytes( + new OpenAPIParser().readLocation(remoteUrl == null ? inputSpec : remoteUrl.toString(), null, parseOptions) + .getOpenAPI().toString().getBytes(StandardCharsets.UTF_8) + ).toString(); } /** - * Try to parse inputSpec setting string into URL (truly remote or resource) + * Try to parse inputSpec setting string into URL * @return A valid URL or null if inputSpec is not a valid URL */ private URL inputSpecRemoteUrl() { - URL url = dependencyClassLoader().getResource(inputSpec); - - if (url == null) { - try { - url = new URI(FilenameUtils.separatorsToUnix(inputSpec)).toURL(); - } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) { - } + try { + return new URI(FilenameUtils.separatorsToUnix(inputSpec)).toURL(); + } catch (URISyntaxException | MalformedURLException | IllegalArgumentException ignored) { + return null; } - - 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()); } /** 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 d39da0d8a62..d7fad6c2b6b 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,17 +16,6 @@ package org.openapitools.codegen.plugin; -import static org.junit.jupiter.api.Assertions.assertThrows; - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import org.apache.commons.io.FileUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.execution.DefaultMavenExecutionRequest; @@ -39,10 +28,23 @@ 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.DefaultLocalPathComposer; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; -import org.eclipse.aether.RepositorySystem; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class CodeGenMojoTest extends BaseTestCase { @Override @@ -58,14 +60,17 @@ public class CodeGenMojoTest extends BaseTestCase { testCommonConfiguration("resource"); } - public void testCommonConfigurationWithURLInputSpec() throws Exception { - testCommonConfiguration("url"); + public void testCommonConfigurationWithResourceExternalRefInputSpec() throws Exception { + testCommonConfiguration("resource-external-ref"); + } + + public void testCommonConfigurationWithJARInputSpec() throws Exception { + testCommonConfiguration("jar"); } @SuppressWarnings("unchecked") private void testCommonConfiguration(String profile) throws Exception { - File folder = Files.createTempDirectory("test").toFile(); - CodeGenMojo mojo = loadMojo(folder, "src/test/resources/default", profile); + CodeGenMojo mojo = loadMojo(newTempFolder(), "src/test/resources/default", profile); mojo.execute(); assertEquals("java", getVariableValueFromObject(mojo, "generatorName")); assertEquals("jersey2", getVariableValueFromObject(mojo, "library")); @@ -81,43 +86,42 @@ 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", "file", "executionId"); + final Path tempDir = newTempFolder(); + CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); // THEN - Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); - assertTrue(hashFolder.resolve("petstore.yaml-executionId.sha256").toFile().exists()); + assertTrue(Files.exists(tempDir.resolve( + "target/generated-sources/common-maven/remote-openapi/.openapi-generator/petstore.yaml-executionId.sha256" + ))); } /** - * For a Pom file which refers to a input file which will be on the classpath, as opposed to a file path, + * For a Pom file which refers to an input file which will be on the classpath, as opposed to a file path, * test that the spec is not regenerated when the hash has not changed. - * - * @throws Exception */ public void testSkipRegenerationForClasspathSpecFileNoChange() throws Exception { - //GIVEN - /* Setup the mojo */ - final Path folder = Files.createTempDirectory("test-classpath"); - final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId"); + /* Set up the mojo */ + final Path tempDir = newTempFolder(); + final CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/classpath", null, "executionId"); /* Perform an initial generation */ mojo.execute(); /* Check the hash file was created */ - final Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); - assertTrue(hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256").toFile().exists()); + final Path generatedDir = tempDir.resolve("target/generated-sources/common-maven/remote-openapi"); + assertTrue(Files.exists( + generatedDir.resolve(".openapi-generator/petstore-on-classpath.yaml-executionId.sha256") + )); /* Remove the generated source */ - Files.walk(folder.resolve("target/generated-sources/common-maven/remote-openapi/src")) - .sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); - + try (Stream files = Files.walk(generatedDir.resolve("src"))) { + //noinspection ResultOfMethodCallIgnored + files.sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); + } // WHEN /* Execute the mojo again */ @@ -125,41 +129,37 @@ public class CodeGenMojoTest extends BaseTestCase { // THEN /* Verify that the source directory has not been repopulated. If it has then we generated code again */ - assertFalse("src directory should not have been regenerated", - folder.resolve("target/generated-sources/common-maven/remote-openapi/src").toFile().exists()); - + assertFalse("src directory should not have been regenerated", Files.exists(generatedDir.resolve("src"))); } /** - * For a Pom file which refers to a input file which will be on the classpath, as opposed to a file path, + * For a Pom file which refers to an input file which will be on the classpath, as opposed to a file path, * test that the generated source is regenerated when the hash has changed. - * - * @throws Exception */ public void testSkipRegenerationForClasspathSpecFileWithChange() throws Exception { - //GIVEN - /* Setup the mojo */ - final Path folder = Files.createTempDirectory("test-classpath"); - final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId"); + /* Set up the mojo */ + final Path tempDir = newTempFolder(); + final CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/classpath", null, "executionId"); /* Perform an initial generation */ mojo.execute(); /* Check the hash file was created, proving a generation occurred */ - final Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); - assertTrue(hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256").toFile().exists()); + final Path generatedDir = tempDir.resolve("target/generated-sources/common-maven/remote-openapi"); + assertTrue(Files.exists(generatedDir.resolve(".openapi-generator/petstore-on-classpath.yaml-executionId.sha256"))); /* Update the hash contents to be a different value, simulating a spec change */ Files.write( - hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256"), - Arrays.asList("bd1bf4a953c858f9d47b67ed6029daacf1707e5cbd3d2e4b01383ba30363366f")); + generatedDir.resolve(".openapi-generator/petstore-on-classpath.yaml-executionId.sha256"), + List.of("bd1bf4a953c858f9d47b67ed6029daacf1707e5cbd3d2e4b01383ba30363366f") + ); /* Remove the generated source */ - Files.walk(folder.resolve("target/generated-sources/common-maven/remote-openapi/src")) - .sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); + try(Stream files = Files.walk(generatedDir.resolve("src"))) { + //noinspection ResultOfMethodCallIgnored + files.sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); + } // WHEN @@ -167,29 +167,27 @@ public class CodeGenMojoTest extends BaseTestCase { mojo.execute(); // THEN - /* Verify that the source directory has not been repopulated. If it has then we generated code again */ - assertTrue("src directory should have been regenerated", - folder.resolve("target/generated-sources/common-maven/remote-openapi/src").toFile().exists()); - + /* Verify that the source directory has been repopulated. */ + assertTrue("src directory should have been regenerated", Files.exists(generatedDir.resolve("src"))); } public void testCollapsedSpecProduced() throws Exception { // GIVEN - Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); + final Path tempDir = newTempFolder(); + CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); // THEN - File collapseSpecFile = folder.resolve("target/generated-sources/common-maven/remote-openapi/petstore-full-spec.yaml").toFile(); - assertTrue(collapseSpecFile.exists()); + assertTrue(Files.exists( + tempDir.resolve("target/generated-sources/common-maven/remote-openapi/petstore-full-spec.yaml") + )); } public void testCollapsedSpecAddedToArtifacts() throws Exception { // GIVEN - Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); + CodeGenMojo mojo = loadMojo(newTempFolder(), "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); @@ -203,8 +201,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", "file", "executionId"); + CodeGenMojo mojo = loadMojo(newTempFolder(), "src/test/resources/default", "file", "executionId"); mojo.inputSpec = null; mojo.inputSpecRootDirectory = null; @@ -217,8 +214,8 @@ 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", "file", "executionId"); + final Path tempDir = newTempFolder(); + CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/default", "file", "executionId"); mojo.inputSpec = null; mojo.inputSpecRootDirectory = "src/test/resources/default"; @@ -227,17 +224,43 @@ public class CodeGenMojoTest extends BaseTestCase { // THEN /* Check the hash file was created */ - final Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); - assertTrue(hashFolder.resolve("_merged_spec.yaml-executionId.sha256").toFile().exists()); + final Path hashFolder = tempDir.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); + assertTrue(Files.exists(hashFolder.resolve("_merged_spec.yaml-executionId.sha256"))); } - protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile) throws Exception { + /** + * Regression test for #16489 + */ + public void test_skipIfSpecIsUnchanged_recognizesUpdatesInExternalReferencedFile() throws Exception { + + //GIVEN + final Path tempDir = newTempFolder(); + final Path generatedDir = tempDir.resolve("target/generated-sources/issue-16489"); + final Path hashFile = generatedDir.resolve(".openapi-generator/petstore.yaml-default.sha256"); + final CodeGenMojo mojo = loadMojo(tempDir, "src/test/resources/issue-16489", null); + mojo.execute(); // Perform an initial generation + var currentHash = Files.readString(hashFile); // read hash + FileUtils.deleteDirectory(generatedDir.resolve("src").toFile()); // Remove the generated source + Files.writeString( // change schema definition in external file + tempDir.resolve("schemas/Pet.yaml"),"\n wrapped: true", StandardOpenOption.APPEND + ); + + // WHEN + mojo.execute(); // Execute the mojo again + + // THEN + assertNotEquals( + Files.readString(hashFile), currentHash, "Checksum should not be the same after external file change" + ); + assertTrue("Src directory should have been regenerated", Files.exists(generatedDir.resolve("src"))); + } + + protected CodeGenMojo loadMojo(Path temporaryFolder, String projectRoot, String profile) throws Exception { return loadMojo(temporaryFolder, projectRoot, profile, "default"); } - protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile, String executionId) throws Exception { - File file = new File(projectRoot); - FileUtils.copyDirectory(file, temporaryFolder); + protected CodeGenMojo loadMojo(Path temporaryFolder, String projectRoot, String profile, String executionId) throws Exception { + FileUtils.copyDirectory(new File(projectRoot), temporaryFolder.toFile()); MavenProject project = readMavenProject(temporaryFolder, profile); MavenSession session = newMavenSession(project); MojoExecution execution = newMojoExecution("generate"); @@ -251,22 +274,29 @@ public class CodeGenMojoTest extends BaseTestCase { return executionWithId; } - 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")); + protected MavenProject readMavenProject(Path basedir, String profile) throws Exception { + LocalRepository localRepo = new LocalRepository(basedir.resolve("local-repo").toFile()); DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); - session.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory().newInstance(session, localRepo)); - MavenExecutionRequest request = new DefaultMavenExecutionRequest(); - request.setBaseDirectory(basedir); + session.setLocalRepositoryManager( + new SimpleLocalRepositoryManagerFactory(new DefaultLocalPathComposer()).newInstance(session, localRepo) + ); + MavenExecutionRequest request = new DefaultMavenExecutionRequest().setBaseDirectory(basedir.toFile()); if (profile != null) { request.addActiveProfile(profile); } - ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); - configuration.setRepositorySession(session); - configuration.setResolveDependencies(true); - MavenProject project = lookup(ProjectBuilder.class).build(pom, configuration).getProject(); + ProjectBuildingRequest configuration = request.getProjectBuildingRequest() + .setRepositorySession(session) + .setResolveDependencies(true); + MavenProject project = lookup(ProjectBuilder.class) + .build(basedir.resolve("pom.xml").toFile(), configuration) + .getProject(); assertNotNull(project); return project; } + + static private Path newTempFolder() throws IOException { + final Path tempDir = Files.createTempDirectory("test"); + tempDir.toFile().deleteOnExit(); + return tempDir; + } } 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 67a74ce3745..9ef40042d38 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 @@ -32,23 +32,30 @@ resource - petstore.yaml + petstore-on-classpath.yaml - url + resource-external-ref + + + schema-external-ref/petstore-on-classpath.yaml + + + + jar jar:file:${basedir}/local-repo/petstore/schema/1/schema-1.jar!/petstore.yaml + + + petstore + schema + 1 + + - - - petstore - schema - 1 - - common-maven diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/petstore.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/petstore.yaml new file mode 100644 index 00000000000..88b99532757 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/petstore.yaml @@ -0,0 +1,105 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: Sample file with just two endpoints and one schema (defined in an external file $ref) + version: 1.0.0 + title: OpenAPI Petstore +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' + '/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: [] + 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' +components: + requestBodies: + Pet: + content: + application/json: + schema: + $ref: 'schemas/Pet.yaml' + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + description: Pet object that needs to be added to the store + required: true + schemas: + Pet: + $ref: 'schemas/Pet.yaml' diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/pom.xml b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/pom.xml new file mode 100644 index 00000000000..54724ef7fa6 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + common.maven + issue-16489 + jar + 1.0.0-SNAPSHOT + OpenAPI Generator Configuration Test + https://openapi-generator.tech/ + + + + org.openapitools + openapi-generator-maven-plugin + 7.6.0 + + java + + true + + native + ${basedir}/target/generated-sources/issue-16489 + hideGenerationTimestamp=true + ${basedir}/petstore.yaml + false + false + false + false + false + + true + + + + + generate + generate-sources + + generate + + + + + + + \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/schemas/Pet.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/schemas/Pet.yaml new file mode 100644 index 00000000000..8f93f9075f3 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/issue-16489/schemas/Pet.yaml @@ -0,0 +1,29 @@ +title: a Pet +description: A pet for sale in the pet store +type: object +required: + - name + - photoUrls +properties: + id: + type: integer + format: int64 + 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 + enum: + - available + - pending + - sold +xml: + name: Pet \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/2_0/python-flask/petstore.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/petstore-on-classpath.yaml similarity index 52% rename from modules/openapi-generator/src/test/resources/2_0/python-flask/petstore.yaml rename to modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/petstore-on-classpath.yaml index 952104fbb70..55cee186ad1 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-flask/petstore.yaml +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/petstore-on-classpath.yaml @@ -1,13 +1,15 @@ -swagger: '2.0' +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.' + 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' -host: petstore.swagger.io -basePath: /v2 tags: - name: pet description: Everything about your Pets @@ -15,8 +17,6 @@ tags: description: Access to Petstore orders - name: user description: Operations about user -schemes: - - http paths: /pet: post: @@ -25,46 +25,40 @@ paths: summary: Add a new pet to the store description: '' operationId: addPet - consumes: - - application/json - - application/xml - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: Pet object that needs to be added to the store - required: true - schema: - $ref: '#/definitions/Pet' responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + application/json: + schema: + $ref: 'schemas/Pet.yaml' '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 - consumes: - - application/json - - application/xml - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: Pet object that needs to be added to the store - required: true - schema: - $ref: '#/definitions/Pet' responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + application/json: + schema: + $ref: 'schemas/Pet.yaml' '400': description: Invalid ID supplied '404': @@ -75,6 +69,8 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' /pet/findByStatus: get: tags: @@ -82,67 +78,79 @@ paths: summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus - produces: - - application/xml - - application/json parameters: - name: status in: query description: Status values that need to be considered for filter required: true - type: array - items: - type: string - enum: - - available - - pending - - sold - default: available - collectionFormat: csv - responses: - '200': - description: successful operation + style: form + explode: false schema: type: array items: - $ref: '#/definitions/Pet' + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: 'schemas/Pet.yaml' + application/json: + schema: + type: array + items: + $ref: 'schemas/Pet.yaml' '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.' + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. operationId: findPetsByTags - produces: - - application/xml - - application/json parameters: - name: tags in: query description: Tags to filter by required: true - type: array - items: - type: string - collectionFormat: csv - responses: - '200': - description: successful operation + style: form + explode: false schema: type: array items: - $ref: '#/definitions/Pet' + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: 'schemas/Pet.yaml' + application/json: + schema: + type: array + items: + $ref: 'schemas/Pet.yaml' '400': description: Invalid tag value security: - petstore_auth: - - 'write:pets' - 'read:pets' deprecated: true '/pet/{petId}': @@ -152,21 +160,24 @@ paths: summary: Find pet by ID description: Returns a single pet operationId: getPetById - produces: - - application/xml - - application/json parameters: - name: petId in: path description: ID of pet to return required: true - type: integer - format: int64 + schema: + type: integer + format: int64 responses: '200': description: successful operation - schema: - $ref: '#/definitions/Pet' + content: + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + application/json: + schema: + $ref: 'schemas/Pet.yaml' '400': description: Invalid ID supplied '404': @@ -179,28 +190,14 @@ paths: summary: Updates a pet in the store with form data description: '' operationId: updatePetWithForm - consumes: - - application/x-www-form-urlencoded - produces: - - application/xml - - application/json parameters: - name: petId in: path description: ID of pet that needs to be updated required: true - type: integer - format: int64 - - name: name - in: formData - description: Updated name of the pet - required: false - type: string - - name: status - in: formData - description: Updated status of the pet - required: false - type: string + schema: + type: integer + format: int64 responses: '405': description: Invalid input @@ -208,26 +205,37 @@ paths: - 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 - produces: - - application/xml - - application/json parameters: - name: api_key in: header required: false - type: string + schema: + type: string - name: petId in: path description: Pet id to delete required: true - type: integer - format: int64 + schema: + type: integer + format: int64 responses: '400': description: Invalid pet value @@ -242,36 +250,38 @@ paths: summary: uploads an image description: '' operationId: uploadFile - consumes: - - multipart/form-data - produces: - - application/json parameters: - name: petId in: path description: ID of pet to update required: true - type: integer - format: int64 - - name: additionalMetadata - in: formData - description: Additional data to pass to server - required: false - type: string - - name: file - in: formData - description: file to upload - required: false - type: file + schema: + type: integer + format: int64 responses: '200': description: successful operation - schema: - $ref: '#/definitions/ApiResponse' + 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: @@ -279,17 +289,16 @@ paths: summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory - produces: - - application/json - parameters: [] responses: '200': description: successful operation - schema: - type: object - additionalProperties: - type: integer - format: int32 + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 security: - api_key: [] /store/order: @@ -299,47 +308,54 @@ paths: summary: Place an order for a pet description: '' operationId: placeOrder - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: order placed for purchasing the pet - required: true - schema: - $ref: '#/definitions/Order' responses: '200': description: successful operation - schema: - $ref: '#/definitions/Order' + content: + application/xml: + schema: + $ref: 'schemas/Order.yaml' + application/json: + schema: + $ref: 'schemas/Order.yaml' '400': description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: 'schemas/Order.yaml' + 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' + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions operationId: getOrderById - produces: - - application/xml - - application/json parameters: - name: orderId in: path description: ID of pet that needs to be fetched required: true - type: integer - maximum: 5 - minimum: 1 - format: int64 + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 responses: '200': description: successful operation - schema: - $ref: '#/definitions/Order' + content: + application/xml: + schema: + $ref: 'schemas/Order.yaml' + application/json: + schema: + $ref: 'schemas/Order.yaml' '400': description: Invalid ID supplied '404': @@ -348,17 +364,17 @@ paths: 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 + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors operationId: deleteOrder - produces: - - application/xml - - application/json parameters: - name: orderId in: path description: ID of the order that needs to be deleted required: true - type: string + schema: + type: string responses: '400': description: Invalid ID supplied @@ -371,19 +387,18 @@ paths: summary: Create user description: This can only be done by the logged in user. operationId: createUser - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: Created user object - required: true - schema: - $ref: '#/definitions/User' responses: default: description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: 'schemas/User.yaml' + description: Created user object + required: true /user/createWithArray: post: tags: @@ -391,21 +406,13 @@ paths: summary: Creates list of users with given input array description: '' operationId: createUsersWithArrayInput - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: List of user object - required: true - schema: - type: array - items: - $ref: '#/definitions/User' responses: default: description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' /user/createWithList: post: tags: @@ -413,21 +420,13 @@ paths: summary: Creates list of users with given input array description: '' operationId: createUsersWithListInput - produces: - - application/xml - - application/json - parameters: - - in: body - name: body - description: List of user object - required: true - schema: - type: array - items: - $ref: '#/definitions/User' responses: default: description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' /user/login: get: tags: @@ -435,34 +434,48 @@ paths: summary: Logs user into the system description: '' operationId: loginUser - produces: - - application/xml - - application/json parameters: - name: username in: query description: The user name for login required: true - type: string + 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 - type: string + schema: + type: string responses: '200': description: successful operation - schema: - type: string 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: - type: integer - format: int32 description: calls per hour allowed by the user + schema: + type: integer + format: int32 X-Expires-After: - type: string - format: date-time 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: @@ -472,13 +485,11 @@ paths: summary: Logs out current logged in user session description: '' operationId: logoutUser - produces: - - application/xml - - application/json - parameters: [] responses: default: description: successful operation + security: + - api_key: [] '/user/{username}': get: tags: @@ -486,20 +497,23 @@ paths: summary: Get user by user name description: '' operationId: getUserByName - produces: - - application/xml - - application/json parameters: - name: username in: path - description: 'The name that needs to be fetched. Use user1 for testing.' + description: The name that needs to be fetched. Use user1 for testing. required: true - type: string + schema: + type: string responses: '200': description: successful operation - schema: - $ref: '#/definitions/User' + content: + application/xml: + schema: + $ref: 'schemas/User.yaml' + application/json: + schema: + $ref: 'schemas/User.yaml' '400': description: Invalid username supplied '404': @@ -510,194 +524,94 @@ paths: summary: Updated user description: This can only be done by the logged in user. operationId: updateUser - produces: - - application/xml - - application/json parameters: - name: username in: path description: name that need to be deleted required: true - type: string - - in: body - name: body - description: Updated user object - required: true schema: - $ref: '#/definitions/User' + type: string responses: '400': description: Invalid user supplied '404': description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: 'schemas/User.yaml' + 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 - produces: - - application/xml - - application/json parameters: - name: username in: path description: The name that needs to be deleted required: true - type: string + schema: + type: string responses: '400': description: Invalid username supplied '404': description: User not found -securityDefinitions: - petstore_auth: - type: oauth2 - authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' - flow: implicit - scopes: - 'write:pets': modify pets in your account - 'read:pets': read your pets - api_key: - type: apiKey - name: api_key - in: header -definitions: - 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 - 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: '#/definitions/Category' - name: - type: string - example: doggie - photoUrls: - type: array - xml: - name: photoUrl - wrapped: true - items: + 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: 'schemas/User.yaml' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: 'schemas/Pet.yaml' + application/xml: + schema: + $ref: 'schemas/Pet.yaml' + 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: + 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 - tags: - type: array - xml: - name: tag - wrapped: true - items: - $ref: '#/definitions/Tag' - status: - type: string - description: pet status in the store - 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 - EnumModel: - enum: - - available> - - pending< - - sold - - 1 - - 2 - type: string diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Category.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Category.yaml new file mode 100644 index 00000000000..7c746a435f0 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Category.yaml @@ -0,0 +1,12 @@ +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 \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Order.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Order.yaml new file mode 100644 index 00000000000..fa6d787d4fe --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Order.yaml @@ -0,0 +1,28 @@ +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 \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Pet.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Pet.yaml new file mode 100644 index 00000000000..7cc642a8cca --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Pet.yaml @@ -0,0 +1,38 @@ +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: 'Category.yaml' + 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: 'Tag.yaml' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold +xml: + name: Pet \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Tag.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Tag.yaml new file mode 100644 index 00000000000..ff2a87dffcc --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/Tag.yaml @@ -0,0 +1,11 @@ +title: Pet Tag +description: A tag for a pet +type: object +properties: + id: + type: integer + format: int64 + name: + type: string +xml: + name: Tag \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/User.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/User.yaml new file mode 100644 index 00000000000..90bdee3fb1f --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/schema-external-ref/schemas/User.yaml @@ -0,0 +1,25 @@ +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 \ No newline at end of file diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 59c26ed68fc..ec32396ee21 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -6,7 +6,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml openapi-generator-online jar @@ -18,6 +18,13 @@ + + com.fasterxml.jackson + jackson-bom + ${jackson.version} + pom + import + org.springframework.boot spring-boot-dependencies diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java index 9a089de40c3..fa2752bd6f8 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/RFC3339DateFormat.java @@ -17,35 +17,23 @@ package org.openapitools.codegen.online; -import com.fasterxml.jackson.databind.util.StdDateFormat; +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; -import java.text.DateFormat; import java.text.FieldPosition; -import java.text.ParsePosition; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; import java.util.Date; -import java.util.TimeZone; -public class RFC3339DateFormat extends DateFormat { + +public class RFC3339DateFormat extends ISO8601DateFormat { private static final long serialVersionUID = 1L; - private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - private static final StdDateFormat sdf = new StdDateFormat() - .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) - .withColonInTimeZone(true); + // Same as ISO8601DateFormat but serializing milliseconds. @Override public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - String value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + String value = ISO8601Utils.format(date, true); toAppendTo.append(value); return toAppendTo; } - @Override - public Date parse(String source, ParsePosition pos) { - return sdf.parse(source, pos); - } - -} +} \ No newline at end of file diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java index b1a1938200b..3362e09d346 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ApiResponse.java @@ -17,8 +17,12 @@ package org.openapitools.codegen.online.model; +import lombok.Getter; +import lombok.Setter; + import javax.xml.bind.annotation.XmlTransient; +@Setter @javax.xml.bind.annotation.XmlRootElement public class ApiResponse { public static final int ERROR = 1; @@ -28,8 +32,8 @@ public class ApiResponse { public static final int TOO_BUSY = 5; int code; - String type; - String message; + @Getter String type; + @Getter String message; public ApiResponse() {} @@ -62,24 +66,4 @@ public class ApiResponse { public int getCode() { return code; } - - public void setCode(int code) { - this.code = code; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } } diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java index 832e178caf9..709ec3b8b1d 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/Generated.java @@ -17,23 +17,11 @@ package org.openapitools.codegen.online.model; +import lombok.Getter; +import lombok.Setter; + +@Getter @Setter public class Generated { private String filename; private String friendlyName; - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getFriendlyName() { - return friendlyName; - } - - public void setFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - } } diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java index 15c71a60c2c..0844839e9e5 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/GeneratorInput.java @@ -20,45 +20,20 @@ package org.openapitools.codegen.online.model; import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.parser.core.models.AuthorizationValue; +import lombok.Getter; +import lombok.Setter; import java.util.Map; +@Setter public class GeneratorInput { - private JsonNode spec; - private Map options; + @Getter private JsonNode spec; + @Getter private Map options; private String openAPIUrl; - private AuthorizationValue authorizationValue; - - public AuthorizationValue getAuthorizationValue() { - return authorizationValue; - } - - public void setAuthorizationValue(AuthorizationValue authorizationValue) { - this.authorizationValue = authorizationValue; - } - - public JsonNode getSpec() { - return spec; - } - - public void setSpec(JsonNode spec) { - this.spec = spec; - } - - public Map getOptions() { - return options; - } - - public void setOptions(Map options) { - this.options = options; - } + @Getter private AuthorizationValue authorizationValue; @ApiModelProperty(example = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml") public String getOpenAPIUrl() { return openAPIUrl; } - - public void setOpenAPIUrl(String url) { - this.openAPIUrl = url; - } } diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java index a8af9ab76ff..85529434ab8 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/model/ResponseCode.java @@ -18,36 +18,25 @@ package org.openapitools.codegen.online.model; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.Setter; +@Setter @NoArgsConstructor @AllArgsConstructor public class ResponseCode { private String code; private String link; - public ResponseCode() {} - - public ResponseCode(String code, String link) { - setCode(code); - setLink(link); - } - @ApiModelProperty(value = "File download code", example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a") public String getCode() { return code; } - public void setCode(String code) { - this.code = code; - } - @ApiModelProperty( value = "URL for fetching the generated client", example = "http://localhost:8080/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a") public String getLink() { return link; } - - public void setLink(String link) { - this.link = link; - } } diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 63c138fef41..88221982c0a 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -6,7 +6,7 @@ 8.0.0-SNAPSHOT - ../.. + ../../pom.xml 4.0.0 openapi-generator @@ -288,6 +288,7 @@ org.slf4j slf4j-simple ${slf4j.version} + runtime org.apache.commons @@ -338,9 +339,9 @@ test - org.testng - testng - ${testng.version} + org.junit.support + testng-engine + 1.0.5 test @@ -349,17 +350,6 @@ 3.24.9 test - - org.openrewrite - rewrite-maven - test - - - org.reflections - reflections - ${reflections.version} - test - com.googlecode.java-diff-utils diffutils @@ -390,7 +380,13 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-databind.version} + ${jackson.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + test com.fasterxml.jackson.datatype @@ -433,7 +429,13 @@ com.google.guava guava-testlib - 31.1-jre + ${guava.version} + + + junit + junit + + test diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java index 7226c7dd931..f4a04b8fd32 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java @@ -19,17 +19,21 @@ package org.openapitools.codegen; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; public class CliOption { - private final String opt; + @Getter private final String opt; + @Getter @Setter private String description; + @Getter @Setter private String type; private String defaultValue; - private String optValue; + @Getter private String optValue; private Map enumValues; public CliOption(String opt, String description) { @@ -42,26 +46,6 @@ public class CliOption { this.type = type; } - public String getOpt() { - return opt; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - public String getDefault() { return defaultValue; } @@ -75,10 +59,6 @@ public class CliOption { return this; } - public String getOptValue() { - return this.optValue; - } - public void setOptValue(String optValue) { if (this.enumValues!=null && this.enumValues.containsKey(optValue)) { this.optValue = optValue; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java index cf5960cf633..519a390a0d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java @@ -20,6 +20,7 @@ package org.openapitools.codegen; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.parser.core.models.AuthorizationValue; +import lombok.Getter; import org.openapitools.codegen.api.TemplateDefinition; import org.openapitools.codegen.auth.AuthParser; import org.openapitools.codegen.config.GeneratorSettings; @@ -31,7 +32,8 @@ public class ClientOptInput { private GeneratorSettings generatorSettings; private OpenAPI openAPI; private List auths; - private List userDefinedTemplates; + // not deprecated as this is added to match other functionality, we need to move to Context instead of ClientOptInput. + @Getter private List userDefinedTemplates; public ClientOptInput openAPI(OpenAPI openAPI) { this.setOpenAPI(openAPI); @@ -79,11 +81,6 @@ public class ClientOptInput { return config; } - public List getUserDefinedTemplates() { - // not deprecated as this is added to match other functionality, we need to move to Context instead of ClientOptInput. - return userDefinedTemplates; - } - /** * Sets the generator/config instance * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java index e2fe8187004..08e261c165e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenComposedSchemas.java @@ -16,8 +16,12 @@ package org.openapitools.codegen; +import lombok.Getter; +import lombok.Setter; + import java.util.*; +@Getter @Setter public class CodegenComposedSchemas { private List allOf; private List oneOf; @@ -31,38 +35,6 @@ public class CodegenComposedSchemas { this.not = not; } - public List getAllOf() { - return allOf; - } - - public List getOneOf() { - return oneOf; - } - - public List getAnyOf() { - return anyOf; - } - - public CodegenProperty getNot() { - return not; - } - - public void setAllOf(List allOf) { - this.allOf = allOf; - } - - public void setOneOf(List oneOf) { - this.oneOf = oneOf; - } - - public void setAnyOf(List anyOf) { - this.anyOf = anyOf; - } - - public void setNot(CodegenProperty not) { - this.not = not; - } - public String toString() { final StringBuilder sb = new StringBuilder("CodegenComposedSchemas{"); sb.append("oneOf=").append(oneOf); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 33f8e754f67..81811d4071a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -232,6 +232,8 @@ public class CodegenConstants { public static final String TEMPLATING_ENGINE = "templatingEngine"; public static final String TEMPLATING_ENGINE_DESC = "The templating engine plugin to use: \"mustache\" (default) or \"handlebars\" (beta)"; + public static final String MUSTACHE_PARENT_CONTEXT = "MUSTACHE_PARENT_CONTEXT"; + public static enum PARAM_NAMING_TYPE {camelCase, PascalCase, snake_case, original} public static enum MODEL_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, original} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java index cabdf4d911d..fdc41c984fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java @@ -1,5 +1,8 @@ package org.openapitools.codegen; +import lombok.Getter; +import lombok.Setter; + import java.util.*; /** @@ -14,10 +17,15 @@ import java.util.*; public class CodegenDiscriminator { // The name of the property in the payload that will hold the discriminator value. // This is the propertyName as specified in the OpenAPI discriminator object. + @Getter @Setter private String propertyName; + @Getter @Setter private String propertyBaseName; + @Getter @Setter private String propertyGetter; + @Getter @Setter private String propertyType; + @Getter @Setter private Map mapping; private boolean isEnum; @@ -36,58 +44,12 @@ public class CodegenDiscriminator { // // see the method createDiscriminator in DefaultCodegen.java + @Getter @Setter private Set mappedModels = new TreeSet<>(); + @Getter @Setter private Map vendorExtensions = new HashMap<>(); - public String getPropertyName() { - return propertyName; - } - - public void setPropertyName(String propertyName) { - this.propertyName = propertyName; - } - - public String getPropertyGetter() { - return propertyGetter; - } - - public void setPropertyGetter(String propertyGetter) { - this.propertyGetter = propertyGetter; - } - - public String getPropertyBaseName() { - return propertyBaseName; - } - - public void setPropertyBaseName(String propertyBaseName) { - this.propertyBaseName = propertyBaseName; - } - - public String getPropertyType() { - return propertyType; - } - - public void setPropertyType(String propertyType) { - this.propertyType = propertyType; - } - - public Map getMapping() { - return mapping; - } - - public void setMapping(Map mapping) { - this.mapping = mapping; - } - - public Set getMappedModels() { - return mappedModels; - } - - public void setMappedModels(Set mappedModels) { - this.mappedModels = mappedModels; - } - public boolean getIsEnum() { return isEnum; } @@ -95,15 +57,7 @@ public class CodegenDiscriminator { public void setIsEnum(boolean isEnum) { this.isEnum = isEnum; } - - public Map getVendorExtensions() { - return vendorExtensions; - } - - public void setVendorExtensions(Map vendorExtensions) { - this.vendorExtensions = vendorExtensions; - } - + /** * An object to hold discriminator mappings between payload values and schema names or * references. @@ -116,11 +70,14 @@ public class CodegenDiscriminator { */ public static class MappedModel implements Comparable{ // The value of the discriminator property in the payload. + @Getter @Setter private String mappingName; // The OAS schema name. It is obtained from the OAS document, and the string value // is converted to a sanitized, internal representation within codegen. + @Getter @Setter private String modelName; + @Getter @Setter private CodegenModel model; private final boolean explicitMapping; @@ -154,26 +111,6 @@ public class CodegenDiscriminator { } } - public String getMappingName() { - return mappingName; - } - - public void setMappingName(String mappingName) { - this.mappingName = mappingName; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public CodegenModel getModel() { return model; } - - public void setModel(CodegenModel model) { this.model = model; } - @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java index d53ee21cc57..c110c5d3ebe 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java @@ -1,17 +1,19 @@ package org.openapitools.codegen; +import lombok.Getter; + import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; public class CodegenEncoding { - private String contentType; - private List headers; - private String style; + @Getter private String contentType; + @Getter private List headers; + @Getter private String style; private boolean explode; private boolean allowReserved; - public Map vendorExtensions = new HashMap<>(); + @Getter public Map vendorExtensions = new HashMap<>(); public CodegenEncoding(String contentType, List headers, String style, boolean explode, boolean allowReserved) { this.contentType = contentType; @@ -21,18 +23,6 @@ public class CodegenEncoding { this.allowReserved = allowReserved; } - public String getContentType() { - return contentType; - } - - public List getHeaders() { - return headers; - } - - public String getStyle() { - return style; - } - public boolean getExplode() { return explode; } @@ -41,10 +31,6 @@ public class CodegenEncoding { return allowReserved; } - public Map getVendorExtensions() { - return vendorExtensions; - } - public String toString() { final StringBuilder sb = new StringBuilder("CodegenEncoding{"); sb.append("contentType=").append(contentType); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java index e314daf14b4..55222dc2ceb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java @@ -1,13 +1,14 @@ package org.openapitools.codegen; import io.swagger.v3.oas.models.examples.Example; +import lombok.Getter; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; -public class CodegenMediaType { +@Getter public class CodegenMediaType { private CodegenProperty schema; private LinkedHashMap encoding; private HashMap testCases = new HashMap<>(); @@ -33,28 +34,6 @@ public class CodegenMediaType { this.example = example; } - public CodegenProperty getSchema() { - return schema; - } - - public LinkedHashMap getEncoding() { - return encoding; - } - - public HashMap getTestCases() { return testCases; } - - public Map getExamples() { - return examples; - } - - public Object getExample() { - return example; - } - - public Map getVendorExtensions() { - return vendorExtensions; - } - public String toString() { final StringBuilder sb = new StringBuilder("CodegenMediaType{"); sb.append("schema=").append(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 0260d687052..41a3a176ab2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -22,6 +22,8 @@ import io.swagger.v3.oas.models.ExternalDocumentation; import java.util.*; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; /** @@ -35,15 +37,21 @@ public class CodegenModel implements IJsonSchemaValidationProperties { // object is a discriminator, that object is set as the parent. If no discriminator is specified, // codegen returns the first one in the list, i.e. there is no obvious parent in the OpenAPI specification. // When possible, the mustache templates should use 'allParents' to handle multiple parents. + @Getter @Setter public String parent, parentSchema; + @Getter @Setter public List interfaces; // The list of parent model name from the schemas. In order of preference, the parent is obtained // from the 'allOf' attribute, then 'anyOf', and finally 'oneOf'. + @Getter @Setter public List allParents; // References to parent and interface CodegenModels. Only set when code generator supports inheritance. + @Getter @Setter public CodegenModel parentModel; + @Getter @Setter public List interfaceModels; + @Getter @Setter public List children; // anyOf, oneOf, allOf @@ -53,42 +61,101 @@ public class CodegenModel implements IJsonSchemaValidationProperties { // The schema name as written in the OpenAPI document // If it's a reserved word, it will be escaped. + @Getter @Setter public String name; // The original schema name as written in the OpenAPI document. + @Getter @Setter public String schemaName; // The language-specific name of the class that implements this schema. // The name of the class is derived from the OpenAPI schema name with formatting rules applied. // The classname is derived from the OpenAPI schema name, with sanitization and escaping rules applied. + @Getter @Setter public String classname; // The value of the 'title' attribute in the OpenAPI document. + @Getter @Setter public String title; + @Getter @Setter public String description, classVarName, modelJson, dataType, xmlPrefix, xmlNamespace, xmlName; + @Getter @Setter public String classFilename; // store the class file name, mainly used for import + @Getter @Setter public String unescapedDescription; - public CodegenDiscriminator discriminator; + /** + * -- GETTER -- + * Returns the discriminator for this schema object, or null if no discriminator has been specified. + * The list of all possible schema discriminator mapping values is obtained + * from explicit discriminator mapping values in the OpenAPI document, and from + * inherited discriminators through oneOf, allOf, anyOf. + * For example, a discriminator may be defined in a 'Pet' schema as shown below. + * The Dog and Cat schemas inherit the discriminator through the allOf reference. + * In the 'Pet' schema, the supported discriminator mapping values for the + * 'objectType' properties are 'Dog' and 'Cat'. + * The allowed discriminator mapping value for the Dog schema is 'Dog'. + * The allowed discriminator mapping value for the Cat schema is 'Dog'. + * Pet: + * type: object + * discriminator: + * propertyName: objectType + * required: + * - objectType + * properties: + * objectType: + * type: string + * Dog: + * allOf: + * - $ref: '#/components/schemas/Pet' + * - type: object + * properties: + * p1: + * type: string + * Cat: + * allOf: + * - $ref: '#/components/schemas/Pet' + * - type: object + * properties: + * p2: + * type: string + * + * @return the discriminator. + */ + @Getter public CodegenDiscriminator discriminator; + @Getter @Setter public String defaultValue; + @Getter @Setter public String arrayModelType; public boolean isAlias; // Is this effectively an alias of another simple type public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isDecimal, isShort, isUnboundedInteger, isPrimitiveType, isBoolean, isFreeFormObject; private boolean additionalPropertiesIsAnyType; public List vars = new ArrayList<>(); // all properties (without parent's properties) + @Getter @Setter public List allVars = new ArrayList<>(); // all properties (with parent's properties) public List requiredVars = new ArrayList<>(); // a list of required properties + @Getter @Setter public List optionalVars = new ArrayList<>(); // a list of optional properties + @Getter @Setter public List readOnlyVars = new ArrayList<>(); // a list of read-only properties + @Getter @Setter public List readWriteVars = new ArrayList<>(); // a list of properties for read, write + @Getter @Setter public List parentVars = new ArrayList<>(); public List parentRequiredVars = new ArrayList<>(); + @Getter @Setter public List nonNullableVars = new ArrayList<>(); // a list of non-nullable properties + @Getter @Setter public Map allowableValues; // Sorted sets of required parameters. + @Getter @Setter public Set mandatory = new TreeSet<>(); // without parent's required properties + @Getter @Setter public Set allMandatory = new TreeSet<>(); // with parent's required properties + @Getter @Setter public Set imports = new TreeSet<>(); - public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation; + @Getter @Setter + public boolean emptyVars; + public boolean hasVars, hasMoreModels, hasEnums, isEnum, hasValidation; /** * Indicates the OAS schema specifies "nullable: true". */ @@ -104,6 +171,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public boolean isArray; public boolean hasChildren; public boolean isMap; + /** datatype is the generic inner parameter of a std::optional for C++, or Optional (Java) */ + public boolean isOptional; public boolean isNull; public boolean isVoid = false; /** @@ -118,8 +187,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties { * Indicates the all properties of the type are read-only. */ public boolean hasOnlyReadOnly = true; + @Getter @Setter public ExternalDocumentation externalDocumentation; + @Getter @Setter public Map vendorExtensions = new HashMap<>(); private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; @@ -156,6 +227,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { * type: integer * */ + @Getter @Setter public String additionalPropertiesType; /** @@ -191,14 +263,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { private Map requiredVarsMap; private String ref; - public String getAdditionalPropertiesType() { - return additionalPropertiesType; - } - - public void setAdditionalPropertiesType(String additionalPropertiesType) { - this.additionalPropertiesType = additionalPropertiesType; - } - @Override public CodegenProperty getContains() { return contains; @@ -269,78 +333,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties; } - public Set getAllMandatory() { - return allMandatory; - } - - public void setAllMandatory(Set allMandatory) { - this.allMandatory = allMandatory; - } - - public List getAllParents() { - return allParents; - } - - public void setAllParents(List allParents) { - this.allParents = allParents; - } - - public List getAllVars() { - return allVars; - } - - public void setAllVars(List allVars) { - this.allVars = allVars; - } - - public List getNonNullableVars() { - return nonNullableVars; - } - - public void setNonNullableVars(List nonNullableVars) { - this.nonNullableVars = nonNullableVars; - } - - public Map getAllowableValues() { - return allowableValues; - } - - public void setAllowableValues(Map allowableValues) { - this.allowableValues = allowableValues; - } - - public String getArrayModelType() { - return arrayModelType; - } - - public void setArrayModelType(String arrayModelType) { - this.arrayModelType = arrayModelType; - } - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - public String getClassFilename() { - return classFilename; - } - - public void setClassFilename(String classFilename) { - this.classFilename = classFilename; - } - - public String getClassVarName() { - return classVarName; - } - - public void setClassVarName(String classVarName) { - this.classVarName = classVarName; - } - /** * Return true if the classname property is sanitized, false if it is the same as the OpenAPI schema name. * The OpenAPI schema name may be any valid JSON schema name, including non-ASCII characters. @@ -352,81 +344,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { return !StringUtils.equals(classname, name); } - public String getClassname() { - return classname; - } - - public void setClassname(String classname) { - this.classname = classname; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - /** - * Returns the discriminator for this schema object, or null if no discriminator has been specified. - * - * The list of all possible schema discriminator mapping values is obtained - * from explicit discriminator mapping values in the OpenAPI document, and from - * inherited discriminators through oneOf, allOf, anyOf. - * For example, a discriminator may be defined in a 'Pet' schema as shown below. - * The Dog and Cat schemas inherit the discriminator through the allOf reference. - * In the 'Pet' schema, the supported discriminator mapping values for the - * 'objectType' properties are 'Dog' and 'Cat'. - * The allowed discriminator mapping value for the Dog schema is 'Dog'. - * The allowed discriminator mapping value for the Cat schema is 'Dog'. - * - * Pet: - * type: object - * discriminator: - * propertyName: objectType - * required: - * - objectType - * properties: - * objectType: - * type: string - * Dog: - * allOf: - * - $ref: '#/components/schemas/Pet' - * - type: object - * properties: - * p1: - * type: string - * Cat: - * allOf: - * - $ref: '#/components/schemas/Pet' - * - type: object - * properties: - * p2: - * type: string - * - * @return the discriminator. - */ - public CodegenDiscriminator getDiscriminator() { - return discriminator; - } - public void setDiscriminator(CodegenDiscriminator discriminator) { this.discriminator = discriminator; if (discriminator != null && !discriminator.getMappedModels().isEmpty()) { @@ -446,110 +363,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { return discriminator == null ? null : discriminator.getPropertyName(); } - public ExternalDocumentation getExternalDocumentation() { - return externalDocumentation; - } - - public void setExternalDocumentation(ExternalDocumentation externalDocumentation) { - this.externalDocumentation = externalDocumentation; - } - - public Set getImports() { - return imports; - } - - public void setImports(Set imports) { - this.imports = imports; - } - - public List getInterfaceModels() { - return interfaceModels; - } - - public void setInterfaceModels(List interfaceModels) { - this.interfaceModels = interfaceModels; - } - - public List getInterfaces() { - return interfaces; - } - - public void setInterfaces(List interfaces) { - this.interfaces = interfaces; - } - - public Set getMandatory() { - return mandatory; - } - - public void setMandatory(Set mandatory) { - this.mandatory = mandatory; - } - - public String getModelJson() { - return modelJson; - } - - public void setModelJson(String modelJson) { - this.modelJson = modelJson; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSchemaName() { - return schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - - public List getOptionalVars() { - return optionalVars; - } - - public void setOptionalVars(List optionalVars) { - this.optionalVars = optionalVars; - } - - public String getParent() { - return parent; - } - - public void setParent(String parent) { - this.parent = parent; - } - - public CodegenModel getParentModel() { - return parentModel; - } - - public void setParentModel(CodegenModel parentModel) { - this.parentModel = parentModel; - } - - public String getParentSchema() { - return parentSchema; - } - - public void setParentSchema(String parentSchema) { - this.parentSchema = parentSchema; - } - - public List getParentVars() { - return parentVars; - } - - public void setParentVars(List parentVars) { - this.parentVars = parentVars; - } @Override public String getPattern() { @@ -741,6 +554,16 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.isMap = isMap; } + @Override + public boolean getIsOptional() { + return isOptional; + } + + @Override + public void setIsOptional(boolean isOptional) { + this.isOptional = isOptional; + } + @Override public boolean getIsArray() { return isArray; @@ -811,22 +634,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.hasValidation = hasValidation; } - public List getReadOnlyVars() { - return readOnlyVars; - } - - public void setReadOnlyVars(List readOnlyVars) { - this.readOnlyVars = readOnlyVars; - } - - public List getReadWriteVars() { - return readWriteVars; - } - - public void setReadWriteVars(List readWriteVars) { - this.readWriteVars = readWriteVars; - } - @Override public List getRequiredVars() { return requiredVars; @@ -837,22 +644,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.requiredVars = requiredVars; } - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUnescapedDescription() { - return unescapedDescription; - } - - public void setUnescapedDescription(String unescapedDescription) { - this.unescapedDescription = unescapedDescription; - } - @Override public List getVars() { return vars; @@ -863,38 +654,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.vars = vars; } - public Map getVendorExtensions() { - return vendorExtensions; - } - - public void setVendorExtensions(Map vendorExtensions) { - this.vendorExtensions = vendorExtensions; - } - - public String getXmlName() { - return xmlName; - } - - public void setXmlName(String xmlName) { - this.xmlName = xmlName; - } - - public String getXmlNamespace() { - return xmlNamespace; - } - - public void setXmlNamespace(String xmlNamespace) { - this.xmlNamespace = xmlNamespace; - } - - public String getXmlPrefix() { - return xmlPrefix; - } - - public void setXmlPrefix(String xmlPrefix) { - this.xmlPrefix = xmlPrefix; - } - @Override public boolean getIsNull() { return isNull; @@ -995,8 +754,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.isFreeFormObject = isFreeFormObject; } + @Override public boolean getIsUuid() { return isUuid; } + @Override public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; } public boolean getIsUri() { return isUri; } @@ -1128,6 +889,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { isArray == that.isArray && hasChildren == that.hasChildren && isMap == that.isMap && + isOptional == that.isOptional && isDeprecated == that.isDeprecated && hasReadOnly == that.hasReadOnly && hasOnlyReadOnly == that.hasOnlyReadOnly && @@ -1221,7 +983,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { getVars(), getAllVars(), getNonNullableVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(), getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray, - hasChildren, isMap, isDeprecated, hasReadOnly, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(), + hasChildren, isMap, isOptional, isDeprecated, hasReadOnly, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(), getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(), getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(), @@ -1296,6 +1058,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { sb.append(", isArray=").append(isArray); sb.append(", hasChildren=").append(hasChildren); sb.append(", isMap=").append(isMap); + sb.append(", isOptional=").append(isOptional); sb.append(", isDeprecated=").append(isDeprecated); sb.append(", hasReadOnly=").append(hasReadOnly); sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly); @@ -1368,14 +1131,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties { } } - public boolean isEmptyVars() { - return emptyVars; - } - - public void setEmptyVars(boolean emptyVars) { - this.emptyVars = emptyVars; - } - public boolean getHasItems() { return this.items != null; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java index 6d85bcf2c2e..6627b81a22c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModelType.java @@ -17,7 +17,9 @@ package org.openapitools.codegen; -public enum CodegenModelType { +import lombok.Getter; + +@Getter public enum CodegenModelType { MODEL(CodegenModel.class), OPERATION(CodegenOperation.class), @@ -32,7 +34,4 @@ public enum CodegenModelType { this.defaultImplementation = defaultImplementation; } - public Class getDefaultImplementation() { - return defaultImplementation; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 578b86152e8..0497bf49c55 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -25,6 +25,8 @@ import java.util.Map; import java.util.Objects; import io.swagger.v3.oas.models.examples.Example; +import lombok.Getter; +import lombok.Setter; /** * Describes a single operation parameter in the OAS specification. @@ -48,6 +50,8 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isShort, isUnboundedInteger; public boolean isArray, isMap; + /** datatype is the generic inner parameter of a std::optional for C++, or Optional (Java) */ + public boolean isOptional; public boolean isFile; public boolean isEnum; public boolean isEnumRef; // true if the enum is a ref (model) but not defined inline @@ -65,6 +69,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public String containerType; public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map) + @Getter @Setter private CodegenProperty schema; private boolean additionalPropertiesIsAnyType; private boolean hasVars; @@ -128,6 +133,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { private boolean hasDiscriminatorWithNonEmptyMapping; private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; + @Getter @Setter private LinkedHashMap content; private Map requiredVarsMap; private String ref; @@ -261,6 +267,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { output.isAnyType = this.isAnyType; output.isArray = this.isArray; output.isMap = this.isMap; + output.isOptional = this.isOptional; output.isExplode = this.isExplode; output.style = this.style; output.isDeepObject = this.isDeepObject; @@ -280,7 +287,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, - isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, + isFreeFormObject, isAnyType, isArray, isMap, isOptional, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), @@ -330,6 +337,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { isAnyType == that.isAnyType && isArray == that.isArray && isMap == that.isMap && + isOptional == that.isOptional && isFile == that.isFile && isEnum == that.isEnum && isEnumRef == that.isEnumRef && @@ -463,6 +471,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { sb.append(", isAnyType=").append(isAnyType); sb.append(", isArray=").append(isArray); sb.append(", isMap=").append(isMap); + sb.append(", isOptional=").append(isOptional); sb.append(", isFile=").append(isFile); sb.append(", isEnum=").append(isEnum); sb.append(", isEnumRef=").append(isEnumRef); @@ -755,6 +764,16 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { this.isMap = isMap; } + @Override + public boolean getIsOptional() { + return isOptional; + } + + @Override + public void setIsOptional(boolean isOptional) { + this.isOptional = isOptional; + } + @Override public boolean getIsArray() { return isArray; @@ -908,8 +927,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { return hasDiscriminatorWithNonEmptyMapping; } - ; - @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; @@ -975,22 +992,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { this.hasMultipleTypes = hasMultipleTypes; } - public CodegenProperty getSchema() { - return schema; - } - - public void setSchema(CodegenProperty schema) { - this.schema = schema; - } - - public LinkedHashMap getContent() { - return content; - } - - public void setContent(LinkedHashMap content) { - this.content = content; - } - @Override public String getBaseType() { return baseType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index 6eee9294dcb..babaaa1727d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -17,6 +17,9 @@ package org.openapitools.codegen; +import lombok.Getter; +import lombok.Setter; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -29,42 +32,58 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti * The value of the 'type' attribute in the OpenAPI schema. * The per-language codegen logic may change to a language-specific type. */ + @Getter public String openApiType; + @Getter @Setter public String baseName; - public String complexType; + @Setter public String complexType; + @Getter @Setter public String getter; + @Getter @Setter public String setter; /** * The value of the 'description' attribute in the OpenAPI schema. */ + @Getter @Setter public String description; /** * The language-specific data type for this property. For example, the OpenAPI type 'integer' * may be represented as 'int', 'int32', 'Integer', etc, depending on the programming language. */ public String dataType; + @Getter @Setter public String datatypeWithEnum; + @Getter @Setter public String dataFormat; /** * The name of this property in the OpenAPI schema. */ + @Getter @Setter public String name; + @Getter @Setter public String min; // TODO: is this really used? + @Getter @Setter public String max; // TODO: is this really used? + @Getter @Setter public String defaultValue; + @Getter @Setter public String defaultValueWithParam; - public String baseType; + @Setter public String baseType; + @Getter @Setter public String containerType; + @Getter @Setter public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map) /** * The value of the 'title' attribute in the OpenAPI schema. */ + @Getter @Setter public String title; /** * The 'description' string without escape characters needed by some programming languages/targets */ + @Getter @Setter public String unescapedDescription; /** @@ -82,8 +101,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti /** * A free-form property to include an example of an instance for this schema. */ + @Getter @Setter public String example; + @Getter @Setter public String jsonSchema; /** * The value of the 'minimum' attribute in the OpenAPI schema. @@ -110,7 +131,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti * The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance. */ public boolean exclusiveMaximum; - public boolean required; + @Setter public boolean required; public boolean deprecated; public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly public boolean isPrimitiveType; @@ -157,6 +178,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isAnyType; public boolean isArray; public boolean isMap; + /** datatype is the generic inner parameter of a std::optional for C++, or Optional (Java) */ + public boolean isOptional; public boolean isEnum; // true if the enum is defined inline public boolean isInnerEnum; // Enums declared inline will be located inside the generic model, changing how the enum is referenced in some cases. public boolean isEnumRef; // true if it's a reference to an enum @@ -168,7 +191,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isDiscriminator; public boolean isNew; // true when this property overrides an inherited property public Boolean isOverridden; // true if the property is a parent property (not defined in child/current schema) + @Getter @Setter public List _enum; + @Getter @Setter public Map allowableValues; // If 'additionalProperties' is not set, items is null. // If 'additionalProperties' is set to a type or refers to a type, 'items' provides the type information for @@ -178,16 +203,22 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public List vars = new ArrayList(); // all properties (without parent's properties) public List requiredVars = new ArrayList<>(); public CodegenProperty mostInnerItems; + @Getter @Setter public Map vendorExtensions = new HashMap(); public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template) public boolean isInherited; public String discriminatorValue; + @Getter @Setter public String nameInLowerCase; // property name in lower case + @Getter @Setter public String nameInCamelCase; // property name in camel case (e.g. modifiedDate) + @Getter @Setter public String nameInPascalCase; // property name in pascal case (e.g. ModifiedDate) + @Getter public String nameInSnakeCase; // property name in upper snake case // enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1) + @Getter @Setter public String enumName; public Integer maxItems; public Integer minItems; @@ -199,8 +230,11 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti // XML public boolean isXmlAttribute = false; + @Getter @Setter public String xmlPrefix; + @Getter @Setter public String xmlName; + @Getter @Setter public String xmlNamespace; public boolean isXmlWrapped = false; private boolean additionalPropertiesIsAnyType; @@ -268,48 +302,11 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.isBooleanSchemaFalse = isBooleanSchemaFalse; } - public String getOpenApiType() { return openApiType; } - - public String getBaseName() { - return baseName; - } - - public void setBaseName(String baseName) { - this.baseName = baseName; - } - + @Override public String getComplexType() { return complexType; } - public void setComplexType(String complexType) { - this.complexType = complexType; - } - - public String getGetter() { - return getter; - } - - public void setGetter(String getter) { - this.getter = getter; - } - - public String getSetter() { - return setter; - } - - public void setSetter(String setter) { - this.setter = setter; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - /** * @return dataType * @deprecated since version 3.0.0, use {@link #getDataType()} instead.
    @@ -320,119 +317,29 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti return getDataType(); } + @Override public String getDataType() { return dataType; } /** - * @deprecated use {@link #setDataType()} instead. + * @deprecated use {@link #setDataType(String)} instead. */ @Deprecated public void setDatatype(String datatype) { this.dataType = datatype; } + @Override public void setDataType(String dataType) { this.dataType = dataType; } - public String getDatatypeWithEnum() { - return datatypeWithEnum; - } - - public void setDatatypeWithEnum(String datatypeWithEnum) { - this.datatypeWithEnum = datatypeWithEnum; - } - - public String getDataFormat() { - return dataFormat; - } - - public void setDataFormat(String dataFormat) { - this.dataFormat = dataFormat; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getDefaultValueWithParam() { - return defaultValueWithParam; - } - - public void setDefaultValueWithParam(String defaultValueWithParam) { - this.defaultValueWithParam = defaultValueWithParam; - } - + @Override public String getBaseType() { return baseType; } - public void setBaseType(String baseType) { - this.baseType = baseType; - } - - public String getContainerType() { - return containerType; - } - - public void setContainerType(String containerType) { - this.containerType = containerType; - } - - public String getContainerTypeMapped() { - return containerTypeMapped; - } - - public void setContainerTypeMapped(String containerTypeMapped) { - this.containerTypeMapped = containerTypeMapped; - } - - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUnescapedDescription() { - return unescapedDescription; - } - - public void setUnescapedDescription(String unescapedDescription) { - this.unescapedDescription = unescapedDescription; - } - @Override public boolean getSchemaIsFromAdditionalProperties() { return schemaIsFromAdditionalProperties; @@ -473,22 +380,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.pattern = pattern; } - public String getExample() { - return example; - } - - public void setExample(String example) { - this.example = example; - } - - public String getJsonSchema() { - return jsonSchema; - } - - public void setJsonSchema(String jsonSchema) { - this.jsonSchema = jsonSchema; - } - @Override public String getMinimum() { return minimum; @@ -545,26 +436,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti return !getRequired() || isNullable; } - public void setRequired(boolean required) { - this.required = required; - } - - public List get_enum() { - return _enum; - } - - public void set_enum(List _enum) { - this._enum = _enum; - } - - public Map getAllowableValues() { - return allowableValues; - } - - public void setAllowableValues(Map allowableValues) { - this.allowableValues = allowableValues; - } - @Override public CodegenProperty getItems() { return items; @@ -625,6 +496,16 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.isMap = isMap; } + @Override + public boolean getIsOptional() { + return isOptional; + } + + @Override + public void setIsOptional(boolean isOptional) { + this.isOptional = isOptional; + } + @Override public boolean getIsArray() { return isArray; @@ -675,50 +556,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.isPrimitiveType = isPrimitiveType; } - public Map getVendorExtensions() { - return vendorExtensions; - } - - public void setVendorExtensions(Map vendorExtensions) { - this.vendorExtensions = vendorExtensions; - } - - public String getNameInLowerCase() { - return nameInLowerCase; - } - - public void setNameInLowerCase(String nameInLowerCase) { - this.nameInLowerCase = nameInLowerCase; - } - - public String getNameInCamelCase() { - return nameInCamelCase; - } - - public void setNameInCamelCase(String nameInCamelCase) { - this.nameInCamelCase = nameInCamelCase; - } - - public String getNameInPascalCase() { - return nameInPascalCase; - } - - public void setNameInPascalCase(String nameInPascalCase) { - this.nameInPascalCase = nameInPascalCase; - } - - public String getNameInSnakeCase() { - return nameInSnakeCase; - } - - public String getEnumName() { - return enumName; - } - - public void setEnumName(String enumName) { - this.enumName = enumName; - } - @Override public Integer getMaxItems() { return maxItems; @@ -739,30 +576,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.minItems = minItems; } - public String getXmlPrefix() { - return xmlPrefix; - } - - public void setXmlPrefix(String xmlPrefix) { - this.xmlPrefix = xmlPrefix; - } - - public String getXmlName() { - return xmlName; - } - - public void setXmlName(String xmlName) { - this.xmlName = xmlName; - } - - public String getXmlNamespace() { - return xmlNamespace; - } - - public void setXmlNamespace(String xmlNamespace) { - this.xmlNamespace = xmlNamespace; - } - @Override public void setComposedSchemas(CodegenComposedSchemas composedSchemas) { this.composedSchemas = composedSchemas; @@ -971,8 +784,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti return hasDiscriminatorWithNonEmptyMapping; } - ; - @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; @@ -1032,10 +843,12 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.hasMultipleTypes = hasMultipleTypes; } + @Override public boolean getIsUuid() { return isUuid; } + @Override public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; } @@ -1200,6 +1013,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", isFreeFormObject=").append(isFreeFormObject); sb.append(", isArray=").append(isArray); sb.append(", isMap=").append(isMap); + sb.append(", isOptional=").append(isOptional); sb.append(", isEnum=").append(isEnum); sb.append(", isInnerEnum=").append(isInnerEnum); sb.append(", isEnumRef=").append(isEnumRef); @@ -1295,6 +1109,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti isFreeFormObject == that.isFreeFormObject && isArray == that.isArray && isMap == that.isMap && + isOptional == that.isOptional && isEnum == that.isEnum && isInnerEnum == that.isInnerEnum && isEnumRef == that.isEnumRef && @@ -1386,7 +1201,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, - isArray, isMap, isEnum, isInnerEnum, isEnumRef, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, + isArray, isMap, isOptional, isEnum, isInnerEnum, isEnumRef, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, isNew, isOverridden, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInPascalCase, nameInCamelCase, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index e8d9090d5e9..9c8dc08aaa5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -17,10 +17,14 @@ package org.openapitools.codegen; +import lombok.Getter; +import lombok.Setter; + import java.util.*; public class CodegenResponse implements IJsonSchemaValidationProperties { public final List headers = new ArrayList(); + @Getter @Setter private List responseHeaders = new ArrayList(); public String code; public boolean is1xx; @@ -59,6 +63,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public boolean simpleType; public boolean primitiveType; public boolean isMap; + /** datatype is the generic inner parameter of a std::optional for C++, or Optional (Java) */ + public boolean isOptional; public boolean isArray; public boolean isBinary = false; public boolean isFile = false; @@ -92,6 +98,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { private boolean hasDiscriminatorWithNonEmptyMapping; private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; + @Getter @Setter private LinkedHashMap content; private Map requiredVarsMap; private String ref; @@ -103,7 +110,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, containerTypeMapped, hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, isDateTime, isUuid, isEmail, isPassword, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, - isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, + isMap, isOptional, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, vars, requiredVars, isNull, isVoid, hasValidation, isShort, isUnboundedInteger, getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), @@ -142,6 +149,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { simpleType == that.simpleType && primitiveType == that.primitiveType && isMap == that.isMap && + isOptional == that.isOptional && isArray == that.isArray && isBinary == that.isBinary && isFile == that.isFile && @@ -246,22 +254,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { @Override public void setFormat(String format) {} - public LinkedHashMap getContent() { - return content; - } - - public void setContent(LinkedHashMap content) { - this.content = content; - } - - public List getResponseHeaders() { - return responseHeaders; - } - - public void setResponseHeaders(List responseHeaders) { - this.responseHeaders = responseHeaders; - } - @Override public String getPattern() { return pattern; @@ -503,6 +495,16 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { this.isMap = isMap; } + @Override + public boolean getIsOptional() { + return isOptional; + } + + @Override + public void setIsOptional(boolean isOptional) { + this.isOptional = isOptional; + } + @Override public CodegenProperty getAdditionalProperties() { return additionalProperties; @@ -594,6 +596,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { sb.append(", simpleType=").append(simpleType); sb.append(", primitiveType=").append(primitiveType); sb.append(", isMap=").append(isMap); + sb.append(", isOptional=").append(isOptional); sb.append(", isArray=").append(isArray); sb.append(", isBinary=").append(isBinary); sb.append(", isFile=").append(isFile); @@ -708,8 +711,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { return hasDiscriminatorWithNonEmptyMapping; } - ; - @Override public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) { this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 0682fe7c099..901696e1918 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -42,6 +42,8 @@ import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.servers.ServerVariable; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.text.StringEscapeUtils; @@ -74,6 +76,7 @@ import java.util.Map.Entry; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -181,12 +184,15 @@ public class DefaultCodegen implements CodegenConfig { protected Map operationIdNameMapping = new HashMap<>(); // a map to store the rules in OpenAPI Normalizer protected Map openapiNormalizer = new HashMap<>(); - protected String modelPackage = "", apiPackage = "", fileSuffix; + @Setter protected String modelPackage = "", apiPackage = ""; + protected String fileSuffix; + @Getter @Setter protected String modelNamePrefix = "", modelNameSuffix = ""; + @Getter @Setter protected String apiNamePrefix = "", apiNameSuffix = "Api"; protected String testPackage = ""; - protected String filesMetadataFilename = "FILES"; - protected String versionMetadataFilename = "VERSION"; + @Setter protected String filesMetadataFilename = "FILES"; + @Setter protected String versionMetadataFilename = "VERSION"; /* apiTemplateFiles are for API outputs only (controllers/handlers). API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group. @@ -198,7 +204,7 @@ public class DefaultCodegen implements CodegenConfig { protected Map apiDocTemplateFiles = new HashMap<>(); protected Map modelDocTemplateFiles = new HashMap<>(); protected Map reservedWordsMappings = new HashMap<>(); - protected String templateDir; + @Setter protected String templateDir; protected String embeddedTemplateDir; protected Map additionalProperties = new HashMap<>(); protected Map serverVariables = new HashMap<>(); @@ -213,7 +219,9 @@ public class DefaultCodegen implements CodegenConfig { protected List cliOptions = new ArrayList<>(); protected boolean skipOverwrite; protected boolean removeOperationIdPrefix; + @Getter @Setter protected String removeOperationIdPrefixDelimiter = "_"; + @Getter @Setter protected int removeOperationIdPrefixCount = 1; protected boolean skipOperationExample; @@ -246,9 +254,13 @@ public class DefaultCodegen implements CodegenConfig { protected boolean supportsMixins; protected Map supportedLibraries = new LinkedHashMap<>(); protected String library; + @Getter @Setter protected Boolean sortParamsByRequiredFlag = true; + @Getter @Setter protected Boolean sortModelPropertiesByRequiredFlag = false; + @Getter @Setter protected Boolean ensureUniqueParams = true; + @Getter @Setter protected Boolean allowUnicodeIdentifiers = false; protected String gitHost, gitUserId, gitRepoId, releaseNote; protected String httpUserAgent; @@ -259,6 +271,7 @@ public class DefaultCodegen implements CodegenConfig { protected Map specialCharReplacements = new LinkedHashMap<>(); // When a model is an alias for a simple type protected Map typeAliases = Collections.emptyMap(); + @Getter @Setter protected Boolean prependFormOrBodyParameters = false; // The extension of the generated documentation files (defaults to markdown .md) protected String docExtension; @@ -281,15 +294,15 @@ public class DefaultCodegen implements CodegenConfig { protected boolean removeEnumValuePrefix = true; // Support legacy logic for evaluating discriminators - protected boolean legacyDiscriminatorBehavior = true; + @Setter protected boolean legacyDiscriminatorBehavior = true; // Specify what to do if the 'additionalProperties' keyword is not present in a schema. // See CodegenConstants.java for more details. - protected boolean disallowAdditionalPropertiesIfNotPresent = true; + @Setter protected boolean disallowAdditionalPropertiesIfNotPresent = true; // 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. - protected boolean enumUnknownDefaultCase = false; + @Setter protected boolean enumUnknownDefaultCase = false; protected String enumUnknownDefaultCaseName = "unknown_default_open_api"; // make openapi available to all methods @@ -312,8 +325,9 @@ public class DefaultCodegen implements CodegenConfig { protected boolean addSuffixToDuplicateOperationNicknames = true; // Whether to automatically hardcode params that are considered Constants by OpenAPI Spec - protected boolean autosetConstants = false; + @Setter protected boolean autosetConstants = false; + @Override public boolean getAddSuffixToDuplicateOperationNicknames() { return addSuffixToDuplicateOperationNicknames; } @@ -323,125 +337,57 @@ public class DefaultCodegen implements CodegenConfig { return cliOptions; } + /** + * add this instance to additionalProperties. + * This instance is used as parent context in Mustache. + * It means that Mustache uses the values found in this order: + * first from additionalProperties + * then from the getter in this instance + * then from the fields in this instance + * + */ + protected void useCodegenAsMustacheParentContext() { + additionalProperties.put(CodegenConstants.MUSTACHE_PARENT_CONTEXT, this); + } + @Override public void processOpts() { - if (additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR)) { - this.setTemplateDir((String) additionalProperties.get(CodegenConstants.TEMPLATE_DIR)); + if (!additionalProperties.containsKey(CodegenConstants.MUSTACHE_PARENT_CONTEXT)) { + // by default empty parent context + additionalProperties.put(CodegenConstants.MUSTACHE_PARENT_CONTEXT, new Object()); + } + convertPropertyToStringAndWriteBack(CodegenConstants.TEMPLATE_DIR, this::setTemplateDir); + convertPropertyToStringAndWriteBack(CodegenConstants.MODEL_PACKAGE, this::setModelPackage); + convertPropertyToStringAndWriteBack(CodegenConstants.API_PACKAGE, this::setApiPackage); + + convertPropertyToBooleanAndWriteBack(CodegenConstants.HIDE_GENERATION_TIMESTAMP, this::setHideGenerationTimestamp); + // put the value back in additionalProperties for backward compatibility with generators not using yet convertPropertyToBooleanAndWriteBack + writePropertyBack(CodegenConstants.HIDE_GENERATION_TIMESTAMP, isHideGenerationTimestamp()); + + convertPropertyToBooleanAndWriteBack(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, this::setSortParamsByRequiredFlag); + convertPropertyToBooleanAndWriteBack(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, this::setSortModelPropertiesByRequiredFlag); + convertPropertyToBooleanAndWriteBack(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, this::setPrependFormOrBodyParameters); + convertPropertyToBooleanAndWriteBack(CodegenConstants.ENSURE_UNIQUE_PARAMS, this::setEnsureUniqueParams); + convertPropertyToBooleanAndWriteBack(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, this::setAllowUnicodeIdentifiers); + convertPropertyToStringAndWriteBack(CodegenConstants.API_NAME_PREFIX, this::setApiNamePrefix); + convertPropertyToStringAndWriteBack(CodegenConstants.API_NAME_SUFFIX, this::setApiNameSuffix); + convertPropertyToStringAndWriteBack(CodegenConstants.MODEL_NAME_PREFIX, this::setModelNamePrefix); + convertPropertyToStringAndWriteBack(CodegenConstants.MODEL_NAME_SUFFIX, this::setModelNameSuffix); + convertPropertyToBooleanAndWriteBack(CodegenConstants.REMOVE_OPERATION_ID_PREFIX, this::setRemoveOperationIdPrefix); + convertPropertyToStringAndWriteBack(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER, this::setRemoveOperationIdPrefixDelimiter); + convertPropertyToTypeAndWriteBack(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT, Integer::parseInt, this::setRemoveOperationIdPrefixCount); + convertPropertyToBooleanAndWriteBack(CodegenConstants.SKIP_OPERATION_EXAMPLE, this::setSkipOperationExample); + convertPropertyToStringAndWriteBack(CodegenConstants.DOCEXTENSION, this::setDocExtension); + convertPropertyToBooleanAndWriteBack(CodegenConstants.ENABLE_POST_PROCESS_FILE, this::setEnablePostProcessFile); + convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_ALIAS_AS_MODEL, ModelUtils::setGenerateAliasAsModel); + convertPropertyToBooleanAndWriteBack(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX, this::setRemoveEnumValuePrefix); + convertPropertyToBooleanAndWriteBack(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, this::setLegacyDiscriminatorBehavior); + convertPropertyToBooleanAndWriteBack(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, this::setDisallowAdditionalPropertiesIfNotPresent); + convertPropertyToBooleanAndWriteBack(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, this::setEnumUnknownDefaultCase); + convertPropertyToBooleanAndWriteBack(CodegenConstants.AUTOSET_CONSTANTS, this::setAutosetConstants); } - if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - this.setModelPackage((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); - } - - if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - this.setApiPackage((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); - } - - if (additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { - setHideGenerationTimestamp(convertPropertyToBooleanAndWriteBack(CodegenConstants.HIDE_GENERATION_TIMESTAMP)); - } else { - additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, hideGenerationTimestamp); - } - - if (additionalProperties.containsKey(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)) { - this.setSortParamsByRequiredFlag(Boolean.valueOf(additionalProperties - .get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG)) { - this.setSortModelPropertiesByRequiredFlag(Boolean.valueOf(additionalProperties - .get(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS)) { - this.setPrependFormOrBodyParameters(Boolean.valueOf(additionalProperties - .get(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ENSURE_UNIQUE_PARAMS)) { - this.setEnsureUniqueParams(Boolean.valueOf(additionalProperties - .get(CodegenConstants.ENSURE_UNIQUE_PARAMS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS)) { - this.setAllowUnicodeIdentifiers(Boolean.valueOf(additionalProperties - .get(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.API_NAME_PREFIX)) { - this.setApiNamePrefix((String) additionalProperties.get(CodegenConstants.API_NAME_PREFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.API_NAME_SUFFIX)) { - this.setApiNameSuffix((String) additionalProperties.get(CodegenConstants.API_NAME_SUFFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_PREFIX)) { - this.setModelNamePrefix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_PREFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_NAME_SUFFIX)) { - this.setModelNameSuffix((String) additionalProperties.get(CodegenConstants.MODEL_NAME_SUFFIX)); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX)) { - this.setRemoveOperationIdPrefix(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER)) { - this.setRemoveOperationIdPrefixDelimiter(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DELIMITER).toString()); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT)) { - this.setRemoveOperationIdPrefixCount(Integer.parseInt(additionalProperties - .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX_COUNT).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.SKIP_OPERATION_EXAMPLE)) { - this.setSkipOperationExample(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.SKIP_OPERATION_EXAMPLE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.DOCEXTENSION)) { - this.setDocExtension(String.valueOf(additionalProperties - .get(CodegenConstants.DOCEXTENSION).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.ENABLE_POST_PROCESS_FILE)) { - this.setEnablePostProcessFile(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.ENABLE_POST_PROCESS_FILE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.GENERATE_ALIAS_AS_MODEL)) { - ModelUtils.setGenerateAliasAsModel(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.GENERATE_ALIAS_AS_MODEL).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX)) { - this.setRemoveEnumValuePrefix(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR)) { - this.setLegacyDiscriminatorBehavior(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR).toString())); - } - if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { - this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); - } - if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) { - this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties - .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); - } - if (additionalProperties.containsKey(CodegenConstants.AUTOSET_CONSTANTS)) { - this.setAutosetConstants( - Boolean.parseBoolean(additionalProperties.get(CodegenConstants.AUTOSET_CONSTANTS).toString())); - } - } /*** * Preset map builder with commonly used Mustache lambdas. @@ -910,6 +856,18 @@ public class DefaultCodegen implements CodegenConfig { return datatype + "." + value; } + /** + * Return the enum default value in the language specified format + * + * @param property The codegen property to create the default for. + * @param value Enum variable name + * @return the default value for the enum + */ + public String toEnumDefaultValue(CodegenProperty property, String value) { + // Use the datatype with the value. + return toEnumDefaultValue(value, property.datatypeWithEnum); + } + /** * Return the enum value in the language specified format * e.g. status becomes "status" @@ -1456,127 +1414,23 @@ public class DefaultCodegen implements CodegenConfig { return filesMetadataFilename; } - public void setFilesMetadataFilename(String filesMetadataFilename) { - this.filesMetadataFilename = filesMetadataFilename; - } - @Override public String getVersionMetadataFilename() { return versionMetadataFilename; } - public void setVersionMetadataFilename(String versionMetadataFilename) { - this.versionMetadataFilename = versionMetadataFilename; - } - - public void setTemplateDir(String templateDir) { - this.templateDir = templateDir; - } - - public void setModelPackage(String modelPackage) { - this.modelPackage = modelPackage; - } - - public String getModelNamePrefix() { - return modelNamePrefix; - } - - public void setModelNamePrefix(String modelNamePrefix) { - this.modelNamePrefix = modelNamePrefix; - } - - public String getModelNameSuffix() { - return modelNameSuffix; - } - - public void setModelNameSuffix(String modelNameSuffix) { - this.modelNameSuffix = modelNameSuffix; - } - - public String getApiNameSuffix() { - return apiNameSuffix; - } - - public void setApiNameSuffix(String apiNameSuffix) { - this.apiNameSuffix = apiNameSuffix; - } - - public String getApiNamePrefix() { - return apiNamePrefix; - } - - public void setApiNamePrefix(String apiNamePrefix) { - this.apiNamePrefix = apiNamePrefix; - } - - public void setApiPackage(String apiPackage) { - this.apiPackage = apiPackage; - } - - public Boolean getSortParamsByRequiredFlag() { - return sortParamsByRequiredFlag; - } - - public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) { - this.sortParamsByRequiredFlag = sortParamsByRequiredFlag; - } - - public Boolean getSortModelPropertiesByRequiredFlag() { - return sortModelPropertiesByRequiredFlag; - } - - public void setSortModelPropertiesByRequiredFlag(Boolean sortModelPropertiesByRequiredFlag) { - this.sortModelPropertiesByRequiredFlag = sortModelPropertiesByRequiredFlag; - } - - public Boolean getPrependFormOrBodyParameters() { - return prependFormOrBodyParameters; - } - - public void setPrependFormOrBodyParameters(Boolean prependFormOrBodyParameters) { - this.prependFormOrBodyParameters = prependFormOrBodyParameters; - } - - public Boolean getEnsureUniqueParams() { - return ensureUniqueParams; - } - - public void setEnsureUniqueParams(Boolean ensureUniqueParams) { - this.ensureUniqueParams = ensureUniqueParams; - } - public Boolean getLegacyDiscriminatorBehavior() { return legacyDiscriminatorBehavior; } - public void setLegacyDiscriminatorBehavior(boolean val) { - this.legacyDiscriminatorBehavior = val; - } - public Boolean getDisallowAdditionalPropertiesIfNotPresent() { return disallowAdditionalPropertiesIfNotPresent; } - public void setDisallowAdditionalPropertiesIfNotPresent(boolean val) { - this.disallowAdditionalPropertiesIfNotPresent = val; - } - public Boolean getEnumUnknownDefaultCase() { return enumUnknownDefaultCase; } - public void setEnumUnknownDefaultCase(boolean val) { - this.enumUnknownDefaultCase = val; - } - - public Boolean getAllowUnicodeIdentifiers() { - return allowUnicodeIdentifiers; - } - - public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) { - this.allowUnicodeIdentifiers = allowUnicodeIdentifiers; - } - public Boolean getUseOneOfInterfaces() { return useOneOfInterfaces; } @@ -1979,6 +1833,7 @@ public class DefaultCodegen implements CodegenConfig { specialCharReplacements.put("!=", "Not_Equal"); specialCharReplacements.put("<>", "Not_Equal"); specialCharReplacements.put("~=", "Tilde_Equal"); + specialCharReplacements.put("==", "Double_Equal"); } /** @@ -2953,7 +2808,9 @@ public class DefaultCodegen implements CodegenConfig { if (null != existingProperties && null != newProperties) { Schema existingType = existingProperties.get("type"); Schema newType = newProperties.get("type"); - newProperties.forEach((key, value) -> existingProperties.put(key, ModelUtils.cloneSchema(value))); + newProperties.forEach((key, value) -> + existingProperties.put(key, ModelUtils.cloneSchema(value, specVersionGreaterThanOrEqualTo310(openAPI))) + ); if (null != existingType && null != newType && null != newType.getEnum() && !newType.getEnum().isEmpty()) { for (Object e : newType.getEnum()) { // ensure all interface enum types are added to schema @@ -5265,6 +5122,9 @@ public class DefaultCodegen implements CodegenConfig { if (parameter.getExtensions() != null && !parameter.getExtensions().isEmpty()) { codegenParameter.vendorExtensions.putAll(parameter.getExtensions()); } + if (parameter.getSchema() != null && parameter.getSchema().getExtensions() != null && !parameter.getSchema().getExtensions().isEmpty()) { + codegenParameter.vendorExtensions.putAll(parameter.getSchema().getExtensions()); + } Schema parameterSchema; @@ -6277,22 +6137,6 @@ public class DefaultCodegen implements CodegenConfig { this.removeOperationIdPrefix = removeOperationIdPrefix; } - public String getRemoveOperationIdPrefixDelimiter() { - return removeOperationIdPrefixDelimiter; - } - - public void setRemoveOperationIdPrefixDelimiter(String removeOperationIdPrefixDelimiter) { - this.removeOperationIdPrefixDelimiter = removeOperationIdPrefixDelimiter; - } - - public int getRemoveOperationIdPrefixCount() { - return removeOperationIdPrefixCount; - } - - public void setRemoveOperationIdPrefixCount(int removeOperationIdPrefixCount) { - this.removeOperationIdPrefixCount = removeOperationIdPrefixCount; - } - @Override public void setSkipOperationExample(boolean skipOperationExample) { this.skipOperationExample = skipOperationExample; @@ -6750,7 +6594,7 @@ public class DefaultCodegen implements CodegenConfig { } } if (enumName != null) { - var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum); + var.defaultValue = toEnumDefaultValue(var, enumName); } } } @@ -6887,6 +6731,59 @@ public class DefaultCodegen implements CodegenConfig { return result; } + + /** + * reads propertyKey from additionalProperties, converts it to a boolean and + * writes it back to additionalProperties to be usable as a boolean in + * mustache files. + * + * @param propertyKey property key + * @param booleanSetter the setter function reference + * @return property value as boolean or false if it does not exist + */ + public boolean convertPropertyToBooleanAndWriteBack(String propertyKey, Consumer booleanSetter) { + if (additionalProperties.containsKey(propertyKey)) { + boolean result = convertPropertyToBoolean(propertyKey); + writePropertyBack(propertyKey, result); + booleanSetter.accept(result); + return result; + } + return false; + } + + /** + * reads propertyKey from additionalProperties, converts it to a string and + * writes it back to additionalProperties to be usable as a string in + * mustache files. + * + * @param propertyKey property key + * @param stringSetter the setter function reference + * @return property value as String or null if not found + */ + public String convertPropertyToStringAndWriteBack(String propertyKey, Consumer stringSetter) { + return convertPropertyToTypeAndWriteBack(propertyKey, Function.identity(), stringSetter); + } + + /** + * reads propertyKey from additionalProperties, converts it to T and + * writes it back to additionalProperties to be usable as T in + * mustache files. + * + * @param propertyKey property key + * @param genericTypeSetter the setter function reference + * @return property value as instance of type T or null if not found + */ + public T convertPropertyToTypeAndWriteBack(String propertyKey, Function converter, Consumer genericTypeSetter) { + if (additionalProperties.containsKey(propertyKey)) { + String value = additionalProperties.get(propertyKey).toString(); + T result = converter.apply(value); + writePropertyBack(propertyKey, result); + genericTypeSetter.accept(result); + return result; + } + return null; + } + /** * Provides an override location, if any is specified, for the .openapi-generator-ignore. *

    @@ -8302,7 +8199,7 @@ public class DefaultCodegen implements CodegenConfig { /** * An map entry for cached sanitized names. */ - private static class SanitizeNameOptions { + @Getter private static class SanitizeNameOptions { public SanitizeNameOptions(String name, String removeCharRegEx, List exceptions) { this.name = name; this.removeCharRegEx = removeCharRegEx; @@ -8313,18 +8210,6 @@ public class DefaultCodegen implements CodegenConfig { } } - public String getName() { - return name; - } - - public String getRemoveCharRegEx() { - return removeCharRegEx; - } - - public List getExceptions() { - return exceptions; - } - private final String name; private final String removeCharRegEx; private final List exceptions; @@ -8533,10 +8418,6 @@ public class DefaultCodegen implements CodegenConfig { } } - public void setAutosetConstants(boolean autosetConstants) { - this.autosetConstants = autosetConstants; - } - /** * This method removes all constant Query, Header and Cookie Params from allParams and sets them as constantParams in the CodegenOperation. * The definition of constant is single valued required enum params. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 8337b77be4d..ac1869f2d14 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -29,7 +29,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.security.*; import io.swagger.v3.oas.models.tags.Tag; - +import lombok.Getter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.comparator.PathFileComparator; import org.apache.commons.lang3.ObjectUtils; @@ -95,7 +95,11 @@ public class DefaultGenerator implements Generator { private String basePathWithoutHost; private String contextPath; private Map generatorPropertyDefaults = new HashMap<>(); - protected TemplateProcessor templateProcessor = null; + /** + * Retrieves an instance to the configured template processor, available after user-defined options are + * applied via + */ + @Getter protected TemplateProcessor templateProcessor = null; private List userDefinedTemplates = new ArrayList<>(); private String generatorCheck = "spring"; @@ -160,16 +164,6 @@ public class DefaultGenerator implements Generator { return this; } - /** - * Retrieves an instance to the configured template processor, available after user-defined options are - * applied via {@link DefaultGenerator#opts(ClientOptInput)}. - * - * @return A configured {@link TemplateProcessor}, or null. - */ - public TemplateProcessor getTemplateProcessor() { - return templateProcessor; - } - /** * Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, * or other metadata files used by OpenAPI Generator. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java index bd755e3a83d..862d29b4861 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunStatus.java @@ -1,5 +1,7 @@ package org.openapitools.codegen; +import lombok.Getter; + import java.io.IOException; import java.nio.file.Path; import java.util.Locale; @@ -7,9 +9,28 @@ import java.util.Locale; /** * Holds details about a file's write status for display via the --dry-run option of CLI */ -class DryRunStatus { - private Path path; +@Getter class DryRunStatus { + /** + * -- GETTER -- + * Gets the target path of the file write operation + * + * @return a {@link Path} instance + */ + private final Path path; + /** + * -- GETTER -- + * Gets the + * as determined by the generator's workflow + * + * @return A {@link State} enum detailing the expected operation of the generator's workflow + */ private State state; + /** + * -- GETTER -- + * Gets the reason for the file's + * + * @return A human-readable string which explains why this file's dry-run resulted in the defined {@link State} + */ private String reason; /** @@ -55,33 +76,6 @@ class DryRunStatus { appendable.append(String.format(Locale.ROOT, "%s %s", this.state.getShortDisplay(), this.path.toAbsolutePath())); } - /** - * Gets the target path of the file write operation - * - * @return a {@link Path} instance - */ - public Path getPath() { - return path; - } - - /** - * Gets the reason for the file's {@link State} - * - * @return A human-readable string which explains why this file's dry-run resulted in the defined {@link State} - */ - public String getReason() { - return reason; - } - - /** - * Gets the {@link State} as determined by the generator's workflow - * - * @return A {@link State} enum detailing the expected operation of the generator's workflow - */ - public State getState() { - return state; - } - /** * Sets the {@link State} as determined by the generator's workflow. *

    @@ -116,7 +110,7 @@ class DryRunStatus { /** * Represents the possible states of a file write operation as determined by the Generator */ - enum State { + @Getter enum State { Write("w", "Write"), WriteIfNewer("n", "Write if New/Updated"), Ignored("i", "Ignored"), @@ -124,7 +118,19 @@ class DryRunStatus { Skipped("k", "Skipped by user option(s)"), Error("e", "Error evaluating file write state"); + /** + * -- GETTER -- + * Gets the short value used for display + * + * @return A character representing this state + */ private final String shortDisplay; + /** + * -- GETTER -- + * Gets a description of the state which is more human-readable than the enum's name + * + * @return A human-readable description + */ private final String description; /** @@ -139,22 +145,5 @@ class DryRunStatus { this.description = description; } - /** - * Gets a description of the state which is more human-readable than the enum's name - * - * @return A human-readable description - */ - public String getDescription() { - return description; - } - - /** - * Gets the short value used for display - * - * @return A character representing this state - */ - public String getShortDisplay() { - return shortDisplay; - } } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java index eb8f05d3dab..d9de181e2f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DryRunTemplateManager.java @@ -18,6 +18,9 @@ import java.util.Map; public class DryRunTemplateManager implements TemplateProcessor { private final TemplateManagerOptions options; private final Map dryRunStatusMap = new HashMap<>(); + + private final Map> capturedTemplateData = new HashMap<>(); + private boolean recordTemplateData = false; /** * Constructs a new instance of {@link DryRunTemplateManager} for the provided options @@ -47,6 +50,9 @@ public class DryRunTemplateManager implements TemplateProcessor { */ @Override public File write(Map data, String template, File target) throws IOException { + if (recordTemplateData) { + this.capturedTemplateData.put(target.getAbsolutePath(), data); + } return writeToFile(target.getAbsolutePath(), "dummy".getBytes(StandardCharsets.UTF_8)); } @@ -101,4 +107,25 @@ public class DryRunTemplateManager implements TemplateProcessor { public void error(Path path, String context) { dryRunStatusMap.put(path.toString(), new DryRunStatus(path, DryRunStatus.State.Error, context)); } + + /** + * Enable capturing of data being passed to the files as they are being written.
    + * Call this method before calling {@link Generator#generate()}. + */ + public DryRunTemplateManager enableTemplateDataCapturing() { + recordTemplateData = true; + return this; + } + + /** + * Retrieve the captured template data for a specific file. Capturing must have + * been enabled via {@link #enableTemplateDataCapturing()} prior to generation.
    + * Note: Not all files have template data (e.g. Metadata files) – in such case an empty + * map is returned. + * @param generatedFile An absolute path to the generated file + * @return Typically one of the *Map types found in {@link org.openapitools.codegen.model} + */ + public Map getCapturedTemplateData(Path generatedFile) { + return capturedTemplateData.getOrDefault(generatedFile.toString(), Map.of()); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java index 7abc0e39d6f..ba2454c3c53 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java @@ -105,9 +105,21 @@ public interface IJsonSchemaValidationProperties { void setIsMap(boolean isMap); + /** + * Tells if the datatype is a generic inner parameter of a std::optional for C++, or Optional (Java)
    + * to resolve cases (detected in issue #6726) where :
    + * - categoryOneOf is a parameter of class GetAccountVideos_categoryOneOf_parameter, a model parameter that correctly prefixed by its namespace: org::openapitools::server::model::GetAccountVideos_categoryOneOf_parameter
    + * - but that GetAccountVideos_categoryOneOf_parameter class is inside an std::optional
    + *
    + * Then a correct generation of that parameter can be (for C++) const std::optional<org::openapitools::server::model::GetAccountVideos_categoryOneOf_parameter> &categoryOneOf
    + * but using #isModel alone without #isOptional in mustache might produce const org::openapitools::server::model::std::optional<org::openapitools::server::model::GetAccountVideos_categoryOneOf_parameter> &categoryOneOf instead, that do not compile. + */ + boolean getIsOptional(); + void setIsOptional(boolean isOptional); + boolean getIsArray(); - void setIsArray(boolean isShort); + void setIsArray(boolean isArray); boolean getIsShort(); @@ -180,7 +192,7 @@ public interface IJsonSchemaValidationProperties { boolean getIsString(); - void setIsString(boolean isNumber); + void setIsString(boolean isString); boolean getIsNumber(); @@ -236,7 +248,7 @@ public interface IJsonSchemaValidationProperties { boolean getIsDouble(); - void setIsInteger(boolean isDouble); + void setIsInteger(boolean isInteger); boolean getIsInteger(); @@ -278,7 +290,6 @@ public interface IJsonSchemaValidationProperties { setIsArray(true); } else if (ModelUtils.isFileSchema(p) && !ModelUtils.isStringSchema(p)) { // swagger v2 only, type file - ; } else if (ModelUtils.isStringSchema(p)) { setIsString(true); if (ModelUtils.isByteArraySchema(p)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 7ccb8996795..172c26eb0bb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -231,7 +231,9 @@ public class InlineModelResolver { if (schema.equals(c)) { return isModelNeeded((Schema) schema.getAllOf().get(0), visitedSchemas); } - } else if (isSingleAllOf && StringUtils.isNotEmpty(((Schema) schema.getAllOf().get(0)).get$ref())) { + } + + if (isSingleAllOf && StringUtils.isNotEmpty(((Schema) schema.getAllOf().get(0)).get$ref())) { // single allOf and it's a ref return isModelNeeded((Schema) schema.getAllOf().get(0), visitedSchemas); } @@ -314,7 +316,7 @@ public class InlineModelResolver { if (schema.getAdditionalProperties() instanceof Schema) { Schema inner = (Schema) schema.getAdditionalProperties(); if (inner != null) { - String schemaName = resolveModelName(schema.getTitle(), modelPrefix + this.inlineSchemaOptions.get("MAP_ITEM_SUFFIX")); + String schemaName = resolveModelName(inner.getTitle(), modelPrefix + this.inlineSchemaOptions.get("MAP_ITEM_SUFFIX")); // Recurse to create $refs for inner models gatherInlineModels(inner, schemaName); if (isModelNeeded(inner)) { @@ -1013,4 +1015,4 @@ public class InlineModelResolver { return name; } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java index f8b7371c10c..704fedc44f3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java @@ -1,8 +1,12 @@ package org.openapitools.codegen; +import lombok.Getter; +import lombok.Setter; + import java.util.Optional; import java.util.Set; +@Getter @Setter public class SpecValidationException extends RuntimeException { private Set errors; @@ -81,22 +85,6 @@ public class SpecValidationException extends RuntimeException { super(message, cause, enableSuppression, writableStackTrace); } - public Set getErrors() { - return errors; - } - - public Set getWarnings() { - return warnings; - } - - public void setErrors(Set errors) { - this.errors = errors; - } - - public void setWarnings(Set warnings) { - this.warnings = warnings; - } - /** * Returns the detail message string of this throwable. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SupportingFile.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SupportingFile.java index 2d72fa2f216..9202a81e94f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/SupportingFile.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/SupportingFile.java @@ -17,6 +17,7 @@ package org.openapitools.codegen; +import lombok.Getter; import org.openapitools.codegen.api.TemplateDefinition; import org.openapitools.codegen.api.TemplateFileType; @@ -30,7 +31,7 @@ import java.util.StringJoiner; * Supporting files are generated once for an entire application while api/model bound definitions are generated multiple * times according to their target use. */ -public class SupportingFile extends TemplateDefinition { +@Getter public class SupportingFile extends TemplateDefinition { private boolean canOverwrite = true; public SupportingFile(String templateFile, String destinationFilename) { @@ -80,10 +81,6 @@ public class SupportingFile extends TemplateDefinition { return isCanOverwrite() == that.isCanOverwrite(); } - public boolean isCanOverwrite() { - return canOverwrite; - } - @Override public int hashCode() { return Objects.hash(super.hashCode(), isCanOverwrite()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java index 8fb9ce1bdae..61cee17f86f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/VendorExtension.java @@ -1,9 +1,12 @@ package org.openapitools.codegen; +import lombok.Getter; + +import java.util.Arrays; import java.util.Collections; import java.util.List; -public enum VendorExtension { +@Getter public enum VendorExtension { X_IMPLEMENTS("x-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implements", "empty array"), X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters", "false"), @@ -16,10 +19,10 @@ public enum VendorExtension { X_ACCEPTS("x-accepts", ExtensionLevel.OPERATION, "Specify custom value for 'Accept' header for operation", null), X_CONTENT_TYPE("x-content-type", ExtensionLevel.OPERATION, "Specify custom value for 'Content-Type' header for operation", null), X_CLASS_EXTRA_ANNOTATION("x-class-extra-annotation", ExtensionLevel.MODEL, "List of custom annotations to be added to model", null), - X_FIELD_EXTRA_ANNOTATION("x-field-extra-annotation", ExtensionLevel.FIELD, "List of custom annotations to be added to property", null), + X_FIELD_EXTRA_ANNOTATION("x-field-extra-annotation", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "List of custom annotations to be added to property", null), X_OPERATION_EXTRA_ANNOTATION("x-operation-extra-annotation", ExtensionLevel.OPERATION, "List of custom annotations to be added to operation", null), X_VERSION_PARAM("x-version-param", ExtensionLevel.OPERATION_PARAMETER, "Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false", null), - X_PATTERN_MESSAGE("x-pattern-message", ExtensionLevel.FIELD, "Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable", null), + X_PATTERN_MESSAGE("x-pattern-message", Arrays.asList(ExtensionLevel.FIELD, ExtensionLevel.OPERATION_PARAMETER), "Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable", null), ; private final String name; @@ -38,22 +41,6 @@ public enum VendorExtension { this(name, Collections.singletonList(level), description, defaultValue); } - public String getName() { - return name; - } - - public List getLevels() { - return levels; - } - - public String getDescription() { - return description; - } - - public String getDefaultValue() { - return defaultValue; - } - public enum ExtensionLevel { FIELD, MODEL, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java index a18d8bdcfde..0254798d927 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/auth/AuthParser.java @@ -21,9 +21,9 @@ import io.swagger.v3.parser.core.models.AuthorizationValue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -40,11 +40,11 @@ public class AuthParser { for (String part : parts) { String[] kvPair = part.split(":"); if (kvPair.length == 2) { - try { - auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0], "UTF-8"), URLDecoder.decode(kvPair[1], "UTF-8"), "header")); - } catch (UnsupportedEncodingException e) { - LOGGER.warn(e.getMessage()); - } + auths.add(new AuthorizationValue( + URLDecoder.decode(kvPair[0], StandardCharsets.UTF_8), + URLDecoder.decode(kvPair[1], StandardCharsets.UTF_8), + "header" + )); } } } @@ -55,17 +55,11 @@ public class AuthParser { if (authorizationValueList != null) { StringBuilder b = new StringBuilder(); for (AuthorizationValue v : authorizationValueList) { - try { - if (b.toString().length() > 0) { - b.append(","); - } - b.append(URLEncoder.encode(v.getKeyName(), "UTF-8")) - .append(":") - .append(URLEncoder.encode(v.getValue(), "UTF-8")); - } catch (Exception e) { - // continue - LOGGER.error(e.getMessage(), e); + if (b.toString().length() > 0) { + b.append(","); } + b.append(URLEncoder.encode(v.getKeyName(), StandardCharsets.UTF_8)) + .append(":").append(URLEncoder.encode(v.getValue(), StandardCharsets.UTF_8)); } return b.toString(); } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java index 2dcedc0f7c7..66165692d1a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/DynamicSettings.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.Getter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.api.TemplateDefinition; import org.openapitools.codegen.api.TemplateFileType; @@ -20,7 +21,13 @@ import java.util.stream.Collectors; */ @SuppressWarnings({"unused", "WeakerAccess"}) public class DynamicSettings { - @JsonAnySetter + /** + * -- GETTER -- + * Gets all "custom" properties included in the config object. + * + * @return All user-specified custom properties. + */ + @Getter @JsonAnySetter private Map dynamicProperties = new HashMap<>(); @JsonUnwrapped @@ -91,15 +98,6 @@ public class DynamicSettings { @JsonCreator public DynamicSettings() { } - /** - * Gets all "custom" properties included in the config object. - * - * @return All user-specified custom properties. - */ - public Map getDynamicProperties() { - return dynamicProperties; - } - private void excludeSettingsFromDynamicProperties(){ Set fieldNames = new HashSet<>(); for (Field field : GeneratorSettings.class.getDeclaredFields()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java index fae47e37f8e..5f7fad79627 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java @@ -45,7 +45,7 @@ public class GlobalSettings { Properties copy = new Properties(); copy.putAll(System.getProperties()); return copy; - }; + } }; public static String getProperty(String key, String defaultValue) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java index b636c1f69a3..70cd50cbdd2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/XmlExampleGenerator.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.examples; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; import org.apache.commons.lang3.StringUtils; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java index 7bdb44b525b..2702c036d2b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/IgnoreLineParser.java @@ -17,11 +17,13 @@ package org.openapitools.codegen.ignore.rules; +import lombok.Getter; + import java.util.ArrayList; import java.util.List; public class IgnoreLineParser { - enum Token { + @Getter enum Token { MATCH_ALL("**"), MATCH_ANY("*"), ESCAPED_EXCLAMATION("\\!"), @@ -39,9 +41,6 @@ public class IgnoreLineParser { this.pattern = pattern; } - public String getPattern() { - return pattern; - } } // NOTE: Comments that start with a : (e.g. //:) are pulled from git documentation for .gitignore diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java index 841a4ff7c0f..00c126db7d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/InvalidRule.java @@ -17,9 +17,11 @@ package org.openapitools.codegen.ignore.rules; +import lombok.Getter; + import java.util.List; -public class InvalidRule extends Rule { +@Getter public class InvalidRule extends Rule { private final String reason; InvalidRule(List syntax, String definition, String reason) { @@ -37,7 +39,4 @@ public class InvalidRule extends Rule { return Operation.NOOP; } - public String getReason() { - return reason; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java index eeb47acea50..e5cb6dff23d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Part.java @@ -17,7 +17,9 @@ package org.openapitools.codegen.ignore.rules; -class Part { +import lombok.Getter; + +@Getter class Part { private final IgnoreLineParser.Token token; private final String value; @@ -31,11 +33,4 @@ class Part { this.value = token.getPattern(); } - public IgnoreLineParser.Token getToken() { - return token; - } - - public String getValue() { - return value; - } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java index fd56a053293..40f1bb1e756 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/rules/Rule.java @@ -17,6 +17,8 @@ package org.openapitools.codegen.ignore.rules; +import lombok.Getter; + import java.util.List; public abstract class Rule { @@ -24,7 +26,7 @@ public abstract class Rule { public enum Operation {EXCLUDE, INCLUDE, NOOP, EXCLUDE_AND_TERMINATE} // The original rule - private final String definition; + @Getter private final String definition; private final List syntax; @@ -35,10 +37,6 @@ public abstract class Rule { public abstract Boolean matches(String relativePath); - public String getDefinition() { - return this.definition; - } - protected String getPattern() { if(syntax == null) return this.definition; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index da798350211..d67987aca81 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -20,7 +20,6 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Escapers; import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; @@ -885,6 +884,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg this.name = name; } + @Override public int compareTo(ModelDepend second) { if (depend != null && depend.contains(second.name)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java index 06823c3a294..6a090df03d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java @@ -19,11 +19,11 @@ package org.openapitools.codegen.languages; import com.google.common.base.Strings; import io.swagger.v3.oas.models.Operation; -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.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.model.ModelsMap; @@ -39,7 +39,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public abstract class AbstractApexCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(AbstractApexCodegen.class); - protected Boolean serializableModel = false; + @Setter protected Boolean serializableModel = false; public AbstractApexCodegen() { super(); @@ -208,14 +208,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code return super.getTypeDeclaration(p); } - @Override - public String getAlias(String name) { - if (typeAliases != null && typeAliases.containsKey(name)) { - return typeAliases.get(name); - } - return name; - } - @Override public String toDefaultValue(Schema p) { if (ModelUtils.isArraySchema(p)) { @@ -634,10 +626,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code } - public void setSerializableModel(Boolean serializableModel) { - this.serializableModel = serializableModel; - } - private String sanitizePath(String p) { //prefer replace a ", instead of a fuLL URL encode for readability return p.replaceAll("\"", "%22"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index ddb24d37bf6..bf77ff2ef25 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -22,8 +22,9 @@ import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -47,59 +48,61 @@ import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETT import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; -public abstract class AbstractCSharpCodegen extends DefaultCodegen implements CodegenConfig { +public abstract class AbstractCSharpCodegen extends DefaultCodegen { protected boolean optionalAssemblyInfoFlag = true; protected boolean optionalEmitDefaultValuesFlag = false; protected boolean conditionalSerialization = false; protected boolean optionalProjectFileFlag = true; - protected boolean optionalMethodArgumentFlag = true; + @Setter protected boolean optionalMethodArgumentFlag = true; protected boolean useDateTimeOffsetFlag = false; protected boolean useDateTimeForDateFlag = false; protected boolean useCollection = false; - protected boolean returnICollection = false; - protected boolean netCoreProjectFileFlag = false; + @Setter protected boolean returnICollection = false; + @Setter protected boolean netCoreProjectFileFlag = false; protected boolean nullReferenceTypesFlag = false; protected boolean useSourceGeneration = false; protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name(); - protected String licenseUrl = "http://localhost"; - protected String licenseName = "NoLicense"; + @Setter protected String licenseUrl = "http://localhost"; + @Setter protected String licenseName = "NoLicense"; - protected String packageVersion = "1.0.0"; - protected String packageName = "Org.OpenAPITools"; - protected String packageTitle = "OpenAPI Library"; - protected String packageProductName = "OpenAPILibrary"; - protected String packageDescription = "A library generated from a OpenAPI doc"; - protected String packageCompany = "OpenAPI"; - protected String packageCopyright = "No Copyright"; - protected String packageAuthors = "OpenAPI"; + @Setter protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "Org.OpenAPITools"; + @Setter protected String packageTitle = "OpenAPI Library"; + @Setter protected String packageProductName = "OpenAPILibrary"; + @Setter protected String packageDescription = "A library generated from a OpenAPI doc"; + @Setter protected String packageCompany = "OpenAPI"; + @Setter protected String packageCopyright = "No Copyright"; + @Setter protected String packageAuthors = "OpenAPI"; public static final String DATE_FORMAT = "dateFormat"; - protected String dateFormat = "yyyy'-'MM'-'dd"; + @Setter protected String dateFormat = "yyyy'-'MM'-'dd"; public static final String DATETIME_FORMAT = "dateTimeFormat"; - protected String dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + @Setter protected String dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + @Getter @Setter protected String interfacePrefix = "I"; - protected String enumNameSuffix = "Enum"; - protected String enumValueSuffix = "Enum"; + @Setter protected String enumNameSuffix = "Enum"; + @Setter protected String enumValueSuffix = "Enum"; - protected String sourceFolder = "src"; + @Setter protected String sourceFolder = "src"; protected static final String invalidParameterNamePrefix = "var"; protected static final String invalidPropertyNamePrefix = "Var"; - protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.PascalCase; + @Getter protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.PascalCase; // TODO: Add option for test folder output location. Nice to allow e.g. ./test instead of ./src. // This would require updating relative paths (e.g. path to main project file in test project file) - protected String testFolder = sourceFolder; + @Setter protected String testFolder = sourceFolder; protected Set collectionTypes; protected Set mapTypes; // true if support nullable type + @Getter @Setter protected boolean supportNullable = Boolean.FALSE; - protected Boolean zeroBasedEnums = null; + @Setter protected Boolean zeroBasedEnums = null; protected static final String zeroBasedEnumVendorExtension = "x-zero-based-enum"; private final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class); @@ -108,7 +111,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co protected Set propertySpecialKeywords = new HashSet<>(Arrays.asList("ToString", "ToJson", "GetHashCode", "Equals", "ShouldSerializeToString")); // A cache to efficiently lookup schema `toModelName()` based on the schema Key - private Map schemaKeyToModelNameCache = new HashMap<>(); + private final Map schemaKeyToModelNameCache = new HashMap<>(); public AbstractCSharpCodegen() { super(); @@ -205,15 +208,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co instantiationTypes.put("array", "List"); instantiationTypes.put("list", "List"); instantiationTypes.put("map", "Dictionary"); - - this.setSortParamsByRequiredFlag(true); - - // do it only on newer libraries to avoid breaking changes - // this.setSortModelPropertiesByRequiredFlag(true); - } - - public void setReturnICollection(boolean returnICollection) { - this.returnICollection = returnICollection; } public void setUseCollection(boolean useCollection) { @@ -225,14 +219,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co this.setTypeMapping(); } - public void setOptionalMethodArgumentFlag(boolean flag) { - this.optionalMethodArgumentFlag = flag; - } - - public void setNetCoreProjectFileFlag(boolean flag) { - this.netCoreProjectFileFlag = flag; - } - public void useDateTimeOffset(boolean flag) { this.useDateTimeOffsetFlag = flag; this.setTypeMapping(); @@ -464,7 +450,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co .put("uniqueLines", new UniqueLambda("\n", false)) .put("unique", new UniqueLambda("\n", true)) .put("camel_case", new CamelCaseLambda()) - .put("escape_reserved_word", new EscapeKeywordLambda((val) -> this.escapeKeyword(val))); + .put("escape_reserved_word", new EscapeKeywordLambda(this::escapeKeyword)); } @Override @@ -476,14 +462,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co property.dataType = property.datatypeWithEnum; } - if (property.isEnum && !property.vendorExtensions.containsKey(this.zeroBasedEnumVendorExtension)) { + if (property.isEnum && !property.vendorExtensions.containsKey(AbstractCSharpCodegen.zeroBasedEnumVendorExtension)) { if (Boolean.TRUE.equals(this.zeroBasedEnums)) { - property.vendorExtensions.put(this.zeroBasedEnumVendorExtension, true); + property.vendorExtensions.put(AbstractCSharpCodegen.zeroBasedEnumVendorExtension, true); } else if (!Boolean.FALSE.equals(this.zeroBasedEnums)) { if (property.allowableValues.containsKey("values")) { - final List allowableValues = (List) property.allowableValues.get("values"); + final List allowableValues = (List) property.allowableValues.get("values"); boolean isZeroBased = String.valueOf(allowableValues.get(0)).toLowerCase(Locale.ROOT).equals("unknown"); - property.vendorExtensions.put(this.zeroBasedEnumVendorExtension, isZeroBased); + property.vendorExtensions.put(AbstractCSharpCodegen.zeroBasedEnumVendorExtension, isZeroBased); } } } @@ -531,14 +517,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } - if (cm.isEnum && !cm.vendorExtensions.containsKey(this.zeroBasedEnumVendorExtension)) { + if (cm.isEnum && !cm.vendorExtensions.containsKey(AbstractCSharpCodegen.zeroBasedEnumVendorExtension)) { if (Boolean.TRUE.equals(this.zeroBasedEnums)) { - cm.vendorExtensions.put(this.zeroBasedEnumVendorExtension, true); + cm.vendorExtensions.put(AbstractCSharpCodegen.zeroBasedEnumVendorExtension, true); } else if (!Boolean.FALSE.equals(this.zeroBasedEnums)) { if (cm.allowableValues.containsKey("values")) { - final List allowableValues = (List) cm.allowableValues.get("values"); + final List allowableValues = (List) cm.allowableValues.get("values"); boolean isZeroBased = String.valueOf(allowableValues.get(0)).toLowerCase(Locale.ROOT).equals("unknown"); - cm.vendorExtensions.put(this.zeroBasedEnumVendorExtension, isZeroBased); + cm.vendorExtensions.put(AbstractCSharpCodegen.zeroBasedEnumVendorExtension, isZeroBased); } } } @@ -560,6 +546,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co Map enumRefs = new HashMap<>(); for (Map.Entry entry : processed.entrySet()) { CodegenModel model = ModelUtils.getModelByName(entry.getKey(), processed); + if (model == null) { + continue; + } // if we don't call setHasDiscriminatorWithNonEmptyMapping then hasDiscriminatorWithNonEmptyMapping will be false, and we need it in the JsonConverter // the checks on oneOf and anyOf must be there or else hasDiscriminatorWithNonEmptyMapping will be true for GrandparentAnimal. @@ -578,7 +567,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co for (Map.Entry entry : objs.entrySet()) { CodegenModel model = ModelUtils.getModelByName(entry.getKey(), objs); - model.vendorExtensions.put("x-model-is-mutatable", modelIsMutatable(model, null)); + if (model == null) { + continue; + } + + model.vendorExtensions.put("x-model-is-mutable", modelIsMutable(model, null)); CodegenComposedSchemas composedSchemas = model.getComposedSchemas(); if (composedSchemas != null) { @@ -597,6 +590,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co property.name = patchPropertyName(model, camelize(property.baseType)); property.isNullable = true; patchPropertyVendorExtensions(property); + property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1)); } } @@ -607,6 +601,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co property.name = patchPropertyName(model, camelize(property.baseType)); property.isNullable = true; patchPropertyVendorExtensions(property); + property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1)); } } } @@ -648,19 +643,17 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co * can instantiate the object. If false, then the model is only ever given * to us by the server, so we do not need a public constructor */ - private boolean modelIsMutatable(CodegenModel model, Set processed) { + private boolean modelIsMutable(CodegenModel model, Set processed) { if (processed == null) { processed = new HashSet(); } - Boolean isMutatable = model.allVars.stream().anyMatch(v -> !v.isReadOnly); - if (!isMutatable && !processed.contains(model.classname) && model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { + boolean isMutable = model.allVars.stream().anyMatch(v -> !v.isReadOnly); + if (!isMutable && !processed.contains(model.classname) && model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { processed.add(model.classname); - for (CodegenDiscriminator.MappedModel mappedModel : model.getDiscriminator().getMappedModels()) { - isMutatable = modelIsMutatable(model, processed); - } + isMutable = modelIsMutable(model, processed); } - return isMutatable; + return isMutable; } protected void removePropertiesDeclaredInComposedTypes(Map objs, CodegenModel model, List composedProperties) { @@ -677,7 +670,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } private void patchPropertyVendorExtensions(CodegenProperty property) { - Boolean isValueType = isValueType(property); + boolean isValueType = isValueType(property); property.vendorExtensions.put("x-is-value-type", isValueType); property.vendorExtensions.put("x-is-reference-type", !isValueType); property.vendorExtensions.put("x-is-nullable-type", this.getNullableReferencesTypes() || isValueType); @@ -736,7 +729,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co String[] numericTypes = {"double", "double?", "decimal", "decimal", "float", "float?", "int", "int?", "long", "long?", "ulong", "ulong?"}; enumVars.forEach((enumVar) -> { - enumVar.put("isNumeric", Arrays.stream(numericTypes).anyMatch(dataType::equals)); + enumVar.put("isNumeric", Arrays.asList(numericTypes).contains(dataType)); }); return enumVars; @@ -823,7 +816,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co case "0": postProcessResponseCode(response, "Default", httpStatusesWithReturn); response.vendorExtensions.put("x-http-status-is-default", true); - if (operation.responses.stream().count() == 1) { + if ((long) operation.responses.size() == 1) { response.vendorExtensions.put("x-only-default", true); } break; @@ -1031,7 +1024,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } else { operation.returnContainer = operation.returnType; - operation.isMap = this.mapTypes.stream().anyMatch(t -> typeMapping.startsWith(t)); + operation.isMap = this.mapTypes.stream().anyMatch(typeMapping::startsWith); } } @@ -1438,7 +1431,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // This supports arrays of arrays. String arrayType = typeMapping.get("array"); StringBuilder instantiationType = new StringBuilder(arrayType); - Schema items = ModelUtils.getSchemaItems(arr); + Schema items = ModelUtils.getSchemaItems(arr); String nestedType = getTypeDeclaration(items); // TODO: We may want to differentiate here between generics and primitive arrays. instantiationType.append("<").append(nestedType).append(">"); @@ -1459,7 +1452,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return getArrayTypeDeclaration(p); } else if (ModelUtils.isMapSchema(p)) { // Should we also support maps of maps? - Schema inner = ModelUtils.getAdditionalProperties(p); + Schema inner = ModelUtils.getAdditionalProperties(p); return getSchemaType(p) + ""; } return super.getTypeDeclaration(p); @@ -1535,70 +1528,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return toModelName(name) + "Tests"; } - public void setLicenseUrl(String licenseUrl) { - this.licenseUrl = licenseUrl; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setPackageTitle(String packageTitle) { - this.packageTitle = packageTitle; - } - - public void setPackageProductName(String packageProductName) { - this.packageProductName = packageProductName; - } - - public void setDateFormat(String dateFormat) { - this.dateFormat = dateFormat; - } - - public void setDateTimeFormat(String dateTimeFormat) { - this.dateTimeFormat = dateTimeFormat; - } - - public void setPackageDescription(String packageDescription) { - this.packageDescription = packageDescription; - } - - public void setPackageCompany(String packageCompany) { - this.packageCompany = packageCompany; - } - - public void setPackageCopyright(String packageCopyright) { - this.packageCopyright = packageCopyright; - } - - public void setPackageAuthors(String packageAuthors) { - this.packageAuthors = packageAuthors; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setTestFolder(String testFolder) { - this.testFolder = testFolder; - } - - public String getInterfacePrefix() { - return interfacePrefix; - } - - public void setZeroBasedEnums(final Boolean zeroBasedEnums) { - this.zeroBasedEnums = zeroBasedEnums; - } - public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag) { this.nullReferenceTypesFlag = nullReferenceTypesFlag; additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag); @@ -1625,30 +1554,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return this.useSourceGeneration; } - public void setInterfacePrefix(final String interfacePrefix) { - this.interfacePrefix = interfacePrefix; - } - - public void setEnumNameSuffix(final String enumNameSuffix) { - this.enumNameSuffix = enumNameSuffix; - } - - public void setEnumValueSuffix(final String enumValueSuffix) { - this.enumValueSuffix = enumValueSuffix; - } - - public boolean isSupportNullable() { - return supportNullable; - } - - public void setSupportNullable(final boolean supportNullable) { - this.supportNullable = supportNullable; - } - - public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { - return this.enumPropertyNaming; - } - public void setEnumPropertyNaming(final String enumPropertyNamingType) { try { this.enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType); @@ -1720,8 +1625,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co private String adjustNamingStyle(String name) { switch (getEnumPropertyNaming()) { - case original: - return name; case camelCase: // NOTE: Removes hyphens and underscores return camelize(name, LOWERCASE_FIRST_LETTER); @@ -1790,7 +1693,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co boolean hasAllowableValues = p.allowableValues != null && !p.allowableValues.isEmpty(); if (hasAllowableValues) { //support examples for inline enums - final List values = (List) p.allowableValues.get("values"); + final List values = (List) p.allowableValues.get("values"); example = String.valueOf(values.get(0)); } else if (p.defaultValue == null) { example = p.example; @@ -1967,7 +1870,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co ? 1 : 0; - Map optionsMap = new HashMap(); + Map optionsMap = new HashMap(); optionsMap.put('i', "IgnoreCase"); optionsMap.put('m', "Multiline"); optionsMap.put('s', "SingleLine"); @@ -1987,7 +1890,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } - String regex = pattern.substring(start, end).replace("'", "\'").replace("\"", "\"\""); + String regex = pattern.substring(start, end).replace("\"", "\"\""); vendorExtensions.put("x-regex", regex); vendorExtensions.put("x-modifiers", modifiers); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index 634d63b6c1c..40335e87c37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -44,7 +44,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; abstract public class AbstractCppCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(AbstractCppCodegen.class); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index e47530d853c..fba1dcecf25 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -2,11 +2,11 @@ package org.openapitools.codegen.languages; import com.google.common.collect.Sets; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.servers.Server; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -48,17 +48,17 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { public static final String PUB_PUBLISH_TO = "pubPublishTo"; public static final String USE_ENUM_EXTENSION = "useEnumExtension"; - protected String pubLibrary = "openapi.api"; - protected String pubName = "openapi"; - protected String pubVersion = "1.0.0"; - protected String pubDescription = "OpenAPI API client"; - protected String pubAuthor = "Author"; - protected String pubAuthorEmail = "author@homepage"; - protected String pubHomepage = "homepage"; - protected String pubRepository = null; - protected String pubPublishTo = null; - protected boolean useEnumExtension = false; - protected String sourceFolder = "src"; + @Setter protected String pubLibrary = "openapi.api"; + @Setter protected String pubName = "openapi"; + @Setter protected String pubVersion = "1.0.0"; + @Setter protected String pubDescription = "OpenAPI API client"; + @Setter protected String pubAuthor = "Author"; + @Setter protected String pubAuthorEmail = "author@homepage"; + @Setter protected String pubHomepage = "homepage"; + @Setter protected String pubRepository = null; + @Setter protected String pubPublishTo = null; + @Setter protected boolean useEnumExtension = false; + @Setter protected String sourceFolder = "src"; protected String libPath = "lib" + File.separator; protected String apiDocPath = "doc/"; protected String modelDocPath = "doc/"; @@ -372,10 +372,17 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { @Override public String toVarName(String name) { + if (nameMapping.containsKey(name)) { + return nameMapping.get(name); + } + // replace - with _ e.g. created-at => created_at name = name.replace("-", "_"); // always need to replace leading underscores first + if (name.equals("_")) { + return "underscore"; + } name = name.replaceAll("^_", ""); // if it's all upper case, do nothing @@ -408,12 +415,20 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { @Override public String toParamName(String name) { + if (parameterNameMapping.containsKey(name)) { + return parameterNameMapping.get(name); + } + // should be the same as variable name return toVarName(name); } @Override public String toModelName(final String name) { + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + String sanitizedName = sanitizeName(name); if (!StringUtils.isEmpty(modelNamePrefix)) { @@ -764,50 +779,6 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { return operationId; } - public void setPubLibrary(String pubLibrary) { - this.pubLibrary = pubLibrary; - } - - public void setPubName(String pubName) { - this.pubName = pubName; - } - - public void setPubVersion(String pubVersion) { - this.pubVersion = pubVersion; - } - - public void setPubDescription(String pubDescription) { - this.pubDescription = pubDescription; - } - - public void setPubAuthor(String pubAuthor) { - this.pubAuthor = pubAuthor; - } - - public void setPubAuthorEmail(String pubAuthorEmail) { - this.pubAuthorEmail = pubAuthorEmail; - } - - public void setPubHomepage(String pubHomepage) { - this.pubHomepage = pubHomepage; - } - - public void setPubRepository(String pubRepository) { - this.pubRepository = pubRepository; - } - - public void setPubPublishTo(String pubPublishTo) { - this.pubPublishTo = pubPublishTo; - } - - public void setUseEnumExtension(boolean useEnumExtension) { - this.useEnumExtension = useEnumExtension; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 479fe4c9984..58a1e0bec04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -20,7 +20,6 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index 713efe56087..e203225c162 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -20,8 +20,9 @@ import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache.Lambda; import io.swagger.v3.core.util.Json; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -49,33 +50,35 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co protected boolean useDateTimeOffsetFlag = false; protected boolean useCollection = false; - protected boolean returnICollection = false; - protected boolean netCoreProjectFileFlag = false; + @Setter protected boolean returnICollection = false; + @Setter protected boolean netCoreProjectFileFlag = false; - protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name(); + @Getter protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name(); - protected String licenseUrl = "http://localhost"; - protected String licenseName = "NoLicense"; + @Setter protected String licenseUrl = "http://localhost"; + @Setter protected String licenseName = "NoLicense"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageVersion = "1.0.0"; protected String packageName = "OpenAPI"; - protected String packageTitle = "OpenAPI Library"; - protected String packageProductName = "OpenAPILibrary"; - protected String packageDescription = "A library generated from a OpenAPI doc"; - protected String packageCompany = "OpenAPI"; - protected String packageCopyright = "No Copyright"; - protected String packageAuthors = "OpenAPI"; + @Setter protected String packageTitle = "OpenAPI Library"; + @Setter protected String packageProductName = "OpenAPILibrary"; + @Setter protected String packageDescription = "A library generated from a OpenAPI doc"; + @Setter protected String packageCompany = "OpenAPI"; + @Setter protected String packageCopyright = "No Copyright"; + @Setter protected String packageAuthors = "OpenAPI"; + @Getter @Setter protected String interfacePrefix = "I"; protected String projectFolder = packageName; - protected String sourceFolder = projectFolder + File.separator + "src"; + @Setter protected String sourceFolder = projectFolder + File.separator + "src"; protected String testFolder = projectFolder + ".Tests"; protected Set collectionTypes; protected Set mapTypes; // true if nullable types will be supported (as option) + @Getter @Setter protected boolean supportNullable = Boolean.TRUE; protected Set nullableType = new HashSet<>(); @@ -187,10 +190,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co ); } - public void setReturnICollection(boolean returnICollection) { - this.returnICollection = returnICollection; - } - public void setUseCollection(boolean useCollection) { this.useCollection = useCollection; if (useCollection) { @@ -202,10 +201,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co } } - public void setNetCoreProjectFileFlag(boolean flag) { - this.netCoreProjectFileFlag = flag; - } - public void useDateTimeOffset(boolean flag) { this.useDateTimeOffsetFlag = flag; if (flag) { @@ -641,10 +636,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co return camelize(sanitizeName(operationId)); } - public String getModelPropertyNaming() { - return this.modelPropertyNaming; - } - public void setModelPropertyNaming(String naming) { if ("original".equals(naming) || "camelCase".equals(naming) || "PascalCase".equals(naming) || "snake_case".equals(naming)) { @@ -936,14 +927,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co return toModelName(name) + "Tests"; } - public void setLicenseUrl(String licenseUrl) { - this.licenseUrl = licenseUrl; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - public void setPackageName(String packageName) { this.packageName = packageName; this.projectFolder = packageName; @@ -951,54 +934,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co this.testFolder = projectFolder + ".Tests"; } - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setPackageTitle(String packageTitle) { - this.packageTitle = packageTitle; - } - - public void setPackageProductName(String packageProductName) { - this.packageProductName = packageProductName; - } - - public void setPackageDescription(String packageDescription) { - this.packageDescription = packageDescription; - } - - public void setPackageCompany(String packageCompany) { - this.packageCompany = packageCompany; - } - - public void setPackageCopyright(String packageCopyright) { - this.packageCopyright = packageCopyright; - } - - public void setPackageAuthors(String packageAuthors) { - this.packageAuthors = packageAuthors; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public String getInterfacePrefix() { - return interfacePrefix; - } - - public void setInterfacePrefix(final String interfacePrefix) { - this.interfacePrefix = interfacePrefix; - } - - public boolean isSupportNullable() { - return supportNullable; - } - - public void setSupportNullable(final boolean supportNullable) { - this.supportNullable = supportNullable; - } - @Override public String toEnumValue(String value, String datatype) { // C# only supports enums as literals for int, int?, long, long?, byte, and byte?. All else must be treated as strings. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 49269a51a42..884c4e7792b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -17,8 +17,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -40,17 +40,26 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege private final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class); private static final String NUMERIC_ENUM_PREFIX = "_"; + @Setter protected boolean withGoCodegenComment = false; + @Setter protected boolean withAWSV4Signature = false; + @Setter protected boolean withXml = false; + @Setter protected boolean enumClassPrefix = false; + @Setter protected boolean structPrefix = false; + @Setter protected boolean generateInterfaces = false; + @Setter protected boolean withGoMod = false; + @Setter protected boolean generateMarshalJSON = true; + @Setter protected boolean generateUnmarshalJSON = true; - + @Setter protected String packageName = "openapi"; protected Set numberTypes; @@ -425,6 +434,13 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege String ref = p.get$ref(); String type; + // schema is a ref to property's schema e.g. #/components/schemas/Pet/properties/id + if (ModelUtils.isRefToSchemaWithProperties(ref)) { + Schema propertySchema = ModelUtils.getSchemaFromRefToSchemaWithProperties(openAPI, ref); + openAPIType = super.getSchemaType(propertySchema); + ref = propertySchema.get$ref(); + } + if (ref != null && !ref.isEmpty()) { type = toModelName(openAPIType); } else if ("object".equals(openAPIType) && ModelUtils.isAnyType(p)) { @@ -432,10 +448,12 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege type = "interface{}"; } else if (typeMapping.containsKey(openAPIType)) { type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) + if (languageSpecificPrimitives.contains(type)) { return (type); - } else + } + } else { type = openAPIType; + } return type; } @@ -725,6 +743,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege for (ModelMap m : objs.getModels()) { boolean addedTimeImport = false; boolean addedOSImport = false; + boolean addedValidator = false; CodegenModel model = m.getModel(); List inheritedProperties = new ArrayList<>(); @@ -753,17 +772,28 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege imports.add(createMapping("import", "time")); addedTimeImport = true; } - + if (!addedOSImport && ("*os.File".equals(cp.dataType) || (cp.items != null && "*os.File".equals(cp.items.dataType)))) { imports.add(createMapping("import", "os")); addedOSImport = true; } + + if (cp.pattern != null) { + cp.vendorExtensions.put("x-go-custom-tag", "validate:\"regexp=" + + cp.pattern.replace("\\", "\\\\").replaceAll("^/|/$", "") + + "\""); + } } if (this instanceof GoClientCodegen && model.isEnum) { imports.add(createMapping("import", "fmt")); } + if (model.oneOf != null && !model.oneOf.isEmpty() && !addedValidator && generateUnmarshalJSON) { + imports.add(createMapping("import", "gopkg.in/validator.v2")); + addedValidator = true; + } + // if oneOf contains "null" type if (model.oneOf != null && !model.oneOf.isEmpty() && model.oneOf.contains("nil")) { model.isNullable = true; @@ -814,10 +844,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -906,42 +932,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } } - public void setWithGoCodegenComment(boolean withGoCodegenComment) { - this.withGoCodegenComment = withGoCodegenComment; - } - - public void setWithAWSV4Signature(boolean withAWSV4Signature) { - this.withAWSV4Signature = withAWSV4Signature; - } - - public void setWithXml(boolean withXml) { - this.withXml = withXml; - } - - public void setEnumClassPrefix(boolean enumClassPrefix) { - this.enumClassPrefix = enumClassPrefix; - } - - public void setStructPrefix(boolean structPrefix) { - this.structPrefix = structPrefix; - } - - public void setGenerateInterfaces(boolean generateInterfaces) { - this.generateInterfaces = generateInterfaces; - } - - public void setWithGoMod(boolean withGoMod) { - this.withGoMod = withGoMod; - } - - public void setGenerateMarshalJSON(boolean generateMarshalJSON) { - this.generateMarshalJSON = generateMarshalJSON; - } - - public void setGenerateUnmarshalJSON(boolean generateUnmarshalJSON) { - this.generateUnmarshalJSON = generateUnmarshalJSON; - } - @Override public String toDefaultValue(Schema schema) { schema = unaliasSchema(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java index 2d92ab1614f..0d383f375a6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java @@ -16,8 +16,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.model.ModelMap; @@ -39,8 +39,8 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C private final Logger LOGGER = LoggerFactory.getLogger(AbstractGraphQLCodegen.class); protected String specFolder = "spec"; - protected String packageName = "openapi2graphql"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi2graphql"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -116,14 +116,6 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C additionalProperties.put("modelDocPath", modelDocPath); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String escapeReservedWord(String name) { // Can't start with an underscore, as our fields need to start with an diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 0ca8bcc2b36..52e71fc22b7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -31,6 +31,8 @@ import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -96,56 +98,96 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; public static final String GENERATE_CONSTRUCTOR_WITH_ALL_ARGS = "generateConstructorWithAllArgs"; public static final String GENERATE_BUILDERS = "generateBuilders"; + + @Getter @Setter protected String dateLibrary = "java8"; - protected boolean supportAsync = false; - protected boolean withXml = false; + @Setter protected boolean supportAsync = false; + @Setter protected boolean withXml = false; + @Getter @Setter protected String invokerPackage = "org.openapitools"; + @Getter @Setter protected String groupId = "org.openapitools"; + @Getter @Setter protected String artifactId = "openapi-java"; + @Getter @Setter protected String artifactVersion = null; + @Getter @Setter protected String artifactUrl = "https://github.com/openapitools/openapi-generator"; + @Getter @Setter protected String artifactDescription = "OpenAPI Java"; + @Getter @Setter protected String developerName = "OpenAPI-Generator Contributors"; + @Getter @Setter protected String developerEmail = "team@openapitools.org"; + @Getter @Setter protected String developerOrganization = "OpenAPITools.org"; + @Getter @Setter protected String developerOrganizationUrl = "http://openapitools.org"; + @Getter @Setter protected String scmConnection = "scm:git:git@github.com:openapitools/openapi-generator.git"; + @Getter @Setter protected String scmDeveloperConnection = "scm:git:git@github.com:openapitools/openapi-generator.git"; + @Getter @Setter protected String scmUrl = "https://github.com/openapitools/openapi-generator"; + @Getter @Setter protected String licenseName = "Unlicense"; + @Getter @Setter protected String licenseUrl = "http://unlicense.org"; protected String projectFolder = "src/main"; protected String projectTestFolder = "src/test"; // this must not be OS-specific + @Getter @Setter protected String sourceFolder = projectFolder + "/java"; + @Getter @Setter protected String testFolder = projectTestFolder + "/java"; - protected boolean discriminatorCaseSensitive = true; // True if the discriminator value lookup should be case-sensitive. + /** + * -- SETTER -- + * Set whether discriminator value lookup is case-sensitive or not. + * + * @param discriminatorCaseSensitive true if the discriminator value lookup should be case-sensitive. + */ + @Setter protected boolean discriminatorCaseSensitive = true; + @Getter @Setter protected Boolean serializableModel = false; - protected boolean serializeBigDecimalAsString = false; + @Setter protected boolean serializeBigDecimalAsString = false; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected boolean disableHtmlEscaping = false; + @Setter protected boolean disableHtmlEscaping = false; + @Getter @Setter protected String booleanGetterPrefix = "get"; - protected boolean ignoreAnyOfInEnum = false; - protected String parentGroupId = ""; - protected String parentArtifactId = ""; - protected String parentVersion = ""; - protected boolean parentOverridden = false; + @Setter protected boolean ignoreAnyOfInEnum = false; + @Setter protected String parentGroupId = ""; + @Setter protected String parentArtifactId = ""; + @Setter protected String parentVersion = ""; + @Setter protected boolean parentOverridden = false; + @Getter @Setter protected List additionalModelTypeAnnotations = new LinkedList<>(); protected Map lombokAnnotations = null; + @Getter @Setter protected List additionalOneOfTypeAnnotations = new LinkedList<>(); - protected List additionalEnumTypeAnnotations = new LinkedList<>(); + @Setter protected List additionalEnumTypeAnnotations = new LinkedList<>(); + @Getter @Setter protected boolean openApiNullable = true; - protected String outputTestFolder = ""; + @Setter protected String outputTestFolder = ""; protected DocumentationProvider documentationProvider; protected AnnotationLibrary annotationLibrary; - protected boolean implicitHeaders = false; - protected String implicitHeadersRegex = null; - protected boolean camelCaseDollarSign = false; - protected boolean useJakartaEe = false; - protected boolean containerDefaultToNull = false; + @Setter protected boolean implicitHeaders = false; + @Setter protected String implicitHeadersRegex = null; + @Setter protected boolean camelCaseDollarSign = false; + @Setter protected boolean useJakartaEe = false; + @Setter protected boolean containerDefaultToNull = false; + @Getter @Setter protected boolean generateConstructorWithAllArgs = false; - protected boolean generateBuilder = false; + @Getter @Setter + protected boolean jackson = false; + @Getter @Setter + protected boolean generateBuilders; + /** + * useBeanValidation has been moved from child generators to AbstractJavaCodegen. + * The reason is that getBeanValidation needs it + */ + @Getter @Setter + protected boolean useBeanValidation = false; private Map schemaKeyToModelNameCache = new HashMap<>(); public AbstractJavaCodegen() { @@ -318,6 +360,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public void processOpts() { + useCodegenAsMustacheParentContext(); super.processOpts(); if (null != defaultDocumentationProvider()) { @@ -360,64 +403,38 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code additionalProperties.put(ANNOTATION_LIBRARY, AnnotationLibrary.NONE); } - if (additionalProperties.containsKey(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS)) { - this.setGenerateConstructorWithAllArgs(convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS)); - } - writePropertyBack(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, generateConstructorWithAllArgs); - - if (additionalProperties.containsKey(GENERATE_BUILDERS)) { - this.setGenerateBuilder(convertPropertyToBoolean(GENERATE_BUILDERS)); - } - writePropertyBack(GENERATE_BUILDERS, generateBuilder); + convertPropertyToBooleanAndWriteBack(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, this::setGenerateConstructorWithAllArgs); + convertPropertyToBooleanAndWriteBack(GENERATE_BUILDERS, this::setGenerateBuilders); if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) { LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)"); LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } - if (additionalProperties.containsKey(DISABLE_HTML_ESCAPING)) { - this.setDisableHtmlEscaping(Boolean.parseBoolean(additionalProperties.get(DISABLE_HTML_ESCAPING).toString())); - } - additionalProperties.put(DISABLE_HTML_ESCAPING, disableHtmlEscaping); - - if (additionalProperties.containsKey(BOOLEAN_GETTER_PREFIX)) { - this.setBooleanGetterPrefix(additionalProperties.get(BOOLEAN_GETTER_PREFIX).toString()); - } - additionalProperties.put(BOOLEAN_GETTER_PREFIX, booleanGetterPrefix); - - if (additionalProperties.containsKey(IGNORE_ANYOF_IN_ENUM)) { - this.setIgnoreAnyOfInEnum(Boolean.parseBoolean(additionalProperties.get(IGNORE_ANYOF_IN_ENUM).toString())); - } - additionalProperties.put(IGNORE_ANYOF_IN_ENUM, ignoreAnyOfInEnum); - - if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { - String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); - this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); - } - - if (additionalProperties.containsKey(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS)) { - String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS).toString(); - this.setAdditionalOneOfTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); - } - - if (additionalProperties.containsKey(ADDITIONAL_ENUM_TYPE_ANNOTATIONS)) { - String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_ENUM_TYPE_ANNOTATIONS).toString(); - - this.setAdditionalEnumTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";"))); - } + convertPropertyToBooleanAndWriteBack(BeanValidationFeatures.USE_BEANVALIDATION, this::setUseBeanValidation); + convertPropertyToBooleanAndWriteBack(DISABLE_HTML_ESCAPING, this::setDisableHtmlEscaping); + convertPropertyToStringAndWriteBack(BOOLEAN_GETTER_PREFIX, this::setBooleanGetterPrefix); + convertPropertyToBooleanAndWriteBack(IGNORE_ANYOF_IN_ENUM, this::setIgnoreAnyOfInEnum); + convertPropertyToTypeAndWriteBack(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, + annotations-> Arrays.asList(annotations.trim().split("\\s*(;|\\r?\\n)\\s*")), + this::setAdditionalModelTypeAnnotations); + convertPropertyToTypeAndWriteBack(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, + annotations-> Arrays.asList(annotations.trim().split("\\s*(;|\\r?\\n)\\s*")), + this::setAdditionalOneOfTypeAnnotations); + convertPropertyToTypeAndWriteBack(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, + annotations -> Arrays.asList(annotations.split(";")), + this::setAdditionalEnumTypeAnnotations); if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { // guess from api package String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.API_PACKAGE)); - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); - this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + this.setInvokerPackage(derivedInvokerPackage); LOGGER.info("Invoker Package Name, originally not set, is now derived from api package name: {}", derivedInvokerPackage); } else if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { // guess from model package String derivedInvokerPackage = deriveInvokerPackageName((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, derivedInvokerPackage); - this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + this.setInvokerPackage(derivedInvokerPackage); LOGGER.info("Invoker Package Name, originally not set, is now derived from model package name: {}", derivedInvokerPackage); } else { @@ -501,85 +518,41 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code additionalProperties.put(CodegenConstants.DEVELOPER_ORGANIZATION_URL, developerOrganizationUrl); } - if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) { - this.setLicenseName((String) additionalProperties.get(CodegenConstants.LICENSE_NAME)); - } else { - additionalProperties.put(CodegenConstants.LICENSE_NAME, licenseName); - } - - if (additionalProperties.containsKey(CodegenConstants.LICENSE_URL)) { - this.setLicenseUrl((String) additionalProperties.get(CodegenConstants.LICENSE_URL)); - } else { - additionalProperties.put(CodegenConstants.LICENSE_URL, licenseUrl); - } - - if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { - this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); - } - additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { - this.setSerializableModel(Boolean.valueOf(additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { - this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); - } - - if (additionalProperties.containsKey(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING)) { - this.setSerializeBigDecimalAsString(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING).toString())); - } - + convertPropertyToStringAndWriteBack(CodegenConstants.MODEL_PACKAGE, this::setModelPackage); + convertPropertyToStringAndWriteBack(CodegenConstants.API_PACKAGE, this::setApiPackage); + convertPropertyToStringAndWriteBack(CodegenConstants.GROUP_ID, this::setGroupId); + convertPropertyToStringAndWriteBack(CodegenConstants.ARTIFACT_ID, this::setArtifactId); + convertPropertyToStringAndWriteBack(CodegenConstants.ARTIFACT_URL, this::setArtifactUrl); + convertPropertyToStringAndWriteBack(CodegenConstants.ARTIFACT_DESCRIPTION, this::setArtifactDescription); + convertPropertyToStringAndWriteBack(CodegenConstants.SCM_CONNECTION, this::setScmConnection); + convertPropertyToStringAndWriteBack(CodegenConstants.SCM_DEVELOPER_CONNECTION, this::setScmDeveloperConnection); + convertPropertyToStringAndWriteBack(CodegenConstants.SCM_URL, this::setScmUrl); + convertPropertyToStringAndWriteBack(CodegenConstants.DEVELOPER_NAME, this::setDeveloperName); + convertPropertyToStringAndWriteBack(CodegenConstants.DEVELOPER_EMAIL, this::setDeveloperEmail); + convertPropertyToStringAndWriteBack(CodegenConstants.DEVELOPER_ORGANIZATION, this::setDeveloperOrganization); + convertPropertyToStringAndWriteBack(CodegenConstants.DEVELOPER_ORGANIZATION_URL, this::setDeveloperOrganizationUrl); + convertPropertyToStringAndWriteBack(CodegenConstants.LICENSE_NAME, this::setLicenseName); + convertPropertyToStringAndWriteBack(CodegenConstants.LICENSE_URL, this::setLicenseUrl); + convertPropertyToStringAndWriteBack(CodegenConstants.SOURCE_FOLDER, this::setSourceFolder); + convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL, this::setSerializableModel); + convertPropertyToStringAndWriteBack(CodegenConstants.LIBRARY, this::setLibrary); + convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, this::setSerializeBigDecimalAsString ); // need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); +// additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); - if (additionalProperties.containsKey(DISCRIMINATOR_CASE_SENSITIVE)) { - this.setDiscriminatorCaseSensitive(Boolean.parseBoolean(additionalProperties.get(DISCRIMINATOR_CASE_SENSITIVE).toString())); - } else { // By default, the discriminator lookup should be case sensitive. There is nothing in the OpenAPI specification // that indicates the lookup should be case insensitive. However, some implementations perform // a case-insensitive lookup. - this.setDiscriminatorCaseSensitive(Boolean.TRUE); - } - additionalProperties.put(DISCRIMINATOR_CASE_SENSITIVE, this.discriminatorCaseSensitive); - - if (additionalProperties.containsKey(WITH_XML)) { - this.setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); - } - additionalProperties.put(WITH_XML, withXml); - - if (additionalProperties.containsKey(OPENAPI_NULLABLE)) { - this.setOpenApiNullable(Boolean.parseBoolean(additionalProperties.get(OPENAPI_NULLABLE).toString())); - } - additionalProperties.put(OPENAPI_NULLABLE, openApiNullable); - - if (additionalProperties.containsKey(CodegenConstants.PARENT_GROUP_ID)) { - this.setParentGroupId((String) additionalProperties.get(CodegenConstants.PARENT_GROUP_ID)); - } - - if (additionalProperties.containsKey(CodegenConstants.PARENT_ARTIFACT_ID)) { - this.setParentArtifactId((String) additionalProperties.get(CodegenConstants.PARENT_ARTIFACT_ID)); - } - - if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) { - this.setParentVersion((String) additionalProperties.get(CodegenConstants.PARENT_VERSION)); - } - - if (additionalProperties.containsKey(IMPLICIT_HEADERS)) { - this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString())); - } - - if (additionalProperties.containsKey(IMPLICIT_HEADERS_REGEX)) { - this.setImplicitHeadersRegex(additionalProperties.get(IMPLICIT_HEADERS_REGEX).toString()); - } - - if (additionalProperties.containsKey(CAMEL_CASE_DOLLAR_SIGN)) { - this.setCamelCaseDollarSign(Boolean.parseBoolean(additionalProperties.get(CAMEL_CASE_DOLLAR_SIGN).toString())); - } - - if (additionalProperties.containsKey(USE_ONE_OF_INTERFACES)) { - this.setUseOneOfInterfaces(Boolean.parseBoolean(additionalProperties.get(USE_ONE_OF_INTERFACES).toString())); - } + convertPropertyToBooleanAndWriteBack(DISCRIMINATOR_CASE_SENSITIVE, this::setDiscriminatorCaseSensitive); + convertPropertyToBooleanAndWriteBack(WITH_XML, this::setWithXml); + convertPropertyToBooleanAndWriteBack(OPENAPI_NULLABLE, this::setOpenApiNullable); + convertPropertyToStringAndWriteBack(CodegenConstants.PARENT_GROUP_ID, this::setParentGroupId); + convertPropertyToStringAndWriteBack(CodegenConstants.PARENT_ARTIFACT_ID, this::setParentArtifactId); + convertPropertyToStringAndWriteBack(CodegenConstants.PARENT_VERSION, this::setParentVersion); + convertPropertyToBooleanAndWriteBack(IMPLICIT_HEADERS, this::setImplicitHeaders); + convertPropertyToStringAndWriteBack(IMPLICIT_HEADERS_REGEX, this::setImplicitHeadersRegex); + convertPropertyToBooleanAndWriteBack(CAMEL_CASE_DOLLAR_SIGN, this::setCamelCaseDollarSign); + convertPropertyToBooleanAndWriteBack(USE_ONE_OF_INTERFACES, this::setUseOneOfInterfaces); if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { additionalProperties.put("parentOverridden", true); @@ -629,16 +602,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // used later in recursive import in postProcessingModels importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator"); - if (additionalProperties.containsKey(SUPPORT_ASYNC)) { - setSupportAsync(Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString())); - if (supportAsync) { - additionalProperties.put(SUPPORT_ASYNC, "true"); - } - } - - if (additionalProperties.containsKey(DATE_LIBRARY)) { - setDateLibrary(additionalProperties.get("dateLibrary").toString()); - } + convertPropertyToBooleanAndWriteBack(SUPPORT_ASYNC, this::setSupportAsync); + convertPropertyToStringAndWriteBack(DATE_LIBRARY, this::setDateLibrary); if ("joda".equals(dateLibrary)) { additionalProperties.put("joda", "true"); @@ -663,25 +628,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code additionalProperties.put("legacyDates", "true"); } - if (additionalProperties.containsKey(TEST_OUTPUT)) { - setOutputTestFolder(additionalProperties.get(TEST_OUTPUT).toString()); - } - - if (additionalProperties.containsKey(USE_JAKARTA_EE)) { - this.setUseJakartaEe(Boolean.parseBoolean(additionalProperties.get(USE_JAKARTA_EE).toString())); - } - additionalProperties.put(USE_JAKARTA_EE, useJakartaEe); - + convertPropertyToStringAndWriteBack(TEST_OUTPUT, this::setOutputTestFolder); + convertPropertyToBooleanAndWriteBack(USE_JAKARTA_EE, this::setUseJakartaEe); if (useJakartaEe) { applyJakartaPackage(); } else { applyJavaxPackage(); } - if (additionalProperties.containsKey(CONTAINER_DEFAULT_TO_NULL)) { - this.setContainerDefaultToNull(Boolean.parseBoolean(additionalProperties.get(CONTAINER_DEFAULT_TO_NULL).toString())); - } - additionalProperties.put(CONTAINER_DEFAULT_TO_NULL, containerDefaultToNull); + convertPropertyToBooleanAndWriteBack(CONTAINER_DEFAULT_TO_NULL, this::setContainerDefaultToNull); additionalProperties.put("sanitizeGeneric", (Mustache.Lambda) (fragment, writer) -> { String content = fragment.execute(); @@ -692,22 +647,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code }); } - public void setGenerateConstructorWithAllArgs(boolean aValue) { - this.generateConstructorWithAllArgs = aValue; - } - - public boolean isGenerateConstructorWithAllArgs() { - return generateConstructorWithAllArgs; - } - - public void setGenerateBuilder(boolean aValue) { - this.generateBuilder = aValue; - } - - public boolean isGenerateBuilder() { - return generateBuilder; - } - /** * Analyse and post process all Models. * @param objs the models map. @@ -841,19 +780,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // the whole additionalProperties object is injected into the main object passed to the mustache layer this.setApiPackage(sanitizePackageName(apiPackage)); - if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); - } - + additionalProperties.remove(CodegenConstants.API_PACKAGE); this.setModelPackage(sanitizePackageName(modelPackage)); - if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); - } - + additionalProperties.remove(CodegenConstants.MODEL_PACKAGE); this.setInvokerPackage(sanitizePackageName(invokerPackage)); - if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { - this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); - } + additionalProperties.remove(CodegenConstants.INVOKER_PACKAGE); } protected void applyJavaxPackage() { @@ -1100,7 +1031,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code * @return BeanValidation for declared type in container(array, set) */ private String getBeanValidation(Schema items) { - if (Boolean.FALSE.equals(additionalProperties.getOrDefault(BeanValidationFeatures.USE_BEANVALIDATION, Boolean.FALSE))) { + if (!isUseBeanValidation()) { return ""; } @@ -1241,14 +1172,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return validations; } - @Override - public String getAlias(String name) { - if (typeAliases != null && typeAliases.containsKey(name)) { - return typeAliases.get(name); - } - return name; - } - /** * Return the default value of array property *

    @@ -1732,12 +1655,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code codegenModel.imports.add("ApiModel"); } } - if (codegenModel.discriminator != null && additionalProperties.containsKey(JACKSON)) { + if (codegenModel.discriminator != null && jackson) { codegenModel.imports.add("JsonSubTypes"); codegenModel.imports.add("JsonTypeInfo"); codegenModel.imports.add("JsonIgnoreProperties"); } - if (codegenModel.getIsClassnameSanitized() && additionalProperties.containsKey(JACKSON) && !codegenModel.isEnum) { + if (codegenModel.getIsClassnameSanitized() && jackson && !codegenModel.isEnum) { codegenModel.imports.add("JsonTypeName"); } if (allDefinitions != null && codegenModel.parentSchema != null && codegenModel.hasEnums) { @@ -1779,7 +1702,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - if (serializeBigDecimalAsString) { + if (serializeBigDecimalAsString && jackson) { if ("decimal".equals(property.baseType) || "bigdecimal".equalsIgnoreCase(property.baseType)) { // we serialize BigDecimal as `string` to avoid precision loss property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = ToStringSerializer.class)"); @@ -1804,7 +1727,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code model.imports.add("Arrays"); } else if ("set".equals(property.containerType)) { model.imports.add("LinkedHashSet"); - if (!openApiNullable || !property.isNullable) { // cannot be wrapped to nullable + if ((!openApiNullable || !property.isNullable) && jackson) { // cannot be wrapped to nullable model.imports.add("JsonDeserialize"); property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)"); } @@ -1838,6 +1761,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } } + @Override public void postProcessResponseWithProperty(CodegenResponse response, CodegenProperty property) { if (response == null || property == null || response.dataType == null || property.dataType == null) { return; @@ -2140,208 +2064,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return packageName; } - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public String getGroupId() { - return groupId; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public String getArtifactId() { - return artifactId; - } - - public void setArtifactId(String artifactId) { - this.artifactId = artifactId; - } - - public String getArtifactVersion() { - return artifactVersion; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public String getArtifactUrl() { - return artifactUrl; - } - - public void setArtifactUrl(String artifactUrl) { - this.artifactUrl = artifactUrl; - } - - public String getArtifactDescription() { - return artifactDescription; - } - - public void setArtifactDescription(String artifactDescription) { - this.artifactDescription = artifactDescription; - } - - public String getScmConnection() { - return scmConnection; - } - - public void setScmConnection(String scmConnection) { - this.scmConnection = scmConnection; - } - - public String getScmDeveloperConnection() { - return scmDeveloperConnection; - } - - public void setScmDeveloperConnection(String scmDeveloperConnection) { - this.scmDeveloperConnection = scmDeveloperConnection; - } - - public String getScmUrl() { - return scmUrl; - } - - public void setScmUrl(String scmUrl) { - this.scmUrl = scmUrl; - } - - public String getDeveloperName() { - return developerName; - } - - public void setDeveloperName(String developerName) { - this.developerName = developerName; - } - - public String getDeveloperEmail() { - return developerEmail; - } - - public void setDeveloperEmail(String developerEmail) { - this.developerEmail = developerEmail; - } - - public String getDeveloperOrganization() { - return developerOrganization; - } - - public void setDeveloperOrganization(String developerOrganization) { - this.developerOrganization = developerOrganization; - } - - public String getDeveloperOrganizationUrl() { - return developerOrganizationUrl; - } - - public void setDeveloperOrganizationUrl(String developerOrganizationUrl) { - this.developerOrganizationUrl = developerOrganizationUrl; - } - - public String getLicenseName() { - return licenseName; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public String getLicenseUrl() { - return licenseUrl; - } - - public void setLicenseUrl(String licenseUrl) { - this.licenseUrl = licenseUrl; - } - - public String getSourceFolder() { - return sourceFolder; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public String getTestFolder() { - return testFolder; - } - - public void setTestFolder(String testFolder) { - this.testFolder = testFolder; - } - - public void setSerializeBigDecimalAsString(boolean s) { - this.serializeBigDecimalAsString = s; - } - - public Boolean getSerializableModel() { - return serializableModel; - } - - public void setSerializableModel(Boolean serializableModel) { - this.serializableModel = serializableModel; - } - private String sanitizePath(String p) { //prefer replace a ", instead of a fuLL URL encode for readability return p.replaceAll("\"", "%22"); } - /** - * Set whether discriminator value lookup is case-sensitive or not. - * - * @param discriminatorCaseSensitive true if the discriminator value lookup should be case sensitive. - */ - public void setDiscriminatorCaseSensitive(boolean discriminatorCaseSensitive) { - this.discriminatorCaseSensitive = discriminatorCaseSensitive; - } - - public void setWithXml(boolean withXml) { - this.withXml = withXml; - } - - public String getDateLibrary() { - return dateLibrary; - } - - public void setDateLibrary(String library) { - this.dateLibrary = library; - } - - public void setSupportAsync(boolean enabled) { - this.supportAsync = enabled; - } - - public void setDisableHtmlEscaping(boolean disabled) { - this.disableHtmlEscaping = disabled; - } - - public String getBooleanGetterPrefix() { - return booleanGetterPrefix; - } - - public void setBooleanGetterPrefix(String booleanGetterPrefix) { - this.booleanGetterPrefix = booleanGetterPrefix; - } - - public void setIgnoreAnyOfInEnum(boolean ignoreAnyOfInEnum) { - this.ignoreAnyOfInEnum = ignoreAnyOfInEnum; - } - - public boolean isOpenApiNullable() { - return openApiNullable; - } - - public void setOpenApiNullable(final boolean openApiNullable) { - this.openApiNullable = openApiNullable; - } - @Override public void setOutputDir(String dir) { super.setOutputDir(dir); @@ -2357,10 +2084,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return outputTestFolder; } - public void setOutputTestFolder(String outputTestFolder) { - this.outputTestFolder = outputTestFolder; - } - @Override public DocumentationProvider getDocumentationProvider() { return documentationProvider; @@ -2381,26 +2104,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.annotationLibrary = annotationLibrary; } - public void setImplicitHeaders(boolean implicitHeaders) { - this.implicitHeaders = implicitHeaders; - } - - public void setImplicitHeadersRegex(String implicitHeadersRegex) { - this.implicitHeadersRegex = implicitHeadersRegex; - } - - public void setCamelCaseDollarSign(boolean camelCaseDollarSign) { - this.camelCaseDollarSign = camelCaseDollarSign; - } - - public void setUseJakartaEe(boolean useJakartaEe) { - this.useJakartaEe = useJakartaEe; - } - - public void setContainerDefaultToNull(boolean containerDefaultToNull) { - this.containerDefaultToNull = containerDefaultToNull; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -2527,42 +2230,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } } - public void setParentGroupId(final String parentGroupId) { - this.parentGroupId = parentGroupId; - } - - public void setParentArtifactId(final String parentArtifactId) { - this.parentArtifactId = parentArtifactId; - } - - public void setParentVersion(final String parentVersion) { - this.parentVersion = parentVersion; - } - - public void setParentOverridden(final boolean parentOverridden) { - this.parentOverridden = parentOverridden; - } - - public List getAdditionalModelTypeAnnotations() { - return additionalModelTypeAnnotations; - } - - public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { - this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; - } - - public List getAdditionalOneOfTypeAnnotations() { - return additionalOneOfTypeAnnotations; - } - - public void setAdditionalOneOfTypeAnnotations(final List additionalOneOfTypeAnnotations) { - this.additionalOneOfTypeAnnotations = additionalOneOfTypeAnnotations; - } - - public void setAdditionalEnumTypeAnnotations(final List additionalEnumTypeAnnotations) { - this.additionalEnumTypeAnnotations = additionalEnumTypeAnnotations; - } - @Override protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { if (!supportsAdditionalPropertiesWithComposedSchema) { @@ -2633,7 +2300,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public void addImportsToOneOfInterface(List> imports) { - if (additionalProperties.containsKey(JACKSON)) { + if (jackson) { for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo")) { Map oneImport = new HashMap<>(); oneImport.put("import", importMapping.get(i)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 29471cca574..6afd7553ae9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -21,6 +21,7 @@ import com.google.common.annotations.VisibleForTesting; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -60,12 +61,12 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen ARRAY_OF_MICROPROFILE_OPEN_API_SCHEMA_TYPES = Collections.unmodifiableMap(schemaTypes); } + @Setter protected String implFolder = "src/main/java"; protected String testResourcesFolder = "src/test/resources"; protected String title = "OpenAPI Server"; protected String serverPort = "8080"; - protected boolean useBeanValidation = true; protected boolean useTags = false; private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); @@ -79,6 +80,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen dateLibrary = "legacy"; //TODO: add joda support to all jax-rs apiPackage = "org.openapitools.api"; modelPackage = "org.openapitools.model"; + useBeanValidation = true; // clioOptions default redefinition need to be updated updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); @@ -90,7 +92,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen additionalProperties.put("title", title); // java inflector uses the jackson lib - additionalProperties.put(JACKSON, "true"); + this.jackson = true; cliOptions.add(new CliOption(CodegenConstants.IMPL_FOLDER, CodegenConstants.IMPL_FOLDER_DESC).defaultValue(implFolder)); cliOptions.add(new CliOption("title", "a title describing the application").defaultValue(title)); @@ -113,19 +115,9 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { - implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); - } - - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - - if (additionalProperties.containsKey(USE_TAGS)) { - setUseTags(convertPropertyToBoolean(USE_TAGS)); - } - - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + convertPropertyToStringAndWriteBack(CodegenConstants.IMPL_FOLDER, this::setImplFolder); + convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION, this::setUseBeanValidation); + convertPropertyToBooleanAndWriteBack(USE_TAGS, this::setUseTags); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java index b1210465b89..3f2549780f5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java @@ -16,6 +16,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.ClientModificationFeature; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -32,7 +33,6 @@ import java.time.format.DateTimeFormatter; import java.util.*; import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.servers.Server; @@ -63,9 +63,9 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen { protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected String packageName; - protected Boolean exportModels; - protected Boolean exportOperations; + @Setter protected String packageName; + @Setter protected Boolean exportModels; + @Setter protected Boolean exportOperations; protected final DateTimeFormatter OFFSET_DATE_TIME_FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME; protected final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT); @@ -147,18 +147,6 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen { return GeneratorLanguage.JULIA; } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setExportModels(Boolean exportModels) { - this.exportModels = exportModels; - } - - public void setExportOperations(Boolean exportOperations) { - this.exportOperations = exportOperations; - } - protected static String dropDots(String str) { return str.replaceAll("\\.", "_"); } @@ -440,6 +428,7 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen { * @param input String to be cleaned up * @return string with quotation mark removed or escaped */ + @Override public String escapeQuotationMark(String input) { return input.replace("\"", "\\\""); } @@ -500,6 +489,7 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen { * @param operationId operation ID * @return the sanitized method name */ + @Override @SuppressWarnings("static-method") public String toOperationId(String operationId) { CamelizeOption camelizeOption = CamelizeOption.UPPERCASE_FIRST_CHAR; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 599236a2b82..7df7f8021c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -20,9 +20,10 @@ package org.openapitools.codegen.languages; import com.fasterxml.jackson.databind.node.ArrayNode; import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -55,32 +56,34 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); - protected String artifactId; - protected String artifactVersion = "1.0.0"; - protected String groupId = "org.openapitools"; - protected String packageName = "org.openapitools"; - protected String apiSuffix = "Api"; + @Setter protected String artifactId; + @Setter protected String artifactVersion = "1.0.0"; + @Setter protected String groupId = "org.openapitools"; + @Setter protected String packageName = "org.openapitools"; + @Setter protected String apiSuffix = "Api"; - protected String sourceFolder = "src/main/kotlin"; - protected String testFolder = "src/test/kotlin"; + @Setter protected String sourceFolder = "src/main/kotlin"; + @Setter protected String testFolder = "src/test/kotlin"; protected String resourcesFolder = "src/main/resources"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected boolean parcelizeModels = false; + @Getter @Setter protected boolean serializableModel = false; - protected boolean useJakartaEe = false; + @Setter protected boolean useJakartaEe = false; - protected boolean nonPublicApi = false; + @Setter protected boolean nonPublicApi = false; - protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.original; + @Getter protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.original; // model classes cannot use the same property names defined in HashMap // ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/ protected Set propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values")); private final Map schemaKeyToModelNameCache = new HashMap<>(); + @Getter @Setter protected List additionalModelTypeAnnotations = new LinkedList<>(); public AbstractKotlinCodegen() { @@ -304,10 +307,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return input.replace("*/", "*_/").replace("/*", "/_*"); } - public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { - return this.enumPropertyNaming; - } - /** * Sets the naming convention for Kotlin enum properties @@ -348,6 +347,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return toModelName(type); } + private String getItemsTypeDeclaration(Schema items) { + String itemsTypeDeclaration = getTypeDeclaration(items); + String nullable = items.getNullable() != null && items.getNullable() && !itemsTypeDeclaration.endsWith("?") ? "?" : ""; + return itemsTypeDeclaration + nullable; + } + /** * Output the type declaration of the property * @@ -360,7 +365,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co Schema target = ModelUtils.isGenerateAliasAsModel() ? p : schema; if (ModelUtils.isArraySchema(target)) { Schema items = ModelUtils.getSchemaItems( schema); - return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">"; + return getSchemaType(target) + "<" + getItemsTypeDeclaration(items) + ">"; } else if (ModelUtils.isMapSchema(target)) { // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines // additionalproperties: true @@ -537,34 +542,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE)); } - public void setArtifactId(String artifactId) { - this.artifactId = artifactId; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setApiSuffix(String apiSuffix) { - this.apiSuffix = apiSuffix; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setTestFolder(String testFolder) { - this.testFolder = testFolder; - } - public Boolean getParcelizeModels() { return parcelizeModels; } @@ -573,26 +550,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co this.parcelizeModels = parcelizeModels; } - public boolean isSerializableModel() { - return serializableModel; - } - - public void setSerializableModel(boolean serializableModel) { - this.serializableModel = serializableModel; - } - - public void setUseJakartaEe(boolean useJakartaEe) { - this.useJakartaEe = useJakartaEe; - } - public boolean nonPublicApi() { return nonPublicApi; } - public void setNonPublicApi(boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - /** * Return the sanitized variable name for enum * @@ -1166,14 +1127,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co setAddProps(schema, m); } - public List getAdditionalModelTypeAnnotations() { - return additionalModelTypeAnnotations; - } - - public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { - this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; - } - @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas() diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index b8ac658b892..af33ba1f36a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -16,9 +16,10 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -48,15 +49,17 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention"; public static final String PACKAGE_NAME = "packageName"; public static final String SRC_BASE_PATH = "srcBasePath"; + @Getter @Setter protected String invokerPackage = "php"; + @Getter @Setter protected String packageName = "php-base"; - protected String artifactVersion = null; - protected String artifactUrl = "https://openapi-generator.tech"; - protected String licenseName = "unlicense"; - protected String developerOrganization = "OpenAPI"; - protected String developerOrganizationUrl = "https://openapi-generator.tech"; - protected String srcBasePath = "lib"; - protected String testBasePath = "test"; + @Setter protected String artifactVersion = null; + @Setter protected String artifactUrl = "https://openapi-generator.tech"; + @Setter protected String licenseName = "unlicense"; + @Setter protected String developerOrganization = "OpenAPI"; + @Setter protected String developerOrganizationUrl = "https://openapi-generator.tech"; + @Setter protected String srcBasePath = "lib"; + @Setter protected String testBasePath = "test"; protected String docsBasePath = "docs"; protected String apiDirName = "Api"; protected String modelDirName = "Model"; @@ -282,10 +285,6 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); } - public String getPackageName() { - return packageName; - } - public String toSrcPath(final String packageName, final String basePath) { String modifiedPackageName = packageName.replace(invokerPackage, ""); String modifiedBasePath = basePath; @@ -417,46 +416,6 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg return toModelName(type); } - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public void setArtifactUrl(String artifactUrl) { - this.artifactUrl = artifactUrl; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public void setDeveloperOrganization(String developerOrganization) { - this.developerOrganization = developerOrganization; - } - - public void setDeveloperOrganizationUrl(String developerOrganizationUrl) { - this.developerOrganizationUrl = developerOrganizationUrl; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setSrcBasePath(String srcBasePath) { - this.srcBasePath = srcBasePath; - } - - public void setTestBasePath(String testBasePath) { - this.testBasePath = testBasePath; - } - public void setParameterNamingConvention(String variableNamingConvention) { this.variableNamingConvention = variableNamingConvention; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index 36b74be9578..13769cad8b1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -41,11 +41,11 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenDiscriminator; import org.openapitools.codegen.CodegenMediaType; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; @@ -66,7 +66,6 @@ import org.slf4j.LoggerFactory; import com.github.curiousoddman.rgxgen.RgxGen; import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; @@ -80,8 +79,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co public static final String MAP_NUMBER_TO = "mapNumberTo"; protected String packageName = "openapi_client"; - protected String packageVersion = "1.0.0"; - protected String projectName; // for setup.py, e.g. petstore-api + @Setter protected String packageVersion = "1.0.0"; + @Setter protected String projectName; // for setup.py, e.g. petstore-api protected boolean hasModelsToImport = Boolean.FALSE; protected String mapNumberTo = "Union[StrictFloat, StrictInt]"; protected Map regexModifiers; @@ -199,6 +198,18 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co */ @Override public String toDefaultValue(Schema p) { + // If the Schema is a $ref, get the default value from the reference. + String ref = ModelUtils.getSimpleRef(p.get$ref()); + if (ref != null) { + Schema referencedSchema = ModelUtils.getSchemas(this.openAPI).get(ref); + if (referencedSchema != null) { + String defaultValue = toDefaultValue(referencedSchema); + if (defaultValue != null) { + return defaultValue; + } + // No default was found for the $ref, so see if one has been defined locally. + } + } if (ModelUtils.isBooleanSchema(p)) { if (p.getDefault() != null) { if (!Boolean.valueOf(p.getDefault().toString())) @@ -218,6 +229,14 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co if (p.getDefault() != null) { return p.getDefault().toString(); } + } else if (ModelUtils.isEnumSchema(p)) { + // Enum must come before string to use enum reference! + if (p.getDefault() != null) { + String defaultValue = String.valueOf(p.getDefault()); + if (defaultValue != null) { + return defaultValue; + } + } } else if (ModelUtils.isStringSchema(p)) { if (p.getDefault() != null) { String defaultValue = String.valueOf(p.getDefault()); @@ -238,7 +257,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co return null; } } - return null; } @@ -679,14 +697,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName); } - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String getTypeDeclaration(Schema p) { p = ModelUtils.unaliasSchema(openAPI, p); @@ -1094,7 +1104,9 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } // remove quote e.g. 'abc' => abc - name = name.substring(1, name.length() - 1); + if (name.startsWith("'") && name.endsWith("'")) { + name = name.substring(1, name.length() - 1); + } if (name.length() == 0) { return "EMPTY"; @@ -1405,7 +1417,13 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co } @Override - public String toEnumDefaultValue(String value, String datatype) { + public String toEnumDefaultValue(CodegenProperty property, String value) { + if (property.isEnumRef) { + // Determine if it's a string by checking if the value has already been encapsulated in single quotes. + String dataType = (value.startsWith("'") && value.endsWith("'")) ? "string" : "int"; + // If the property is an enum reference, then use the fully qualified name with the data type. + return property.dataType + "." + toEnumVariableName(value, dataType); + } return value; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index e6480bac8d3..6062a561bc2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -55,7 +55,6 @@ 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.PathItem.HttpMethod; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; @@ -737,6 +736,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho * does not support this in as natural a way so it needs to convert it. See * https://docs.python.org/2/howto/regex.html#compilation-flags for details. */ + @Override public void postProcessPattern(String pattern, Map vendorExtensions) { if (pattern != null) { int i = pattern.lastIndexOf('/'); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index 617da587f84..fc2d73b3bb2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -18,9 +18,9 @@ package org.openapitools.codegen.languages; import com.github.curiousoddman.rgxgen.RgxGen; import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -48,8 +48,8 @@ public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen imp public static final String MAP_NUMBER_TO = "mapNumberTo"; protected String packageName = "openapi_client"; - protected String packageVersion = "1.0.0"; - protected String projectName; // for setup.py, e.g. petstore-api + @Setter protected String packageVersion = "1.0.0"; + @Setter protected String projectName; // for setup.py, e.g. petstore-api protected boolean hasModelsToImport = Boolean.FALSE; protected String mapNumberTo = "Union[StrictFloat, StrictInt]"; protected Map regexModifiers; @@ -642,14 +642,6 @@ public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen imp additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName); } - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String getTypeDeclaration(Schema p) { p = ModelUtils.unaliasSchema(openAPI, p); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index b3a43938e7b..7ef29f104a7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java index adcc6264fd8..567f6ec4159 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java @@ -2,7 +2,6 @@ package org.openapitools.codegen.languages; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; @@ -148,8 +147,6 @@ public abstract class AbstractRustCodegen extends DefaultCodegen implements Code public enum CasingType {CAMEL_CASE, SNAKE_CASE} - ; - /** * General purpose sanitizing function for Rust identifiers (fields, variables, structs, parameters, etc.).
    * Rules for Rust are fairly simple: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index 9b746340c5b..228728eb42d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -20,10 +20,11 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Escapers; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -48,8 +49,9 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public abstract class AbstractScalaCodegen extends DefaultCodegen { private final Logger LOGGER = LoggerFactory.getLogger(AbstractScalaCodegen.class); - protected String modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase.name(); - protected String invokerPackage = "org.openapitools.client"; + @Getter protected String modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase.name(); + @Setter protected String invokerPackage = "org.openapitools.client"; + @Getter @Setter protected String sourceFolder = "src/main/scala"; protected String appName = "OpenAPI Sample"; protected String appDescription = "A sample openapi server"; @@ -59,7 +61,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { protected String licenseUrl = "http://apache.org/licenses/LICENSE-2.0.html"; protected String apiVersion = "1.0"; protected boolean stripPackageName = true; - protected String dateLibrary = DateLibraries.java8.name(); + @Getter protected String dateLibrary = DateLibraries.java8.name(); protected enum DateLibraries { java8("Java 8 native JSR310 (preferred for JDK 1.8+)"), @@ -255,10 +257,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { throw new IllegalArgumentException("Invalid dateLibrary. Must be 'java8' or 'joda'"); } - public String getDateLibrary() { - return this.dateLibrary; - } - public void setModelPropertyNaming(String naming) { try { this.modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(naming).name(); @@ -269,10 +267,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { } } - public String getModelPropertyNaming() { - return this.modelPropertyNaming; - } - @Override public String toVarName(String name) { @@ -316,14 +310,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { } } - public String getSourceFolder() { - return sourceFolder; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - @Override public String escapeReservedWord(String name) { if (this.reservedWordsMappings().containsKey(name)) { @@ -614,10 +600,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { return operationId; } - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SCALA; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index e751790abcf..cc5a4d31921 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -18,10 +18,10 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.Nullable; @@ -240,14 +240,18 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @SuppressWarnings("squid:S5164") protected static final ThreadLocal SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT)); - protected MODEL_PROPERTY_NAMING_TYPE modelPropertyNaming = MODEL_PROPERTY_NAMING_TYPE.original; + @Getter protected MODEL_PROPERTY_NAMING_TYPE modelPropertyNaming = MODEL_PROPERTY_NAMING_TYPE.original; protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase; - protected PARAM_NAMING_TYPE paramNaming = PARAM_NAMING_TYPE.camelCase; + @Getter protected PARAM_NAMING_TYPE paramNaming = PARAM_NAMING_TYPE.camelCase; protected boolean enumPropertyNamingReplaceSpecialChar = false; + @Getter @Setter protected Boolean supportsES6 = false; + @Getter @Setter protected Boolean nullSafeAdditionalProps = false; protected HashSet languageGenericTypes; + @Getter @Setter protected String npmName = null; + @Getter @Setter protected String npmVersion = "1.0.0"; protected String enumSuffix = "Enum"; @@ -625,7 +629,11 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp public String getTypeDeclaration(Schema p) { if (ModelUtils.isArraySchema(p)) { Schema items = ModelUtils.getSchemaItems(p); - return getSchemaType(p) + "<" + getTypeDeclaration(unaliasSchema(items)) + ">"; + String postfix = ""; + if (Boolean.TRUE.equals(items.getNullable())) { + postfix = " | null"; + } + return getSchemaType(p) + "<" + getTypeDeclaration(unaliasSchema(items)) + postfix + ">"; } else if (ModelUtils.isMapSchema(p)) { Schema inner = getSchemaAdditionalProperties(p); String nullSafeSuffix = getNullSafeAdditionalProps() ? " | undefined" : ""; @@ -827,14 +835,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } } - public MODEL_PROPERTY_NAMING_TYPE getModelPropertyNaming() { - return modelPropertyNaming; - } - - public PARAM_NAMING_TYPE getParamNaming() { - return paramNaming; - } - private String getNameUsingParamNaming(String name) { switch (getParamNaming()) { case original: @@ -1037,38 +1037,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp return result; } - public void setSupportsES6(Boolean value) { - supportsES6 = value; - } - - public Boolean getSupportsES6() { - return supportsES6; - } - - public Boolean getNullSafeAdditionalProps() { - return nullSafeAdditionalProps; - } - - public void setNullSafeAdditionalProps(Boolean value) { - nullSafeAdditionalProps = value; - } - - public String getNpmName() { - return npmName; - } - - public void setNpmName(String npmName) { - this.npmName = npmName; - } - - public String getNpmVersion() { - return npmVersion; - } - - public void setNpmVersion(String npmVersion) { - this.npmVersion = npmVersion; - } - private void setDiscriminatorValue(CodegenModel model, String baseName, String value) { for (CodegenProperty prop : model.allVars) { if (prop.baseName.equals(baseName)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index 9436c7482c9..b94c939f8e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -17,8 +17,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -40,21 +41,26 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi public static final String ANDROID_GRADLE_VERSION = "androidGradleVersion"; public static final String ANDROID_SDK_VERSION = "androidSdkVersion"; public static final String ANDROID_BUILD_TOOLS_VERSION = "androidBuildToolsVersion"; + @Getter @Setter protected String invokerPackage = "org.openapitools.client"; - protected String groupId = "org.openapitools"; - protected String artifactId = "openapi-android-client"; - protected String artifactVersion = "1.0.0"; + @Setter protected String groupId = "org.openapitools"; + @Setter protected String artifactId = "openapi-android-client"; + @Setter protected String artifactVersion = "1.0.0"; protected String projectFolder = "src/main"; - protected String sourceFolder = projectFolder + "/java"; + @Setter protected String sourceFolder = projectFolder + "/java"; + @Getter @Setter protected Boolean useAndroidMavenGradlePlugin = true; + @Getter @Setter protected String androidGradleVersion; + @Getter @Setter protected String androidSdkVersion; + @Getter @Setter protected String androidBuildToolsVersion; - protected Boolean serializableModel = false; + @Setter protected Boolean serializableModel = false; // requestPackage and authPackage are used by the "volley" template/library - protected String requestPackage = "org.openapitools.client.request"; - protected String authPackage = "org.openapitools.client.auth"; + @Setter protected String requestPackage = "org.openapitools.client.request"; + @Setter protected String authPackage = "org.openapitools.client.auth"; protected String gradleWrapperPackage = "gradle.wrapper"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -453,8 +459,6 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi if (additionalProperties.containsKey(USE_ANDROID_MAVEN_GRADLE_PLUGIN)) { this.setUseAndroidMavenGradlePlugin(Boolean.valueOf((String) additionalProperties .get(USE_ANDROID_MAVEN_GRADLE_PLUGIN))); - } else { - additionalProperties.put(USE_ANDROID_MAVEN_GRADLE_PLUGIN, useAndroidMavenGradlePlugin); } if (additionalProperties.containsKey(ANDROID_GRADLE_VERSION)) { @@ -477,8 +481,9 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi this.setSerializableModel(Boolean.valueOf(additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL).toString())); } - // need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string + // need to put back boolean properties into additionalProperties as the values in additionalProperties are strings additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); + additionalProperties.put(USE_ANDROID_MAVEN_GRADLE_PLUGIN, useAndroidMavenGradlePlugin); //make api and model doc path available in mustache template additionalProperties.put("apiDocPath", apiDocPath); @@ -498,74 +503,6 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi } } - public Boolean getUseAndroidMavenGradlePlugin() { - return useAndroidMavenGradlePlugin; - } - - public String getAndroidGradleVersion() { - return androidGradleVersion; - } - - public String getAndroidSdkVersion() { - return androidSdkVersion; - } - - public String getAndroidBuildToolsVersion() { - return androidBuildToolsVersion; - } - - public void setUseAndroidMavenGradlePlugin(Boolean useAndroidMavenGradlePlugin) { - this.useAndroidMavenGradlePlugin = useAndroidMavenGradlePlugin; - } - - public void setAndroidGradleVersion(String androidGradleVersion) { - this.androidGradleVersion = androidGradleVersion; - } - - public void setAndroidSdkVersion(String androidSdkVersion) { - this.androidSdkVersion = androidSdkVersion; - } - - public void setAndroidBuildToolsVersion(String androidBuildToolsVersion) { - this.androidBuildToolsVersion = androidBuildToolsVersion; - } - - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public void setRequestPackage(String requestPackage) { - this.requestPackage = requestPackage; - } - - public void setAuthPackage(String authPackage) { - this.authPackage = authPackage; - } - - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - public void setArtifactId(String artifactId) { - this.artifactId = artifactId; - } - - public void setArtifactVersion(String artifactVersion) { - this.artifactVersion = artifactVersion; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setSerializableModel(Boolean serializableModel) { - this.serializableModel = serializableModel; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -586,7 +523,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); - // supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); supportingFiles.add(new SupportingFile("build.mustache", "", "build.gradle")); supportingFiles.add(new SupportingFile("manifest.mustache", projectFolder, "AndroidManifest.xml")); supportingFiles.add(new SupportingFile("apiInvoker.mustache", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java index 7db30070252..167d1f08678 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java @@ -18,8 +18,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenProperty; @@ -45,9 +45,9 @@ public class ApexClientCodegen extends AbstractApexCodegen { private static final String NAMED_CREDENTIAL = "namedCredential"; private final Logger LOGGER = LoggerFactory.getLogger(ApexClientCodegen.class); private String classPrefix = "OAS"; - private String apiVersion = "42.0"; + @Setter private String apiVersion = "42.0"; private String buildMethod = "sfdx"; - private String namedCredential; + @Setter private String namedCredential; private String srcPath = "force-app/main/default/"; private String sfdxConfigPath = "config/"; private HashMap primitiveDefaults = new HashMap<>(); @@ -263,20 +263,12 @@ public class ApexClientCodegen extends AbstractApexCodegen { this.buildMethod = buildMethod; } - public void setNamedCredential(String namedCredential) { - this.namedCredential = namedCredential; - } - public void setClassPrefix(String classPrefix) { // the best thing we can do without namespacing in Apex modelNamePrefix = classPrefix; this.classPrefix = classPrefix; } - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - private String toApiVersion(String apiVersion) { if (apiVersion.matches("^\\d{2}(\\.0)?$")) { return apiVersion.substring(0, 2) + ".0"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java index af1e53ab7ab..abd15101b14 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AsciidocDocumentationCodegen.java @@ -16,6 +16,8 @@ package org.openapitools.codegen.languages; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import java.io.File; @@ -153,10 +155,15 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code protected String groupId = "org.openapitools"; protected String artifactId = "openapi-client"; protected String artifactVersion = "1.0.0"; + @Getter @Setter protected boolean headerAttributes = true; + @Getter @Setter protected boolean useIntroduction = false; + @Getter @Setter protected boolean skipExamples = false; + @Getter @Setter protected boolean useMethodAndPath = false; + @Getter @Setter protected boolean useTableTitles = false; private IncludeMarkupLambda includeSpecMarkupLambda; @@ -281,46 +288,6 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code return input; // just return the original string } - public boolean isHeaderAttributes() { - return headerAttributes; - } - - public void setHeaderAttributes(boolean headerAttributes) { - this.headerAttributes = headerAttributes; - } - - public boolean isUseIntroduction() { - return useIntroduction; - } - - public void setUseIntroduction(boolean useIntroduction) { - this.useIntroduction = useIntroduction; - } - - public boolean isSkipExamples() { - return skipExamples; - } - - public void setSkipExamples(boolean skipExamples) { - this.skipExamples = skipExamples; - } - - public boolean isUseMethodAndPath() { - return useMethodAndPath; - } - - public void setUseMethodAndPath(boolean useMethodAndPath) { - this.useMethodAndPath = useMethodAndPath; - } - - public boolean isUseTableTitles() { - return useTableTitles; - } - - public void setUseTableTitles(boolean useTableTitles) { - this.useTableTitles = useTableTitles; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java index b649982f204..5a0f5e5d9af 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetServerCodegen.java @@ -21,6 +21,7 @@ import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -64,7 +65,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { public static final String USE_DEFAULT_ROUTING = "useDefaultRouting"; public static final String NEWTONSOFT_VERSION = "newtonsoftVersion"; - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; private String userSecretsGuid = randomUUID().toString(); protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class); @@ -185,7 +186,9 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { aspnetCoreVersion.addEnum("3.1", "ASP.NET Core 3.1"); aspnetCoreVersion.addEnum("5.0", "ASP.NET Core 5.0"); aspnetCoreVersion.addEnum("6.0", "ASP.NET Core 6.0"); - aspnetCoreVersion.setDefault("3.1"); + aspnetCoreVersion.addEnum("7.0", "ASP.NET Core 7.0"); + aspnetCoreVersion.addEnum("8.0", "ASP.NET Core 8.0"); + aspnetCoreVersion.setDefault("8.0"); aspnetCoreVersion.setOptValue(aspnetCoreVersion.getDefault()); cliOptions.add(aspnetCoreVersion); @@ -193,7 +196,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { swashbuckleVersion.addEnum("4.0.0", "Swashbuckle 4.0.0"); swashbuckleVersion.addEnum("5.0.0", "Swashbuckle 5.0.0"); swashbuckleVersion.addEnum("6.4.0", "Swashbuckle 6.4.0"); - swashbuckleVersion.setDefault("3.0.0"); + swashbuckleVersion.setDefault("6.4.0"); swashbuckleVersion.setOptValue(swashbuckleVersion.getDefault()); cliOptions.add(swashbuckleVersion); @@ -307,11 +310,6 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { "DateTime", "DateOnly", "DateTimeOffset", "Guid")); } - @Override - protected Set getValueTypes() { - return new HashSet<>(Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double", "DateTime", "DateOnly", "DateTimeOffset", "Guid")); - } - @Override public CodegenType getTag() { return CodegenType.SERVER; @@ -431,7 +429,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("typeConverter.mustache", packageFolder + File.separator + "Converters", "CustomEnumConverter.cs")); } - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { + if (!aspnetCoreVersion.getOptValue().startsWith("2.")) { supportingFiles.add(new SupportingFile("OpenApi" + File.separator + "TypeExtensions.mustache", packageFolder + File.separator + "OpenApi", "TypeExtensions.cs")); } @@ -472,10 +470,6 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { return additionalProperties.containsKey(NET_60_OR_LATER); } - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - @Override public String apiFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Controllers"; @@ -689,7 +683,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { private void setAspnetCoreVersion(String packageFolder) { setCliOption(aspnetCoreVersion); - if (aspnetCoreVersion.getOptValue().startsWith("3.") || aspnetCoreVersion.getOptValue().startsWith("5.0") || aspnetCoreVersion.getOptValue().startsWith("6.")) { + if (!aspnetCoreVersion.getOptValue().startsWith("2.")) { compatibilityVersion = null; } else if ("2.0".equals(aspnetCoreVersion.getOptValue())) { compatibilityVersion = null; @@ -706,6 +700,8 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen { private String determineTemplateVersion(String frameworkVersion) { switch (frameworkVersion) { + case "8.0": + case "7.0": case "6.0": case "5.0": case "3.1": diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index a38e556de49..5a989fe113a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -22,10 +22,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.servers.Server; +import lombok.Setter; import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -44,14 +44,14 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { protected String apiVersion = "1.0.0"; - protected String curlOptions; - protected boolean processMarkdown = false; - protected String scriptName = "client.sh"; - protected boolean generateBashCompletion = false; - protected boolean generateZshCompletion = false; - protected String hostEnvironmentVariable; - protected String basicAuthEnvironmentVariable; - protected String apiKeyAuthEnvironmentVariable; + @Setter protected String curlOptions; + @Setter protected boolean processMarkdown = false; + @Setter protected String scriptName = "client.sh"; + @Setter protected boolean generateBashCompletion = false; + @Setter protected boolean generateZshCompletion = false; + @Setter protected String hostEnvironmentVariable; + @Setter protected String basicAuthEnvironmentVariable; + @Setter protected String apiKeyAuthEnvironmentVariable; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -333,40 +333,6 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { "Dockerfile.mustache", "", "Dockerfile")); } - public void setCurlOptions(String curlOptions) { - this.curlOptions = curlOptions; - } - - public void setProcessMarkdown(boolean processMarkdown) { - this.processMarkdown = processMarkdown; - } - - public void setScriptName(String scriptName) { - this.scriptName = scriptName; - } - - public void setGenerateBashCompletion(boolean generateBashCompletion) { - this.generateBashCompletion = generateBashCompletion; - } - - public void setGenerateZshCompletion(boolean generateZshCompletion) { - this.generateZshCompletion = generateZshCompletion; - } - - public void setHostEnvironmentVariable(String hostEnvironmentVariable) { - this.hostEnvironmentVariable = hostEnvironmentVariable; - } - - public void setBasicAuthEnvironmentVariable(String - basicAuthEnvironmentVariable) { - this.basicAuthEnvironmentVariable = basicAuthEnvironmentVariable; - } - - public void setApiKeyAuthEnvironmentVariable(String - apiKeyAuthEnvironmentVariable) { - this.apiKeyAuthEnvironmentVariable = apiKeyAuthEnvironmentVariable; - } - /** * Escapes a reserved word as defined in the `reservedWords` array. Handle diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index b0183cc8a8e..96352d244c2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -18,12 +18,11 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.servers.Server; -import org.mozilla.javascript.optimizer.Codegen; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -94,8 +93,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { ); private static FrameworkStrategy latestFramework = frameworkStrategies.get(frameworkStrategies.size() - 1); protected final Map frameworks; - protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; - protected String clientPackage = "Client"; + @Setter protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter protected String clientPackage = "Client"; protected String authFolder = "Auth"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -113,16 +112,27 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { protected boolean supportsFileParameters = Boolean.TRUE; protected boolean supportsDateOnly = Boolean.FALSE; - protected boolean validatable = Boolean.TRUE; - protected boolean equatable = Boolean.FALSE; + @Setter protected boolean validatable = Boolean.TRUE; + @Setter protected boolean equatable = Boolean.FALSE; // By default, generated code is considered public + @Getter @Setter protected boolean nonPublicApi = Boolean.FALSE; + private static final String OPERATION_PARAMETER_SORTING_KEY = "operationParameterSorting"; + private static final String MODEL_PROPERTY_SORTING_KEY = "modelPropertySorting"; + enum SortingMethod { + DEFAULT, + ALPHABETICAL, + LEGACY + } + private SortingMethod operationParameterSorting = SortingMethod.LEGACY; + private SortingMethod modelPropertySorting = SortingMethod.LEGACY; + protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; protected String releaseNote = "Minor update"; - protected String licenseId; - protected String packageTags; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected String licenseId; + @Setter protected String packageTags; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup protected boolean needsCustomHttpMethod = false; protected boolean needsUriBuilder = false; @@ -218,6 +228,14 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { "Enumerations with string values will start from 0 when true, 1 when false. If not set, enumerations with string values will start from 0 if the first value is 'unknown', case insensitive.", null); + addOption(CSharpClientCodegen.OPERATION_PARAMETER_SORTING_KEY, + "One of legacy, alphabetical, default (only `generichost` library supports this option).", + this.operationParameterSorting.toString().toLowerCase(Locale.ROOT)); + + addOption(CSharpClientCodegen.MODEL_PROPERTY_SORTING_KEY, + "One of legacy, alphabetical, default (only `generichost` library supports this option).", + this.modelPropertySorting.toString().toLowerCase(Locale.ROOT)); + CliOption framework = new CliOption( CodegenConstants.DOTNET_FRAMEWORK, CodegenConstants.DOTNET_FRAMEWORK_DESC @@ -408,7 +426,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel codegenModel = super.fromModel(name, model); if (allDefinitions != null && codegenModel != null && codegenModel.parent != null) { - final Schema parentModel = allDefinitions.get(toModelName(codegenModel.parent)); + final Schema parentModel = allDefinitions.get(toModelName(codegenModel.parent)); if (parentModel != null) { final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel); if (codegenModel.hasEnums) { @@ -426,13 +444,11 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } } - CodegenProperty last = null; for (final CodegenProperty property : parentCodegenModel.vars) { // helper list of parentVars simplifies templating if (!propertyHash.containsKey(property.name)) { final CodegenProperty parentVar = property.clone(); parentVar.isInherited = true; - last = parentVar; LOGGER.debug("adding parent variable {}", property.name); codegenModel.parentVars.add(parentVar); } @@ -455,21 +471,42 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { // avoid breaking changes if (GENERICHOST.equals(getLibrary()) && codegenModel != null) { - Collections.sort(codegenModel.vars, propertyComparatorByName); - Collections.sort(codegenModel.allVars, propertyComparatorByName); - Collections.sort(codegenModel.requiredVars, propertyComparatorByName); - Collections.sort(codegenModel.optionalVars, propertyComparatorByName); - Collections.sort(codegenModel.readOnlyVars, propertyComparatorByName); - Collections.sort(codegenModel.readWriteVars, propertyComparatorByName); - Collections.sort(codegenModel.parentVars, propertyComparatorByName); + if (this.modelPropertySorting == SortingMethod.LEGACY) { + Collections.sort(codegenModel.vars, propertyComparatorByName); + Collections.sort(codegenModel.allVars, propertyComparatorByName); + Collections.sort(codegenModel.requiredVars, propertyComparatorByName); + Collections.sort(codegenModel.optionalVars, propertyComparatorByName); + Collections.sort(codegenModel.readOnlyVars, propertyComparatorByName); + Collections.sort(codegenModel.readWriteVars, propertyComparatorByName); + Collections.sort(codegenModel.parentVars, propertyComparatorByName); - Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefault); - Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy); + } + else { + if (this.modelPropertySorting == SortingMethod.ALPHABETICAL) { + Collections.sort(codegenModel.vars, propertyComparatorByName); + Collections.sort(codegenModel.allVars, propertyComparatorByName); + Collections.sort(codegenModel.requiredVars, propertyComparatorByName); + Collections.sort(codegenModel.optionalVars, propertyComparatorByName); + Collections.sort(codegenModel.readOnlyVars, propertyComparatorByName); + Collections.sort(codegenModel.readWriteVars, propertyComparatorByName); + Collections.sort(codegenModel.parentVars, propertyComparatorByName); + } + + Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefault); + Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefault); + } } return codegenModel; @@ -482,6 +519,18 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } }; + public static Comparator propertyComparatorByNotNullableRequiredNoDefaultLegacy = new Comparator() { + @Override + public int compare(CodegenProperty one, CodegenProperty another) { + if (one.isNullable == another.isNullable && one.required == another.required && (one.defaultValue == null) == (another.defaultValue == null)) + return 0; + else if (!one.isNullable && one.required && one.defaultValue == null) + return -1; + else + return 1; + } + }; + public static Comparator propertyComparatorByNotNullableRequiredNoDefault = Comparator.comparing(p -> p.isNullable || !p.required || p.defaultValue != null); @@ -492,6 +541,16 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } }; + public static Comparator parameterComparatorByName = new Comparator() { + @Override + public int compare(CodegenParameter one, CodegenParameter another) { + return one.paramName.compareTo(another.paramName); + } + }; + + public static Comparator parameterComparatorByNotNullableRequiredNoDefault = + Comparator.comparing(p -> p.isNullable || !p.required || p.defaultValue != null); + public static Comparator parameterComparatorByDefaultValue = new Comparator() { @Override public int compare(CodegenParameter one, CodegenParameter another) { @@ -580,14 +639,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { return CodegenType.CLIENT; } - public boolean isNonPublicApi() { - return nonPublicApi; - } - - public void setNonPublicApi(final boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - @Override public String modelDocFileFolder() { if (GENERICHOST.equals(getLibrary())) { @@ -670,6 +721,14 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { setLicenseId((String) additionalProperties.get(CodegenConstants.LICENSE_ID)); } + if (additionalProperties.containsKey(CSharpClientCodegen.OPERATION_PARAMETER_SORTING_KEY)) { + setOperationParameterSorting((String) additionalProperties.get(CSharpClientCodegen.OPERATION_PARAMETER_SORTING_KEY)); + } + + if (additionalProperties.containsKey(CSharpClientCodegen.MODEL_PROPERTY_SORTING_KEY)) { + setModelPropertySorting((String) additionalProperties.get(CSharpClientCodegen.MODEL_PROPERTY_SORTING_KEY)); + } + if (additionalProperties.containsKey(CodegenConstants.API_NAME)) { setApiName((String) additionalProperties.get(CodegenConstants.API_NAME)); } else { @@ -686,8 +745,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { if (GENERICHOST.equals(getLibrary())) { setLibrary(GENERICHOST); additionalProperties.put("useGenericHost", true); - // all c# libraries should be doing this, but we only do it here to avoid breaking changes - this.setSortModelPropertiesByRequiredFlag(true); } else if (RESTSHARP.equals(getLibrary())) { additionalProperties.put("useRestSharp", true); needsCustomHttpMethod = true; @@ -860,10 +917,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { this.useSourceGeneration = useSourceGeneration; } - public void setClientPackage(String clientPackage) { - this.clientPackage = clientPackage; - } - @Override public CodegenOperation fromOperation(String path, String httpMethod, @@ -875,30 +928,58 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { return op; } - Collections.sort(op.allParams, parameterComparatorByDataType); - Collections.sort(op.bodyParams, parameterComparatorByDataType); - Collections.sort(op.pathParams, parameterComparatorByDataType); - Collections.sort(op.queryParams, parameterComparatorByDataType); - Collections.sort(op.headerParams, parameterComparatorByDataType); - Collections.sort(op.implicitHeadersParams, parameterComparatorByDataType); - Collections.sort(op.formParams, parameterComparatorByDataType); - Collections.sort(op.cookieParams, parameterComparatorByDataType); - Collections.sort(op.requiredParams, parameterComparatorByDataType); - Collections.sort(op.optionalParams, parameterComparatorByDataType); - Collections.sort(op.notNullableParams, parameterComparatorByDataType); + if (this.operationParameterSorting == SortingMethod.LEGACY) { + Collections.sort(op.allParams, parameterComparatorByDataType); + Collections.sort(op.bodyParams, parameterComparatorByDataType); + Collections.sort(op.pathParams, parameterComparatorByDataType); + Collections.sort(op.queryParams, parameterComparatorByDataType); + Collections.sort(op.headerParams, parameterComparatorByDataType); + Collections.sort(op.implicitHeadersParams, parameterComparatorByDataType); + Collections.sort(op.formParams, parameterComparatorByDataType); + Collections.sort(op.cookieParams, parameterComparatorByDataType); + Collections.sort(op.requiredParams, parameterComparatorByDataType); + Collections.sort(op.optionalParams, parameterComparatorByDataType); + Collections.sort(op.notNullableParams, parameterComparatorByDataType); - Comparator comparator = parameterComparatorByRequired.thenComparing(parameterComparatorByDefaultValue); - Collections.sort(op.allParams, comparator); - Collections.sort(op.bodyParams, comparator); - Collections.sort(op.pathParams, comparator); - Collections.sort(op.queryParams, comparator); - Collections.sort(op.headerParams, comparator); - Collections.sort(op.implicitHeadersParams, comparator); - Collections.sort(op.formParams, comparator); - Collections.sort(op.cookieParams, comparator); - Collections.sort(op.requiredParams, comparator); - Collections.sort(op.optionalParams, comparator); - Collections.sort(op.notNullableParams, comparator); + Comparator comparator = parameterComparatorByRequired.thenComparing(parameterComparatorByDefaultValue); + Collections.sort(op.allParams, comparator); + Collections.sort(op.bodyParams, comparator); + Collections.sort(op.pathParams, comparator); + Collections.sort(op.queryParams, comparator); + Collections.sort(op.headerParams, comparator); + Collections.sort(op.implicitHeadersParams, comparator); + Collections.sort(op.formParams, comparator); + Collections.sort(op.cookieParams, comparator); + Collections.sort(op.requiredParams, comparator); + Collections.sort(op.optionalParams, comparator); + Collections.sort(op.notNullableParams, comparator); + } else { + if (this.operationParameterSorting == SortingMethod.ALPHABETICAL) { + Collections.sort(op.allParams, parameterComparatorByName); + Collections.sort(op.bodyParams, parameterComparatorByName); + Collections.sort(op.pathParams, parameterComparatorByName); + Collections.sort(op.queryParams, parameterComparatorByName); + Collections.sort(op.headerParams, parameterComparatorByName); + Collections.sort(op.implicitHeadersParams, parameterComparatorByName); + Collections.sort(op.formParams, parameterComparatorByName); + Collections.sort(op.cookieParams, parameterComparatorByName); + Collections.sort(op.requiredParams, parameterComparatorByName); + Collections.sort(op.optionalParams, parameterComparatorByName); + Collections.sort(op.notNullableParams, parameterComparatorByName); + } + + Collections.sort(op.allParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.bodyParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.pathParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.queryParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.headerParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.implicitHeadersParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.formParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.cookieParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.requiredParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.optionalParams, parameterComparatorByNotNullableRequiredNoDefault); + Collections.sort(op.notNullableParams, parameterComparatorByNotNullableRequiredNoDefault); + } return op; } @@ -1062,17 +1143,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { public void setOptionalProjectFileFlag(boolean flag) { this.optionalProjectFileFlag = flag; } - - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - - // TODO: this does the same as super - @Override - public void setPackageName(String packageName) { - this.packageName = packageName; - } - + /** * Sets the api name. This value must be a valid class name. * @@ -1085,10 +1156,20 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { this.apiName = apiName; } - // TODO: this does the same as super - @Override - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; + public void setOperationParameterSorting(String operationParameterSorting) { + if (operationParameterSorting == null) { + operationParameterSorting = "DEFAULT"; + } + + this.operationParameterSorting = SortingMethod.valueOf(operationParameterSorting.toUpperCase(Locale.ROOT)); + } + + public void setModelPropertySorting(String modelPropertySorting) { + if (modelPropertySorting == null) { + modelPropertySorting = "DEFAULT"; + } + + this.modelPropertySorting = SortingMethod.valueOf(modelPropertySorting.toUpperCase(Locale.ROOT)); } public void setSupportsAsync(Boolean supportsAsync) { @@ -1153,35 +1234,15 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { .collect(Collectors.joining(";")); } - public void setValidatable(boolean validatable) { - this.validatable = validatable; - } - - public void setEquatable(boolean equatable) { - this.equatable = equatable; - } - public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } - public void setLicenseId(String licenseId) { - this.licenseId = licenseId; - } - @Override public void setReleaseNote(String releaseNote) { this.releaseNote = releaseNote; } - public void setPackageTags(String packageTags) { - this.packageTags = packageTags; - } - - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } @@ -1323,8 +1384,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @SuppressWarnings("Duplicates") private static abstract class FrameworkStrategy { - private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); - static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3", "net7.0") { }; static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4", "net7.0") { @@ -1365,22 +1424,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { this.isNetStandard = isNetStandard; } - protected void configureAdditionalProperties(final Map properties) { - properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.name); - - // not intended to be user-settable - properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier()); - properties.put(TARGET_FRAMEWORK_VERSION, this.getTargetFrameworkVersion()); - properties.putIfAbsent(MCS_NET_VERSION_KEY, "4.6-api"); - - properties.put(NET_STANDARD, this.isNetStandard); - if (properties.containsKey(SUPPORTS_UWP)) { - LOGGER.warn(".NET {} generator does not support the UWP option. Use the csharp generator instead.", - this.name); - properties.remove(SUPPORTS_UWP); - } - } - protected String getNugetFrameworkIdentifier() { return this.name.toLowerCase(Locale.ROOT); } @@ -1496,7 +1539,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { @Override public String toInstantiationType(Schema schema) { if (ModelUtils.isMapSchema(schema)) { - Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); + Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); String inner = getSchemaType(additionalProperties); if (ModelUtils.isMapSchema(additionalProperties)) { inner = toInstantiationType(additionalProperties); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpFunctionsServerCodegen.java index 9aaffde2c10..4871f6d44fd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpFunctionsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpFunctionsServerCodegen.java @@ -20,6 +20,7 @@ import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -55,7 +56,7 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen { public static final String NEWTONSOFT_VERSION = "newtonsoftVersion"; public static final String NET_60_OR_LATER = "net60OrLater"; - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; private String userSecretsGuid = randomUUID().toString(); protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class); @@ -388,10 +389,6 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen { this.setTypeMapping(); } - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - @Override public String apiFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Functions"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpReducedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpReducedClientCodegen.java index 44c30344ccc..86652a8520c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpReducedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpReducedClientCodegen.java @@ -18,9 +18,9 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -75,7 +75,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen { ); private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; protected final Map frameworks; - protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; protected String clientPackage = "Org.OpenAPITools.Client"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -91,16 +91,17 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen { protected boolean supportsAsync = Boolean.TRUE; protected boolean netStandard = Boolean.FALSE; - protected boolean validatable = Boolean.TRUE; + @Setter protected boolean validatable = Boolean.TRUE; protected Map regexModifiers; // By default, generated code is considered public + @Getter @Setter protected boolean nonPublicApi = Boolean.FALSE; protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; protected String releaseNote = "Minor update"; - protected String licenseId; - protected String packageTags; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected String licenseId; + @Setter protected String packageTags; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup protected boolean needsCustomHttpMethod = false; protected boolean needsUriBuilder = false; @@ -484,14 +485,6 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen { return CodegenType.CLIENT; } - public boolean isNonPublicApi() { - return nonPublicApi; - } - - public void setNonPublicApi(final boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - @Override public String modelDocFileFolder() { return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); @@ -753,10 +746,6 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen { this.optionalProjectFileFlag = flag; } - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - @Override public void setPackageName(String packageName) { this.packageName = packageName; @@ -821,31 +810,15 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen { .collect(Collectors.joining(";")); } - public void setValidatable(boolean validatable) { - this.validatable = validatable; - } - public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } - public void setLicenseId(String licenseId) { - this.licenseId = licenseId; - } - @Override public void setReleaseNote(String releaseNote) { this.releaseNote = releaseNote; } - public void setPackageTags(String packageTags) { - this.packageTags = packageTags; - } - - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java index 8af296e05e0..93aeaf744d6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java @@ -21,7 +21,6 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -199,6 +198,10 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi @Override public String toModelName(String name) { + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + return dashize(name); } @@ -340,11 +343,19 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi @Override public String toParamName(String name) { + if (parameterNameMapping.containsKey(name)) { + return parameterNameMapping.get(name); + } + return toVarName(name); } @Override public String toVarName(String name) { + if (nameMapping.containsKey(name)) { + return nameMapping.get(name); + } + name = name.replaceAll("[^a-zA-Z0-9_-]+", ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. return name; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index b4ff2e32d2a..52f7eff818f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 1d1084596b2..fe14ee6a86c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -356,13 +356,17 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { * data types for Header and Query parameters. * @param param CodegenParameter to be modified. */ - private static void postProcessSingleParam(CodegenParameter param) { + private void postProcessSingleParam(CodegenParameter param) { //TODO: This changes the info about the real type but it is needed to parse the header params if (param.isHeaderParam) { param.dataType = "std::optional"; param.baseType = "std::optional"; } else if (param.isQueryParam) { - param.dataType = "std::optional<" + param.dataType + ">"; + String dataTypeWithNamespace = param.isPrimitiveType ? param.dataType : prefixWithNameSpaceIfNeeded(param.dataType); + + param.dataType = "std::optional<" + dataTypeWithNamespace + ">"; + param.isOptional = true; + if (!param.isPrimitiveType) { param.baseType = "std::optional<" + param.baseType + ">"; } @@ -434,8 +438,17 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { return toModelName(openAPIType); } + return prefixWithNameSpaceIfNeeded(openAPIType); + } + + /** + * Prefix an open API type with a namespace or not, depending of its current type and if it is on a list to avoid it. + * @param openAPIType Open API Type. + * @return type prefixed with the namespace or not. + */ + private String prefixWithNameSpaceIfNeeded(String openAPIType) { // Some types might not support namespace - if (this.openAPITypesWithoutModelNamespace.contains(openAPIType)) { + if (this.openAPITypesWithoutModelNamespace.contains(openAPIType) || openAPIType.startsWith("std::")) { return openAPIType; } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java index 76e66f62792..86dc9997010 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtAbstractCodegen.java @@ -1,6 +1,5 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; @@ -367,11 +366,6 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements return objs; } - @Override - public String toEnumValue(String value, String datatype) { - return escapeText(value); - } - @Override public boolean isDataTypeString(String dataType) { return "QString".equals(dataType); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java index 7f4a0ad31c5..048e6ebf949 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; @@ -38,7 +39,7 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC protected String packageName = ""; // source folder where to write the files protected String sourceFolder = "client"; - protected boolean optionalProjectFileFlag = true; + @Setter protected boolean optionalProjectFileFlag = true; public CppQtClientCodegen() { super(); @@ -224,10 +225,6 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC return modelNamePrefix + sanitizeName(camelize(name)) + "Api"; } - public void setOptionalProjectFileFlag(boolean flag) { - this.optionalProjectFileFlag = flag; - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { objs = super.postProcessOperationsWithModels(objs, allModels); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index 19e8dfdf504..a802ea26f87 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -105,7 +105,8 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { GlobalFeature.MultiServer ) .includeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.oneOf ) .excludeParameterFeatures( ParameterFeature.Cookie diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index 5808719fd55..55d383a6b26 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerDeprecatedCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerDeprecatedCodegen.java index cd79aa682b5..603e81e0030 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerDeprecatedCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerDeprecatedCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java index 54aa49b5188..c316f1c7a31 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -16,8 +16,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.CodegenModel; @@ -52,7 +52,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { // Will be included using the <> syntax, not used in Unreal's coding convention protected Set systemIncludes = new HashSet<>(); protected String cppNamespace = unrealModuleName; - protected boolean optionalProjectFileFlag = true; + @Setter protected boolean optionalProjectFileFlag = true; public CppUE4ClientCodegen() { super(); @@ -246,10 +246,6 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { } } - public void setOptionalProjectFileFlag(boolean flag) { - this.optionalProjectFileFlag = flag; - } - // override to post-process any model properties @Override @SuppressWarnings("unused") @@ -561,17 +557,6 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { return modelNamePrefix + camelize(type) + "Api"; } - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public String toBooleanGetter(String name) { return "Is" + getterAndSetterCapitalize(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index ac13c05d318..cd7c18145c6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -16,8 +16,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -50,17 +50,17 @@ public class CrystalClientCodegen extends DefaultCodegen { private static final String NUMERIC_ENUM_PREFIX = "N"; protected static int emptyMethodNameCounter = 0; - protected String shardName = "openapi_client"; - protected String moduleName = "OpenAPIClient"; - protected String shardVersion = "1.0.0"; + @Setter protected String shardName = "openapi_client"; + @Setter protected String moduleName = "OpenAPIClient"; + @Setter protected String shardVersion = "1.0.0"; protected String specFolder = "spec"; protected String srcFolder = "src"; - protected String shardLicense = "unlicense"; - protected String shardHomepage = "https://openapitools.org"; - protected String shardSummary = "A Crystal SDK for the REST API"; - protected String shardDescription = "This shard maps to a REST API"; - protected String shardAuthor = ""; - protected String shardAuthorEmail = ""; + @Setter protected String shardLicense = "unlicense"; + @Setter protected String shardHomepage = "https://openapitools.org"; + @Setter protected String shardSummary = "A Crystal SDK for the REST API"; + @Setter protected String shardDescription = "This shard maps to a REST API"; + @Setter protected String shardAuthor = ""; + @Setter protected String shardAuthorEmail = ""; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected List primitiveTypes = new ArrayList(); @@ -547,42 +547,6 @@ public class CrystalClientCodegen extends DefaultCodegen { return shardName + "/" + apiPackage() + "/" + toApiFilename(name); } - public void setShardName(String shardName) { - this.shardName = shardName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setShardVersion(String shardVersion) { - this.shardVersion = shardVersion; - } - - public void setShardDescription(String shardDescription) { - this.shardDescription = shardDescription; - } - - public void setShardSummary(String shardSummary) { - this.shardSummary = shardSummary; - } - - public void setShardLicense(String shardLicense) { - this.shardLicense = shardLicense; - } - - public void setShardHomepage(String shardHomepage) { - this.shardHomepage = shardHomepage; - } - - public void setShardAuthor(String shardAuthor) { - this.shardAuthor = shardAuthor; - } - - public void setShardAuthorEmail(String shardAuthorEmail) { - this.shardAuthorEmail = shardAuthorEmail; - } - @Override protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { final Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 7fa0d521e72..95a49a9ee44 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -19,9 +19,10 @@ package org.openapitools.codegen.languages; import com.google.common.collect.Sets; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Discriminator; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -73,9 +74,12 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private static final String CLIENT_NAME = "clientName"; + @Getter @Setter private String dateLibrary; + @Getter @Setter private String equalityCheckMethod; + @Getter @Setter private String clientName; private TemplateManager templateManager; @@ -137,30 +141,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen { cliOptions.add(finalProperties); } - public String getDateLibrary() { - return dateLibrary; - } - - public void setDateLibrary(String library) { - this.dateLibrary = library; - } - - public String getEqualityCheckMethod() { - return equalityCheckMethod; - } - - public void setEqualityCheckMethod(String equalityCheckMethod) { - this.equalityCheckMethod = equalityCheckMethod; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - @Override public String getName() { return "dart-dio"; @@ -790,13 +770,13 @@ public class DartDioClientCodegen extends AbstractDartCodegen { final boolean isArray; - final boolean uniqueItems; + @Getter final boolean uniqueItems; final boolean isMap; final boolean isNullable; - final String dataType; + @Getter final String dataType; private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, String dataType) { this.isArray = isArray; @@ -810,10 +790,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen { return isArray; } - public boolean isUniqueItems() { - return uniqueItems; - } - public boolean isMap() { return isMap; } @@ -822,10 +798,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen { return isNullable; } - public String getDataType() { - return dataType; - } - @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java index 9c5b6f0d5a2..af66fcf53e3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/EiffelClientCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenType; @@ -34,8 +35,8 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen { private final Logger LOGGER = LoggerFactory.getLogger(EiffelClientCodegen.class); protected String libraryTarget = "openapi_eiffel_client"; - protected String packageName = "Eiffel"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "Eiffel"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs"; protected String modelDocPath = "docs"; protected String modelPath = "domain"; @@ -170,10 +171,12 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen { return outputFolder + File.separator + "src" + File.separator + "api"; } + @Override public String modelFileFolder() { return outputFolder + File.separator + "src" + File.separator + modelPath; } + @Override public String apiTestFileFolder() { return outputFolder + File.separator + "test" + File.separator + "apis"; } @@ -188,14 +191,6 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen { return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String toEnumName(CodegenProperty property) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 658560e51da..775afb9bd59 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -21,9 +21,10 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.responses.ApiResponse; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -49,8 +50,8 @@ public class ElixirClientCodegen extends DefaultCodegen { private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_@\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-)\\z"); - protected String apiVersion = "1.0.0"; - protected String moduleName; + @Setter protected String packageVersion = "1.0.0"; + @Setter protected String moduleName; protected static final String defaultModuleName = "OpenAPI.Client"; // This is the name of elixir project name; @@ -62,8 +63,7 @@ public class ElixirClientCodegen extends DefaultCodegen { "{:tesla, \"~> 1.7\"}", "{:jason, \"~> 1.4\"}", "{:ex_doc, \"~> 0.30\", only: :dev, runtime: false}", - "{:dialyxir, \"~> 1.3\", only: [:dev, :test], runtime: false}" - ); + "{:dialyxir, \"~> 1.3\", only: [:dev, :test], runtime: false}"); public ElixirClientCodegen() { super(); @@ -72,114 +72,111 @@ public class ElixirClientCodegen extends DefaultCodegen { .includeDocumentationFeatures(DocumentationFeature.Readme) .securityFeatures(EnumSet.of( SecurityFeature.OAuth2_Implicit, - SecurityFeature.BasicAuth - )) + SecurityFeature.BasicAuth)) .excludeGlobalFeatures( GlobalFeature.XMLStructureDefinitions, GlobalFeature.Callbacks, GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) + GlobalFeature.ParameterStyling) .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) + SchemaSupportFeature.Polymorphism) .excludeParameterFeatures( - ParameterFeature.Cookie - ) + ParameterFeature.Cookie) .includeClientModificationFeatures( - ClientModificationFeature.BasePath - ) + ClientModificationFeature.BasePath) .includeDataTypeFeatures( - DataTypeFeature.AnyType - ) - ); + DataTypeFeature.AnyType)); // set the output folder here outputFolder = "generated-code/elixir"; /* - * Models. You can write model files using the modelTemplateFiles map. + * Models. You can write model files using the modelTemplateFiles map. * if you want to create one template for file, you can do so here. - * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * for multiple files for model, just put another entry in the + * `modelTemplateFiles` with * a different extension */ modelTemplateFiles.put( "model.mustache", // the template to use - ".ex"); // the extension for each file to write + ".ex"); // the extension for each file to write /** - * Api classes. You can write classes for each Api file with the apiTemplateFiles map. - * as with models, add multiple entries with different extensions for multiple files per + * Api classes. You can write classes for each Api file with the + * apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple + * files per * class */ apiTemplateFiles.put( - "api.mustache", // the template to use - ".ex"); // the extension for each file to write + "api.mustache", // the template to use + ".ex"); // the extension for each file to write /** - * Template Location. This is the location which templates will be read from. The generator + * Template Location. This is the location which templates will be read from. + * The generator * will use the resource stream to attempt to read the templates. */ templateDir = "elixir"; /** - * Reserved words. Override this with reserved words specific to your language - * Ref: https://github.com/itsgreggreg/elixir_quick_reference#reserved-words + * Reserved words. Override this with reserved words specific to your language + * Ref: https://hexdocs.pm/elixir/1.16.3/syntax-reference.html#reserved-words */ reservedWords = new HashSet<>( Arrays.asList( - "nil", "true", "false", + "nil", + "when", + "and", + "or", + "not", + "in", + "fn", + "do", + "end", + "catch", + "rescue", + "after", + "else", + "__struct__", "__MODULE__", "__FILE__", "__DIR__", "__ENV__", - "__CALLER__") - ); + "__CALLER__")); /** - * Additional Properties. These values can be passed to the templates and - * are available in models, apis, and supporting files + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied */ - additionalProperties.put("apiVersion", apiVersion); - - /** - * Supporting Files. You can write single files for the generator with the - * entire object tree available. If the input file has a suffix of `.mustache - * it will be processed by the template engine. Otherwise, it will be copied - */ - supportingFiles.add(new SupportingFile("README.md.mustache", // the input template or file - "", // the destination folder, relative `outputFolder` - "README.md") // the output file + supportingFiles.add(new SupportingFile("README.md.mustache", // the input template or file + "", // the destination folder, relative `outputFolder` + "README.md") // the output file ); supportingFiles.add(new SupportingFile("config.exs.mustache", "config", - "config.exs") - ); + "config.exs")); supportingFiles.add(new SupportingFile("runtime.exs.mustache", "config", - "runtime.exs") - ); + "runtime.exs")); supportingFiles.add(new SupportingFile("mix.exs.mustache", "", - "mix.exs") - ); + "mix.exs")); supportingFiles.add(new SupportingFile("formatter.exs", "", - ".formatter.exs") - ); + ".formatter.exs")); supportingFiles.add(new SupportingFile("test_helper.exs.mustache", "test", - "test_helper.exs") - ); + "test_helper.exs")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", - ".gitignore") - ); + ".gitignore")); /** - * Language Specific Primitives. These types will not trigger imports by + * Language Specific Primitives. These types will not trigger imports by * the client generator */ languageSpecificPrimitives = new HashSet<>( @@ -195,12 +192,13 @@ public class ElixirClientCodegen extends DefaultCodegen { "AnyType", "Tuple", "PID", - "map()", // This is a workaround, since the DefaultCodeGen uses our elixir TypeSpec datetype to evaluate the primitive - "any()" - ) - ); + // This is a workaround, since the DefaultCodeGen uses our elixir TypeSpec + // datetype to evaluate the primitive + "map()", + "any()")); - // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + // ref: + // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types typeMapping = new HashMap<>(); typeMapping.put("integer", "Integer"); typeMapping.put("long", "Integer"); @@ -222,7 +220,8 @@ public class ElixirClientCodegen extends DefaultCodegen { typeMapping.put("UUID", "String"); typeMapping.put("URI", "String"); - cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay.Pets")); + cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, + "The main namespace to use for all classes. e.g. Yay.Pets")); cliOptions.add(new CliOption("licenseHeader", "The license header to prepend to the top of all source files.")); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Elixir package name (convention: lowercase).")); } @@ -239,7 +238,8 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Configures a friendly name for the generator. This will be used by the generator + * Configures a friendly name for the generator. This will be used by the + * generator * to select the library with the -g flag. * * @return the friendly name for the generator @@ -250,7 +250,7 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Returns human-friendly help for the generator. Provide the consumer with help + * Returns human-friendly help for the generator. Provide the consumer with help * tips, parameters here * * @return A string value for the help message @@ -295,6 +295,10 @@ public class ElixirClientCodegen extends DefaultCodegen { if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { setModuleName((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); } @Override @@ -322,7 +326,6 @@ public class ElixirClientCodegen extends DefaultCodegen { sourceFolder(), "request_builder.ex")); - supportingFiles.add(new SupportingFile("deserializer.ex.mustache", sourceFolder(), "deserializer.ex")); @@ -407,34 +410,39 @@ public class ElixirClientCodegen extends DefaultCodegen { } private String atomized(String text) { - StringBuilder atom = new StringBuilder(); - Matcher m = simpleAtomPattern.matcher(text); + StringBuilder atom = new StringBuilder(); + Matcher m = simpleAtomPattern.matcher(text); - atom.append(":"); + atom.append(":"); - if (!m.matches()) { - atom.append("\""); - } + if (!m.matches()) { + atom.append("\""); + } - atom.append(text); + atom.append(text); - if (!m.matches()) { - atom.append("\""); - } + if (!m.matches()) { + atom.append("\""); + } - return atom.toString(); + return atom.toString(); } - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reserved words + * Escapes a reserved word as defined in the `reservedWords` array. Handle + * escaping + * those terms here. This logic is only called if a variable matches the + * reserved words * * @return the escaped term */ @Override public String escapeReservedWord(String name) { - return "_" + name; // add an underscore to the name + String escapedName = name + "_var"; + + // Trim leading underscores in the event the name is already underscored + escapedName = escapedName.replaceAll("^_+", ""); + return escapedName; } private String sourceFolder() { @@ -446,7 +454,8 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Location to write model files. You can use the modelPackage() as defined when the class is + * Location to write model files. You can use the modelPackage() as defined when + * the class is * instantiated */ @Override @@ -455,7 +464,8 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Location to write api files. You can use the apiPackage() as defined when the class is + * Location to write api files. You can use the apiPackage() as defined when the + * class is * instantiated */ @Override @@ -528,20 +538,23 @@ public class ElixirClientCodegen extends DefaultCodegen { @Override public String toOperationId(String operationId) { - // throw exception if method name is empty (should not occur as an auto-generated method name will be used) + // throw exception if method name is empty (should not occur as an + // auto-generated method name will be used) if (StringUtils.isEmpty(operationId)) { throw new RuntimeException("Empty method name (operationId) not allowed"); } // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); + LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, + underscore(sanitizeName("call_" + operationId))); return underscore(sanitizeName("call_" + operationId)); } // operationId starts with a number if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, + underscore(sanitizeName("call_" + operationId))); operationId = "call_" + operationId; } @@ -549,10 +562,12 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Optional - type declaration. This is a String which is used by the templates to instantiate your - * types. There is typically special handling for different property types + * Optional - type declaration. This is a String which is used by the templates + * to instantiate your + * types. There is typically special handling for different property types * - * @return a string value used as the `dataType` field for model templates, `returnType` for api templates + * @return a string value used as the `dataType` field for model templates, + * `returnType` for api templates */ @Override public String getTypeDeclaration(Schema p) { @@ -602,8 +617,10 @@ public class ElixirClientCodegen extends DefaultCodegen { } /** - * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Schema` into - * either language specific types via `typeMapping` or into complex models if there is not a mapping. + * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a + * `Schema` into + * either language specific types via `typeMapping` or into complex models if + * there is not a mapping. * * @return a string value of the type or complex model for this property */ @@ -699,7 +716,7 @@ public class ElixirClientCodegen extends DefaultCodegen { } - class ExtendedCodegenOperation extends CodegenOperation { + @Getter @Setter class ExtendedCodegenOperation extends CodegenOperation { private List pathTemplateNames = new ArrayList<>(); private String replacedPathName; @@ -762,22 +779,6 @@ public class ElixirClientCodegen extends DefaultCodegen { this.operationIdCamelCase = o.operationIdCamelCase; } - public List getPathTemplateNames() { - return pathTemplateNames; - } - - public void setPathTemplateNames(List pathTemplateNames) { - this.pathTemplateNames = pathTemplateNames; - } - - public String getReplacedPathName() { - return replacedPathName; - } - - public void setReplacedPathName(String replacedPathName) { - this.replacedPathName = replacedPathName; - } - private void translateBaseType(StringBuilder returnEntry, String baseType) { switch (baseType) { case "AnyType": @@ -816,23 +817,10 @@ public class ElixirClientCodegen extends DefaultCodegen { if (exResponse.baseType == null) { returnEntry.append("nil"); } else if (exResponse.containerType == null) { // not container (array, map, set) - if (!exResponse.primitiveType) { - returnEntry.append(moduleName); - returnEntry.append(".Model."); - } - - translateBaseType(returnEntry, exResponse.baseType); + returnEntry.append(normalizeTypeName(exResponse.dataType, exResponse.primitiveType)); } else { - if (exResponse.containerType.equals("array") || - exResponse.containerType.equals("set")) { - returnEntry.append("list("); - if (!exResponse.primitiveType) { - returnEntry.append(moduleName); - returnEntry.append(".Model."); - } - - translateBaseType(returnEntry, exResponse.baseType); - returnEntry.append(")"); + if (exResponse.containerType.equals("array") || exResponse.containerType.equals("set")) { + returnEntry.append(exResponse.dataType); } else if (exResponse.containerType.equals("map")) { returnEntry.append("map()"); } @@ -848,6 +836,22 @@ public class ElixirClientCodegen extends DefaultCodegen { return sb.toString(); } + private String normalizeTypeName(String baseType, boolean isPrimitive) { + if (baseType == null) { + return "nil"; + } + if (isPrimitive || "String.t".equals(baseType)) { + return baseType; + } + if (!baseType.startsWith(moduleName + ".Model.")) { + baseType = moduleName + ".Model." + baseType; + } + if (!baseType.endsWith(".t")) { + baseType += ".t"; + } + return baseType; + } + private void buildTypespec(CodegenParameter param, StringBuilder sb) { if (param.dataType == null) { sb.append("nil"); @@ -861,26 +865,15 @@ public class ElixirClientCodegen extends DefaultCodegen { sb.append("%{optional(String.t) => "); buildTypespec(param.items, sb); sb.append("}"); - } else if (param.isPrimitiveType) { - // like `integer()`, `String.t` - sb.append(param.dataType); - } else if (param.isFile || param.isBinary) { - sb.append("String.t"); - } else if ("String.t".equals(param.dataType)) { - // uuid, password, etc - sb.append(param.dataType); } else { - // .Model..t - sb.append(moduleName); - sb.append(".Model."); - sb.append(param.dataType); - sb.append(".t"); + sb.append(normalizeTypeName(param.dataType, param.isPrimitiveType || param.isFile || param.isBinary)); } } private void buildTypespec(CodegenProperty property, StringBuilder sb) { if (property == null) { - LOGGER.error("CodegenProperty cannot be null. Please report the issue to https://github.com/openapitools/openapi-generator with the spec"); + LOGGER.error( + "CodegenProperty cannot be null. Please report the issue to https://github.com/openapitools/openapi-generator with the spec"); } else if (property.isArray) { sb.append("list("); buildTypespec(property.items, sb); @@ -889,14 +882,8 @@ public class ElixirClientCodegen extends DefaultCodegen { sb.append("%{optional(String.t) => "); buildTypespec(property.items, sb); sb.append("}"); - } else if (property.isPrimitiveType) { - sb.append(property.baseType); - sb.append(".t"); } else { - sb.append(moduleName); - sb.append(".Model."); - sb.append(property.baseType); - sb.append(".t"); + sb.append(normalizeTypeName(property.dataType, property.isPrimitiveType)); } } @@ -996,11 +983,9 @@ public class ElixirClientCodegen extends DefaultCodegen { return input; } - public void setModuleName(String moduleName) { - this.moduleName = moduleName; + @Override + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.ELIXIR; } - @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ELIXIR; } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index c27645f7a68..3bc81accdc3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -52,6 +51,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { protected String packageName = "openapi"; protected String packageVersion = "1.0.0"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } @@ -61,6 +61,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { return "elm"; } + @Override public String getHelp() { return "Generates an Elm client library."; } @@ -273,6 +274,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { } } + @Override @SuppressWarnings({"static-method", "unchecked"}) public Map postProcessAllModels(final Map orgObjs) { final Map objs = super.postProcessAllModels(orgObjs); @@ -403,6 +405,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { } static class ParameterSorter implements Comparator { + @Override public int compare(final CodegenParameter p1, final CodegenParameter p2) { return index(p1) - index(p2); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java index f5032301b73..72379dbeb4a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java @@ -20,6 +20,8 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -42,18 +44,21 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(ErlangClientCodegen.class); - protected String packageName = "openapi"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi"; + @Setter protected String packageVersion = "1.0.0"; protected String sourceFolder = "src"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "erlang-client"; } + @Override public String getHelp() { return "Generates an Erlang client library (beta)."; } @@ -246,6 +251,10 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig @Override public String toVarName(String name) { + if (nameMapping.containsKey(name)) { + return nameMapping.get(name); + } + // replace - with _ e.g. created-at => created_at name = sanitizeName(name.replaceAll("-", "_")); // for reserved word or word starting with number, append _ @@ -257,6 +266,10 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig @Override public String toParamName(String name) { + if (parameterNameMapping.containsKey(name)) { + return parameterNameMapping.get(name); + } + return camelize(toVarName(name)); } @@ -347,14 +360,6 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig return objs; } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - /** * Returns the number of required parameters plus 1. * @@ -397,7 +402,9 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig } class ExtendedCodegenOperation extends CodegenOperation { + @Getter @Setter private List pathTemplateNames = new ArrayList(); + @Getter @Setter private String replacedPathName; String arityRequired; String arityOptional; @@ -463,21 +470,6 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig this.operationIdCamelCase = o.operationIdCamelCase; } - public List getPathTemplateNames() { - return pathTemplateNames; - } - - public void setPathTemplateNames(List pathTemplateNames) { - this.pathTemplateNames = pathTemplateNames; - } - - public String getReplacedPathName() { - return replacedPathName; - } - - public void setReplacedPathName(String replacedPathName) { - this.replacedPathName = replacedPathName; - } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java index cd57040f730..ab03c7c55d3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java @@ -18,8 +18,9 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -43,19 +44,22 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(ErlangProperCodegen.class); - protected String packageName = "openapi"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi"; + @Setter protected String packageVersion = "1.0.0"; protected String sourceFolder = "src"; protected String modelFolder = "model"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "erlang-proper"; } + @Override public String getHelp() { return "Generates an Erlang library with PropEr generators (beta)."; } @@ -399,14 +403,6 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig return objs; } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - String length(Object os) { int l = 1; for (CodegenParameter o : ((ExtendedCodegenOperation) os).allParams) { @@ -499,6 +495,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig } class ExtendedCodegenOperation extends CodegenOperation { + @Getter @Setter private String replacedPathName; String arity; @@ -560,13 +557,6 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig this.operationIdCamelCase = o.operationIdCamelCase; } - public String getReplacedPathName() { - return replacedPathName; - } - - public void setReplacedPathName(String replacedPathName) { - this.replacedPathName = replacedPathName; - } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java index 49f15cc26c3..d41136eb676 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -40,8 +41,8 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig protected String apiVersion = "1.0.0"; protected String apiPath = "src"; - protected String packageName = "openapi"; - protected String openApiSpecName = "openapi"; + @Setter protected String packageName = "openapi"; + @Setter protected String openApiSpecName = "openapi"; public ErlangServerCodegen() { super(); @@ -289,14 +290,6 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig return super.postProcessSupportingFileData(objs); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setOpenApiSpecName(String openApiSpecName) { - this.openApiSpecName = openApiSpecName; - } - protected String toHandlerName(String name) { return toModuleName(name) + "_handler"; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java index a924aa6fb5e..34ff9c7bf29 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpFunctionsServerCodegen.java @@ -31,14 +31,17 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen { final Logger LOGGER = LoggerFactory.getLogger(FsharpFunctionsServerCodegen.class); + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "fsharp-functions"; } + @Override public String getHelp() { return "Generates a fsharp-functions server (beta)."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java index 1bc6d6bf8c3..e0b1a765cd0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FsharpGiraffeServerCodegen.java @@ -19,6 +19,7 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.OpenAPI; +import lombok.Setter; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenType; @@ -47,7 +48,7 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen { public static final String SDK_WEB = "Microsoft.NET.Sdk.Web"; public static final String SDK_LIB = "Microsoft.NET.Sdk"; - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; @SuppressWarnings("hiding") protected final Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class); @@ -211,10 +212,6 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen { LOGGER.warn("Swashbuckle flag not currently supported, this will be ignored."); } - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - @Override public String modelFileFolder() { return super.modelFileFolder().replace("Model", "model"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 060dfc277d7..b4d75b60e23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -19,9 +19,9 @@ package org.openapitools.codegen.languages; import com.google.common.collect.Iterables; import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -37,8 +37,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.IOException; -import java.io.Writer; import java.util.*; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; @@ -47,7 +45,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public class GoClientCodegen extends AbstractGoCodegen { private final Logger LOGGER = LoggerFactory.getLogger(GoClientCodegen.class); - protected String packageVersion = "1.0.0"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String modelFileFolder = null; @@ -57,9 +55,9 @@ public class GoClientCodegen extends AbstractGoCodegen { public static final String GENERATE_INTERFACES = "generateInterfaces"; public static final String MODEL_FILE_FOLDER = "modelFileFolder"; public static final String WITH_GO_MOD = "withGoMod"; - protected String goImportAlias = "openapiclient"; + @Setter protected String goImportAlias = "openapiclient"; protected boolean isGoSubmodule = false; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup // A cache to efficiently lookup schema `toModelName()` based on the schema Key private Map schemaKeyToModelNameCache = new HashMap<>(); @@ -169,7 +167,7 @@ public class GoClientCodegen extends AbstractGoCodegen { * Configures the type of generator. * * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType + * @see CodegenType */ @Override public CodegenType getTag() { @@ -312,22 +310,10 @@ public class GoClientCodegen extends AbstractGoCodegen { supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go")); } - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } - public void setGoImportAlias(String goImportAlias) { - this.goImportAlias = goImportAlias; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - public void setIsGoSubmodule(boolean isGoSubmodule) { this.isGoSubmodule = isGoSubmodule; } @@ -374,12 +360,6 @@ public class GoClientCodegen extends AbstractGoCodegen { return toModelName(name); } - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - @Override public String toModelName(String name) { if (schemaKeyToModelNameCache.containsKey(name)) { @@ -392,6 +372,7 @@ public class GoClientCodegen extends AbstractGoCodegen { return camelizedName; } + @Override public String escapeReservedWord(String name) { if (this.reservedWordsMappings().containsKey(name)) { return this.reservedWordsMappings().get(name); @@ -424,7 +405,7 @@ public class GoClientCodegen extends AbstractGoCodegen { /** * Determines if at least one of the allOf pieces of a schema are of type string * - * @param p + * @param schema * @return */ private boolean isAllOfStringSchema(Schema schema) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java index ed1f4ca40e3..621494b0c7a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java @@ -28,7 +28,6 @@ import java.io.File; import java.util.Arrays; import java.util.EnumSet; import java.util.List; -import java.util.Map; public class GoEchoServerCodegen extends AbstractGoCodegen { protected String apiVersion = "1.0.0"; @@ -40,14 +39,17 @@ public class GoEchoServerCodegen extends AbstractGoCodegen { private static final String API_PACKAGE_NAME = "handlers"; private static final String OUTPUT_PATH = "generated-code" + File.separator + "go-echo-server"; + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "go-echo-server"; } + @Override public String getHelp() { return "Generates a go-echo server. (Beta)"; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java index 34d7a80cbeb..6d18e6b8924 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java @@ -16,6 +16,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; @@ -32,7 +33,6 @@ import java.io.File; import java.util.Arrays; import java.util.EnumSet; import java.util.List; -import java.util.Map; public class GoGinServerCodegen extends AbstractGoCodegen { @@ -40,7 +40,7 @@ public class GoGinServerCodegen extends AbstractGoCodegen { public static final String INTERFACE_ONLY = "interfaceOnly"; - protected boolean interfaceOnly = false; + @Setter protected boolean interfaceOnly = false; protected String apiVersion = "1.0.0"; protected int serverPort = 8080; @@ -209,10 +209,6 @@ public class GoGinServerCodegen extends AbstractGoCodegen { supportingFiles.add(new SupportingFile("go.mod.mustache", "go.mod")); } - public void setInterfaceOnly(boolean interfaceOnly) { - this.interfaceOnly = interfaceOnly; - } - @Override public String apiPackage() { return apiPath; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index b0c7b93edca..d38c62e5b2b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import com.google.common.collect.Iterables; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -52,14 +53,14 @@ public class GoServerCodegen extends AbstractGoCodegen { private final Logger LOGGER = LoggerFactory.getLogger(GoServerCodegen.class); - protected String packageVersion = "1.0.0"; - protected int serverPort = 8080; + @Setter protected String packageVersion = "1.0.0"; + @Setter protected int serverPort = 8080; protected String projectName = "openapi-server"; - protected String sourceFolder = "go"; + @Setter protected String sourceFolder = "go"; protected Boolean corsFeatureEnabled = false; - protected Boolean addResponseHeaders = false; - protected Boolean outputAsLibrary = false; - protected Boolean onlyInterfaces = false; + @Setter protected Boolean addResponseHeaders = false; + @Setter protected Boolean outputAsLibrary = false; + @Setter protected Boolean onlyInterfaces = false; public GoServerCodegen() { @@ -474,32 +475,8 @@ public class GoServerCodegen extends AbstractGoCodegen { return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); } - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setServerPort(int serverPort) { - this.serverPort = serverPort; - } - public void setFeatureCORS(Boolean featureCORS) { this.corsFeatureEnabled = featureCORS; } - public void setAddResponseHeaders(Boolean addResponseHeaders) { - this.addResponseHeaders = addResponseHeaders; - } - - public void setOnlyInterfaces(Boolean onlyInterfaces) { - this.onlyInterfaces = onlyInterfaces; - } - - public void setOutputAsLibrary(Boolean outputAsLibrary) { - this.outputAsLibrary = outputAsLibrary; - } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java index 8a32d2ccf5f..9e74139e546 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java @@ -16,7 +16,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java index 5215b9d3bed..4d1b4127e6f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java @@ -32,10 +32,12 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code return CodegenType.SCHEMA; } + @Override public String getName() { return "graphql-schema"; } + @Override public String getHelp() { return "Generates GraphQL schema files (beta)"; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java index 1c0bff0c1be..1b194c7a4da 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java @@ -22,7 +22,6 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import java.io.File; import java.util.EnumSet; import java.util.List; -import java.util.Map; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.ClientModificationFeature; @@ -154,11 +153,6 @@ public class GroovyClientCodegen extends AbstractJavaCodegen { return input.replace("'", ""); } - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GROOVY; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index a879e5b28a4..a78e9a703ca 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -19,7 +19,6 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.io.FilenameUtils; @@ -147,14 +146,17 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC final private static Pattern CONTAINS_JSON_MIME_PATTERN = Pattern.compile("(?i)application/.*json(;.*)?"); + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "haskell-http-client"; } + @Override public String getHelp() { return "Generates a Haskell http-client library."; } @@ -1180,12 +1182,19 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC @Override public String toVarName(String name) { + if (nameMapping.containsKey(name)) { + return nameMapping.get(name); + } + return toVarName("", name); } public String toVarName(String prefix, String name) { boolean hasPrefix = !StringUtils.isBlank(prefix); name = underscore(sanitizeName(name.replaceAll("-", "_"))); + if (name.equals("_")) { + name = "underscore"; + } name = camelize(name, hasPrefix ? UPPERCASE_FIRST_CHAR : LOWERCASE_FIRST_LETTER); if (hasPrefix) { @@ -1201,6 +1210,10 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC @Override public String toParamName(String name) { + if (parameterNameMapping.containsKey(name)) { + return parameterNameMapping.get(name); + } + return toVarName(name); } @@ -1214,6 +1227,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC return toTypeName("Model", name); } + @Override public String toApiName(String name) { if (name.length() == 0) { return "Default"; @@ -1434,6 +1448,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC } // override with any special text escaping logic + @Override @SuppressWarnings("static-method") public String escapeText(String input) { if (input == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index c1fd7e15ada..a7785024a06 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -19,7 +19,6 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import org.apache.commons.io.FilenameUtils; @@ -59,6 +58,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf * * @return the CodegenType for this generator */ + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -69,6 +69,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf * * @return the friendly name for the generator */ + @Override public String getName() { return "haskell"; } @@ -79,6 +80,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a Haskell server and client library."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java index 0bd106d632e..f3587ad772f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java @@ -19,9 +19,10 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -49,37 +50,26 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen private final Logger LOGGER = LoggerFactory.getLogger(HaskellYesodServerCodegen.class); + @Getter @Setter protected String projectName; + @Getter @Setter protected String apiModuleName; + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "haskell-yesod"; } + @Override public String getHelp() { return "Generates a haskell-yesod server."; } - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getApiModuleName() { - return apiModuleName; - } - - public void setApiModuleName(String apiModuleName) { - this.apiModuleName = apiModuleName; - } - public HaskellYesodServerCodegen() { super(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java index 3d8ac3561f8..d005f54111b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java @@ -20,7 +20,6 @@ package org.openapitools.codegen.languages; 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.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java index 032668cee00..1b72f5699ac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java @@ -18,6 +18,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.GzipTestFeatures; @@ -45,17 +47,13 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles"; - protected boolean useBeanValidation = false; + @Getter protected boolean useGenericResponse = false; - protected boolean useGenericResponse = false; + @Getter protected boolean useGzipFeatureForTests = false; - protected boolean useGzipFeatureForTests = false; + @Getter protected boolean useLoggingFeatureForTests = false; - protected boolean useLoggingFeatureForTests = false; - - private boolean useJackson = false; - - protected boolean useAbstractionForFiles = false; + @Setter protected boolean useAbstractionForFiles = false; public JavaCXFClientCodegen() { super(); @@ -100,30 +98,11 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen @Override public void processOpts() { super.processOpts(); - - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION)); - } - - if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { - this.setUseGenericResponse(convertPropertyToBooleanAndWriteBack(USE_GENERIC_RESPONSE)); - } - - if (additionalProperties.containsKey(USE_GZIP_FEATURE_FOR_TESTS)) { - this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); - } - - if (additionalProperties.containsKey(USE_LOGGING_FEATURE_FOR_TESTS)) { - this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); - } - - if (additionalProperties.containsKey(JACKSON)) { - useJackson = convertPropertyToBooleanAndWriteBack(JACKSON); - } - - if (additionalProperties.containsKey(USE_ABSTRACTION_FOR_FILES)) { - this.setUseAbstractionForFiles(convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES)); - } + convertPropertyToBooleanAndWriteBack(USE_GENERIC_RESPONSE, this::setUseGenericResponse); + convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS, this::setUseGzipFeatureForTests); + convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS, this::setUseLoggingFeatureForTests); + convertPropertyToBooleanAndWriteBack(JACKSON, this::setJackson); + convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES, this::setUseAbstractionForFiles); supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen @@ -157,7 +136,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen model.imports.remove("ToStringSerializer"); - if (useJackson) { + if (jackson) { //Add jackson imports when model has inner enum if (Boolean.FALSE.equals(model.isEnum) && Boolean.TRUE.equals(model.hasEnums)) { model.imports.add("JsonCreator"); @@ -188,47 +167,20 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen return "Generates a Java JAXRS Client based on Apache CXF framework."; } - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - public boolean isUseBeanValidation() { - return useBeanValidation; - } @Override public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) { this.useGzipFeatureForTests = useGzipFeatureForTests; } - public boolean isUseGzipFeatureForTests() { - return useGzipFeatureForTests; - } - @Override public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests) { this.useLoggingFeatureForTests = useLoggingFeatureForTests; } - public boolean isUseLoggingFeatureForTests() { - return useLoggingFeatureForTests; - } - @Override public void setUseGenericResponse(boolean useGenericResponse) { this.useGenericResponse = useGenericResponse; } - public boolean isUseGenericResponse() { - return useGenericResponse; - } - - public boolean isUseJackson() { - return useJackson; - } - - public void setUseAbstractionForFiles(boolean useAbstractionForFiles) { - this.useAbstractionForFiles = useAbstractionForFiles; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java index 34e95936171..95cc6ce28f1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java @@ -17,41 +17,35 @@ package org.openapitools.codegen.languages; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.apache.commons.text.StringEscapeUtils; +import com.fasterxml.jackson.core.JsonPointer; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.mifmif.common.regex.Generex; +import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.SupportingFile; +import org.apache.commons.text.StringEscapeUtils; +import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.CXFExtServerFeatures; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.JsonCache; -import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.JsonCache.CacheException; import org.openapitools.codegen.utils.JsonCache.Root.MergePolicy; +import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonPointer; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.mifmif.common.regex.Generex; - -import io.swagger.v3.oas.models.media.Schema; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; /** * An Apache CXF-based JAX-RS server with extended capabilities. @@ -312,19 +306,19 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF private final Map REGEX_GENERATORS = new HashMap<>(); - protected boolean generateOperationBody = false; + @Setter protected boolean generateOperationBody = false; - protected boolean loadTestDataFromFile = false; + @Setter protected boolean loadTestDataFromFile = false; - protected boolean supportMultipleSpringServices = false; + @Setter protected boolean supportMultipleSpringServices = false; protected JsonCache testDataCache = null; protected JsonCache testDataControlCache = null; - protected File testDataFile = null; + @Setter protected File testDataFile = null; - protected File testDataControlFile = null; + @Setter protected File testDataControlFile = null; public JavaCXFExtServerCodegen() { super(); @@ -1288,11 +1282,11 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF if (testDataCache.root().isDirty()) { ByteArrayOutputStream out = new ByteArrayOutputStream(); testDataCache.root().flush(out); - String testDataJson = out.toString("UTF-8"); + String testDataJson = out.toString(StandardCharsets.UTF_8); objs.put("test-data.json", testDataJson); supportingFiles.add(new SupportingFile("testData.mustache", testDataFile.getAbsolutePath())); } - } catch (CacheException | UnsupportedEncodingException e) { + } catch (CacheException e) { LOGGER.error("Error writing JSON test data file " + testDataFile, e); } @@ -1300,12 +1294,12 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF if (testDataControlCache.root().isDirty()) { ByteArrayOutputStream out = new ByteArrayOutputStream(); testDataControlCache.root().flush(out); - String testDataControlJson = out.toString("UTF-8"); + String testDataControlJson = out.toString(StandardCharsets.UTF_8); objs.put("test-data-control.json", testDataControlJson); supportingFiles .add(new SupportingFile("testDataControl.mustache", testDataControlFile.getAbsolutePath())); } - } catch (CacheException | UnsupportedEncodingException e) { + } catch (CacheException e) { LOGGER.error("Error writing JSON test data control file " + testDataControlFile, e); } } @@ -1317,13 +1311,10 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) { - this.setSupportMultipleSpringServices( - convertPropertyToBooleanAndWriteBack(SUPPORT_MULTIPLE_SPRING_SERVICES)); - } - if (additionalProperties.containsKey(GENERATE_OPERATION_BODY)) { - boolean generateOperationBody = convertPropertyToBooleanAndWriteBack(GENERATE_OPERATION_BODY); - this.setGenerateOperationBody(generateOperationBody); + convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION, this::setSupportMultipleSpringServices); + + convertPropertyToBooleanAndWriteBack(GENERATE_OPERATION_BODY, this::setGenerateOperationBody); + if (generateOperationBody) { boolean loadTestDataFromFile = convertPropertyToBooleanAndWriteBack(LOAD_TEST_DATA_FROM_FILE); this.setLoadTestDataFromFile(loadTestDataFromFile); @@ -1403,26 +1394,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF } } - public void setGenerateOperationBody(boolean generateOperationBody) { - this.generateOperationBody = generateOperationBody; - } - - public void setLoadTestDataFromFile(boolean loadTestDataFromFile) { - this.loadTestDataFromFile = loadTestDataFromFile; - } - - public void setSupportMultipleSpringServices(boolean supportMultipleSpringServices) { - this.supportMultipleSpringServices = supportMultipleSpringServices; - } - - public void setTestDataControlFile(File testDataControlFile) { - this.testDataControlFile = testDataControlFile; - } - - public void setTestDataFile(File testDataFile) { - this.testDataFile = testDataFile; - } - @Override public String toDefaultValue(Schema p) { if (ModelUtils.isGenerateAliasAsModel(p) && StringUtils.isNotEmpty(p.get$ref())) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFServerCodegen.java index 26c99103f23..a1efb7ae720 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFServerCodegen.java @@ -17,8 +17,7 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.openapitools.codegen.languages.features.GzipTestFeatures; @@ -26,7 +25,6 @@ import org.openapitools.codegen.languages.features.LoggingTestFeatures; import org.openapitools.codegen.languages.features.UseGenericResponseFeatures; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,41 +37,41 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles"; - protected boolean addConsumesProducesJson = true; + @Setter protected boolean addConsumesProducesJson = false; - protected boolean generateSpringApplication = false; + @Setter protected boolean generateSpringApplication = false; - protected boolean useSpringAnnotationConfig = false; + @Setter protected boolean useSpringAnnotationConfig = false; - protected boolean useSwaggerFeature = false; + @Setter protected boolean useSwaggerFeature = false; - protected boolean useSwaggerUI = false; + @Setter protected boolean useSwaggerUI = false; - protected boolean useWadlFeature = false; + @Setter protected boolean useWadlFeature = false; - protected boolean useMultipartFeature = false; + @Setter protected boolean useMultipartFeature = false; - protected boolean useBeanValidationFeature = false; + @Setter protected boolean useBeanValidationFeature = false; - protected boolean generateSpringBootApplication = false; + @Setter protected boolean generateSpringBootApplication = false; - protected boolean generateJbossDeploymentDescriptor = false; + @Setter protected boolean generateJbossDeploymentDescriptor = false; - protected boolean useGzipFeature = false; + @Setter protected boolean useGzipFeature = false; - protected boolean useGzipFeatureForTests = false; + @Setter protected boolean useGzipFeatureForTests = false; - protected boolean useLoggingFeature = false; + @Setter protected boolean useLoggingFeature = false; - protected boolean useLoggingFeatureForTests = false; + @Setter protected boolean useLoggingFeatureForTests = false; - protected boolean useAnnotatedBasePath = false; + @Setter protected boolean useAnnotatedBasePath = false; - protected boolean generateNonSpringApplication = false; + @Setter protected boolean generateNonSpringApplication = false; - protected boolean useGenericResponse = false; + @Setter protected boolean useGenericResponse = false; - protected boolean useAbstractionForFiles = false; + @Setter protected boolean useAbstractionForFiles = false; public JavaCXFServerCodegen() { super(); @@ -139,21 +137,10 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(ADD_CONSUMES_PRODUCES_JSON)) { - this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON)); - } - - if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) { - this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE)); - } - - if (useGenericResponse) { - writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse); - } - - if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) { - this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION)); - + convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON, this::setAddConsumesProducesJson); + convertPropertyToBooleanAndWriteBack(USE_GENERIC_RESPONSE, this::setUseGenericResponse); + convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION, this::setGenerateSpringApplication); + if (generateSpringApplication) { this.setUseSwaggerFeature(convertPropertyToBooleanAndWriteBack(USE_SWAGGER_FEATURE)); this.setUseSwaggerUI(convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI)); @@ -174,25 +161,13 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen this.setGenerateSpringBootApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_BOOT_APPLICATION)); } - if (additionalProperties.containsKey(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)) { - boolean generateJbossDeploymentDescriptorProp = convertPropertyToBooleanAndWriteBack( - GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); - this.setGenerateJbossDeploymentDescriptor(generateJbossDeploymentDescriptorProp); - } + convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, this::setGenerateJbossDeploymentDescriptor); - if (additionalProperties.containsKey(USE_ANNOTATED_BASE_PATH)) { - boolean useAnnotatedBasePathProp = convertPropertyToBooleanAndWriteBack(USE_ANNOTATED_BASE_PATH); - this.setUseAnnotatedBasePath(useAnnotatedBasePathProp); - } + convertPropertyToBooleanAndWriteBack(USE_ANNOTATED_BASE_PATH, this::setUseAnnotatedBasePath); - if (additionalProperties.containsKey(GENERATE_NON_SPRING_APPLICATION)) { - boolean generateNonSpringApplication = convertPropertyToBooleanAndWriteBack(GENERATE_NON_SPRING_APPLICATION); - this.setGenerateNonSpringApplication(generateNonSpringApplication); - } + convertPropertyToBooleanAndWriteBack(GENERATE_NON_SPRING_APPLICATION, this::setGenerateNonSpringApplication); - if (additionalProperties.containsKey(USE_ABSTRACTION_FOR_FILES)) { - this.setUseAbstractionForFiles(convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES)); - } + convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES, this::setUseAbstractionForFiles); supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen @@ -256,7 +231,7 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen model.imports.remove("ToStringSerializer"); //Add imports for Jackson when model has inner enum - if (additionalProperties.containsKey(JACKSON)) { + if (isJackson()) { if (Boolean.FALSE.equals(model.isEnum) && Boolean.TRUE.equals(model.hasEnums)) { model.imports.add("JsonCreator"); model.imports.add("JsonValue"); @@ -276,81 +251,5 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen return "Generates a Java JAXRS Server application based on Apache CXF framework."; } - public void setGenerateSpringApplication(boolean generateSpringApplication) { - this.generateSpringApplication = generateSpringApplication; - } - - public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig) { - this.useSpringAnnotationConfig = useSpringAnnotationConfig; - } - - public void setUseSwaggerFeature(boolean useSwaggerFeature) { - this.useSwaggerFeature = useSwaggerFeature; - } - - - public void setUseWadlFeature(boolean useWadlFeature) { - this.useWadlFeature = useWadlFeature; - } - - - public void setUseMultipartFeature(boolean useMultipartFeature) { - this.useMultipartFeature = useMultipartFeature; - } - - - public void setUseGzipFeature(boolean useGzipFeature) { - this.useGzipFeature = useGzipFeature; - } - - - public void setUseLoggingFeature(boolean useLoggingFeature) { - this.useLoggingFeature = useLoggingFeature; - } - - - public void setUseBeanValidationFeature(boolean useBeanValidationFeature) { - this.useBeanValidationFeature = useBeanValidationFeature; - } - - public void setGenerateSpringBootApplication(boolean generateSpringBootApplication) { - this.generateSpringBootApplication = generateSpringBootApplication; - } - - public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) { - this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor; - } - - public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) { - this.useGzipFeatureForTests = useGzipFeatureForTests; - } - - public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests) { - this.useLoggingFeatureForTests = useLoggingFeatureForTests; - } - - public void setUseSwaggerUI(boolean useSwaggerUI) { - this.useSwaggerUI = useSwaggerUI; - } - - public void setAddConsumesProducesJson(boolean addConsumesProducesJson) { - this.addConsumesProducesJson = addConsumesProducesJson; - } - - public void setUseAnnotatedBasePath(boolean useAnnotatedBasePath) { - this.useAnnotatedBasePath = useAnnotatedBasePath; - } - - public void setGenerateNonSpringApplication(boolean generateNonSpringApplication) { - this.generateNonSpringApplication = generateNonSpringApplication; - } - - public void setUseGenericResponse(boolean useGenericResponse) { - this.useGenericResponse = useGenericResponse; - } - - public void setUseAbstractionForFiles(boolean useAbstractionForFiles) { - this.useAbstractionForFiles = useAbstractionForFiles; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java index 49887a338bb..199d34bf24b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java @@ -19,7 +19,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenType; + import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.OptionalFeatures; @@ -58,14 +58,12 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat private final Logger LOGGER = LoggerFactory.getLogger(JavaCamelServerCodegen.class); - public CodegenType getTag() { - return CodegenType.SERVER; - } - + @Override public String getName() { return "java-camel"; } + @Override public String getHelp() { return "Generates a Java Camel server (beta)."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index d50685efd69..397b41b1741 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -19,6 +19,9 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -110,39 +113,42 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean useRxJava3 = false; // backwards compatibility for openapi configs that specify neither rx1 nor rx2 // (mustache does not allow for boolean operators so we need this extra field) - protected boolean doNotUseRx = true; - protected boolean usePlayWS = false; - protected String microprofileFramework = MICROPROFILE_DEFAULT; - protected boolean microprofileMutiny = false; - protected String configKey = null; - protected boolean configKeyFromClassName = false; + @Setter protected boolean doNotUseRx = true; + @Setter protected boolean usePlayWS = false; + @Setter protected String microprofileFramework = MICROPROFILE_DEFAULT; + @Setter protected String microprofileRestClientVersion = MICROPROFILE_REST_CLIENT_DEFAULT_VERSION; + @Setter protected boolean microprofileMutiny = false; + @Setter protected String configKey = null; + @Setter(AccessLevel.PRIVATE) protected boolean configKeyFromClassName = false; - protected boolean asyncNative = false; - protected boolean parcelableModel = false; - protected boolean useBeanValidation = false; - protected boolean performBeanValidation = false; - protected boolean useGzipFeature = false; - protected boolean useRuntimeException = false; - protected boolean useReflectionEqualsHashCode = false; + @Setter protected boolean asyncNative = false; + @Setter protected boolean parcelableModel = false; + @Setter protected boolean performBeanValidation = false; + @Setter protected boolean useGzipFeature = false; + @Setter protected boolean useRuntimeException = false; + @Setter protected boolean useReflectionEqualsHashCode = false; protected boolean caseInsensitiveResponseHeaders = false; - protected boolean useAbstractionForFiles = false; - protected boolean dynamicOperations = false; - protected boolean supportStreaming = false; - protected boolean withAWSV4Signature = false; - protected String gradleProperties; - protected String errorObjectType; + @Setter protected boolean useAbstractionForFiles = false; + @Setter protected boolean dynamicOperations = false; + @Setter protected boolean supportStreaming = false; + @Setter protected boolean withAWSV4Signature = false; + @Setter protected String gradleProperties; + @Setter protected String errorObjectType; protected String authFolder; - protected String serializationLibrary = null; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + /** + * Serialization library. + */ + @Getter protected String serializationLibrary = null; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup protected String rootJavaEEPackage; protected Map mpRestClientVersions = new LinkedHashMap<>(); - protected boolean useSingleRequestParameter = false; + @Setter(AccessLevel.PRIVATE) protected boolean useSingleRequestParameter = false; protected boolean webclientBlockingOperations = false; - protected boolean generateClientAsBean = false; - protected boolean useEnumCaseInsensitive = false; + @Setter protected boolean generateClientAsBean = false; + @Setter protected boolean useEnumCaseInsensitive = false; - protected int maxAttemptsForRetry = 1; - protected long waitTimeMillis = 10l; + @Setter protected int maxAttemptsForRetry = 1; + @Setter protected long waitTimeMillis = 10l; private static class MpRestClientVersion { public final String rootPackage; @@ -235,21 +241,21 @@ public class JavaClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(SUPPORT_URL_QUERY, "Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.")); cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE, "Use `equalsIgnoreCase` when String for enum comparison", useEnumCaseInsensitive)); - supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x"); - supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x"); - supportedLibraries.put(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'."); - supportedLibraries.put(RETROFIT_2, "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)"); - supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(RESTCLIENT, "HTTP client: Spring RestClient 6.1. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(VERTX, "HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8"); - supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+"); - supportedLibraries.put(MICROPROFILE, "HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x"); - supportedLibraries.put(APACHE, "HTTP client: Apache httpclient 5.x"); + supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 13.2.1. JSON processing: Jackson 2.17.1 or Gson 2.10.1"); + supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); + supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 4.11.0. JSON processing: Gson 2.10.1 (Retrofit 2.5.0) or Jackson 2.17.1. Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)"); + supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 5.3.33 (6.1.5 if `useJakartaEe=true`). JSON processing: Jackson 2.17.1"); + supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.1.18. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(RESTCLIENT, "HTTP client: Spring RestClient 6.1.6. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 4.7.6. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(VERTX, "HTTP client: VertX client 3.5.2. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 2.2.0. JSON processing: Jackson 2.17.1"); + supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured 5.3.2. JSON processing: Gson 2.10.1 or Jackson 2.17.1. Only for Java 8"); + supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.17.1. Only for Java11+"); + supportedLibraries.put(MICROPROFILE, "HTTP client: Microprofile client " + MICROPROFILE_REST_CLIENT_DEFAULT_VERSION + " (default, set desired version via `" + MICROPROFILE_REST_CLIENT_VERSION + "=x.x.x`). JSON processing: JSON-B 1.0.2 or Jackson 2.17.1"); + supportedLibraries.put(APACHE, "HTTP client: Apache httpclient 5.2.1. JSON processing: Jackson 2.17.1"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -311,73 +317,51 @@ public class JavaClientCodegen extends AbstractJavaCodegen dateLibrary = "legacy"; } super.processOpts(); + // default jackson unless overriden by setSerializationLibrary + this.jackson = !additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY) || SERIALIZATION_LIBRARY_JACKSON.equals(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); - if (additionalProperties.containsKey(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)) { - setUseOneOfDiscriminatorLookup(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)); - } else { - additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup); - } + convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup); // RxJava if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { LOGGER.warn("You specified all RxJava versions 2 and 3 but they are mutually exclusive. Defaulting to v3."); - this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); - } else { - if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { - LOGGER.warn("You specified both RxJava versions 2 and 3 but they are mutually exclusive. Defaulting to v3."); - this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); + convertPropertyToBooleanAndWriteBack(USE_RX_JAVA3, this::setUseRxJava3); + writePropertyBack(USE_RX_JAVA2, false); } else { - if (additionalProperties.containsKey(USE_RX_JAVA2)) { - this.setUseRxJava2(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA2).toString())); - } - if (additionalProperties.containsKey(USE_RX_JAVA3)) { - this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); - } - } + convertPropertyToBooleanAndWriteBack(USE_RX_JAVA3, this::setUseRxJava3); + convertPropertyToBooleanAndWriteBack(USE_RX_JAVA2, this::setUseRxJava2); } - - if (additionalProperties.containsKey(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER)) { - this.setUseSingleRequestParameter(convertPropertyToBoolean(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER)); - } - writePropertyBack(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, getUseSingleRequestParameter()); + convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, this::setUseSingleRequestParameter); if (!useRxJava && !useRxJava2 && !useRxJava3) { additionalProperties.put(DO_NOT_USE_RX, true); } // Java Play - if (additionalProperties.containsKey(USE_PLAY_WS)) { - this.setUsePlayWS(Boolean.parseBoolean(additionalProperties.get(USE_PLAY_WS).toString())); - } - additionalProperties.put(USE_PLAY_WS, usePlayWS); + convertPropertyToBooleanAndWriteBack(USE_PLAY_WS, this::setUsePlayWS); // Microprofile framework if (additionalProperties.containsKey(MICROPROFILE_FRAMEWORK)) { if (!MICROPROFILE_KUMULUZEE.equals(microprofileFramework)) { throw new RuntimeException("Invalid microprofileFramework '" + microprofileFramework + "'. Must be 'kumuluzee' or none."); } - this.setMicroprofileFramework(additionalProperties.get(MICROPROFILE_FRAMEWORK).toString()); +// this.setMicroprofileFramework(additionalProperties.get(MICROPROFILE_FRAMEWORK).toString()); } - additionalProperties.put(MICROPROFILE_FRAMEWORK, microprofileFramework); + convertPropertyToStringAndWriteBack(MICROPROFILE_FRAMEWORK, this::setMicroprofileFramework); - if (additionalProperties.containsKey(MICROPROFILE_MUTINY)) { - this.setMicroprofileMutiny(convertPropertyToBooleanAndWriteBack(MICROPROFILE_MUTINY)); - } + convertPropertyToBooleanAndWriteBack(MICROPROFILE_MUTINY, this::setMicroprofileMutiny); - if (!additionalProperties.containsKey(MICROPROFILE_REST_CLIENT_VERSION)) { - additionalProperties.put(MICROPROFILE_REST_CLIENT_VERSION, MICROPROFILE_REST_CLIENT_DEFAULT_VERSION); - } else { - String mpRestClientVersion = (String) additionalProperties.get(MICROPROFILE_REST_CLIENT_VERSION); - if (!mpRestClientVersions.containsKey(mpRestClientVersion)) { + convertPropertyToStringAndWriteBack(MICROPROFILE_REST_CLIENT_VERSION, value->microprofileRestClientVersion=value); + if (!mpRestClientVersions.containsKey(microprofileRestClientVersion)) { throw new IllegalArgumentException( String.format(Locale.ROOT, "Version %s of MicroProfile Rest Client is not supported or incorrect. Supported versions are %s", - mpRestClientVersion, + microprofileRestClientVersion, String.join(", ", mpRestClientVersions.keySet()) ) ); } - } + if (!additionalProperties.containsKey("rootJavaEEPackage")) { String mpRestClientVersion = (String) additionalProperties.get(MICROPROFILE_REST_CLIENT_VERSION); if (mpRestClientVersions.containsKey(mpRestClientVersion)) { @@ -387,76 +371,25 @@ public class JavaClientCodegen extends AbstractJavaCodegen } if (additionalProperties.containsKey(CONFIG_KEY)) { - this.setConfigKey(additionalProperties.get(CONFIG_KEY).toString()); - } else if (additionalProperties.containsKey(CONFIG_KEY_FROM_CLASS_NAME)) { - this.setConfigKeyFromClassName(Boolean.parseBoolean(additionalProperties.get(CONFIG_KEY_FROM_CLASS_NAME).toString())); + convertPropertyToStringAndWriteBack(CONFIG_KEY, this::setConfigKey); + } else { + convertPropertyToBooleanAndWriteBack(CONFIG_KEY_FROM_CLASS_NAME, this::setConfigKeyFromClassName); } - if (additionalProperties.containsKey(ASYNC_NATIVE)) { - this.setAsyncNative(convertPropertyToBooleanAndWriteBack(ASYNC_NATIVE)); - } - - if (additionalProperties.containsKey(PARCELABLE_MODEL)) { - this.setParcelableModel(Boolean.parseBoolean(additionalProperties.get(PARCELABLE_MODEL).toString())); - } - // put the boolean value back to PARCELABLE_MODEL in additionalProperties - additionalProperties.put(PARCELABLE_MODEL, parcelableModel); - - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION)); - } - - if (additionalProperties.containsKey(PERFORM_BEANVALIDATION)) { - this.setPerformBeanValidation(convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION)); - } - - if (additionalProperties.containsKey(USE_GZIP_FEATURE)) { - this.setUseGzipFeature(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE)); - } - - if (additionalProperties.containsKey(USE_RUNTIME_EXCEPTION)) { - this.setUseRuntimeException(convertPropertyToBooleanAndWriteBack(USE_RUNTIME_EXCEPTION)); - } - - if (additionalProperties.containsKey(USE_REFLECTION_EQUALS_HASHCODE)) { - this.setUseReflectionEqualsHashCode(convertPropertyToBooleanAndWriteBack(USE_REFLECTION_EQUALS_HASHCODE)); - } - - if (additionalProperties.containsKey(CASE_INSENSITIVE_RESPONSE_HEADERS)) { - this.setUseReflectionEqualsHashCode(convertPropertyToBooleanAndWriteBack(CASE_INSENSITIVE_RESPONSE_HEADERS)); - } - - if (additionalProperties.containsKey(USE_ABSTRACTION_FOR_FILES)) { - this.setUseAbstractionForFiles(convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES)); - } - - if (additionalProperties.containsKey(DYNAMIC_OPERATIONS)) { - this.setDynamicOperations(Boolean.parseBoolean(additionalProperties.get(DYNAMIC_OPERATIONS).toString())); - } - additionalProperties.put(DYNAMIC_OPERATIONS, dynamicOperations); - - if (additionalProperties.containsKey(SUPPORT_STREAMING)) { - this.setSupportStreaming(Boolean.parseBoolean(additionalProperties.get(SUPPORT_STREAMING).toString())); - } - additionalProperties.put(SUPPORT_STREAMING, supportStreaming); - - if (additionalProperties.containsKey(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT)) { - this.setWithAWSV4Signature(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT).toString())); - } - additionalProperties.put(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, withAWSV4Signature); - - if (additionalProperties.containsKey(GRADLE_PROPERTIES)) { - this.setGradleProperties(additionalProperties.get(GRADLE_PROPERTIES).toString()); - } - additionalProperties.put(GRADLE_PROPERTIES, gradleProperties); - - if (additionalProperties.containsKey(ERROR_OBJECT_TYPE)) { - this.setErrorObjectType(additionalProperties.get(ERROR_OBJECT_TYPE).toString()); - } - additionalProperties.put(ERROR_OBJECT_TYPE, errorObjectType); - if (additionalProperties.containsKey(WEBCLIENT_BLOCKING_OPERATIONS)) { - this.webclientBlockingOperations = Boolean.parseBoolean(additionalProperties.get(WEBCLIENT_BLOCKING_OPERATIONS).toString()); - } + convertPropertyToBooleanAndWriteBack(ASYNC_NATIVE, this::setAsyncNative); + convertPropertyToBooleanAndWriteBack(PARCELABLE_MODEL, this::setParcelableModel); + convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION, this::setPerformBeanValidation); + convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE, this::setUseGzipFeature); + convertPropertyToBooleanAndWriteBack(USE_RUNTIME_EXCEPTION, this::setUseRuntimeException); + convertPropertyToBooleanAndWriteBack(USE_REFLECTION_EQUALS_HASHCODE, this::setUseReflectionEqualsHashCode); + convertPropertyToBooleanAndWriteBack(CASE_INSENSITIVE_RESPONSE_HEADERS, this::setUseReflectionEqualsHashCode); + convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES, this::setUseAbstractionForFiles); + convertPropertyToBooleanAndWriteBack(DYNAMIC_OPERATIONS, this::setDynamicOperations); + convertPropertyToBooleanAndWriteBack(SUPPORT_STREAMING, this::setSupportStreaming); + convertPropertyToBooleanAndWriteBack(CodegenConstants.WITH_AWSV4_SIGNATURE_COMMENT, this::setWithAWSV4Signature); + convertPropertyToStringAndWriteBack(GRADLE_PROPERTIES, this::setGradleProperties); + convertPropertyToStringAndWriteBack(ERROR_OBJECT_TYPE, this::setErrorObjectType); + convertPropertyToBooleanAndWriteBack(WEBCLIENT_BLOCKING_OPERATIONS, op -> webclientBlockingOperations=op); // add URL query deepObject support to native, apache-httpclient by default if (!additionalProperties.containsKey(SUPPORT_URL_QUERY)) { @@ -468,26 +401,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen additionalProperties.put(SUPPORT_URL_QUERY, Boolean.parseBoolean(additionalProperties.get(SUPPORT_URL_QUERY).toString())); } - if (additionalProperties.containsKey(GENERATE_CLIENT_AS_BEAN)) { - this.setGenerateClientAsBean(convertPropertyToBooleanAndWriteBack(GENERATE_CLIENT_AS_BEAN)); - } - - if (additionalProperties.containsKey(USE_ENUM_CASE_INSENSITIVE)) { - this.setUseEnumCaseInsensitive(Boolean.parseBoolean(additionalProperties.get(USE_ENUM_CASE_INSENSITIVE).toString())); - } - - if (additionalProperties.containsKey(CodegenConstants.MAX_ATTEMPTS_FOR_RETRY)) { - this.setMaxAttemptsForRetry(Integer.parseInt(additionalProperties.get(CodegenConstants.MAX_ATTEMPTS_FOR_RETRY).toString())); - } else { - additionalProperties.put(CodegenConstants.MAX_ATTEMPTS_FOR_RETRY, maxAttemptsForRetry); - } - - if (additionalProperties.containsKey(CodegenConstants.WAIT_TIME_OF_THREAD)) { - this.setWaitTimeMillis(Long.parseLong((additionalProperties.get(CodegenConstants.WAIT_TIME_OF_THREAD).toString()))); - } else { - additionalProperties.put(CodegenConstants.WAIT_TIME_OF_THREAD, waitTimeMillis); - } - writePropertyBack(USE_ENUM_CASE_INSENSITIVE, useEnumCaseInsensitive); + convertPropertyToBooleanAndWriteBack(GENERATE_CLIENT_AS_BEAN, this::setGenerateClientAsBean); + convertPropertyToBooleanAndWriteBack(USE_ENUM_CASE_INSENSITIVE, this::setUseEnumCaseInsensitive); + convertPropertyToTypeAndWriteBack(CodegenConstants.MAX_ATTEMPTS_FOR_RETRY, Integer::parseInt, this::setMaxAttemptsForRetry); + convertPropertyToTypeAndWriteBack(CodegenConstants.WAIT_TIME_OF_THREAD, Long::parseLong, this::setWaitTimeMillis); final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); @@ -547,9 +464,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen "BeanValidationException.java")); } - if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { - setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); - } + convertPropertyToStringAndWriteBack(CodegenConstants.SERIALIZATION_LIBRARY, this::setSerializationLibrary); //TODO: add auto-generated doc to feign if (FEIGN.equals(getLibrary())) { @@ -697,8 +612,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen } else if (MICROPROFILE.equals(getLibrary())) { supportingFiles.clear(); // Don't need extra files provided by Java Codegen String apiExceptionFolder = (sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); - String mpRestClientVersion = (String) additionalProperties.get(MICROPROFILE_REST_CLIENT_VERSION); - String pomTemplate = mpRestClientVersions.get(mpRestClientVersion).pomTemplate; + String pomTemplate = mpRestClientVersions.get(microprofileRestClientVersion).pomTemplate; supportingFiles.add(new SupportingFile(pomTemplate, "", "pom.xml")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("api_exception.mustache", apiExceptionFolder, "ApiException.java")); @@ -716,7 +630,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportingFiles.add(new SupportingFile("kumuluzee.beans.xml.mustache", "src/main/resources/META-INF", "beans.xml")); } - if ("3.0".equals(mpRestClientVersion)) { + if ("3.0".equals(microprofileRestClientVersion)) { additionalProperties.put("microprofile3", true); } } else if (APACHE.equals(getLibrary())) { @@ -1172,10 +1086,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen return false; } - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } @@ -1184,10 +1094,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen return useSingleRequestParameter; } - private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { - this.useSingleRequestParameter = useSingleRequestParameter; - } - public void setUseRxJava(boolean useRxJava) { this.useRxJava = useRxJava; doNotUseRx = false; @@ -1203,114 +1109,20 @@ public class JavaClientCodegen extends AbstractJavaCodegen doNotUseRx = false; } - public void setDoNotUseRx(boolean doNotUseRx) { - this.doNotUseRx = doNotUseRx; - } - - public void setUsePlayWS(boolean usePlayWS) { - this.usePlayWS = usePlayWS; - } - - public void setAsyncNative(boolean asyncNative) { - this.asyncNative = asyncNative; - } - - public void setMicroprofileFramework(String microprofileFramework) { - this.microprofileFramework = microprofileFramework; - } - - public void setMicroprofileMutiny(boolean microprofileMutiny) { - this.microprofileMutiny = microprofileMutiny; - } - - public void setConfigKey(String configKey) { - this.configKey = configKey; - } - - public void setParcelableModel(boolean parcelableModel) { - this.parcelableModel = parcelableModel; - } - - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - public void setPerformBeanValidation(boolean performBeanValidation) { - this.performBeanValidation = performBeanValidation; - } - - public void setUseGzipFeature(boolean useGzipFeature) { - this.useGzipFeature = useGzipFeature; - } - - public void setUseRuntimeException(boolean useRuntimeException) { - this.useRuntimeException = useRuntimeException; - } - - public void setUseReflectionEqualsHashCode(boolean useReflectionEqualsHashCode) { - this.useReflectionEqualsHashCode = useReflectionEqualsHashCode; - } - public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } - public void setUseAbstractionForFiles(boolean useAbstractionForFiles) { - this.useAbstractionForFiles = useAbstractionForFiles; - } - - public void setDynamicOperations(final boolean dynamicOperations) { - this.dynamicOperations = dynamicOperations; - } - - public void setSupportStreaming(final boolean supportStreaming) { - this.supportStreaming = supportStreaming; - } - - public void setWithAWSV4Signature(boolean withAWSV4Signature) { - this.withAWSV4Signature = withAWSV4Signature; - } - - public void setGradleProperties(final String gradleProperties) { - this.gradleProperties = gradleProperties; - } - - public void setErrorObjectType(final String errorObjectType) { - this.errorObjectType = errorObjectType; - } - - public void setGenerateClientAsBean(boolean generateClientAsBean) { - this.generateClientAsBean = generateClientAsBean; - } - - public void setUseEnumCaseInsensitive(boolean useEnumCaseInsensitive) { - this.useEnumCaseInsensitive = useEnumCaseInsensitive; - } - - public void setMaxAttemptsForRetry(int maxAttemptsForRetry) { - this.maxAttemptsForRetry = maxAttemptsForRetry; - } - - public void setWaitTimeMillis(long waitTimeMillis) { - this.waitTimeMillis = waitTimeMillis; - } - - /** - * Serialization library. - * - * @return 'gson' or 'jackson' - */ - public String getSerializationLibrary() { - return serializationLibrary; - } - public void setSerializationLibrary(String serializationLibrary) { if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + this.jackson = true; } else if (SERIALIZATION_LIBRARY_GSON.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_GSON; + this.jackson = false; } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB; + this.jackson = false; } else { throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); } @@ -1331,10 +1143,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen return super.postProcessSupportingFileData(objs); } - private void setConfigKeyFromClassName(boolean configKeyFromClassName) { - this.configKeyFromClassName = configKeyFromClassName; - } - @Override public String toApiVarName(String name) { String apiVarName = super.toApiVarName(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java index 79ce9f6186c..980f2051ade 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java @@ -33,6 +33,8 @@ import java.util.TreeSet; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; @@ -65,14 +67,13 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen { private static final String X_HELIDON_IMPL_IMPORTS = "x-helidon-implImports"; public static final String CONFIG_KEY = "configKey"; - protected String configKey = null; - protected boolean useBeanValidation = false; - protected boolean performBeanValidation = false; - protected boolean useGzipFeature = false; + @Setter protected String configKey = null; + @Setter protected boolean performBeanValidation = false; + @Setter protected boolean useGzipFeature = false; protected boolean caseInsensitiveResponseHeaders = false; protected Path invokerFolder; protected Path apiFolder; - protected String serializationLibrary = null; + @Getter protected String serializationLibrary = null; /** * Constructor for this generator. Uses the embedded template dir to find common templates @@ -172,13 +173,9 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen { public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(SERIALIZATION_LIBRARY)) { - setSerializationLibrary(additionalProperties.get(SERIALIZATION_LIBRARY).toString()); - } + convertPropertyToStringAndWriteBack(SERIALIZATION_LIBRARY, this::setSerializationLibrary); - if (additionalProperties.containsKey(CONFIG_KEY)) { - setConfigKey(additionalProperties.get(CONFIG_KEY).toString()); - } + convertPropertyToStringAndWriteBack(CONFIG_KEY, this::setConfigKey); String invokerPath = invokerPackage.replace('.', File.separatorChar); invokerFolder = Paths.get(sourceFolder, invokerPath); @@ -460,35 +457,17 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen { return objs; } - public void setConfigKey(String configKey) { - this.configKey = configKey; - } - - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - public void setPerformBeanValidation(boolean performBeanValidation) { - this.performBeanValidation = performBeanValidation; - } - - public void setUseGzipFeature(boolean useGzipFeature) { - this.useGzipFeature = useGzipFeature; - } - public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } - public String getSerializationLibrary() { - return serializationLibrary; - } - public void setSerializationLibrary(String serializationLibrary) { if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + this.jackson = true; } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB; + this.jackson = false; } else { throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java index 56867bd176d..4e4cceb4960 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java @@ -29,6 +29,7 @@ import java.util.Map; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; +import lombok.Getter; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; @@ -54,9 +55,8 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { public static final String USE_ABSTRACT_CLASS = "useAbstractClass"; public static final String GRADLE_PROJECT = "gradleProject"; - protected boolean useBeanValidation = true; protected String implFolder = "src/main/java"; - protected String serializationLibrary = null; + @Getter protected String serializationLibrary = null; private boolean useAbstractClass = false; private boolean gradleProject = false; @@ -70,6 +70,7 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); + this.useBeanValidation = true; outputFolder = "generated-code" + File.separator + "java"; embeddedTemplateDir = templateDir = "java-helidon" + File.separator + "server"; invokerPackage = "org.openapitools.server"; @@ -149,36 +150,19 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { List unmodifiable = new ArrayList<>(); unmodifiable.add(openApiFile); - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - importMapping.put("ObjectMapper", "com.fasterxml.jackson.databind.ObjectMapper"); importMapping.put("Jsonb", rootJavaEEPackage() + ".json.bind.Jsonb"); importMapping.put("JsonbBuilder", rootJavaEEPackage() + ".json.bind.JsonbBuilder"); - if (additionalProperties.containsKey(USE_ABSTRACT_CLASS)) { - useAbstractClass = Boolean.parseBoolean(additionalProperties.get(USE_ABSTRACT_CLASS).toString()); - } - if (!useAbstractClass) { - additionalProperties.remove(USE_ABSTRACT_CLASS); - } - - if (additionalProperties.containsKey(GRADLE_PROJECT)) { - gradleProject = Boolean.parseBoolean(additionalProperties.get(GRADLE_PROJECT).toString()); - } - if (!gradleProject) { - additionalProperties.remove(GRADLE_PROJECT); - } else { + convertPropertyToBooleanAndWriteBack(USE_ABSTRACT_CLASS, value -> useAbstractClass = value); + convertPropertyToBooleanAndWriteBack(GRADLE_PROJECT, value -> gradleProject = value); + if (gradleProject) { modifiable.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); modifiable.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); modifiable.remove(pomFile); } - if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { - setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); - } + convertPropertyToStringAndWriteBack(CodegenConstants.SERIALIZATION_LIBRARY, this::setSerializationLibrary); String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); @@ -275,7 +259,7 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { CodegenOperation codegenOperation = super.fromOperation(path, httpMethod, operation, servers); if (HELIDON_SE.equals(getLibrary())) { - if (additionalProperties.containsKey(JACKSON)) { + if (isJackson()) { codegenOperation.imports.add("ObjectMapper"); } if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JSONB)) { @@ -352,7 +336,7 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { if (Boolean.TRUE.equals(model.hasEnums)) { // Add imports for Jackson - if (additionalProperties.containsKey(JACKSON)) { + if (isJackson()) { model.imports.add("JsonValue"); model.imports.add("JsonCreator"); } @@ -374,26 +358,18 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { return "Generates a Java Helidon Server application."; } - - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - @Override public void setPerformBeanValidation(boolean performBeanValidation) { throw new UnsupportedOperationException("Not implemented"); } - public String getSerializationLibrary() { - return serializationLibrary; - } - public void setSerializationLibrary(String serializationLibrary) { if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + this.jackson = true; } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB; + this.jackson = false; } else { throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java index 471fb2a14cc..680a98320a6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java @@ -73,7 +73,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen { additionalProperties.put("title", title); // java inflector uses the jackson lib - additionalProperties.put(JACKSON, "true"); + this.jackson = true; } @Override @@ -213,6 +213,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen { return super.getOrGenerateOperationId(operation, path, httpMethod.toUpperCase(Locale.ROOT)); } + @Override public String apiFilename(String templateName, String tag) { String result = super.apiFilename(templateName, tag); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index ddd5dfaccc0..7da886e8743 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -69,13 +69,6 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - - supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen // POM @@ -113,8 +106,4 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp return "Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an " + "Apache CXF runtime and a Java EE runtime with CDI enabled."; } - - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java index ef2c3097a9f..c0cc50bb49f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -18,6 +18,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -54,8 +56,15 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { private boolean useMicroProfileOpenAPIAnnotations = false; private boolean useMutiny = false; + @Setter protected boolean useGzipFeature = false; - private boolean useJackson = false; + /** + * -- SETTER -- + * Location where the file containing the spec will be generated in the output folder. + * + * @param location location inside the output folder. No file generated when set to null or empty string. + */ + @Getter @Setter private String openApiSpecFileLocation = "src/main/openapi/openapi.yaml"; public JavaJAXRSSpecServerCodegen() { @@ -124,54 +133,26 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { @Override public void processOpts() { - if (additionalProperties.containsKey(GENERATE_POM)) { - generatePom = Boolean.parseBoolean(additionalProperties.get(GENERATE_POM).toString()); - } - if (additionalProperties.containsKey(INTERFACE_ONLY)) { - interfaceOnly = Boolean.parseBoolean(additionalProperties.get(INTERFACE_ONLY).toString()); - if (!interfaceOnly) { - additionalProperties.remove(INTERFACE_ONLY); - } - } - if (additionalProperties.containsKey(RETURN_RESPONSE)) { - returnResponse = Boolean.parseBoolean(additionalProperties.get(RETURN_RESPONSE).toString()); - if (!returnResponse) { - additionalProperties.remove(RETURN_RESPONSE); - } - } - if (additionalProperties.containsKey(SUPPORT_ASYNC)) { - supportAsync = Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString()); - if (!supportAsync) { - additionalProperties.remove(SUPPORT_ASYNC); - } else { - // java8 tag has been deprecated - //setJava8ModeAndAdditionalProperties(true); - } - } + convertPropertyToBooleanAndWriteBack(GENERATE_POM, value -> generatePom = value); + + convertPropertyToBooleanAndWriteBack(INTERFACE_ONLY, value -> interfaceOnly = value); + convertPropertyToBooleanAndWriteBack(RETURN_RESPONSE, value -> returnResponse = value); + convertPropertyToBooleanAndWriteBack(SUPPORT_ASYNC, this::setSupportAsync); if (QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || OPEN_LIBERTY_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) { useSwaggerAnnotations = false; } else { - if (additionalProperties.containsKey(USE_SWAGGER_ANNOTATIONS)) { - useSwaggerAnnotations = Boolean.parseBoolean(additionalProperties.get(USE_SWAGGER_ANNOTATIONS).toString()); - } + convertPropertyToBooleanAndWriteBack(USE_SWAGGER_ANNOTATIONS, value -> useSwaggerAnnotations = value); } if (KUMULUZEE_LIBRARY.equals(library)){ super.setSourceFolder("src/main/java"); } - writePropertyBack(USE_SWAGGER_ANNOTATIONS, useSwaggerAnnotations); if (QUARKUS_LIBRARY.equals(library)) { - if (additionalProperties.containsKey(USE_MICROPROFILE_OPENAPI_ANNOTATIONS)) { - useMicroProfileOpenAPIAnnotations = Boolean.parseBoolean(additionalProperties.get(USE_MICROPROFILE_OPENAPI_ANNOTATIONS).toString()); - } - writePropertyBack(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, useMicroProfileOpenAPIAnnotations); + convertPropertyToBooleanAndWriteBack(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, value -> useMicroProfileOpenAPIAnnotations = value); } if (QUARKUS_LIBRARY.equals(library)) { - if (additionalProperties.containsKey(USE_MUTINY)) { - useMutiny = Boolean.parseBoolean(additionalProperties.get(USE_MUTINY).toString()); - } - writePropertyBack(USE_MUTINY, useMutiny); + convertPropertyToBooleanAndWriteBack(USE_MUTINY, value -> useMutiny = value); } if (additionalProperties.containsKey(OPEN_API_SPEC_FILE_LOCATION)) { @@ -184,8 +165,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { additionalProperties.put(OPEN_API_SPEC_FILE_LOCATION, openApiSpecFileLocation); - useJackson = convertPropertyToBoolean(JACKSON); - if (interfaceOnly) { // Change default artifactId if generating interfaces only, before command line options are applied in base class. artifactId = "openapi-jaxrs-client"; @@ -255,12 +234,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { supportingFiles.add(new SupportingFile("config.yaml.mustache", "src/main/resources", "config.yaml")); } - if (additionalProperties.containsKey(USE_GZIP_FEATURE)) { - useGzipFeature = Boolean.parseBoolean(additionalProperties.get(USE_GZIP_FEATURE).toString()); - if (!useGzipFeature) { - additionalProperties.remove(USE_GZIP_FEATURE); - } - } + convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE, this::setUseGzipFeature); } @Override @@ -268,18 +242,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { return "jaxrs-spec"; } - public String getOpenApiSpecFileLocation() { - return openApiSpecFileLocation; - } - - /** - * Location where the file containing the spec will be generated in the output folder. - * @param location location inside the output folder. No file generated when set to null or empty string. - */ - public void setOpenApiSpecFileLocation(String location) { - this.openApiSpecFileLocation = location; - } - @Override public CodegenModel fromModel(String name, Schema model) { CodegenModel codegenModel = super.fromModel(name, model); @@ -287,7 +249,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { codegenModel.imports.remove("ApiModelProperty"); codegenModel.imports.remove("ApiModel"); } - if (!useJackson) { + if (!jackson) { codegenModel.imports.remove("JsonSerialize"); codegenModel.imports.remove("ToStringSerializer"); codegenModel.imports.remove("JsonValue"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java index 3ddb064eda0..27763fcb5ef 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJerseyServerCodegen.java @@ -115,10 +115,7 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen { } - if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { - implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); - } - + convertPropertyToStringAndWriteBack(CodegenConstants.IMPL_FOLDER, value -> implFolder = value); if ("joda".equals(dateLibrary)) { supportingFiles.add(new SupportingFile("JodaDateTimeProvider.mustache", (sourceFolder + '/' + apiPackage).replace(".", "/"), "JodaDateTimeProvider.java")); supportingFiles.add(new SupportingFile("JodaLocalDateProvider.mustache", (sourceFolder + '/' + apiPackage).replace(".", "/"), "JodaLocalDateProvider.java")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java index 49a5498a6e6..9cd0136077a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMSF4JServerCodegen.java @@ -92,9 +92,7 @@ public class JavaMSF4JServerCodegen extends AbstractJavaJAXRSServerCodegen { setLibrary(DEFAULT_MSF4J_LIBRARY); } - if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { - implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); - } + convertPropertyToStringAndWriteBack(CodegenConstants.IMPL_FOLDER, value -> implFolder = value); if ("joda".equals(dateLibrary)) { supportingFiles.add(new SupportingFile("JodaDateTimeProvider.mustache", (sourceFolder + '/' + apiPackage).replace(".", "/"), "JodaDateTimeProvider.java")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java index e169a653e8d..8e19ac226ab 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java @@ -5,6 +5,8 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -24,8 +26,6 @@ import java.util.*; import java.util.stream.Collectors; import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE; -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen implements BeanValidationFeatures, OptionalFeatures { public static final String OPT_TITLE = "title"; @@ -58,8 +58,8 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i protected final Logger LOGGER = LoggerFactory.getLogger(JavaMicronautAbstractCodegen.class); protected String title; - protected boolean useBeanValidation; - protected boolean useOptional; + @Getter protected boolean useOptional; + @Getter @Setter protected boolean visitable; protected String buildTool; protected String testTool; @@ -225,10 +225,6 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i } // Get boolean properties - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); if (additionalProperties.containsKey(USE_OPTIONAL)) { this.setUseOptional(convertPropertyToBoolean(USE_OPTIONAL)); @@ -318,6 +314,7 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY)); } additionalProperties.put(this.serializationLibrary, true); + this.jackson = JACKSON.equals(this.serializationLibrary); // Add all the supporting files String resourceFolder = projectFolder + "/resources"; @@ -426,20 +423,11 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i return toModelName(name) + "Test"; } - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - @Override public void setUseOptional(boolean useOptional) { this.useOptional = useOptional; } - public void setVisitable(boolean visitable) { - this.visitable = visitable; - } - @Override public String toApiVarName(String name) { String apiVarName = super.toApiVarName(name); @@ -449,18 +437,6 @@ public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen i return apiVarName; } - public boolean isUseBeanValidation() { - return useBeanValidation; - } - - public boolean isUseOptional() { - return useOptional; - } - - public boolean isVisitable() { - return visitable; - } - @Override public String sanitizeTag(String tag) { // Skip sanitization to get the original tag name in the addOperationToGroup() method. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java index cdf8b8a1fcf..58426205629 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java @@ -3,6 +3,8 @@ package org.openapitools.codegen.languages; import java.util.Arrays; import java.util.List; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; @@ -22,10 +24,10 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { public static final String NAME = "java-micronaut-client"; - protected boolean configureAuthorization; - protected List additionalClientTypeAnnotations; + @Getter protected boolean configureAuthorization; + @Setter protected List additionalClientTypeAnnotations; protected String authorizationFilterPattern; - protected String basePathSeparator = "-"; + @Setter protected String basePathSeparator = "-"; protected String clientId; public JavaMicronautClientCodegen() { @@ -61,29 +63,17 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { return "Generates a Java Micronaut Client."; } - public boolean isConfigureAuthorization() { - return configureAuthorization; - } - @Override public void processOpts() { super.processOpts(); - - if (additionalProperties.containsKey(OPT_CONFIGURE_AUTH)) { - this.configureAuthorization = convertPropertyToBoolean(OPT_CONFIGURE_AUTH); - } - writePropertyBack(OPT_CONFIGURE_AUTH, configureAuthorization); + convertPropertyToBooleanAndWriteBack(OPT_CONFIGURE_AUTH, value -> this.configureAuthorization = value); // Write property that is present in server writePropertyBack(OPT_USE_AUTH, true); writePropertyBack(OPT_CONFIGURE_AUTH_FILTER_PATTERN, false); writePropertyBack(OPT_CONFIGURE_CLIENT_ID, false); - - if(additionalProperties.containsKey(BASE_PATH_SEPARATOR)) { - basePathSeparator = additionalProperties.get(BASE_PATH_SEPARATOR).toString(); - } - writePropertyBack(BASE_PATH_SEPARATOR, basePathSeparator); + convertPropertyToStringAndWriteBack(BASE_PATH_SEPARATOR, this::setBasePathSeparator); final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); @@ -143,10 +133,6 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { apiDocTemplateFiles.put("client/doc/api_doc.mustache", ".md"); } - public void setAdditionalClientTypeAnnotations(final List additionalClientTypeAnnotations) { - this.additionalClientTypeAnnotations = additionalClientTypeAnnotations; - } - public void setAuthorizationFilterPattern(final String pattern) { writePropertyBack(OPT_CONFIGURE_AUTH_FILTER_PATTERN, true); this.authorizationFilterPattern = pattern; @@ -156,8 +142,4 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { writePropertyBack(OPT_CONFIGURE_CLIENT_ID, true); this.clientId = id; } - - public void setBasePathSeparator(final String separator) { - this.basePathSeparator = separator; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicroprofileServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicroprofileServerCodegen.java index df04653b8a6..d9719592d0a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicroprofileServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicroprofileServerCodegen.java @@ -26,14 +26,17 @@ public class JavaMicroprofileServerCodegen extends JavaClientCodegen { setLibrary("microprofile"); } + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "java-microprofile"; } + @Override public String getHelp() { return "Generates a microprofile server."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java index 1289a515486..351242ad353 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java @@ -21,6 +21,8 @@ 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.tags.Tag; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.model.ModelMap; @@ -39,6 +41,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; /** * Created by prokarma on 04/09/17. */ +@Setter public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { public static final String CONFIG_PACKAGE = "configPackage"; @@ -47,10 +50,10 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { public static final String EUREKA_URI = "eurekaUri"; public static final String ZIPKIN_URI = "zipkinUri"; public static final String SPRINGADMIN_URI = "springBootAdminUri"; - protected String basePackage = "com.prokarma.pkmst"; - protected String serviceName = "Pkmst"; - protected String configPackage = "com.prokarma.pkmst.config"; - protected String title; + @Getter protected String basePackage = "com.prokarma.pkmst"; + @Getter protected String serviceName = "Pkmst"; + @Getter protected String configPackage = "com.prokarma.pkmst.config"; + @Getter protected String title; protected String eurekaUri; protected String zipkinUri; protected String springBootAdminUri; @@ -74,7 +77,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - additionalProperties.put(JACKSON, "true"); + this.jackson = true; this.cliOptions.add(new CliOption("basePackage", "base package for java source code")); this.cliOptions.add(new CliOption("serviceName", "Service Name")); @@ -95,19 +98,23 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { } } + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "java-pkmst"; } + @Override public String getHelp() { return "Generates a PKMST SpringBoot Server application using the SpringFox integration." + " Also enables EurekaServerClient / Zipkin / Spring-Boot admin"; } + @Override public void processOpts() { super.processOpts(); if (this.additionalProperties.containsKey("basePackage")) { @@ -123,53 +130,18 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { this.additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); this.additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); } - if (this.additionalProperties.containsKey("groupId")) { - this.setGroupId((String) this.additionalProperties.get("groupId")); - } else { - // not set, use to be passed to template - additionalProperties.put(CodegenConstants.GROUP_ID, groupId); - } - if (this.additionalProperties.containsKey("artifactId")) { - this.setArtifactId((String) this.additionalProperties.get("artifactId")); - } else { - // not set, use to be passed to template - additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); - } - if (this.additionalProperties.containsKey("artifactVersion")) { - this.setArtifactVersion((String) this.additionalProperties.get("artifactVersion")); - } else { - // not set, use to be passed to template - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - } - if (this.additionalProperties.containsKey("serviceName")) { - this.setServiceName((String) this.additionalProperties.get("serviceName")); - } else { - // not set, use to be passed to template - additionalProperties.put("serviceName", serviceName); - } + convertPropertyToStringAndWriteBack("groupId", this::setGroupId); - if (this.additionalProperties.containsKey(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING)) { - this.setSerializeBigDecimalAsString(Boolean.parseBoolean( - this.additionalProperties.get(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING).toString())); - } - if (this.additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { - this.setSerializableModel( - Boolean.valueOf(this.additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL).toString())); - } - if (this.additionalProperties.containsKey(TITLE)) { - this.setTitle((String) this.additionalProperties.get(TITLE)); - } + convertPropertyToStringAndWriteBack("artifactId", this::setArtifactId); + convertPropertyToStringAndWriteBack("artifactVersion", this::setArtifactVersion); + convertPropertyToStringAndWriteBack("serviceName", this::setServiceName); + convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, this::setSerializeBigDecimalAsString); + convertPropertyToStringAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL, this::setTitle); this.additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); - if (this.additionalProperties.containsKey(EUREKA_URI)) { - this.setEurekaUri((String) this.additionalProperties.get(EUREKA_URI)); - } - if (this.additionalProperties.containsKey(ZIPKIN_URI)) { - this.setZipkinUri((String) this.additionalProperties.get(ZIPKIN_URI)); - } - if (this.additionalProperties.containsKey(SPRINGADMIN_URI)) { - this.setSpringBootAdminUri((String) this.additionalProperties.get(SPRINGADMIN_URI)); - } + convertPropertyToStringAndWriteBack(EUREKA_URI, this::setEurekaUri); + convertPropertyToStringAndWriteBack(ZIPKIN_URI, this::setZipkinUri); + convertPropertyToStringAndWriteBack(SPRINGADMIN_URI, this::setSpringBootAdminUri); this.additionalProperties.put("java8", true); if (this.additionalProperties.containsKey(WITH_XML)) { @@ -319,10 +291,12 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { } doDataTypeAssignment(resp.dataType, new DataTypeAssigner() { + @Override public void setReturnType(final String returnType) { resp.dataType = returnType; } + @Override public void setReturnContainer(final String returnContainer) { resp.containerType = returnContainer; } @@ -332,10 +306,12 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { doDataTypeAssignment(operation.returnType, new DataTypeAssigner() { + @Override public void setReturnType(final String returnType) { operation.returnType = returnType; } + @Override public void setReturnContainer(final String returnContainer) { operation.returnContainer = returnContainer; } @@ -395,7 +371,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { } } else { // enum class // Needed imports for Jackson's JsonCreator - if (this.additionalProperties.containsKey(JACKSON)) { + if (isJackson()) { model.imports.add("JsonCreator"); } } @@ -578,50 +554,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { return (this.outputFolder + "/" + this.modelDocPath).replace("/", File.separator); } - public void setEurekaUri(String eurekaUri) { - this.eurekaUri = eurekaUri; - } - - public void setZipkinUri(String zipkinUri) { - this.zipkinUri = zipkinUri; - } - - public void setSpringBootAdminUri(String springBootAdminUri) { - this.springBootAdminUri = springBootAdminUri; - } - - public String getBasePackage() { - return basePackage; - } - - public void setBasePackage(String basePackage) { - this.basePackage = basePackage; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getConfigPackage() { - return configPackage; - } - - public void setConfigPackage(String configPackage) { - this.configPackage = configPackage; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - private interface DataTypeAssigner { void setReturnType(String returnType); @@ -629,18 +561,11 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { void setReturnContainer(String returnContainer); } + @Getter @Setter private static class ResourcePath { private String path; - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - @Override public String toString() { return this.path; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java index 2e652dcfc53..72deea70ce2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java @@ -19,6 +19,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -52,22 +54,24 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea private static final String X_TOKEN_INTROSPECT_URL = "x-tokenIntrospectUrl"; - protected String title = "openapi-java-playframework"; + @Setter protected String title = "openapi-java-playframework"; + @Getter @Setter protected String configPackage = "org.openapitools.configuration"; + @Getter @Setter protected String basePackage = "org.openapitools"; - protected boolean controllerOnly = false; - protected boolean useInterfaces = true; - protected boolean useBeanValidation = true; - protected boolean handleExceptions = true; - protected boolean wrapCalls = true; - protected boolean useSwaggerUI = true; - protected boolean supportAsync = false; + @Setter protected boolean controllerOnly = false; + @Setter protected boolean useInterfaces = true; + @Setter protected boolean handleExceptions = true; + @Setter protected boolean wrapCalls = true; + @Setter protected boolean useSwaggerUI = true; + @Setter protected boolean supportAsync = false; public JavaPlayFrameworkCodegen() { super(); modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); + useBeanValidation = true; outputFolder = "generated-code/javaPlayFramework"; apiTestTemplateFiles.clear(); embeddedTemplateDir = templateDir = "JavaPlayFramework"; @@ -89,7 +93,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); additionalProperties.put("java8", true); - additionalProperties.put(JACKSON, "true"); + this.jackson = true; cliOptions.add(new CliOption(TITLE, "server title name or client service name").defaultValue(title)); cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code").defaultValue(getConfigPackage())); @@ -129,57 +133,20 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea //TODO: add doc templates modelDocTemplateFiles.remove("model_doc.mustache"); apiDocTemplateFiles.remove("api_doc.mustache"); + convertPropertyToStringAndWriteBack(TITLE, this::setTitle); - if (additionalProperties.containsKey(TITLE)) { - this.setTitle((String) additionalProperties.get(TITLE)); - } + convertPropertyToStringAndWriteBack(CONFIG_PACKAGE, this::setConfigPackage); - if (additionalProperties.containsKey(CONFIG_PACKAGE)) { - this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE)); - } else { - additionalProperties.put(CONFIG_PACKAGE, configPackage); - } + convertPropertyToStringAndWriteBack(BASE_PACKAGE, this::setBasePackage); + convertPropertyToBooleanAndWriteBack(CONTROLLER_ONLY, this::setControllerOnly); - if (additionalProperties.containsKey(BASE_PACKAGE)) { - this.setBasePackage((String) additionalProperties.get(BASE_PACKAGE)); - } else { - additionalProperties.put(BASE_PACKAGE, basePackage); - } + convertPropertyToBooleanAndWriteBack(USE_INTERFACES, this::setUseInterfaces); - if (additionalProperties.containsKey(CONTROLLER_ONLY)) { - this.setControllerOnly(convertPropertyToBoolean(CONTROLLER_ONLY)); - } - writePropertyBack(CONTROLLER_ONLY, controllerOnly); + convertPropertyToBooleanAndWriteBack(HANDLE_EXCEPTIONS, this::setHandleExceptions); + convertPropertyToBooleanAndWriteBack(WRAP_CALLS, this::setWrapCalls); - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - - if (additionalProperties.containsKey(USE_INTERFACES)) { - this.setUseInterfaces(convertPropertyToBoolean(USE_INTERFACES)); - } - writePropertyBack(USE_INTERFACES, useInterfaces); - - if (additionalProperties.containsKey(HANDLE_EXCEPTIONS)) { - this.setHandleExceptions(convertPropertyToBoolean(HANDLE_EXCEPTIONS)); - } - writePropertyBack(HANDLE_EXCEPTIONS, handleExceptions); - - if (additionalProperties.containsKey(WRAP_CALLS)) { - this.setWrapCalls(convertPropertyToBoolean(WRAP_CALLS)); - } - writePropertyBack(WRAP_CALLS, wrapCalls); - - if (additionalProperties.containsKey(USE_SWAGGER_UI)) { - this.setUseSwaggerUI(convertPropertyToBoolean(USE_SWAGGER_UI)); - } - writePropertyBack(USE_SWAGGER_UI, useSwaggerUI); - - if (additionalProperties.containsKey(SUPPORT_ASYNC)) { - this.setSupportAsync(convertPropertyToBoolean(SUPPORT_ASYNC)); - } - writePropertyBack(SUPPORT_ASYNC, supportAsync); + convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); + convertPropertyToBooleanAndWriteBack(SUPPORT_ASYNC, this::setSupportAsync); //We don't use annotation anymore importMapping.remove("ApiModelProperty"); @@ -258,54 +225,6 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea return codegenModel; } - public void setTitle(String title) { - this.title = title; - } - - public String getConfigPackage() { - return configPackage; - } - - public void setConfigPackage(String configPackage) { - this.configPackage = configPackage; - } - - public String getBasePackage() { - return basePackage; - } - - public void setBasePackage(String basePackage) { - this.basePackage = basePackage; - } - - public void setControllerOnly(boolean controllerOnly) { - this.controllerOnly = controllerOnly; - } - - public void setUseInterfaces(boolean useInterfaces) { - this.useInterfaces = useInterfaces; - } - - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - public void setHandleExceptions(boolean handleExceptions) { - this.handleExceptions = handleExceptions; - } - - public void setWrapCalls(boolean wrapCalls) { - this.wrapCalls = wrapCalls; - } - - public void setUseSwaggerUI(boolean useSwaggerUI) { - this.useSwaggerUI = useSwaggerUI; - } - - public void setSupportAsync(boolean supportAsync) { - this.supportAsync = supportAsync; - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { OperationMap operations = objs.getOperations(); @@ -460,6 +379,5 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea sb.append(", tokenIntrospectUrl='").append(tokenIntrospectUrl).append('\''); return sb.toString(); } - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java index 03d8728f69a..cf40de482c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.apache.commons.lang3.BooleanUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -32,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +@Setter public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen implements JbossFeature, BeanValidationFeatures, SwaggerFeatures { @@ -80,22 +82,9 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)) { - boolean generateJbossDeploymentDescriptorProp = convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); - this.setGenerateJbossDeploymentDescriptor(generateJbossDeploymentDescriptorProp); - } + convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, this::setGenerateJbossDeploymentDescriptor); - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - - if (additionalProperties.containsKey(USE_SWAGGER_FEATURE)) { - this.setUseSwaggerFeature(convertPropertyToBoolean(USE_SWAGGER_FEATURE)); - } - - writePropertyBack(USE_SWAGGER_FEATURE, useSwaggerFeature); + convertPropertyToBooleanAndWriteBack(USE_SWAGGER_FEATURE, this::setUseSwaggerFeature); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml") .doNotOverwrite()); @@ -159,16 +148,4 @@ public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen removeImport(objs, "java.util.List"); return objs; } - - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) { - this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor; - } - - public void setUseSwaggerFeature(boolean useSwaggerFeature) { - this.useSwaggerFeature = useSwaggerFeature; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java index 248eec26660..30f2c7dcb9d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyServerCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import lombok.Setter; import org.apache.commons.lang3.BooleanUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.JbossFeature; @@ -28,6 +29,7 @@ import org.openapitools.codegen.model.OperationsMap; import java.io.File; import java.util.*; +@Setter public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen implements JbossFeature { protected boolean generateJbossDeploymentDescriptor = true; @@ -73,12 +75,7 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR)) { - boolean generateJbossDeploymentDescriptorProp = convertPropertyToBooleanAndWriteBack( - GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR); - this.setGenerateJbossDeploymentDescriptor(generateJbossDeploymentDescriptorProp); - } - + convertPropertyToBooleanAndWriteBack(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, this::setGenerateJbossDeploymentDescriptor); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml") .doNotOverwrite()); supportingFiles.add(new SupportingFile("gradle.mustache", "", "build.gradle") @@ -168,8 +165,4 @@ public class JavaResteasyServerCodegen extends AbstractJavaJAXRSServerCodegen im removeImport(objs, "java.util.List"); return objs; } - - public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) { - this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java index 58f6f362655..c13bc3c4aeb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java @@ -190,6 +190,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen { return objs; } + @Override public String apiFilename(String templateName, String tag) { String result = super.apiFilename(templateName, tag); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java index ddff4cf7108..8d8701b6372 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java @@ -119,6 +119,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -129,6 +130,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { * * @return the friendly name for the generator */ + @Override public String getName() { return "java-vertx"; } @@ -139,6 +141,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a java-Vert.X Server library."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java index a7fc895b215..c55d972fa4e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java @@ -76,14 +76,17 @@ public class JavaVertXWebServerCodegen extends AbstractJavaCodegen { typeMapping.put("DateTime", "String"); } + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "java-vertx-web"; } + @Override public String getHelp() { return "Generates a Java Vert.x-Web Server (beta)."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaWiremockServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaWiremockServerCodegen.java index 8cb6eebaa7f..101ea6c5ff3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaWiremockServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaWiremockServerCodegen.java @@ -14,14 +14,17 @@ import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; public class JavaWiremockServerCodegen extends AbstractJavaCodegen implements CodegenConfig { + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "java-wiremock"; } + @Override public String getHelp() { return "Generates Java WireMock stubs, requests and responses samples."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java index 9676b9bf34c..b7c3d422704 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java @@ -20,10 +20,10 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -83,24 +83,25 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod new String[]{"gitignore.mustache", ".gitignore"} }; - protected String projectName; - protected String moduleName; - protected String projectDescription; - protected String projectVersion; - protected String licenseName; + @Setter protected String projectName; + @Setter protected String moduleName; + @Setter protected String projectDescription; + @Setter protected String projectVersion; + @Setter protected String licenseName; + @Getter @Setter protected String invokerPackage; - protected String sourceFolder = "src"; - protected boolean usePromises; - protected boolean emitModelMethods; - protected boolean emitJSDoc = true; + @Setter protected String sourceFolder = "src"; + @Setter protected boolean usePromises; + @Setter protected boolean emitModelMethods; + @Setter protected boolean emitJSDoc = true; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String apiTestPath = "api/"; protected String modelTestPath = "model/"; protected boolean useES6 = true; // default is ES6 - protected String npmRepository = null; - private String modelPropertyNaming = "camelCase"; + @Setter protected String npmRepository = null; + @Getter private String modelPropertyNaming = "camelCase"; public JavascriptApolloClientCodegen() { super(); @@ -418,59 +419,11 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod return createPath(outputFolder, sourceFolder, invokerPackage, modelPackage()); } - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setProjectDescription(String projectDescription) { - this.projectDescription = projectDescription; - } - - public void setProjectVersion(String projectVersion) { - this.projectVersion = projectVersion; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public void setUsePromises(boolean usePromises) { - this.usePromises = usePromises; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - public void setUseInheritance(boolean useInheritance) { this.supportsInheritance = useInheritance; this.supportsMixins = useInheritance; } - public void setEmitModelMethods(boolean emitModelMethods) { - this.emitModelMethods = emitModelMethods; - } - - public void setEmitJSDoc(boolean emitJSDoc) { - this.emitJSDoc = emitJSDoc; - } - @Override public String apiDocFileFolder() { return createPath(outputFolder, apiDocPath); @@ -501,10 +454,6 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod return toModelName(name) + ".spec"; } - public String getModelPropertyNaming() { - return this.modelPropertyNaming; - } - private String getNameUsingModelPropertyNaming(String name) { switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { case original: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 1eaede84d60..4860b8f2515 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -21,10 +21,10 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -62,24 +62,25 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo public static final String LIBRARY_JAVASCRIPT = "javascript"; public static final String LIBRARY_APOLLO = "apollo"; - protected String projectName; - protected String moduleName; - protected String projectDescription; - protected String projectVersion; - protected String licenseName; + @Setter protected String projectName; + @Setter protected String moduleName; + @Setter protected String projectDescription; + @Setter protected String projectVersion; + @Setter protected String licenseName; + @Getter @Setter protected String invokerPackage; - protected String sourceFolder = "src"; - protected boolean usePromises; - protected boolean emitModelMethods; - protected boolean emitJSDoc = true; + @Setter protected String sourceFolder = "src"; + @Setter protected boolean usePromises; + @Setter protected boolean emitModelMethods; + @Setter protected boolean emitJSDoc = true; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String apiTestPath = "api/"; protected String modelTestPath = "model/"; protected boolean useES6 = true; // default is ES6 - protected String npmRepository = null; - private String modelPropertyNaming = "camelCase"; + @Setter protected String npmRepository = null; + @Getter private String modelPropertyNaming = "camelCase"; public JavascriptClientCodegen() { super(); @@ -403,59 +404,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return createPath(outputFolder, sourceFolder, invokerPackage, modelPackage()); } - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setProjectDescription(String projectDescription) { - this.projectDescription = projectDescription; - } - - public void setProjectVersion(String projectVersion) { - this.projectVersion = projectVersion; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public void setUsePromises(boolean usePromises) { - this.usePromises = usePromises; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - public void setUseInheritance(boolean useInheritance) { this.supportsInheritance = useInheritance; this.supportsMixins = useInheritance; } - public void setEmitModelMethods(boolean emitModelMethods) { - this.emitModelMethods = emitModelMethods; - } - - public void setEmitJSDoc(boolean emitJSDoc) { - this.emitJSDoc = emitJSDoc; - } - @Override public String apiDocFileFolder() { return createPath(outputFolder, apiDocPath); @@ -486,10 +439,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo return toModelName(name) + ".spec"; } - public String getModelPropertyNaming() { - return this.modelPropertyNaming; - } - private String getNameUsingModelPropertyNaming(String name) { switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { case original: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java index 69eb6243f77..2062ba27da3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java @@ -18,10 +18,14 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.FeatureSet; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.WireFormatFeature; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationsMap; @@ -40,10 +44,19 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem public static final String USE_ES6 = "useEs6"; - protected boolean useEs6; + @Setter protected boolean useEs6; public JavascriptClosureAngularClientCodegen() { super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .featureSet( + FeatureSet.newBuilder(generatorMetadata.getFeatureSet()) + .excludeWireFormatFeatures(WireFormatFeature.XML).build() + ) + .build(); + outputFolder = "generated-code/javascript-closure-angular"; // default HIDE_GENERATION_TIMESTAMP to true @@ -140,7 +153,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem @Override public String getHelp() { - return "Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations" + + return "Generates a Javascript AngularJS client library annotated with Google Closure Compiler annotations" + "(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en)"; } @@ -162,6 +175,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); } + @Override public String modelFileFolder() { return outputFolder + File.separator + modelPackage().replace('.', File.separatorChar); } @@ -310,10 +324,6 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem return input.replace("*/", "*_/").replace("/*", "/_*"); } - public void setUseEs6(boolean useEs6) { - this.useEs6 = useEs6; - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java index 6943a3887ec..c2e377eae16 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java @@ -20,6 +20,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -32,6 +34,7 @@ import java.util.*; import static org.openapitools.codegen.utils.StringUtils.dashize; +@Getter @Setter public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCodegen { public static final String NPM_REPOSITORY = "npmRepository"; @@ -208,30 +211,6 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo return "Generates a Javascript client library (beta) using Flow types and Fetch API."; } - public String getNpmName() { - return npmName; - } - - public void setNpmName(String npmName) { - this.npmName = npmName; - } - - public String getNpmVersion() { - return npmVersion; - } - - public void setNpmVersion(String npmVersion) { - this.npmVersion = npmVersion; - } - - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JetbrainsHttpClientClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JetbrainsHttpClientClientCodegen.java index 6f3f393534f..6e97d9f9f53 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JetbrainsHttpClientClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JetbrainsHttpClientClientCodegen.java @@ -25,12 +25,16 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.examples.Example; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import java.io.File; import java.io.IOException; import java.io.Writer; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -66,15 +70,21 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements public List customHeaders = new ArrayList<>(); + // A map is nice, because that way I easily override variables across APIs, for pagination for example. This should add nice defaults + private final Map customVariables = new HashMap<>(); + + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "jetbrains-http-client"; } + @Override public String getHelp() { return "Generates a jetbrains-http client. See https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html"; } @@ -96,6 +106,7 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements embeddedTemplateDir = templateDir = "jetbrains-http-client"; apiPackage = "Apis"; supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("http-client.template.env.mustache", "Apis", "http-client.template.env.json")); cliOptions.clear(); @@ -116,6 +127,14 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements if (additionalProperties.containsKey(CUSTOM_HEADERS)) { customHeaders = Arrays.asList(additionalProperties.get(CUSTOM_HEADERS).toString().split("&")); } + + bodyVariables.forEach(variable -> customVariables.put(variable, "")); + for(String header: customHeaders) { + List variables = extractDoubleCurlyBraces(header); + if(!variables.isEmpty()) { + variables.forEach(v -> customVariables.put(v, "")); + } + } } @Override @@ -152,9 +171,17 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements codegenOperation.vendorExtensions.put("customHeaders", customHeaders); } } + return results; } + @Override + public Map postProcessSupportingFileData(Map objs) { + var variables = new ArrayList<>(customVariables.keySet()); + objs.put("vendorExtensionsVariables", variables); + return objs; + } + List getRequests(CodegenOperation codegenOperation) { List items = new ArrayList<>(); @@ -195,10 +222,42 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements items.add(new RequestItem(codegenOperation.summary, null)); } + codegenOperation.headerParams.forEach(param -> customVariables.put(param.baseName, "")); + codegenOperation.queryParams.forEach(param -> customVariables.put(param.paramName, "")); + + // I also need to grab the parameters from the path + List pathVariables = extractSingleCurlyBraces(codegenOperation.path); + pathVariables.forEach(pv -> customVariables.put(pv, "")); + // Handling custom variables now return handleCustomVariablesInRequests(items); } + public static List extractDoubleCurlyBraces(String input) { + List result = new ArrayList<>(); + Pattern pattern = Pattern.compile("\\{\\{([^}]+)\\}\\}"); + Matcher matcher = pattern.matcher(input); + + while (matcher.find()) { + result.add(matcher.group(1)); + } + + return result; + } + + public static List extractSingleCurlyBraces(String input) { + List result = new ArrayList<>(); + Pattern pattern = Pattern.compile("\\{([^}]+)\\}"); + Matcher matcher = pattern.matcher(input); + + while (matcher.find()) { + result.add(matcher.group(1)); + } + + return result; + } + + private List handleCustomVariablesInRequests(List items) { if (!bodyVariables.isEmpty()) { for (var item : items) { @@ -220,13 +279,14 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements public void postProcess() { System.out.println("##########################################################################################"); System.out.println("# Thanks for using OpenAPI Generator. #"); - System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); System.out.println("# https://opencollective.com/openapi_generator/donate #"); System.out.println("# #"); System.out.println("# This generator was written by Julien Lengrand-Lambert (https://github.com/jlengrand) #"); System.out.println("##########################################################################################"); } + @Getter @Setter public class RequestItem { private String name; @@ -236,22 +296,6 @@ public class JetbrainsHttpClientClientCodegen extends DefaultCodegen implements this.name = name; this.body = body; } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } } /* diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaClientCodegen.java index f411744f39f..92e8b914971 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaClientCodegen.java @@ -29,6 +29,7 @@ public class JuliaClientCodegen extends AbstractJuliaCodegen { * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.CLIENT; } @@ -39,6 +40,7 @@ public class JuliaClientCodegen extends AbstractJuliaCodegen { * * @return the name of the generator */ + @Override public String getName() { return "julia-client"; } @@ -49,6 +51,7 @@ public class JuliaClientCodegen extends AbstractJuliaCodegen { * * @return the help message for the generator */ + @Override public String getHelp() { return "Generates a julia client."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaServerCodegen.java index 22dd3af2841..d9f31a0fdde 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JuliaServerCodegen.java @@ -29,6 +29,7 @@ public class JuliaServerCodegen extends AbstractJuliaCodegen { * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -39,6 +40,7 @@ public class JuliaServerCodegen extends AbstractJuliaCodegen { * * @return the name of the generator */ + @Override public String getName() { return "julia-server"; } @@ -49,6 +51,7 @@ public class JuliaServerCodegen extends AbstractJuliaCodegen { * * @return the help message for the generator */ + @Override public String getHelp() { return "Generates a julia server."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index aa31665c5c3..88dbb526d75 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -45,6 +45,8 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; import com.google.common.collect.ImmutableMap; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -70,6 +72,8 @@ import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -298,6 +302,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { @Nullable HTTPBody body; boolean hasBodyExample; + boolean hasCookie; @Nullable HTTPParameters params; @Nullable @@ -306,7 +311,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { DataExtractSubstituteParameter dataExtract; public HTTPRequest(String operationId, String method, String path, @Nullable List query, @Nullable HTTPBody body, - boolean hasBodyExample, @Nullable HTTPParameters params, @Nullable List k6Checks, + boolean hasBodyExample, boolean hasCookie, @Nullable HTTPParameters params, @Nullable List k6Checks, DataExtractSubstituteParameter dataExtract) { // NOTE: https://k6.io/docs/javascript-api/k6-http/del-url-body-params this.method = method.equals("delete") ? "del" : method; @@ -316,6 +321,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { this.query = query; this.body = body; this.hasBodyExample = hasBodyExample; + this.hasCookie = hasCookie; this.params = params; this.k6Checks = k6Checks; this.dataExtract = dataExtract; @@ -361,16 +367,17 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { static final String[][] JAVASCRIPT_SUPPORTING_FILES = { new String[]{"script.mustache", "script.js"}, new String[]{"README.mustache", "README.md"}}; - protected String projectName; - protected String moduleName; - protected String projectDescription; - protected String projectVersion; - protected String licenseName; + @Setter protected String projectName; + @Setter protected String moduleName; + @Setter protected String projectDescription; + @Setter protected String projectVersion; + @Setter protected String licenseName; + @Getter @Setter protected String invokerPackage; - protected String sourceFolder = ""; - private String modelPropertyNaming = "camelCase"; - protected boolean preserveLeadingParamChar = false; + @Setter protected String sourceFolder = ""; + @Getter private String modelPropertyNaming = "camelCase"; + @Setter protected boolean preserveLeadingParamChar = false; @Override public CodegenType getTag() { @@ -491,6 +498,29 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { Set extraParameters = new HashSet<>(); Map> pathVariables = new HashMap<>(); + // get security schema from components + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + + // get global security requirements + List securityRequirements = openAPI.getSecurity(); + + // match global security requirements with security schemes and transform them to global auth methods + // global auth methods is a list of auth methods that are used in all requests + List globalAuthMethods = new ArrayList<>(); + Map globalSecurityMap = new HashMap<>(); + if (securityRequirements != null) { + for (SecurityRequirement securityRequirement : securityRequirements) { + for (String securityRequirementKey : securityRequirement.keySet()) { + SecurityScheme securityScheme = securitySchemeMap.get(securityRequirementKey); + if (securityScheme != null) { + globalSecurityMap.put(securityRequirementKey, securityScheme); + } + } + } + globalAuthMethods = fromSecurity(globalSecurityMap); + } + for (String path : openAPI.getPaths().keySet()) { Map requests = new HashMap<>(); Set variables = new HashSet<>(); @@ -500,6 +530,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { for (Map.Entry methodOperation : openAPI.getPaths().get(path). readOperationsMap().entrySet()) { List httpParams = new ArrayList<>(); + List cookieParams = new ArrayList<>(); List queryParams = new ArrayList<>(); List bodyOrFormParams = new ArrayList<>(); List k6Checks = new ArrayList<>(); @@ -635,7 +666,19 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { pathVariables.put(groupName, variables); - final HTTPParameters params = new HTTPParameters(null, null, httpParams, null, null, null, null, null, + // put auth medthods in header or cookie + for (CodegenSecurity globalAuthMethod : globalAuthMethods) { + if (globalAuthMethod.isKeyInHeader) { + httpParams.add(new Parameter(globalAuthMethod.keyParamName, getTemplateString(toVarName(globalAuthMethod.keyParamName)))); + extraParameters.add(new Parameter(toVarName(globalAuthMethod.keyParamName), globalAuthMethod.keyParamName.toUpperCase(Locale.ROOT))); + } + if (globalAuthMethod.isKeyInCookie) { + cookieParams.add(new Parameter(globalAuthMethod.keyParamName, getTemplateString(toVarName(globalAuthMethod.keyParamName)))); + extraParameters.add(new Parameter(toVarName(globalAuthMethod.keyParamName), globalAuthMethod.keyParamName.toUpperCase(Locale.ROOT))); + } + } + + final HTTPParameters params = new HTTPParameters(null, cookieParams, httpParams, null, null, null, null, null, responseType.length() > 0 ? responseType : null); assert params.headers != null; @@ -647,11 +690,18 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { // calculate order for this current request Integer requestOrder = calculateRequestOrder(operationGroupingOrder, requests.size()); - requests.put(requestOrder, new HTTPRequest(operationId, method.toString().toLowerCase(Locale.ROOT), path, - queryParams.size() > 0 ? queryParams : null, - bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, hasRequestBodyExample, - params.headers.size() > 0 ? params : null, k6Checks.size() > 0 ? k6Checks : null, - dataExtract.orElse(null))); + requests.put(requestOrder, new HTTPRequest( + operationId, + method.toString().toLowerCase(Locale.ROOT), + path, + queryParams.size() > 0 ? queryParams : null, + bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, + hasRequestBodyExample, + params.cookies.size() > 0 ? true : false, + params.headers.size() > 0 ? params : null, + k6Checks.size() > 0 ? k6Checks : null, + dataExtract.orElse(null)) + ); } addOrUpdateRequestGroup(requestGroups, groupName, pathVariables.get(groupName), requests); @@ -702,10 +752,6 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { return "${" + input + "}"; } - public String getModelPropertyNaming() { - return this.modelPropertyNaming; - } - private String getNameUsingModelPropertyNaming(String name) { switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { case original: @@ -797,38 +843,6 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { return createPath(outputFolder, sourceFolder, invokerPackage, apiPackage()); } - public String getInvokerPackage() { - return invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setProjectDescription(String projectDescription) { - this.projectDescription = projectDescription; - } - - public void setProjectVersion(String projectVersion) { - this.projectVersion = projectVersion; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - public void setModelPropertyNaming(String naming) { if ("original".equals(naming) || "camelCase".equals(naming) || "PascalCase".equals(naming) || "snake_case".equals(naming)) { @@ -839,10 +853,6 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { } } - public void setPreserveLeadingParamChar(boolean preserveLeadingParamChar) { - this.preserveLeadingParamChar = preserveLeadingParamChar; - } - @Override public String escapeQuotationMark(String input) { // remove ', " to avoid code injection diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index d550c452f32..6984956674a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -26,6 +26,9 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; +import com.samskivert.mustache.Mustache; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; @@ -89,24 +92,28 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW = "supportAndroidApiLevel25AndBelow"; + public static final String GENERATE_ONEOF_ANYOF_WRAPPERS = "generateOneOfAnyOfWrappers"; + protected static final String VENDOR_EXTENSION_BASE_NAME_LITERAL = "x-base-name-literal"; - protected String dateLibrary = DateLibrary.JAVA8.value; - protected String requestDateConverter = RequestDateConverter.TO_JSON.value; - protected String collectionType = CollectionType.LIST.value; + @Setter protected String dateLibrary = DateLibrary.JAVA8.value; + @Setter protected String requestDateConverter = RequestDateConverter.TO_JSON.value; + @Setter protected String collectionType = CollectionType.LIST.value; protected boolean useRxJava3 = false; protected boolean useCoroutines = false; // backwards compatibility for openapi configs that specify neither rx1 nor rx2 // (mustache does not allow for boolean operators so we need this extra field) protected boolean doNotUseRxAndCoroutines = true; protected boolean generateRoomModels = false; - protected String roomModelPackage = ""; - protected boolean omitGradleWrapper = false; + @Setter protected String roomModelPackage = ""; + @Setter protected boolean omitGradleWrapper = false; + @Setter protected boolean generateOneOfAnyOfWrappers = true; protected String authFolder; - protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; + @Getter protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson' or 'kotlinx_serialization'"; + public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson, kotlinx_serialization} public enum DateLibrary { @@ -259,18 +266,23 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { cliOptions.add(CliOption.newBoolean(SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW, "[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in order to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284")); + cliOptions.add(CliOption.newBoolean(GENERATE_ONEOF_ANYOF_WRAPPERS, "Generate oneOf, anyOf schemas as wrappers.")); + CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name())); } + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "kotlin"; } + @Override public String getHelp() { return "Generates a Kotlin client."; } @@ -283,6 +295,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { return omitGradleWrapper; } + public boolean getGenerateOneOfAnyOfWrappers() { + return generateOneOfAnyOfWrappers; + } + public void setGenerateRoomModels(Boolean generateRoomModels) { this.generateRoomModels = generateRoomModels; } @@ -311,36 +327,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { this.useCoroutines = useCoroutines; } - - public void setDateLibrary(String library) { - this.dateLibrary = library; - } - - public void setRequestDateConverter(String converter) { - this.requestDateConverter = converter; - } - - public void setCollectionType(String collectionType) { - this.collectionType = collectionType; - } - - public void setRoomModelPackage(String roomModelPackage) { - this.roomModelPackage = roomModelPackage; - } - - public void setOmitGradleWrapper(boolean omitGradleWrapper) { - this.omitGradleWrapper = omitGradleWrapper; - } - - public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() { - return this.serializationLibrary; - } - /** * Sets the serialization engine for Kotlin * * @param enumSerializationLibrary The string representation of the serialization library as defined by - * {@link org.openapitools.codegen.languages.AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE} + * {@link org.openapitools.codegen.languages.KotlinClientCodegen.SERIALIZATION_LIBRARY_TYPE} */ public void setSerializationLibrary(final String enumSerializationLibrary) { try { @@ -443,6 +434,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { additionalProperties.put(this.serializationLibrary.name(), true); } + if (additionalProperties.containsKey(GENERATE_ONEOF_ANYOF_WRAPPERS)) { + setGenerateOneOfAnyOfWrappers(Boolean.parseBoolean(additionalProperties.get(GENERATE_ONEOF_ANYOF_WRAPPERS).toString())); + } + commonSupportingFiles(); switch (getLibrary()) { @@ -513,6 +508,14 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.kt.mustache", authFolder, "HttpBasicAuth.kt")); } } + + additionalProperties.put("sanitizeGeneric", (Mustache.Lambda) (fragment, writer) -> { + String content = fragment.execute(); + for (final String s : List.of("<", ">", ",", " ", ".")) { + content = content.replace(s, ""); + } + writer.write(content); + }); } private void processDateLibrary() { @@ -874,7 +877,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { for (ModelMap mo : objects.getModels()) { CodegenModel cm = mo.getModel(); - if (getGenerateRoomModels()) { + if (getGenerateRoomModels() || getGenerateOneOfAnyOfWrappers()) { cm.vendorExtensions.put("x-has-data-class-body", true); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index b5b5bd36352..1db516c090d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -18,6 +18,8 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ImmutableMap; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -25,6 +27,7 @@ import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.templating.mustache.CamelCaseLambda; import org.openapitools.codegen.templating.mustache.LowercaseLambda; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,19 +40,26 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa public static final String DEFAULT_LIBRARY = Constants.KTOR; private final Logger LOGGER = LoggerFactory.getLogger(KotlinServerCodegen.class); + @Getter @Setter private Boolean autoHeadFeatureEnabled = true; + @Getter @Setter private Boolean conditionalHeadersFeatureEnabled = false; + @Getter @Setter private Boolean hstsFeatureEnabled = true; + @Getter @Setter private Boolean corsFeatureEnabled = false; + @Getter @Setter private Boolean compressionFeatureEnabled = true; + @Getter @Setter private Boolean resourcesFeatureEnabled = true; + @Getter @Setter private Boolean metricsFeatureEnabled = true; private boolean interfaceOnly = false; private boolean useBeanValidation = false; private boolean useCoroutines = false; private boolean useMutiny = false; private boolean returnResponse = false; - private boolean omitGradleWrapper = false; + @Setter private boolean omitGradleWrapper = false; // This is here to potentially warn the user when an option is not supported by the target framework. private Map> optionsSupportedPerFramework = new ImmutableMap.Builder>() @@ -119,6 +129,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa supportedLibraries.put(Constants.KTOR, "ktor framework"); supportedLibraries.put(Constants.JAXRS_SPEC, "JAX-RS spec only"); supportedLibraries.put(Constants.JAVALIN5, "Javalin 5"); + supportedLibraries.put(Constants.JAVALIN6, "Javalin 6"); // TODO: Configurable server engine. Defaults to netty in build.gradle. addOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC, DEFAULT_LIBRARY, supportedLibraries); @@ -138,78 +149,21 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa addSwitch(USE_JAKARTA_EE, Constants.USE_JAKARTA_EE_DESC, useJakartaEe); } - public Boolean getAutoHeadFeatureEnabled() { - return autoHeadFeatureEnabled; - } - - public void setAutoHeadFeatureEnabled(Boolean autoHeadFeatureEnabled) { - this.autoHeadFeatureEnabled = autoHeadFeatureEnabled; - } - - public Boolean getCompressionFeatureEnabled() { - return compressionFeatureEnabled; - } - - public void setCompressionFeatureEnabled(Boolean compressionFeatureEnabled) { - this.compressionFeatureEnabled = compressionFeatureEnabled; - } - - public Boolean getConditionalHeadersFeatureEnabled() { - return conditionalHeadersFeatureEnabled; - } - - public void setConditionalHeadersFeatureEnabled(Boolean conditionalHeadersFeatureEnabled) { - this.conditionalHeadersFeatureEnabled = conditionalHeadersFeatureEnabled; - } - - public Boolean getCorsFeatureEnabled() { - return corsFeatureEnabled; - } - - public void setCorsFeatureEnabled(Boolean corsFeatureEnabled) { - this.corsFeatureEnabled = corsFeatureEnabled; - } - + @Override public String getHelp() { return "Generates a Kotlin server."; } - public Boolean getHstsFeatureEnabled() { - return hstsFeatureEnabled; - } - - public void setHstsFeatureEnabled(Boolean hstsFeatureEnabled) { - this.hstsFeatureEnabled = hstsFeatureEnabled; - } - - public Boolean getResourcesFeatureEnabled() { - return resourcesFeatureEnabled; - } - public boolean getOmitGradleWrapper() { return omitGradleWrapper; } - public void setOmitGradleWrapper(boolean omitGradleWrapper) { - this.omitGradleWrapper = omitGradleWrapper; - } - - public void setResourcesFeatureEnabled(Boolean resourcesFeatureEnabled) { - this.resourcesFeatureEnabled = resourcesFeatureEnabled; - } - - public Boolean getMetricsFeatureEnabled() { - return metricsFeatureEnabled; - } - - public void setMetricsFeatureEnabled(Boolean metricsEnabled) { - this.metricsFeatureEnabled = metricsEnabled; - } - + @Override public String getName() { return "kotlin-server"; } + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -324,7 +278,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa String gradleBuildFile = "build.gradle"; - if (library.equals(Constants.JAVALIN5)) { + if (isJavalin()) { gradleBuildFile = "build.gradle.kts"; } @@ -346,11 +300,12 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", File.separator); supportingFiles.add(new SupportingFile("ApiKeyAuth.kt.mustache", infrastructureFolder, "ApiKeyAuth.kt")); - } else if (library.equals(Constants.JAVALIN5)) { + } else if (isJavalin()) { supportingFiles.add(new SupportingFile("Main.kt.mustache", packageFolder, "Main.kt")); apiTemplateFiles.put("service.mustache", "Service.kt"); apiTemplateFiles.put("serviceImpl.mustache", "ServiceImpl.kt"); additionalProperties.put("lowercase", new LowercaseLambda()); + additionalProperties.put("camelcase", new CamelCaseLambda()); typeMapping.put("file", "io.javalin.http.UploadedFile"); importMapping.put("io.javalin.http.UploadedFile", "io.javalin.http.UploadedFile"); } @@ -366,6 +321,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa public final static String JAXRS_SPEC = "jaxrs-spec"; public final static String JAVALIN5 = "javalin5"; + public final static String JAVALIN6 = "javalin6"; public final static String AUTOMATIC_HEAD_REQUESTS = "featureAutoHead"; public final static String AUTOMATIC_HEAD_REQUESTS_DESC = "Automatically provide responses to HEAD requests for existing routes that have the GET verb defined."; public final static String CONDITIONAL_HEADERS = "featureConditionalHeaders"; @@ -452,4 +408,8 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa return objs; } + + private boolean isJavalin() { + return Constants.JAVALIN5.equals(library) || Constants.JAVALIN6.equals(library); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 158e4b114af..4c50581c0bb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -22,9 +22,7 @@ import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; +import lombok.*; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; @@ -34,6 +32,7 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenResponse; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.VendorExtension; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.openapitools.codegen.languages.features.SwaggerUIFeatures; @@ -95,6 +94,8 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String SERVICE_INTERFACE = "serviceInterface"; public static final String SERVICE_IMPLEMENTATION = "serviceImplementation"; public static final String SKIP_DEFAULT_INTERFACE = "skipDefaultInterface"; + public static final String SKIP_DEFAULT_API_INTERFACE = "skipDefaultApiInterface"; + public static final String SKIP_DEFAULT_DELEGATE_INTERFACE = "skipDefaultDelegateInterface"; public static final String REACTIVE = "reactive"; public static final String INTERFACE_ONLY = "interfaceOnly"; public static final String USE_FEIGN_CLIENT_URL = "useFeignClientUrl"; @@ -105,28 +106,56 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String USE_SPRING_BOOT3 = "useSpringBoot3"; public static final String APPEND_REQUEST_TO_HANDLER = "appendRequestToHandler"; + public static final String REQUEST_MAPPING_OPTION = "requestMappingMode"; + public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController"; + public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface"; + public enum RequestMappingMode { + api_interface("Generate the @RequestMapping annotation on the generated Api Interface."), + controller("Generate the @RequestMapping annotation on the generated Api Controller Implementation."), + none("Do not add a class level @RequestMapping annotation."); + + public String getDescription() { + return description; + } + + private String description; + + RequestMappingMode(String description) { + this.description = description; + } + } + + @Getter @Setter private String basePackage; + @Getter @Setter protected String configPackage; + @Getter @Setter private String invokerPackage; + @Getter @Setter private String serverPort = "8080"; private String title = "OpenAPI Kotlin Spring"; private boolean useBeanValidation = true; - private boolean skipDefaultInterface = false; - private boolean exceptionHandler = true; - private boolean gradleBuildFile = true; + @Setter private boolean skipDefaultInterface = false; + @Setter private boolean skipDefaultApiInterface = false; + @Setter private boolean skipDefaultDelegateInterface = false; + @Setter private boolean exceptionHandler = true; + @Setter private boolean gradleBuildFile = true; private boolean useSwaggerUI = true; - private boolean serviceInterface = false; - private boolean serviceImplementation = false; + @Setter private boolean serviceInterface = false; + @Setter private boolean serviceImplementation = false; + @Getter @Setter private boolean reactive = false; - private boolean interfaceOnly = false; - protected boolean useFeignClientUrl = true; - protected boolean useFeignClient = false; - private boolean delegatePattern = false; - protected boolean useTags = false; - private boolean beanQualifiers = false; + @Setter private boolean interfaceOnly = false; + @Setter protected boolean useFeignClientUrl = true; + @Setter protected boolean useFeignClient = false; + @Setter private boolean delegatePattern = false; + @Setter protected boolean useTags = false; + @Setter private boolean beanQualifiers = false; + @Getter @Setter protected boolean useSpringBoot3 = false; + protected RequestMappingMode requestMappingMode = RequestMappingMode.controller; private DocumentationProvider documentationProvider; private AnnotationLibrary annotationLibrary; @@ -197,7 +226,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen addSwitch(SERVICE_IMPLEMENTATION, "generate stub service implementations that extends service " + "interfaces. If this is set to true service interfaces will also be generated", serviceImplementation); addSwitch(USE_BEANVALIDATION, "Use BeanValidation API annotations to validate data types", useBeanValidation); - addSwitch(SKIP_DEFAULT_INTERFACE, "Whether to skip generation of default implementations for interfaces", skipDefaultInterface); + addSwitch(SKIP_DEFAULT_INTERFACE, "Whether to skip generation of default implementations for interfaces (Api interfaces or Delegate interfaces depending on the delegatePattern option)", skipDefaultInterface); addSwitch(REACTIVE, "use coroutines for reactive behavior", reactive); addSwitch(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.", interfaceOnly); addSwitch(USE_FEIGN_CLIENT_URL, "Whether to generate Feign client with url parameter.", useFeignClientUrl); @@ -218,6 +247,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen cliOpt.setEnum(supportedLibraries); cliOptions.add(cliOpt); + CliOption requestMappingOpt = new CliOption(REQUEST_MAPPING_OPTION, + "Where to generate the class level @RequestMapping annotation.") + .defaultValue(requestMappingMode.name()); + for (RequestMappingMode mode: RequestMappingMode.values()) { + requestMappingOpt.addEnum(mode.name(), mode.getDescription()); + } + cliOptions.add(requestMappingOpt); + if (null != defaultDocumentationProvider()) { CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, "Select the OpenAPI documentation provider.") @@ -260,6 +297,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen return DocumentationProvider.SPRINGDOC; } + @Override public List supportedDocumentationProvider() { return Arrays.asList( DocumentationProvider.NONE, @@ -289,54 +327,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen getDocumentationProvider().equals(DocumentationProvider.SOURCE); } - public void setConfigPackage(String configPackage) { - this.configPackage = configPackage; - } - - public String getConfigPackage() { - return configPackage; - } - - public String getBasePackage() { - return this.basePackage; - } - - public void setBasePackage(String basePackage) { - this.basePackage = basePackage; - } - - public String getInvokerPackage() { - return this.invokerPackage; - } - - public void setInvokerPackage(String invokerPackage) { - this.invokerPackage = invokerPackage; - } - - public String getServerPort() { - return this.serverPort; - } - - public void setServerPort(String serverPort) { - this.serverPort = serverPort; - } - public boolean getExceptionHandler() { return this.exceptionHandler; } - public void setExceptionHandler(boolean exceptionHandler) { - this.exceptionHandler = exceptionHandler; - } - public boolean getGradleBuildFile() { return this.gradleBuildFile; } - public void setGradleBuildFile(boolean gradleBuildFile) { - this.gradleBuildFile = gradleBuildFile; - } - public boolean getUseSwaggerUI() { return this.useSwaggerUI; } @@ -350,75 +348,23 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen return this.serviceInterface; } - public void setServiceInterface(boolean serviceInterface) { - this.serviceInterface = serviceInterface; - } - - public void setUseFeignClientUrl(boolean useFeignClientUrl) { - this.useFeignClientUrl = useFeignClientUrl; - } - public boolean getServiceImplementation() { return this.serviceImplementation; } - public void setServiceImplementation(boolean serviceImplementation) { - this.serviceImplementation = serviceImplementation; - } - public boolean getUseBeanValidation() { return this.useBeanValidation; } - public void setInterfaceOnly(boolean interfaceOnly) { - this.interfaceOnly = interfaceOnly; - } - - public void setDelegatePattern(boolean delegatePattern) { - this.delegatePattern = delegatePattern; - } - - public void setUseTags(boolean useTags) { - this.useTags = useTags; - } - public boolean isAppendRequestToHandler() { return Boolean.parseBoolean(additionalProperties.getOrDefault(APPEND_REQUEST_TO_HANDLER, false).toString()); } - public void setUseSpringBoot3(boolean isSpringBoot3) { - this.useSpringBoot3 = isSpringBoot3; - } - - public boolean isUseSpringBoot3() { - return useSpringBoot3; - } - @Override public void setUseBeanValidation(boolean useBeanValidation) { this.useBeanValidation = useBeanValidation; } - public void setUseFeignClient(boolean useFeignClient) { - this.useFeignClient = useFeignClient; - } - - public void setSkipDefaultInterface(boolean skipDefaultInterface) { - this.skipDefaultInterface = skipDefaultInterface; - } - - public boolean isReactive() { - return reactive; - } - - public void setReactive(boolean reactive) { - this.reactive = reactive; - } - - public void setBeanQualifiers(boolean beanQualifiers) { - this.beanQualifiers = beanQualifiers; - } - @Override public CodegenType getTag() { return CodegenType.SERVER; @@ -520,6 +466,13 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen LOGGER.info("Set base package to invoker package ({})", basePackage); } + if (additionalProperties.containsKey(REQUEST_MAPPING_OPTION)) { + RequestMappingMode optValue = RequestMappingMode.valueOf( + String.valueOf(additionalProperties.get(REQUEST_MAPPING_OPTION))); + setRequestMappingMode(optValue); + additionalProperties.remove(REQUEST_MAPPING_OPTION); + } + if (additionalProperties.containsKey(CONFIG_PACKAGE)) { this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE)); } else { @@ -613,6 +566,16 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen this.setDelegatePattern(Boolean.parseBoolean(additionalProperties.get(DELEGATE_PATTERN).toString())); } + if (skipDefaultInterface) { + if (delegatePattern) { + this.setSkipDefaultDelegateInterface(true); + } else { + this.setSkipDefaultApiInterface(true); + } + } + writePropertyBack(SKIP_DEFAULT_API_INTERFACE, skipDefaultApiInterface); + writePropertyBack(SKIP_DEFAULT_DELEGATE_INTERFACE, skipDefaultDelegateInterface); + if (additionalProperties.containsKey(USE_TAGS)) { this.setUseTags(Boolean.parseBoolean(additionalProperties.get(USE_TAGS).toString())); } @@ -726,6 +689,9 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen supportingFiles.add(new SupportingFile("settingsGradle.mustache", "settings.gradle")); } + // @RequestMapping not supported with spring cloud openfeign. + setRequestMappingMode(RequestMappingMode.none); + supportingFiles.add(new SupportingFile("apiKeyRequestInterceptor.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "ApiKeyRequestInterceptor.kt")); @@ -749,6 +715,19 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen } } + switch (getRequestMappingMode()) { + case api_interface: + additionalProperties.put(USE_REQUEST_MAPPING_ON_INTERFACE, true); + break; + case controller: + additionalProperties.put(USE_REQUEST_MAPPING_ON_CONTROLLER, true); + break; + case none: + additionalProperties.put(USE_REQUEST_MAPPING_ON_INTERFACE, false); + additionalProperties.put(USE_REQUEST_MAPPING_ON_CONTROLLER, false); + break; + } + // spring uses the jackson lib, and we disallow configuration. additionalProperties.put("jackson", "true"); @@ -836,6 +815,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen model.imports.add("JsonProperty"); if (Boolean.TRUE.equals(model.hasEnums)) { model.imports.add("JsonValue"); + model.imports.add("JsonCreator"); } } else { //Needed imports for Jackson's JsonCreator @@ -861,10 +841,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen .filter(cm -> Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) .forEach(cm -> { cm.imports.add(importMapping.get("JsonValue")); + cm.imports.add(importMapping.get("JsonCreator")); cm.imports.add(importMapping.get("JsonProperty")); Map itemJsonValue = new HashMap<>(); itemJsonValue.put("import", importMapping.get("JsonValue")); imports.add(itemJsonValue); + Map itemJsonCreator = new HashMap<>(); + itemJsonCreator.put("import", importMapping.get("JsonCreator")); + imports.add(itemJsonCreator); Map itemJsonProperty = new HashMap<>(); itemJsonProperty.put("import", importMapping.get("JsonProperty")); imports.add(itemJsonProperty); @@ -910,7 +894,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen final List allParams = operation.allParams; if (allParams != null) { if (this.isAppendRequestToHandler()) { - allParams.add(new RequestCodegenParameter(true)); + allParams.add(new RequestCodegenParameter()); } allParams.forEach(param -> // This is necessary in case 'modelMutable' is enabled, @@ -1007,6 +991,36 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen @Data @EqualsAndHashCode(callSuper = true) static class RequestCodegenParameter extends CodegenParameter { - boolean isRequestObject; + + boolean isRequestObject = true; + + public RequestCodegenParameter() { + this.isOptional = false; + this.required = true; + this.paramName = "serverHttpRequest"; + this.dataType = "ServerHttpRequest"; + } + } + + public RequestMappingMode getRequestMappingMode() { + return requestMappingMode; + } + + public void setRequestMappingMode(RequestMappingMode requestMappingMode) { + this.requestMappingMode = requestMappingMode; + } + + @Override + public List getSupportedVendorExtensions() { + List extensions = super.getSupportedVendorExtensions(); + extensions.add(VendorExtension.X_ACCEPTS); + extensions.add(VendorExtension.X_CLASS_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_CONTENT_TYPE); + extensions.add(VendorExtension.X_DISCRIMINATOR_VALUE); + extensions.add(VendorExtension.X_FIELD_EXTRA_ANNOTATION); + extensions.add(VendorExtension.X_PATTERN_MESSAGE); + return extensions; + } + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java index 6445a7018dc..525b327212a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinVertxServerCodegen.java @@ -39,14 +39,17 @@ public class KotlinVertxServerCodegen extends AbstractKotlinCodegen { final Logger LOGGER = LoggerFactory.getLogger(KotlinVertxServerCodegen.class); + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "kotlin-vertx"; } + @Override public String getHelp() { return "Generates a kotlin-vertx server."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinWiremockServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinWiremockServerCodegen.java index 2de5bda7e1f..4ed88127122 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinWiremockServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinWiremockServerCodegen.java @@ -41,6 +41,8 @@ public class KotlinWiremockServerCodegen extends AbstractKotlinCodegen { public KotlinWiremockServerCodegen() { super(); + embeddedTemplateDir = templateDir = "kotlin-wiremock"; + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) .build(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java index ebada61f2cb..4c689566377 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java @@ -16,6 +16,8 @@ package org.openapitools.codegen.languages; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -51,14 +53,26 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { public static final String ADD_SURROGATE_KEY = "addSurrogateKey"; public static final Integer IDENTIFIER_MAX_LENGTH = 255; + /** + * Imported package name for the models + */ + @Getter @Setter protected String importModelPackageName = ""; - protected String defaultDatabaseName = "sqlite.db"; + /** + * Default database name for all queries + * This value must be used with backticks only, eg. `database_name` + */ + @Getter protected String defaultDatabaseName = "sqlite.db"; protected String databaseNamePrefix = "_", databaseNameSuffix = ""; protected String tableNamePrefix = "_", tableNameSuffix = ""; protected String columnNamePrefix = "_", columnNameSuffix = ""; - protected String identifierNamingConvention = "original"; + /** + * Identifier naming convention for table names and column names. + */ + @Getter protected String identifierNamingConvention = "original"; + @Getter @Setter protected String primaryKeyConvention = "id"; - protected boolean addSurrogateKey = false; + @Setter protected boolean addSurrogateKey = false; protected Map sqlTypeMapping = new HashMap(); @@ -232,14 +246,17 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { } + @Override public CodegenType getTag() { return CodegenType.SCHEMA; } + @Override public String getName() { return "ktorm-schema"; } + @Override public String getHelp() { return "Generates a kotlin-ktorm schema (beta)"; } @@ -1097,11 +1114,6 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { return input.replace("'", ""); } - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - /** * Sets default database name for all queries * Provided value will be escaped when necessary @@ -1118,34 +1130,6 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { this.defaultDatabaseName = escapedName; } - /** - * Returns default database name for all queries - * This value must be used with backticks only, eg. `database_name` - * - * @return default database name - */ - public String getDefaultDatabaseName() { - return this.defaultDatabaseName; - } - - /** - * Sets imported package name for the models - * - * @param name name - */ - public void setImportModelPackageName(String name) { - this.importModelPackageName = name; - } - - /** - * Returns imported package name for the models - * - * @return name - */ - public String getImportModelPackageName() { - return this.importModelPackageName; - } - /** * Sets identifier naming convention for table names and column names. * This is not related to database name which is defined by defaultDatabaseName option. @@ -1164,42 +1148,6 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { } } - /** - * Returns identifier naming convention for table names and column names. - * - * @return identifier naming convention - */ - public String getIdentifierNamingConvention() { - return this.identifierNamingConvention; - } - - /** - * Sets primary key naming convention - * - * @param name name - */ - public void setPrimaryKeyConvention(String name) { - this.primaryKeyConvention = name; - } - - /** - * Returns primary key naming convention - * - * @return name - */ - public String getPrimaryKeyConvention() { - return this.primaryKeyConvention; - } - - /** - * Sets primary key naming convention - * - * @param enable enable this option - */ - public void setAddSurrogateKey(boolean enable) { - this.addSurrogateKey = enable; - } - /** * Returns primary key naming convention * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java index 5dec9a47004..9f6ff2977ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java @@ -17,8 +17,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -42,20 +42,23 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(LuaClientCodegen.class); protected String specFolder = "spec"; - protected String packageName = "openapiclient"; - protected String packageVersion = "1.0.0-1"; + @Setter protected String packageName = "openapiclient"; + @Setter protected String packageVersion = "1.0.0-1"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected String luaRocksFilename = "openapiclient-1.0.0-1.rockspec"; + @Setter protected String luaRocksFilename = "openapiclient-1.0.0-1.rockspec"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "lua"; } + @Override public String getHelp() { return "Generates a Lua client library (beta)."; } @@ -233,6 +236,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { return outputFolder + File.separator + packageName + File.separator + "api" + File.separator; } + @Override public String modelFileFolder() { return outputFolder + File.separator + packageName + File.separator + "model" + File.separator; } @@ -500,18 +504,6 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { && !languageSpecificPrimitives.contains(type); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setLuaRocksFilename(String luaRocksFilename) { - this.luaRocksFilename = luaRocksFilename; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java index 7eb20048fee..1815860f40c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java @@ -15,14 +15,17 @@ public class MarkdownDocumentationCodegen extends DefaultCodegen implements Code private final Logger LOGGER = LoggerFactory.getLogger(MarkdownDocumentationCodegen.class); + @Override public CodegenType getTag() { return CodegenType.DOCUMENTATION; } + @Override public String getName() { return "markdown"; } + @Override public String getHelp() { return "Generates a markdown documentation."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index deb82787d0f..828874976d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -16,6 +16,8 @@ package org.openapitools.codegen.languages; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -59,12 +61,28 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig "GEOMETRY", "GEOMETRYCOLLECTION", "LINESTRING", "MULTILINESTRING", "MULTIPOINT", "MULTIPOLYGON", "POINT", "POLYGON" )); - protected String defaultDatabaseName = "", databaseNamePrefix = "", databaseNameSuffix = "_db"; + /** + * Returns default database name for all MySQL queries + * This value must be used with backticks only, e.g. `database_name` + */ + @Getter protected String defaultDatabaseName = "", databaseNamePrefix = "", databaseNameSuffix = "_db"; protected String tableNamePrefix = "tbl_", tableNameSuffix = ""; protected String columnNamePrefix = "col_", columnNameSuffix = ""; + /** + * Whether JSON data type enabled or disabled in all MySQL queries. + * JSON data type requires MySQL version 5.7.8 + */ + @Getter @Setter protected Boolean jsonDataTypeEnabled = true; + /** + * Whether named parameters enabled or disabled in prepared SQLs + */ + @Getter @Setter protected Boolean namedParametersEnabled = false; - protected String identifierNamingConvention = "original"; + /** + * Returns identifier naming convention for table names and column names. + */ + @Getter protected String identifierNamingConvention = "original"; public MysqlSchemaCodegen() { super(); @@ -1162,53 +1180,6 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig this.defaultDatabaseName = escapedName; } - /** - * Returns default database name for all MySQL queries - * This value must be used with backticks only, eg. `database_name` - * - * @return default database name - */ - public String getDefaultDatabaseName() { - return this.defaultDatabaseName; - } - - /** - * Enables special JSON data type in all MySQL queries - * JSON data type requires MySQL version 5.7.8 - * - * @param enabled true to enable, otherwise false - */ - public void setJsonDataTypeEnabled(Boolean enabled) { - this.jsonDataTypeEnabled = enabled; - } - - /** - * Whether JSON data type enabled or disabled in all MySQL queries - * - * @return true if enabled otherwise false - */ - public Boolean getJsonDataTypeEnabled() { - return this.jsonDataTypeEnabled; - } - - /** - * Enables named parameters in prepared SQLs - * - * @param enabled true to enable, otherwise false - */ - public void setNamedParametersEnabled(Boolean enabled) { - this.namedParametersEnabled = enabled; - } - - /** - * Whether named parameters enabled or disabled in prepared SQLs - * - * @return true if enabled otherwise false - */ - public Boolean getNamedParametersEnabled() { - return this.namedParametersEnabled; - } - /** * Sets identifier naming convention for table names and column names. * This is not related to database name which is defined by defaultDatabaseName option. @@ -1227,15 +1198,6 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig } } - /** - * Returns identifier naming convention for table names and column names. - * - * @return identifier naming convention - */ - public String getIdentifierNamingConvention() { - return this.identifierNamingConvention; - } - /** * Slightly modified version of AbstractPhpCodegen.toSrcPath method. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/N4jsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/N4jsClientCodegen.java index 972d8bbdb0d..6f154dbb273 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/N4jsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/N4jsClientCodegen.java @@ -61,8 +61,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; @@ -79,14 +77,17 @@ public class N4jsClientCodegen extends DefaultCodegen implements CodegenConfig { private boolean checkSuperfluousBodyProps = true; private boolean generateDefaultApiExecuter = true; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "n4js"; } + @Override public String getHelp() { return "Generates a n4js client."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index bed1cec85ec..b2332a2d964 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -16,9 +16,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -43,17 +43,20 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; - protected String packageName = "openapiclient"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapiclient"; + @Setter protected String packageVersion = "1.0.0"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "nim"; } + @Override public String getHelp() { return "Generates a nim client (beta)."; } @@ -166,14 +169,6 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("file", "string"); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public ModelsMap postProcessModels(ModelsMap objs) { return postProcessModelsEnum(objs); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java index 0f01e91e89d..c6aa293cdee 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -25,6 +25,8 @@ import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.PathItem.HttpMethod; import io.swagger.v3.oas.models.Paths; import io.swagger.v3.oas.models.info.Info; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -58,6 +60,7 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege protected String defaultServerPort = "8080"; protected String implFolder = "services"; protected String projectName = "openapi-server"; + @Getter @Setter protected String exportedName; public NodeJSExpressServerCodegen() { @@ -232,14 +235,6 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); } - public String getExportedName() { - return exportedName; - } - - public void setExportedName(String name) { - exportedName = name; - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { OperationMap objectMap = objs.getOperations(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index d023dc13052..32329d4a859 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.headers.Header; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.responses.ApiResponse; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -51,8 +52,8 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig public static final String CO_HTTP = "cohttp"; - protected String packageName = "openapi"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String apiFolder = "src/apis"; @@ -62,14 +63,17 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig private Map enumHash = new HashMap<>(); private Map enumUniqNames; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "ocaml"; } + @Override public String getHelp() { return "Generates an OCaml client library (beta)."; } @@ -752,14 +756,6 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig && !languageSpecificPrimitives.contains(type); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 391b8eb46b9..9c388464071 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -17,8 +17,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -48,13 +48,13 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String CORE_DATA = "coreData"; protected Set foundationClasses = new HashSet<>(); - protected String podName = "OpenAPIClient"; - protected String podVersion = "1.0.0"; - protected String classPrefix = "OAI"; - protected String authorName = "OpenAPI"; - protected String authorEmail = "team@openapitools.org"; - protected String license = DEFAULT_LICENSE; - protected String gitRepoURL = "https://github.com/openapitools/openapi-generator"; + @Setter protected String podName = "OpenAPIClient"; + @Setter protected String podVersion = "1.0.0"; + @Setter protected String classPrefix = "OAI"; + @Setter protected String authorName = "OpenAPI"; + @Setter protected String authorEmail = "team@openapitools.org"; + @Setter protected String license = DEFAULT_LICENSE; + @Setter protected String gitRepoURL = "https://github.com/openapitools/openapi-generator"; protected String[] specialWords = {"new", "copy"}; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -626,34 +626,6 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } - public void setClassPrefix(String classPrefix) { - this.classPrefix = classPrefix; - } - - public void setPodName(String podName) { - this.podName = podName; - } - - public void setPodVersion(String podVersion) { - this.podVersion = podVersion; - } - - public void setAuthorEmail(String authorEmail) { - this.authorEmail = authorEmail; - } - - public void setAuthorName(String authorName) { - this.authorName = authorName; - } - - public void setGitRepoURL(String gitRepoURL) { - this.gitRepoURL = gitRepoURL; - } - - public void setLicense(String license) { - this.license = license; - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { OperationMap operations = objs.getOperations(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 19a552bb22c..67dee27a017 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -17,8 +17,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -44,9 +44,9 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { protected static int emptyFunctionNameCounter = 0; public static final String MODULE_NAME = "moduleName"; public static final String MODULE_VERSION = "moduleVersion"; - protected String moduleName = "WWW::OpenAPIClient"; - protected String modulePathPart = moduleName.replaceAll("::", Matcher.quoteReplacement(File.separator)); - protected String moduleVersion = "1.0.0"; + @Setter protected String moduleName = "WWW::OpenAPIClient"; + @Setter protected String modulePathPart = moduleName.replaceAll("::", Matcher.quoteReplacement(File.separator)); + @Setter protected String moduleVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -465,18 +465,6 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { return underscore(sanitizeName(operationId)); } - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setModulePathPart(String modulePathPart) { - this.modulePathPart = modulePathPart; - } - - public void setModuleVersion(String moduleVersion) { - this.moduleVersion = moduleVersion; - } - @Override public void setParameterExampleValue(CodegenParameter p) { String example; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java index 16920f32fc9..59e191e75d1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java @@ -43,6 +43,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -53,6 +54,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { * * @return the friendly name for the generator */ + @Override public String getName() { return "php-laravel"; } @@ -63,6 +65,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a PHP laravel server library."; } @@ -199,9 +202,6 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { supportingFiles.add(new SupportingFile("config/session.php", outputFolder + File.separator + "config", "session.php")); supportingFiles.add(new SupportingFile("config/view.php", outputFolder + File.separator + "config", "view.php")); - // /database/ - supportingFiles.add(new SupportingFile("database/migrations/2019_08_19_000000_create_failed_jobs_table.php", outputFolder + File.separator + "database" + File.separator + "migrations", "2019_08_19_000000_create_failed_jobs_table.php")); - // /resources/ supportingFiles.add(new SupportingFile("resources/js/app.js", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "js", "app.js")); supportingFiles.add(new SupportingFile("resources/js/bootstrap.js", outputFolder + File.separator + "resources" + File.separator + "assets" + File.separator + "js", "bootstrap.js")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java index fc5b114d3f4..a660336ac02 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java @@ -38,6 +38,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen { * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.SERVER; } @@ -48,6 +49,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen { * * @return the friendly name for the generator */ + @Override public String getName() { return "php-lumen"; } @@ -58,6 +60,7 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen { * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a PHP Lumen server library."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index 22da687b9e6..6335eafdd16 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index df8f7eee7b9..4611bb17c5a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -17,16 +17,11 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; -import org.apache.commons.text.StringEscapeUtils; +import lombok.Getter; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenSecurity; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.SupportingFile; +import org.apache.commons.text.StringEscapeUtils; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; @@ -38,9 +33,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; -import java.util.*; +import java.nio.charset.StandardCharsets; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -56,7 +53,10 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { protected String authPackage = ""; protected String appDirName = "App"; protected String appPackage = ""; - protected String psr7Implementation = "slim-psr7"; + /** + * Returns PSR-7 implementation package. + */ + @Getter protected String psr7Implementation = "slim-psr7"; protected String interfacesDirName = "Interfaces"; protected String interfacesPackage = ""; @@ -344,23 +344,17 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { // from AbstractPhpCodegen.java // Trim the string to avoid leading and trailing spaces. input = input.trim(); - try { - input = URLEncoder.encode(input, "UTF-8") - .replaceAll("\\+", "%20") - .replaceAll("\\%2F", "/") - .replaceAll("\\%7B", "{") // keep { part of complex placeholders - .replaceAll("\\%7D", "}") // } part - .replaceAll("\\%5B", "[") // [ part - .replaceAll("\\%5D", "]") // ] part - .replaceAll("\\%3A", ":") // : part - .replaceAll("\\%2B", "+") // + part - .replaceAll("\\%5C\\%5Cd", "\\\\d"); // \d part - } catch (UnsupportedEncodingException e) { - // continue - LOGGER.error(e.getMessage(), e); - } - return input; + return URLEncoder.encode(input, StandardCharsets.UTF_8) + .replaceAll("\\+", "%20") + .replaceAll("\\%2F", "/") + .replaceAll("\\%7B", "{") // keep { part of complex placeholders + .replaceAll("\\%7D", "}") // } part + .replaceAll("\\%5B", "[") // [ part + .replaceAll("\\%5D", "]") // ] part + .replaceAll("\\%3A", ":") // : part + .replaceAll("\\%2B", "+") // + part + .replaceAll("\\%5C\\%5Cd", "\\\\d"); // \d part } @Override @@ -394,12 +388,4 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { } } - /** - * Returns PSR-7 implementation package. - * - * @return PSR-7 implementation package - */ - public String getPsr7Implementation() { - return this.psr7Implementation; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 823e9609929..8a0aa66e939 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -17,8 +17,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -48,10 +49,10 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg protected String testsPackage; protected String apiTestsPackage; protected String modelTestsPackage; - protected String composerVendorName = "openapi"; - protected String composerProjectName = "server-bundle"; + @Setter protected String composerVendorName = "openapi"; + @Setter protected String composerProjectName = "server-bundle"; protected String testsDirName = "Tests"; - protected String bundleName; + @Getter protected String bundleName; protected String bundleClassName; protected String bundleExtensionName; protected String bundleAlias; @@ -60,7 +61,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg protected String controllerPackage; protected String controllerTestsPackage; protected String servicePackage; - protected Boolean phpLegacySupport = Boolean.TRUE; + @Setter protected Boolean phpLegacySupport = Boolean.TRUE; protected HashSet typeHintable; @@ -212,10 +213,6 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg cliOptions.add(new CliOption(PHP_LEGACY_SUPPORT, "Should the generated code be compatible with PHP 5.x?").defaultValue(Boolean.TRUE.toString())); } - public String getBundleName() { - return bundleName; - } - public void setBundleName(String bundleName) { this.bundleName = bundleName; this.bundleClassName = bundleName + "Bundle"; @@ -230,10 +227,6 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg } } - public void setPhpLegacySupport(Boolean support) { - this.phpLegacySupport = support; - } - public String controllerFileFolder() { return (outputFolder + File.separator + toSrcPath(controllerPackage, srcBasePath)); } @@ -492,6 +485,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg * @param name the name of the property * @return getter name based on naming convention */ + @Override public String toBooleanGetter(String name) { return "is" + getterAndSetterCapitalize(name); } @@ -514,14 +508,6 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg return (outputFolder + File.separator + toSrcPath(modelTestsPackage, srcBasePath)); } - public void setComposerVendorName(String composerVendorName) { - this.composerVendorName = composerVendorName; - } - - public void setComposerProjectName(String composerProjectName) { - this.composerProjectName = composerProjectName; - } - @Override public void setInvokerPackage(String invokerPackage) { super.setInvokerPackage(invokerPackage); @@ -611,6 +597,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg return escapeText(pattern); } + @Override public String toApiName(String name) { if (name.isEmpty()) { return "DefaultApiInterface"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java index 6212b7929b5..2b7314ef699 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java @@ -32,14 +32,17 @@ public class PlantumlDocumentationCodegen extends DefaultCodegen implements Code final Logger LOGGER = LoggerFactory.getLogger(PlantumlDocumentationCodegen.class); + @Override public CodegenType getTag() { return CodegenType.DOCUMENTATION; } + @Override public String getName() { return "plantuml"; } + @Override public String getHelp() { return "Generates a plantuml documentation."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostmanCollectionCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostmanCollectionCodegen.java index 03fa6c5141b..d3f7d77f91c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostmanCollectionCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PostmanCollectionCodegen.java @@ -10,6 +10,8 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.ServerVariable; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -85,6 +87,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.SCHEMA; } @@ -101,6 +104,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC * * @return the friendly name for the generator */ + @Override public String getName() { return "postman-collection"; } @@ -453,6 +457,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a Postman collection (format v2.1.0) JSON file"; } @@ -505,6 +510,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC * @param input String to be cleaned up * @return string with quotation mark removed or escaped */ + @Override public String escapeQuotationMark(String input) { //TODO: check that this logic is safe to escape quotation mark to avoid code injection return input.replace("\"", "\\\""); @@ -820,7 +826,7 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC } // Supporting models - public class PostmanRequestItem { + @Getter @Setter public class PostmanRequestItem { private String name; private String body; @@ -833,23 +839,9 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC this.body = body; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } } + @Getter @Setter class PostmanVariable { private String name; @@ -871,30 +863,6 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC return this; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - @Override public boolean equals(Object o) { if (this == o) return true; @@ -917,6 +885,5 @@ public class PostmanCollectionCodegen extends DefaultCodegen implements CodegenC '}'; } } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index edf53eb5174..6550d352bb5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -16,8 +16,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; @@ -43,29 +43,29 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public class PowerShellClientCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(PowerShellClientCodegen.class); - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + @Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; - protected String sourceFolder = "src"; + @Setter protected String sourceFolder = "src"; protected String packageName = "PSOpenAPITools"; - protected String packageVersion = "0.1.2"; + @Setter protected String packageVersion = "0.1.2"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String apiTestPath = "tests/Api"; protected String modelTestPath = "tests/Model"; protected HashSet nullablePrimitives; - protected String powershellGalleryUrl; + @Setter protected String powershellGalleryUrl; protected HashSet powershellVerbs; protected Map commonVerbs; // verbs not in the official ps verb list but can be mapped to one of the verbs protected HashSet methodNames; // store a list of method names to detect duplicates - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup - protected boolean discardReadOnly = false; // Discard the readonly property in initialize cmdlet - protected boolean skipVerbParsing = false; // Attempt to parse cmdlets from operation names - protected String projectUri; - protected String licenseUri; - protected String releaseNotes; - protected String tags; - protected String iconUri; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected boolean discardReadOnly = false; // Discard the readonly property in initialize cmdlet + @Setter protected boolean skipVerbParsing = false; // Attempt to parse cmdlets from operation names + @Setter protected String projectUri; + @Setter protected String licenseUri; + @Setter protected String releaseNotes; + @Setter protected String tags; + @Setter protected String iconUri; protected Set paramNameReservedWords; protected String modelsCmdletVerb = "Initialize"; protected boolean useClassNameInModelsExamples = true; @@ -577,14 +577,17 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo additionalProperties.put("psData", null); } + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "powershell"; } + @Override public String getHelp() { return "Generates a PowerShell API client (beta)"; } @@ -595,60 +598,14 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo this.modelPackage = packageName + File.separator + "Model"; } - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - - public void setPowershellGalleryUrl(String powershellGalleryUrl) { - this.powershellGalleryUrl = powershellGalleryUrl; - } - - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } - public void setDiscardReadOnly(boolean discardReadOnly) { - this.discardReadOnly = discardReadOnly; - } - public boolean getDiscardReadOnly() { return this.discardReadOnly; } - public void setTags(String tags){ - this.tags = tags; - } - - public void setLicenseUri(String licenseUri){ - this.licenseUri = licenseUri; - } - - public void setProjectUri(String projectUri){ - this.projectUri = projectUri; - } - - public void setReleaseNotes(String releaseNotes){ - this.releaseNotes = releaseNotes; - } - - public void setIconUri(String iconUri){ - this.iconUri = iconUri; - } - - public void setSkipVerbParsing(boolean skipVerbParsing) { this.skipVerbParsing = skipVerbParsing; } - public void SetModelsCmdletVerb(String modelsCmdletVerb) { this.modelsCmdletVerb = modelsCmdletVerb; } public void SetUseClassNameInModelsExamples(boolean useClassNameInModelsExamples) { this.useClassNameInModelsExamples = useClassNameInModelsExamples; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index f1ca476646a..bac31f924dd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -16,9 +16,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.exceptions.ProtoBufIndexComputationException; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -56,7 +56,7 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf private final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class); - protected String packageName = "openapitools"; + @Setter protected String packageName = "openapitools"; private boolean numberedFieldNumberList = false; @@ -67,10 +67,12 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf return CodegenType.SCHEMA; } + @Override public String getName() { return "protobuf-schema"; } + @Override public String getHelp() { return "Generates gRPC and protocol buffer schema files (beta)"; } @@ -485,10 +487,6 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf return underscore(name) + "_service"; } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - @Override public String toModelFilename(String name) { // underscore the model file name diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java index d497c8a0e01..49e86939942 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java @@ -77,5 +77,5 @@ public class PythonAiohttpConnexionServerCodegen extends AbstractPythonConnexion } @Override - public String generatorLanguageVersion() { return "3.5.2+"; }; + public String generatorLanguageVersion() { return "3.5.2+"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java index e36fc7a3170..e0fdc0a52b3 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java @@ -267,5 +267,5 @@ public class PythonBluePlanetServerCodegen extends AbstractPythonConnexionServer } @Override - public String generatorLanguageVersion() { return "3.5.2+"; }; + public String generatorLanguageVersion() { return "3.5.2+"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 93cebd71582..da30b6e1ed7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -17,19 +17,14 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; @@ -38,7 +33,6 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.escape; import static org.openapitools.codegen.utils.StringUtils.underscore; public class PythonClientCodegen extends AbstractPythonCodegen implements CodegenConfig { @@ -49,14 +43,15 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege public static final String RECURSION_LIMIT = "recursionLimit"; public static final String DATETIME_FORMAT = "datetimeFormat"; public static final String DATE_FORMAT = "dateFormat"; + public static final String SET_ENSURE_ASCII_TO_FALSE = "setEnsureAsciiToFalse"; - protected String packageUrl; + @Setter protected String packageUrl; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup - protected String datetimeFormat = "%Y-%m-%dT%H:%M:%S.%f%z"; - protected String dateFormat = "%Y-%m-%d"; - + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected String datetimeFormat = "%Y-%m-%dT%H:%M:%S.%f%z"; + @Setter protected String dateFormat = "%Y-%m-%d"; + @Setter protected boolean setEnsureAsciiToFalse = false; private String testFolder; @@ -141,6 +136,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(SET_ENSURE_ASCII_TO_FALSE, "When set to true, add `ensure_ascii=False` in json.dumps when creating the HTTP request body.") + .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); cliOptions.add(new CliOption(MAP_NUMBER_TO, "Map number to Union[StrictFloat, StrictInt], StrictStr or float.") .defaultValue("Union[StrictFloat, StrictInt]")); @@ -228,6 +225,10 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); + if (additionalProperties.containsKey(SET_ENSURE_ASCII_TO_FALSE)) { + additionalProperties.put(SET_ENSURE_ASCII_TO_FALSE, Boolean.valueOf(additionalProperties.get(SET_ENSURE_ASCII_TO_FALSE).toString())); + } + if (additionalProperties.containsKey(PACKAGE_URL)) { setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); } @@ -335,10 +336,6 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege apiPackage = this.packageName + "." + apiPackage; } - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } @@ -413,10 +410,6 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege return outputFolder + File.separatorChar + testFolder; } - public void setPackageUrl(String packageUrl) { - this.packageUrl = packageUrl; - } - public String packagePath() { return packageName.replace('.', File.separatorChar); } @@ -456,14 +449,4 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege } return "var_" + name; } - - public void setDatetimeFormat(String datetimeFormat) { - this.datetimeFormat = datetimeFormat; - } - - public void setDateFormat(String dateFormat) { - this.dateFormat = dateFormat; - } - - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java index 5fb5d415ee4..d219a8c48a6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.module.SimpleModule; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -90,18 +89,17 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen { super(); modifyFeatureSet(features -> features.includeSecurityFeatures( - SecurityFeature.OAuth2_AuthorizationCode, - SecurityFeature.OAuth2_Password + SecurityFeature.OAuth2_AuthorizationCode, + SecurityFeature.OAuth2_Password )); - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.BETA) - .build(); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.BETA).build(); - SimpleModule simpleModule = new SimpleModule(); - simpleModule.addKeySerializer(String.class, new SnakeCaseKeySerializer()); - simpleModule.addSerializer(Boolean.class, new PythonBooleanSerializer()); - MAPPER.registerModule(simpleModule); + MAPPER.registerModule( + new SimpleModule() + .addKeySerializer(String.class, new SnakeCaseKeySerializer()) + .addSerializer(Boolean.class, new PythonBooleanSerializer()) + ); /* * Additional Properties. These values can be passed to the templates and @@ -139,19 +137,6 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen { .defaultValue(DEFAULT_SOURCE_FOLDER)); cliOptions.add(new CliOption(CodegenConstants.FASTAPI_IMPLEMENTATION_PACKAGE, "python package name for the implementation code (convention: snake_case).") .defaultValue(implPackage)); - - // option to change how we process + set the data in the 'additionalProperties' keyword. - CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); - Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); - disallowAdditionalPropertiesIfNotPresentOpts.put("false", - "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); - disallowAdditionalPropertiesIfNotPresentOpts.put("true", - "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."); - disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); - cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); - this.setDisallowAdditionalPropertiesIfNotPresent(true); } @Override @@ -338,5 +323,5 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen { } @Override - public String generatorLanguageVersion() { return "3.7"; }; + public String generatorLanguageVersion() { return "3.7"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index f667f7b6fca..715574a8835 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -56,5 +56,5 @@ public class PythonFlaskConnexionServerCodegen extends AbstractPythonConnexionSe } @Override - public String generatorLanguageVersion() { return "3.5.2+"; }; + public String generatorLanguageVersion() { return "3.5.2+"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPydanticV1ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPydanticV1ClientCodegen.java index 0c7c0bbc78e..bf1823b9016 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPydanticV1ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonPydanticV1ClientCodegen.java @@ -17,19 +17,14 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; @@ -38,7 +33,6 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.escape; import static org.openapitools.codegen.utils.StringUtils.underscore; public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codegen implements CodegenConfig { @@ -50,12 +44,12 @@ public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codeg public static final String DATETIME_FORMAT = "datetimeFormat"; public static final String DATE_FORMAT = "dateFormat"; - protected String packageUrl; + @Setter protected String packageUrl; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup - protected String datetimeFormat = "%Y-%m-%dT%H:%M:%S.%f%z"; - protected String dateFormat = "%Y-%m-%d"; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected String datetimeFormat = "%Y-%m-%dT%H:%M:%S.%f%z"; + @Setter protected String dateFormat = "%Y-%m-%d"; private String testFolder; @@ -350,10 +344,6 @@ public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codeg apiPackage = this.packageName + "." + apiPackage; } - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } @@ -428,10 +418,6 @@ public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codeg return outputFolder + File.separatorChar + testFolder; } - public void setPackageUrl(String packageUrl) { - this.packageUrl = packageUrl; - } - public String packagePath() { return packageName.replace('.', File.separatorChar); } @@ -471,14 +457,4 @@ public class PythonPydanticV1ClientCodegen extends AbstractPythonPydanticV1Codeg } return "var_" + name; } - - public void setDatetimeFormat(String datetimeFormat) { - this.datetimeFormat = datetimeFormat; - } - - public void setDateFormat(String dateFormat) { - this.dateFormat = dateFormat; - } - - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 8e1d295dcd1..7e7d8ebb351 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -17,15 +17,14 @@ package org.openapitools.codegen.languages; -import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; //import com.sun.media.sound.InvalidDataException; import io.swagger.v3.oas.models.examples.Example; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -50,12 +49,12 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public class RClientCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(RClientCodegen.class); - protected String packageName = "openapi"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String testFolder = "tests/testthat"; - protected boolean returnExceptionOnFailure = false; + @Setter protected boolean returnExceptionOnFailure = false; protected String exceptionPackage = "default"; protected Map exceptionPackages = new LinkedHashMap(); protected Set itemReservedWords = new TreeSet(); @@ -74,21 +73,24 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { protected boolean useDefaultExceptionHandling = false; protected boolean useRlangExceptionHandling = false; - protected String errorObjectType; + @Setter protected String errorObjectType; protected String operationIdNaming; - protected boolean generateWrapper; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + @Setter protected boolean generateWrapper; + @Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup private Map schemaKeyToModelNameCache = new HashMap<>(); + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "r"; } + @Override public String getHelp() { return "Generates a R client library (beta)."; } @@ -387,6 +389,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { return outputFolder + File.separator + "R" + File.separator; } + @Override public String modelFileFolder() { return outputFolder + File.separator + "R" + File.separator; } @@ -631,18 +634,6 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { return !languageSpecificPrimitives.contains(type); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setReturnExceptionOnFailure(boolean returnExceptionOnFailure) { - this.returnExceptionOnFailure = returnExceptionOnFailure; - } - public void setExceptionPackageToUse(String exceptionPackage) { if (DEFAULT.equals(exceptionPackage)) this.useDefaultExceptionHandling = true; @@ -652,18 +643,6 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { } } - public void setErrorObjectType(final String errorObjectType) { - this.errorObjectType = errorObjectType; - } - - public void setGenerateWrapper(final boolean generateWrapper) { - this.generateWrapper = generateWrapper; - } - - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } @@ -822,6 +801,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { * @param codegenParameter Codegen parameter * @param parameter Parameter */ + @Override public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { if (parameter.getExample() != null) { codegenParameter.example = parameter.getExample().toString(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 966089f2443..2e1731f4af1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -20,6 +20,7 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -56,22 +57,22 @@ public class RubyClientCodegen extends AbstractRubyCodegen { private final Logger LOGGER = LoggerFactory.getLogger(RubyClientCodegen.class); private static final String NUMERIC_ENUM_PREFIX = "N"; protected static int emptyMethodNameCounter = 0; - protected String gemName; - protected String moduleName; - protected String gemVersion = "1.0.0"; + @Setter protected String gemName; + @Setter protected String moduleName; + @Setter protected String gemVersion = "1.0.0"; protected String specFolder = "spec"; protected String libFolder = "lib"; - protected String gemLicense = "unlicense"; - protected String gemRequiredRubyVersion = ">= 1.9"; - protected String gemHomepage = "https://openapitools.org"; - protected String gemSummary = "A Ruby SDK for the REST API"; - protected String gemDescription = "This gem maps to a REST API"; - protected String gemAuthor = ""; - protected String gemMetadata = "{}"; - protected String gemAuthorEmail = ""; + @Setter protected String gemLicense = "unlicense"; + @Setter protected String gemRequiredRubyVersion = ">= 1.9"; + @Setter protected String gemHomepage = "https://openapitools.org"; + @Setter protected String gemSummary = "A Ruby SDK for the REST API"; + @Setter protected String gemDescription = "This gem maps to a REST API"; + @Setter protected String gemAuthor = ""; + @Setter protected String gemMetadata = "{}"; + @Setter protected String gemAuthorEmail = ""; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected boolean useAutoload = false; + @Setter protected boolean useAutoload = false; private Map schemaKeyToModelNameCache = new HashMap<>(); @@ -590,54 +591,6 @@ public class RubyClientCodegen extends AbstractRubyCodegen { return gemName + "/" + apiPackage() + "/" + toApiFilename(name); } - public void setGemName(String gemName) { - this.gemName = gemName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public void setGemVersion(String gemVersion) { - this.gemVersion = gemVersion; - } - - public void setGemDescription(String gemDescription) { - this.gemDescription = gemDescription; - } - - public void setGemSummary(String gemSummary) { - this.gemSummary = gemSummary; - } - - public void setGemLicense(String gemLicense) { - this.gemLicense = gemLicense; - } - - public void setGemRequiredRubyVersion(String gemRequiredRubyVersion) { - this.gemRequiredRubyVersion = gemRequiredRubyVersion; - } - - public void setGemHomepage(String gemHomepage) { - this.gemHomepage = gemHomepage; - } - - public void setGemAuthor(String gemAuthor) { - this.gemAuthor = gemAuthor; - } - - public void setGemAuthorEmail(String gemAuthorEmail) { - this.gemAuthorEmail = gemAuthorEmail; - } - - public void setGemMetadata(String gemMetadata) { - this.gemMetadata = gemMetadata; - } - - public void setUseAutoload(boolean useAutoload) { - this.useAutoload = useAutoload; - } - @Override protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { final Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java index 576216bbf01..b3f484f375c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyOnRailsServerCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; @@ -66,7 +67,7 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { protected String pidFolder = tmpFolder + File.separator + "pids"; protected String socketsFolder = tmpFolder + File.separator + "sockets"; protected String vendorFolder = "vendor"; - protected String databaseAdapter = "sqlite"; + @Setter protected String databaseAdapter = "sqlite"; public RubyOnRailsServerCodegen() { @@ -294,8 +295,4 @@ public class RubyOnRailsServerCodegen extends AbstractRubyCodegen { generateYAMLSpecFile(objs); return super.postProcessSupportingFileData(objs); } - - public void setDatabaseAdapter(String databaseAdapter) { - this.databaseAdapter = databaseAdapter; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java index 4b36b305c09..6cef19c836f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java @@ -20,7 +20,6 @@ import com.samskivert.mustache.Mustache; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; @@ -45,7 +44,6 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; -import java.io.ObjectInputFilter.Config; import java.math.BigInteger; import java.nio.file.Path; import java.util.*; @@ -245,14 +243,17 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege .doNotOverwrite()); } + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "rust-axum"; } + @Override public String getHelp() { return "Generates a Rust server library which bases on Axum."; } @@ -474,16 +475,18 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege original = operation.getResponses().get(rsp.code); } - // Create a unique responseID for this response. - String[] words = rsp.message.split("[^A-Za-z ]"); + // Create a unique responseID for this response, if one is not already specified with the "x-response-id" extension + if (!rsp.vendorExtensions.containsKey("x-response-id")) { + String[] words = rsp.message.split("[^A-Za-z ]"); - // build responseId from both status code and description - String responseId = "Status" + rsp.code + ( - ((words.length != 0) && (!words[0].trim().isEmpty())) ? - "_" + camelize(words[0].replace(" ", "_")) : "" - ); - - rsp.vendorExtensions.put("x-response-id", responseId); + // build responseId from both status code and description + String responseId = "Status" + rsp.code + ( + ((words.length != 0) && (!words[0].trim().isEmpty())) ? + "_" + camelize(words[0].replace(" ", "_")) : "" + ); + rsp.vendorExtensions.put("x-response-id", responseId); + } + if (rsp.dataType != null) { // Get the mimetype which is produced by this response. Note // that although in general responses produces a set of diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 78669ce2fba..cb880c97541 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -22,6 +22,8 @@ import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.parser.util.SchemaTypeUtil; import joptsimple.internal.Strings; +import lombok.AccessLevel; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -43,18 +45,19 @@ import java.util.stream.Collectors; public class RustClientCodegen extends AbstractRustCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(RustClientCodegen.class); - private boolean useSingleRequestParameter = false; - private boolean supportAsync = true; - private boolean supportMiddleware = false; + @Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false; + @Setter(AccessLevel.PRIVATE) private boolean supportAsync = true; + @Setter(AccessLevel.PRIVATE) private boolean supportMiddleware = false; private boolean supportMultipleResponses = false; private boolean withAWSV4Signature = false; - private boolean preferUnsignedInt = false; - private boolean bestFitInt = false; - private boolean avoidBoxedModels = false; + @Setter private boolean preferUnsignedInt = false; + @Setter private boolean bestFitInt = false; + @Setter private boolean avoidBoxedModels = false; public static final String PACKAGE_NAME = "packageName"; public static final String PACKAGE_VERSION = "packageVersion"; public static final String HYPER_LIBRARY = "hyper"; + public static final String HYPER0X_LIBRARY = "hyper0x"; public static final String REQWEST_LIBRARY = "reqwest"; public static final String SUPPORT_ASYNC = "supportAsync"; public static final String SUPPORT_MIDDLEWARE = "supportMiddleware"; @@ -63,21 +66,24 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon public static final String BEST_FIT_INT = "bestFitInt"; public static final String AVOID_BOXED_MODELS = "avoidBoxedModels"; - protected String packageName = "openapi"; - protected String packageVersion = "1.0.0"; + @Setter protected String packageName = "openapi"; + @Setter protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String apiFolder = "src/apis"; protected String modelFolder = "src/models"; + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "rust"; } + @Override public String getHelp() { return "Generates a Rust client library (beta)."; } @@ -197,7 +203,8 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon cliOptions.add(new CliOption(AVOID_BOXED_MODELS, "If set, `Box` will not be used for models", SchemaTypeUtil.BOOLEAN_TYPE) .defaultValue(Boolean.FALSE.toString())); - supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper."); + supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper (v1.x)."); + supportedLibraries.put(HYPER0X_LIBRARY, "HTTP client: Hyper (v0.x)."); supportedLibraries.put(REQWEST_LIBRARY, "HTTP client: Reqwest."); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use."); @@ -366,6 +373,9 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon if (HYPER_LIBRARY.equals(getLibrary())) { additionalProperties.put(HYPER_LIBRARY, "true"); + } else if (HYPER0X_LIBRARY.equals(getLibrary())) { + additionalProperties.put(HYPER_LIBRARY, "true"); + additionalProperties.put(HYPER0X_LIBRARY, "true"); } else if (REQWEST_LIBRARY.equals(getLibrary())) { additionalProperties.put(REQWEST_LIBRARY, "true"); } else { @@ -417,18 +427,10 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon return supportAsync; } - private void setSupportAsync(boolean supportAsync) { - this.supportAsync = supportAsync; - } - private boolean getSupportMiddleware() { return supportMiddleware; } - private void setSupportMiddleware(boolean supportMiddleware) { - this.supportMiddleware = supportMiddleware; - } - public boolean getSupportMultipleReturns() { return supportMultipleResponses; } @@ -441,34 +443,18 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon return preferUnsignedInt; } - public void setPreferUnsignedInt(boolean preferUnsignedInt) { - this.preferUnsignedInt = preferUnsignedInt; - } - public boolean getBestFitInt() { return bestFitInt; } - public void setBestFitInt(boolean bestFitInt) { - this.bestFitInt = bestFitInt; - } - private boolean getUseSingleRequestParameter() { return useSingleRequestParameter; } - private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { - this.useSingleRequestParameter = useSingleRequestParameter; - } - public boolean getAvoidBoxedModels() { return avoidBoxedModels; } - public void setAvoidBoxedModels(boolean avoidBoxedModels) { - this.avoidBoxedModels = avoidBoxedModels; - } - @Override public String apiFileFolder() { return (outputFolder + File.separator + apiFolder).replace("/", File.separator); @@ -623,14 +609,6 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon return objs; } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String toDefaultValue(Schema p) { if (p.getDefault() != null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 215af9d7e0e..c9d889efb75 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -21,7 +21,6 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; import io.swagger.v3.oas.models.parameters.Parameter; @@ -29,6 +28,7 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; import joptsimple.internal.Strings; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -69,7 +69,7 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected String packageName; - protected String packageVersion; + @Setter protected String packageVersion; protected String externCrateName; protected Map> pathSetMap = new HashMap(); protected Map> callbacksPathSetMap = new HashMap(); @@ -282,10 +282,6 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon this.externCrateName = packageName.replace('-', '_'); } - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - @Override public String apiPackage() { return apiPath; @@ -1128,6 +1124,7 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon // the templates to process. List>> pathSetEntryList = new ArrayList(pathSetMap.entrySet()); Collections.sort(pathSetEntryList, new Comparator>>() { + @Override public int compare(Map.Entry> a, Map.Entry> b) { return a.getValue().get("path").compareTo(b.getValue().get("path")); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index a5df2e22ba4..e03a7f90965 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -17,9 +17,6 @@ package org.openapitools.codegen.languages; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.lang3.StringUtils; @@ -33,13 +30,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.camelize; - public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements CodegenConfig { protected String mainPackage = "org.openapitools.client"; protected String groupId = "org.openapitools"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java index a88e5cc1d8f..2962bfc5619 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaHttpServerCodegen.java @@ -67,14 +67,17 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements final Logger LOGGER = LoggerFactory.getLogger(ScalaAkkaHttpServerCodegen.class); + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "scala-akka-http-server"; } + @Override public String getHelp() { return "Generates a scala-akka-http server (beta)."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java index 576e138aead..6487a9921ed 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java @@ -41,14 +41,17 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code private final Logger LOGGER = LoggerFactory.getLogger(ScalaCaskServerCodegen.class); + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "scala-cask"; } + @Override public String getHelp() { return "Generates a scala-cask server."; } @@ -152,6 +155,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code return "jvm/src/test/scala"; } + @Override public String toModelTestFilename(String name) { String n = super.toModelTestFilename(name); return (modelPackage + "." + n).replace('.', '/'); @@ -305,7 +309,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code @Override public String apiFileFolder() { - final String folder = outputFolder + "/jvm/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar);; + final String folder = outputFolder + "/jvm/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); return folder; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java index 7427c4ce786..a869bbecad1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java @@ -17,8 +17,8 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; @@ -38,7 +38,7 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo protected String artifactId = "finch-server"; protected String artifactVersion = "1.0.0"; protected String sourceFolder = "src/main/scala"; - protected String packageName = "org.openapitools"; + @Setter protected String packageName = "org.openapitools"; public ScalaFinchServerCodegen() { super(); @@ -297,10 +297,6 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo return input.replace("*/", "*_/").replace("/*", "/_*"); } - public void setPackageName(String packageName) { - this.packageName = packageName; - } - /** * @param prim primitive type diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java index 5d99d8d80cc..48e4f81f124 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaGatlingCodegen.java @@ -20,7 +20,6 @@ package org.openapitools.codegen.languages; 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.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.io.FileUtils; @@ -52,6 +51,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen * * @return the CodegenType for this generator */ + @Override public CodegenType getTag() { return CodegenType.CLIENT; } @@ -62,6 +62,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen * * @return the friendly name for the generator */ + @Override public String getName() { return "scala-gatling"; } @@ -72,6 +73,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates a gatling simulation library (beta)."; } @@ -231,6 +233,7 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated */ + @Override public String modelFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttp4sServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttp4sServerCodegen.java index d97f772e642..59dc936667d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttp4sServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttp4sServerCodegen.java @@ -16,7 +16,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPekkoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPekkoClientCodegen.java index c4da7d22d21..1eb47d1d0f8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPekkoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPekkoClientCodegen.java @@ -17,9 +17,6 @@ package org.openapitools.codegen.languages; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.lang3.StringUtils; @@ -33,13 +30,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; import java.util.*; -import static org.openapitools.codegen.utils.StringUtils.camelize; - public class ScalaPekkoClientCodegen extends AbstractScalaCodegen implements CodegenConfig { protected String mainPackage = "org.openapitools.client"; protected String groupId = "org.openapitools"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java index 4c4d748ab95..44caae87fb3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java @@ -19,8 +19,8 @@ package org.openapitools.codegen.languages; import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache.Lambda; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ApiInfoMap; @@ -55,12 +55,12 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem final Logger LOGGER = LoggerFactory.getLogger(ScalaPlayFrameworkServerCodegen.class); - protected boolean skipStubs = false; - protected boolean supportAsync = false; - protected boolean generateCustomExceptions = true; - protected boolean useSwaggerUI = true; - protected String routesFileName = "routes"; - protected String basePackage = "org.openapitools"; + @Setter protected boolean skipStubs = false; + @Setter protected boolean supportAsync = false; + @Setter protected boolean generateCustomExceptions = true; + @Setter protected boolean useSwaggerUI = true; + @Setter protected String routesFileName = "routes"; + @Setter protected String basePackage = "org.openapitools"; public ScalaPlayFrameworkServerCodegen() { super(); @@ -119,42 +119,21 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem addCliOptionWithDefault(USE_SWAGGER_UI, "Add a route to /api which show your documentation in swagger-ui. Will also import needed dependencies", useSwaggerUI); } + @Override public CodegenType getTag() { return CodegenType.SERVER; } + @Override public String getName() { return "scala-play-server"; } + @Override public String getHelp() { return "Generates a Scala server application (beta) with Play Framework."; } - public void setSupportAsync(boolean supportAsync) { - this.supportAsync = supportAsync; - } - - public void setSkipStubs(boolean skipStubs) { - this.skipStubs = skipStubs; - } - - public void setGenerateCustomExceptions(boolean generateCustomExceptions) { - this.generateCustomExceptions = generateCustomExceptions; - } - - public void setRoutesFileName(String routesFileName) { - this.routesFileName = routesFileName; - } - - public void setBasePackage(String basePackage) { - this.basePackage = basePackage; - } - - public void setUseSwaggerUI(boolean useSwaggerUI) { - this.useSwaggerUI = useSwaggerUI; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java index 3d9d3d1f04a..9c54671b863 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttp4ClientCodegen.java @@ -1,9 +1,6 @@ package org.openapitools.codegen.languages; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; @@ -16,23 +13,15 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.utils.CamelizeOption.*; -import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; -import static org.openapitools.codegen.utils.StringUtils.camelize; - public class ScalaSttp4ClientCodegen extends AbstractScalaCodegen implements CodegenConfig { private static final StringProperty STTP_CLIENT_VERSION = new StringProperty("sttpClientVersion", "The version of " + "sttp client", "4.0.0-M1"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java index 4b4f73dd3e3..9ef0b225522 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java @@ -16,10 +16,7 @@ package org.openapitools.codegen.languages; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.servers.Server; @@ -32,23 +29,15 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.openapitools.codegen.utils.CamelizeOption.*; -import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; -import static org.openapitools.codegen.utils.StringUtils.camelize; - public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements CodegenConfig { private static final StringProperty STTP_CLIENT_VERSION = new StringProperty("sttpClientVersion", "The version of " + "sttp client", "3.3.18"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java index 720ed0e8853..3a46fc6a51a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java @@ -19,7 +19,6 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -38,7 +37,6 @@ import java.util.HashMap; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; public class ScalazClientCodegen extends AbstractScalaCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(ScalazClientCodegen.class); @@ -153,24 +151,6 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen return formatIdentifier(property.baseName, true); } - public String getNameUsingModelPropertyNaming(String name) { - switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { - case original: - return name; - case camelCase: - return camelize(name, LOWERCASE_FIRST_LETTER); - case PascalCase: - return camelize(name); - case snake_case: - return underscore(name); - default: - throw new IllegalArgumentException("Invalid model property naming '" + - name + "'. Must be 'original', 'camelCase', " + - "'PascalCase' or 'snake_case'"); - } - - } - @Override public String toDefaultValue(Schema p) { if (p.getDefault() != null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index bb241bf0501..cb3c52a99c7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -28,7 +28,6 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.tags.Tag; import java.io.File; @@ -37,6 +36,9 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; + +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.openapitools.codegen.CliOption; @@ -112,15 +114,11 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController"; public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface"; - public enum RequestMappingMode { + @Getter public enum RequestMappingMode { api_interface("Generate the @RequestMapping annotation on the generated Api Interface."), controller("Generate the @RequestMapping annotation on the generated Api Controller Implementation."), none("Do not add a class level @RequestMapping annotation."); - public String getDescription() { - return description; - } - private String description; RequestMappingMode(String description) { @@ -131,36 +129,41 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String OPEN_BRACE = "{"; public static final String CLOSE_BRACE = "}"; - protected String title = "OpenAPI Spring"; + @Setter protected String title = "OpenAPI Spring"; + @Getter @Setter protected String configPackage = "org.openapitools.configuration"; + @Getter @Setter protected String basePackage = "org.openapitools"; + @Getter @Setter protected String resourceFolder = projectFolder + "/resources"; - protected boolean interfaceOnly = false; - protected boolean useFeignClientUrl = true; - protected boolean delegatePattern = false; + @Setter protected boolean interfaceOnly = false; + @Setter protected boolean useFeignClientUrl = true; + @Setter protected boolean delegatePattern = false; protected boolean delegateMethod = false; - protected boolean singleContentTypes = false; - protected boolean async = false; - protected boolean reactive = false; - protected boolean sse = false; - protected String responseWrapper = ""; - protected boolean skipDefaultInterface = false; - protected boolean useTags = false; - protected boolean useBeanValidation = true; + @Setter protected boolean singleContentTypes = false; + @Setter protected boolean async = false; + @Setter protected boolean reactive = false; + @Setter protected boolean sse = false; + @Setter protected String responseWrapper = null; + @Setter protected boolean skipDefaultInterface = false; + @Setter protected boolean useTags = false; protected boolean performBeanValidation = false; - protected boolean apiFirst = false; + @Setter protected boolean apiFirst = false; protected boolean useOptional = false; - protected boolean virtualService = false; - protected boolean hateoas = false; - protected boolean returnSuccessCode = false; + @Setter protected boolean virtualService = false; + @Setter protected boolean hateoas = false; + @Setter protected boolean returnSuccessCode = false; + @Getter @Setter protected boolean unhandledException = false; - protected boolean useSpringController = false; + @Setter protected boolean useSpringController = false; protected boolean useSwaggerUI = true; - protected boolean useResponseEntity = true; - protected boolean useEnumCaseInsensitive = false; + @Setter protected boolean useResponseEntity = true; + @Setter protected boolean useEnumCaseInsensitive = false; + @Getter @Setter protected boolean useSpringBoot3 = false; protected boolean generatedConstructorWithRequiredArgs = true; + @Getter @Setter protected RequestMappingMode requestMappingMode = RequestMappingMode.controller; public SpringCodegen() { @@ -177,6 +180,7 @@ public class SpringCodegen extends AbstractJavaCodegen .includeSchemaSupportFeatures(SchemaSupportFeature.Polymorphism) .excludeParameterFeatures(ParameterFeature.Cookie)); + useBeanValidation = true; outputFolder = "generated-code/javaSpring"; embeddedTemplateDir = templateDir = "JavaSpring"; apiPackage = "org.openapitools.api"; @@ -193,7 +197,7 @@ public class SpringCodegen extends AbstractJavaCodegen apiTestTemplateFiles.clear(); // TODO: add test template // spring uses the jackson lib - additionalProperties.put(JACKSON, "true"); + jackson = true; additionalProperties.put("openbrace", OPEN_BRACE); additionalProperties.put("closebrace", CLOSE_BRACE); @@ -296,6 +300,7 @@ public class SpringCodegen extends AbstractJavaCodegen return isLibrary(SPRING_HTTP_INTERFACE) ? null : DocumentationProvider.SPRINGDOC; } + @Override public List supportedDocumentationProvider() { List supportedProviders = new ArrayList<>(); supportedProviders.add(DocumentationProvider.NONE); @@ -347,16 +352,10 @@ public class SpringCodegen extends AbstractJavaCodegen && additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { // set invokerPackage as basePackage: this.setBasePackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); - additionalProperties.put(BASE_PACKAGE, basePackage); LOGGER.info("Set base package to invoker package ({})", basePackage); } - if (additionalProperties.containsKey(REQUEST_MAPPING_OPTION)) { - RequestMappingMode optValue = RequestMappingMode.valueOf( - String.valueOf(additionalProperties.get(REQUEST_MAPPING_OPTION))); - setRequestMappingMode(optValue); - additionalProperties.remove(REQUEST_MAPPING_OPTION); - } + convertPropertyToTypeAndWriteBack(REQUEST_MAPPING_OPTION, RequestMappingMode::valueOf, this::setRequestMappingMode); useOneOfInterfaces = true; legacyDiscriminatorBehavior = false; @@ -395,139 +394,45 @@ public class SpringCodegen extends AbstractJavaCodegen modelDocTemplateFiles.remove("model_doc.mustache"); apiDocTemplateFiles.remove("api_doc.mustache"); - if (additionalProperties.containsKey(TITLE)) { - this.setTitle((String) additionalProperties.get(TITLE)); - } - - if (additionalProperties.containsKey(CONFIG_PACKAGE)) { - this.setConfigPackage((String) additionalProperties.get(CONFIG_PACKAGE)); - } else { - additionalProperties.put(CONFIG_PACKAGE, configPackage); - } - - if (additionalProperties.containsKey(BASE_PACKAGE)) { - this.setBasePackage((String) additionalProperties.get(BASE_PACKAGE)); - } else { - additionalProperties.put(BASE_PACKAGE, basePackage); - } - - if (additionalProperties.containsKey(VIRTUAL_SERVICE)) { - this.setVirtualService(Boolean.parseBoolean(additionalProperties.get(VIRTUAL_SERVICE).toString())); - } - - if (additionalProperties.containsKey(INTERFACE_ONLY)) { - this.setInterfaceOnly(Boolean.parseBoolean(additionalProperties.get(INTERFACE_ONLY).toString())); - } - - if (additionalProperties.containsKey(USE_FEIGN_CLIENT_URL)) { - this.setUseFeignClientUrl(Boolean.parseBoolean(additionalProperties.get(USE_FEIGN_CLIENT_URL).toString())); - } - writePropertyBack(USE_FEIGN_CLIENT_URL, useFeignClientUrl); - - if (additionalProperties.containsKey(DELEGATE_PATTERN)) { - this.setDelegatePattern(Boolean.parseBoolean(additionalProperties.get(DELEGATE_PATTERN).toString())); - } - - if (additionalProperties.containsKey(SINGLE_CONTENT_TYPES)) { - this.setSingleContentTypes(Boolean.parseBoolean(additionalProperties.get(SINGLE_CONTENT_TYPES).toString())); - } - - if (additionalProperties.containsKey(SKIP_DEFAULT_INTERFACE)) { - this.setSkipDefaultInterface( - Boolean.parseBoolean(additionalProperties.get(SKIP_DEFAULT_INTERFACE).toString())); - } - - if (additionalProperties.containsKey(ASYNC)) { - this.setAsync(Boolean.parseBoolean(additionalProperties.get(ASYNC).toString())); - // fix for issue/1164 - convertPropertyToBooleanAndWriteBack(ASYNC); - } - + convertPropertyToStringAndWriteBack(TITLE, this::setTitle); + convertPropertyToStringAndWriteBack(CONFIG_PACKAGE, this::setConfigPackage); + convertPropertyToStringAndWriteBack(BASE_PACKAGE, this::setBasePackage); + convertPropertyToBooleanAndWriteBack(VIRTUAL_SERVICE, this::setVirtualService); + convertPropertyToBooleanAndWriteBack(INTERFACE_ONLY, this::setInterfaceOnly); + convertPropertyToBooleanAndWriteBack(USE_FEIGN_CLIENT_URL, this::setUseFeignClientUrl); + convertPropertyToBooleanAndWriteBack(DELEGATE_PATTERN, this::setDelegatePattern); + convertPropertyToBooleanAndWriteBack(SINGLE_CONTENT_TYPES, this:: setSingleContentTypes); + convertPropertyToBooleanAndWriteBack(SKIP_DEFAULT_INTERFACE, this::setSkipDefaultInterface); + convertPropertyToBooleanAndWriteBack(ASYNC, this::setAsync); if (additionalProperties.containsKey(REACTIVE)) { if (SPRING_CLOUD_LIBRARY.equals(library)) { throw new IllegalArgumentException("Currently, reactive option doesn't supported by Spring Cloud"); } - this.setReactive(Boolean.parseBoolean(additionalProperties.get(REACTIVE).toString())); - if (additionalProperties.containsKey(SSE)) { - this.setSse(Boolean.parseBoolean(additionalProperties.get(SSE).toString())); - } - } - - if (additionalProperties.containsKey(RESPONSE_WRAPPER)) { - this.setResponseWrapper((String) additionalProperties.get(RESPONSE_WRAPPER)); - } - - if (additionalProperties.containsKey(USE_TAGS)) { - this.setUseTags(Boolean.parseBoolean(additionalProperties.get(USE_TAGS).toString())); - } - - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - - if (additionalProperties.containsKey(PERFORM_BEANVALIDATION)) { - this.setPerformBeanValidation(convertPropertyToBoolean(PERFORM_BEANVALIDATION)); - } - writePropertyBack(PERFORM_BEANVALIDATION, performBeanValidation); - - if (additionalProperties.containsKey(USE_OPTIONAL)) { - this.setUseOptional(convertPropertyToBoolean(USE_OPTIONAL)); - } - - if (additionalProperties.containsKey(API_FIRST)) { - this.setApiFirst(Boolean.parseBoolean(additionalProperties.get(API_FIRST).toString())); - } - - if (additionalProperties.containsKey(HATEOAS)) { - this.setHateoas(Boolean.parseBoolean(additionalProperties.get(HATEOAS).toString())); - } - - if (additionalProperties.containsKey(SPRING_CONTROLLER)) { - this.setUseSpringController(convertPropertyToBoolean(SPRING_CONTROLLER)); - } - writePropertyBack(SPRING_CONTROLLER, useSpringController); - - if (additionalProperties.containsKey(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS)) { - this.generatedConstructorWithRequiredArgs = convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS); - } - writePropertyBack(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS, generatedConstructorWithRequiredArgs); - - if (additionalProperties.containsKey(RETURN_SUCCESS_CODE)) { - this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); - } - - if (additionalProperties.containsKey(USE_SWAGGER_UI)) { - this.setUseSwaggerUI(convertPropertyToBoolean(USE_SWAGGER_UI)); + convertPropertyToBooleanAndWriteBack(REACTIVE, this::setReactive); + convertPropertyToBooleanAndWriteBack(SSE, this::setSse); } + convertPropertyToStringAndWriteBack(RESPONSE_WRAPPER, this::setResponseWrapper); + convertPropertyToBooleanAndWriteBack(USE_TAGS, this::setUseTags); + convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION, this::setUseBeanValidation); + convertPropertyToBooleanAndWriteBack(PERFORM_BEANVALIDATION, this::setPerformBeanValidation); + convertPropertyToBooleanAndWriteBack(USE_OPTIONAL, this::setUseOptional); + convertPropertyToBooleanAndWriteBack(API_FIRST, this::setApiFirst); + convertPropertyToBooleanAndWriteBack(HATEOAS, this::setHateoas); + convertPropertyToBooleanAndWriteBack(SPRING_CONTROLLER, this::setUseSpringController); + convertPropertyToBooleanAndWriteBack(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS, value -> this.generatedConstructorWithRequiredArgs=value); + convertPropertyToBooleanAndWriteBack(RETURN_SUCCESS_CODE, this::setReturnSuccessCode); + convertPropertyToBooleanAndWriteBack(USE_SWAGGER_UI, this::setUseSwaggerUI); if (getDocumentationProvider().equals(DocumentationProvider.NONE)) { this.setUseSwaggerUI(false); } - writePropertyBack(USE_SWAGGER_UI, useSwaggerUI); - - if (additionalProperties.containsKey(UNHANDLED_EXCEPTION_HANDLING)) { - this.setUnhandledException( - Boolean.parseBoolean(additionalProperties.get(UNHANDLED_EXCEPTION_HANDLING).toString())); - } - additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException()); - - if (additionalProperties.containsKey(USE_RESPONSE_ENTITY)) { - this.setUseResponseEntity( - Boolean.parseBoolean(additionalProperties.get(USE_RESPONSE_ENTITY).toString())); - } - writePropertyBack(USE_RESPONSE_ENTITY, useResponseEntity); + convertPropertyToBooleanAndWriteBack(UNHANDLED_EXCEPTION_HANDLING, this::setUnhandledException); + convertPropertyToBooleanAndWriteBack(USE_RESPONSE_ENTITY, this::setUseResponseEntity); additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda()); - if (additionalProperties.containsKey(USE_ENUM_CASE_INSENSITIVE)) { - this.setUseEnumCaseInsensitive(Boolean.parseBoolean(additionalProperties.get(USE_ENUM_CASE_INSENSITIVE).toString())); - } - writePropertyBack(USE_ENUM_CASE_INSENSITIVE, useEnumCaseInsensitive); - - if (additionalProperties.containsKey(USE_SPRING_BOOT3)) { - this.setUseSpringBoot3(convertPropertyToBoolean(USE_SPRING_BOOT3)); - } + convertPropertyToBooleanAndWriteBack(USE_ENUM_CASE_INSENSITIVE, this::setUseEnumCaseInsensitive); + convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT3, this::setUseSpringBoot3); if (isUseSpringBoot3()) { if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { throw new IllegalArgumentException(DocumentationProvider.SPRINGFOX.getPropertyName() + " is not supported with Spring Boot > 3.x"); @@ -536,16 +441,9 @@ public class SpringCodegen extends AbstractJavaCodegen throw new IllegalArgumentException(AnnotationLibrary.SWAGGER1.getPropertyName() + " is not supported with Spring Boot > 3.x"); } useJakartaEe=true; - additionalProperties.put(USE_JAKARTA_EE, useJakartaEe); applyJakartaPackage(); } - writePropertyBack(USE_SPRING_BOOT3, isUseSpringBoot3()); - - if (additionalProperties.containsKey(RESOURCE_FOLDER)) { - this.setResourceFolder((String) additionalProperties.get(RESOURCE_FOLDER)); - } - additionalProperties.put(RESOURCE_FOLDER, resourceFolder); - + convertPropertyToStringAndWriteBack(RESOURCE_FOLDER, this::setResourceFolder); typeMapping.put("file", "org.springframework.core.io.Resource"); importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource"); @@ -556,10 +454,6 @@ public class SpringCodegen extends AbstractJavaCodegen importMapping.put("ParameterObject", "org.springdoc.core.annotations.ParameterObject"); } - if (useOptional) { - writePropertyBack(USE_OPTIONAL, useOptional); - } - if (interfaceOnly && delegatePattern) { delegateMethod = true; additionalProperties.put("delegate-method", true); @@ -1023,102 +917,6 @@ public class SpringCodegen extends AbstractJavaCodegen } } - public void setTitle(String title) { - this.title = title; - } - - public void setConfigPackage(String configPackage) { - this.configPackage = configPackage; - } - - public String getConfigPackage() { - return configPackage; - } - - public boolean isUnhandledException() { - return unhandledException; - } - - public void setBasePackage(String basePackage) { - this.basePackage = basePackage; - } - - public String getBasePackage() { - return basePackage; - } - - public void setInterfaceOnly(boolean interfaceOnly) { - this.interfaceOnly = interfaceOnly; - } - - public void setUseFeignClientUrl(boolean useFeignClientUrl) { - this.useFeignClientUrl = useFeignClientUrl; - } - - public void setDelegatePattern(boolean delegatePattern) { - this.delegatePattern = delegatePattern; - } - - public void setSingleContentTypes(boolean singleContentTypes) { - this.singleContentTypes = singleContentTypes; - } - - public void setSkipDefaultInterface(boolean skipDefaultInterface) { - this.skipDefaultInterface = skipDefaultInterface; - } - - public void setVirtualService(boolean virtualService) { - this.virtualService = virtualService; - } - - public void setAsync(boolean async) { - this.async = async; - } - - public void setReactive(boolean reactive) { - this.reactive = reactive; - } - - public void setSse(boolean sse) { - this.sse = sse; - } - - public void setResponseWrapper(String responseWrapper) { - this.responseWrapper = responseWrapper; - } - - public void setUseTags(boolean useTags) { - this.useTags = useTags; - } - - public void setApiFirst(boolean apiFirst) { - this.apiFirst = apiFirst; - } - - public void setHateoas(boolean hateoas) { - this.hateoas = hateoas; - } - - public void setUseSpringController(boolean useSpringController) { - this.useSpringController = useSpringController; - } - - public void setReturnSuccessCode(boolean returnSuccessCode) { - this.returnSuccessCode = returnSuccessCode; - } - - public void setUnhandledException(boolean unhandledException) { - this.unhandledException = unhandledException; - } - - public void setUseResponseEntity(boolean useResponseEntity) { - this.useResponseEntity = useResponseEntity; - } - - public void setUseEnumCaseInsensitive(boolean useEnumCaseInsensitive) { - this.useEnumCaseInsensitive = useEnumCaseInsensitive; - } - @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -1350,11 +1148,6 @@ public class SpringCodegen extends AbstractJavaCodegen return objs; } - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - @Override public void setPerformBeanValidation(boolean performBeanValidation) { this.performBeanValidation = performBeanValidation; @@ -1379,28 +1172,4 @@ public class SpringCodegen extends AbstractJavaCodegen extensions.add(VendorExtension.X_PATTERN_MESSAGE); return extensions; } - - public boolean isUseSpringBoot3() { - return useSpringBoot3; - } - - public void setUseSpringBoot3(boolean useSpringBoot3) { - this.useSpringBoot3 = useSpringBoot3; - } - - public RequestMappingMode getRequestMappingMode() { - return requestMappingMode; - } - - public void setRequestMappingMode(RequestMappingMode requestMappingMode) { - this.requestMappingMode = requestMappingMode; - } - - public void setResourceFolder( String resourceFolder ) { - this.resourceFolder = resourceFolder; - } - - public String getResourceFolder() { - return resourceFolder; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java index 027df764bf7..0b050fbecf1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java @@ -22,7 +22,6 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import org.apache.commons.lang3.StringUtils; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java index 7ed7121d572..a25d32bdee7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java @@ -21,7 +21,6 @@ import com.samskivert.mustache.Escapers; import com.samskivert.mustache.Mustache.Compiler; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -205,6 +204,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig } } + @Override public void preprocessOpenAPI(OpenAPI openAPI) { Info info = openAPI.getInfo(); info.setDescription(toHtml(info.getDescription())); @@ -217,6 +217,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig } // override to post-process any parameters + @Override public void postProcessParameter(CodegenParameter parameter) { parameter.description = toHtml(parameter.description); parameter.unescapedDescription = toHtml( @@ -224,6 +225,7 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig } // override to post-process any model properties + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { property.description = toHtml(property.description); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 86344d9c08a..33e4cdd5c71 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -17,8 +17,9 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -83,23 +84,24 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected static final String RESPONSE_LIBRARY_COMBINE = "Combine"; protected static final String RESPONSE_LIBRARY_ASYNC_AWAIT = "AsyncAwait"; protected static final String[] RESPONSE_LIBRARIES = {RESPONSE_LIBRARY_PROMISE_KIT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_ASYNC_AWAIT}; - protected String projectName = "OpenAPIClient"; - protected boolean nonPublicApi = false; - protected boolean objcCompatible = false; - protected boolean lenientTypeCast = false; - protected boolean readonlyProperties = false; - protected boolean swiftUseApiNamespace = false; - protected boolean useSPMFileStructure = false; - protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs"; - protected boolean useClasses = false; - protected boolean useBacktickEscapes = false; - protected boolean generateModelAdditionalProperties = true; - protected boolean hashableModels = true; - protected boolean useJsonEncodable = true; + @Setter protected String projectName = "OpenAPIClient"; + @Setter protected boolean nonPublicApi = false; + @Setter protected boolean objcCompatible = false; + @Setter protected boolean lenientTypeCast = false; + @Setter protected boolean readonlyProperties = false; + @Setter protected boolean swiftUseApiNamespace = false; + @Setter protected boolean useSPMFileStructure = false; + @Setter protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs"; + @Setter protected boolean useClasses = false; + @Setter protected boolean useBacktickEscapes = false; + @Setter protected boolean generateModelAdditionalProperties = true; + @Setter protected boolean hashableModels = true; + @Setter protected boolean useJsonEncodable = true; + @Getter @Setter protected boolean mapFileBinaryToData = false; - protected boolean useCustomDateWithoutTime = false; - protected boolean validatable = true; - protected String[] responseAs = new String[0]; + @Setter protected boolean useCustomDateWithoutTime = false; + @Setter protected boolean validatable = true; + @Setter protected String[] responseAs = new String[0]; protected String sourceFolder = swiftPackagePath; protected HashSet objcReservedWords; protected String apiDocPath = "docs/"; @@ -635,18 +637,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig } - public boolean isMapFileBinaryToData() { - return mapFileBinaryToData; - } - - public void setMapFileBinaryToData(boolean mapFileBinaryToData) { - this.mapFileBinaryToData = mapFileBinaryToData; - } - - public void setUseCustomDateWithoutTime(boolean useCustomDateWithoutTime) { - this.useCustomDateWithoutTime = useCustomDateWithoutTime; - } - @Override protected boolean isReservedWord(String word) { return word != null && reservedWords.contains(word); //don't lowercase as super does @@ -717,6 +707,11 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig */ @Override public String toModelName(String name) { + + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + // FIXME parameter should not be assigned. Also declare it as "final" name = sanitizeName(name); @@ -947,66 +942,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig return codegenModel; } - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setNonPublicApi(boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - - public void setObjcCompatible(boolean objcCompatible) { - this.objcCompatible = objcCompatible; - } - - public void setLenientTypeCast(boolean lenientTypeCast) { - this.lenientTypeCast = lenientTypeCast; - } - - public void setReadonlyProperties(boolean readonlyProperties) { - this.readonlyProperties = readonlyProperties; - } - - public void setResponseAs(String[] responseAs) { - this.responseAs = responseAs; - } - - public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { - this.swiftUseApiNamespace = swiftUseApiNamespace; - } - - public void setUseSPMFileStructure(boolean useSPMFileStructure) { - this.useSPMFileStructure = useSPMFileStructure; - } - - public void setSwiftPackagePath(String swiftPackagePath) { - this.swiftPackagePath = swiftPackagePath; - } - - public void setUseClasses(boolean useClasses) { - this.useClasses = useClasses; - } - - public void setUseBacktickEscapes(boolean useBacktickEscapes) { - this.useBacktickEscapes = useBacktickEscapes; - } - - public void setGenerateModelAdditionalProperties(boolean generateModelAdditionalProperties) { - this.generateModelAdditionalProperties = generateModelAdditionalProperties; - } - - public void setHashableModels(boolean hashableModels) { - this.hashableModels = hashableModels; - } - - public void setUseJsonEncodable(boolean useJsonEncodable) { - this.useJsonEncodable = useJsonEncodable; - } - - public void setValidatable(boolean validatable) { - this.validatable = validatable; - } - @Override public String toEnumValue(String value, String datatype) { // for string, array of string diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java index 74b19997939..1a927937c88 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java @@ -16,10 +16,10 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import lombok.Setter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; @@ -54,7 +54,7 @@ public class SwiftCombineClientCodegen extends DefaultCodegen implements Codegen public static final String PROJECT_NAME = "projectName"; public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData"; - protected String projectName = "OpenAPIClient"; + @Setter protected String projectName = "OpenAPIClient"; protected String privateFolder = "Sources/Private"; protected String sourceFolder = "Sources"; protected String transportFolder = "OpenAPITransport"; @@ -553,10 +553,6 @@ public class SwiftCombineClientCodegen extends DefaultCodegen implements Codegen return m; } - public void setProjectName(String projectName) { - this.projectName = projectName; - } - @Override public String toEnumValue(String value, String datatype) { // for string, array of string diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index a1b7512c5f1..18d4051c9c0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -18,6 +18,9 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; @@ -72,16 +75,18 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String STRING_ENUMS = "stringEnums"; public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; + public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames"; - protected String ngVersion = "17.0.0"; + protected String ngVersion = "18.0.0"; + @Getter @Setter protected String npmRepository = null; - private boolean useSingleRequestParameter = false; + @Setter(AccessLevel.PRIVATE) private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; protected String serviceFileSuffix = ".service"; protected String modelSuffix = ""; protected String modelFileSuffix = ""; protected String fileNaming = "camelCase"; - protected Boolean stringEnums = false; + @Getter protected Boolean stringEnums = false; protected QUERY_PARAM_OBJECT_FORMAT_TYPE queryParamObjectFormat = QUERY_PARAM_OBJECT_FORMAT_TYPE.dot; protected PROVIDED_IN_LEVEL providedIn = PROVIDED_IN_LEVEL.root; @@ -138,6 +143,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.cliOptions.add(new CliOption(FILE_NAMING, "Naming convention for the output files: 'camelCase', 'kebab-case'.").defaultValue(this.fileNaming)); this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); this.cliOptions.add(new CliOption(QUERY_PARAM_OBJECT_FORMAT, "The format for query param objects: 'dot', 'json', 'key'.").defaultValue(this.queryParamObjectFormat.name())); + this.cliOptions.add(CliOption.newBoolean(USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, "Setting this property to true will add brackets to array attribute names, e.g. my_values[].", false)); } @Override @@ -153,7 +159,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode @Override public String getHelp() { - return "Generates a TypeScript Angular (9.x - 17.x) client library."; + return "Generates a TypeScript Angular (9.x - 18.x) client library."; } @Override @@ -288,7 +294,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode // Set the typescript version compatible to the Angular version // based on https://angular.io/guide/versions#actively-supported-versions - if (ngVersion.atLeast("17.0.0")) { + if (ngVersion.atLeast("18.1.0")) { + additionalProperties.put("tsVersion", ">=5.4.0 <5.6.0"); + } else if (ngVersion.atLeast("18.0.0")) { + additionalProperties.put("tsVersion", ">=5.4.0 <5.5.0"); + } else if (ngVersion.atLeast("17.0.0")) { additionalProperties.put("tsVersion", ">=4.9.3 <5.3.0"); } else if (ngVersion.atLeast("16.1.0")) { additionalProperties.put("tsVersion", ">=4.9.3 <5.2.0"); @@ -313,7 +323,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } // Set the rxJS version compatible to the Angular version - if (ngVersion.atLeast("17.0.0")) { + if (ngVersion.atLeast("18.0.0")) { + additionalProperties.put("rxjsVersion", "7.4.0"); + } else if (ngVersion.atLeast("17.0.0")) { additionalProperties.put("rxjsVersion", "7.4.0"); } else if (ngVersion.atLeast("16.0.0")) { additionalProperties.put("rxjsVersion", "7.4.0"); @@ -332,7 +344,15 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); // Specific ng-packagr configuration - if (ngVersion.atLeast("17.0.0")) { + if (ngVersion.atLeast("18.1.0")) { + additionalProperties.put("ngPackagrVersion", "18.1.0"); + // tsTickle is not required and there is no available version compatible with + // versions of TypeScript compatible with Angular 18. + } else if (ngVersion.atLeast("18.0.0")) { + additionalProperties.put("ngPackagrVersion", "18.0.0"); + // tsTickle is not required and there is no available version compatible with + // versions of TypeScript compatible with Angular 18. + } else if (ngVersion.atLeast("17.0.0")) { additionalProperties.put("ngPackagrVersion", "17.0.3"); // tsTickle is not required and there is no available version compatible with // versions of TypeScript compatible with Angular 17. @@ -365,7 +385,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } // set zone.js version - if (ngVersion.atLeast("17.0.0")) { + if (ngVersion.atLeast("18.0.0")) { + additionalProperties.put("zonejsVersion", "0.14.7"); + } else if (ngVersion.atLeast("17.0.0")) { additionalProperties.put("zonejsVersion", "0.14.0"); } else if (ngVersion.atLeast("16.0.0")) { additionalProperties.put("zonejsVersion", "0.13.0"); @@ -397,10 +419,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode stringEnums = value; } - public Boolean getStringEnums() { - return stringEnums; - } - public boolean getQueryParamObjectFormatDot() { return QUERY_PARAM_OBJECT_FORMAT_TYPE.dot.equals(queryParamObjectFormat); } @@ -640,22 +658,10 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX + modelPackage() + "/" + toModelFilename(removeModelPrefixSuffix(name)).substring(DEFAULT_IMPORT_PREFIX.length()); } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - private boolean getUseSingleRequestParameter() { return useSingleRequestParameter; } - private void setUseSingleRequestParameter(boolean useSingleRequestParameter) { - this.useSingleRequestParameter = useSingleRequestParameter; - } - private String getApiFilenameFromClassname(String classname) { String name = classname.substring(0, classname.length() - serviceSuffix.length()); return toApiFilename(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAureliaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAureliaClientCodegen.java index a5bc76b874d..7350642bc6c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAureliaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAureliaClientCodegen.java @@ -58,22 +58,6 @@ public class TypeScriptAureliaClientCodegen extends AbstractTypeScriptClientCode return "Generates a TypeScript client library for the Aurelia framework (beta)."; } - public String getNpmName() { - return npmName; - } - - public void setNpmName(String npmName) { - this.npmName = npmName; - } - - public String getNpmVersion() { - return npmVersion; - } - - public void setNpmVersion(String npmVersion) { - this.npmVersion = npmVersion; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 5b9aba6ab0b..6bc4ecfb373 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -17,9 +17,10 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -42,10 +43,17 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public static final String WITH_NODE_IMPORTS = "withNodeImports"; public static final String STRING_ENUMS = "stringEnums"; public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; + public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames"; + public static final String AXIOS_VERSION = "axiosVersion"; + public static final String DEFAULT_AXIOS_VERSION = "^1.6.1"; + @Getter @Setter protected String npmRepository = null; protected Boolean stringEnums = false; + @Getter @Setter + protected String axiosVersion = DEFAULT_AXIOS_VERSION; + private String tsModelPackage = ""; public TypeScriptAxiosClientCodegen() { @@ -73,6 +81,8 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITH_NODE_IMPORTS, "Setting this property to true adds imports for NodeJS", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); + this.cliOptions.add(new CliOption(USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, "Setting this property to true will add brackets to array attribute names, e.g. my_values[].", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(AXIOS_VERSION, "Use this property to override the axios version in package.json").defaultValue(DEFAULT_AXIOS_VERSION)); // Templates have no mapping between formatted property names and original base names so use only "original" and remove this option removeOption(CodegenConstants.MODEL_PROPERTY_NAMING); } @@ -87,14 +97,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege return "Generates a TypeScript client library using axios."; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - private static String getRelativeToRoot(String path) { StringBuilder sb = new StringBuilder(); int slashCount = path.split("/").length; @@ -152,6 +154,11 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege addNpmPackageGeneration(); } + if (additionalProperties.containsKey(AXIOS_VERSION)) { + setAxiosVersion(additionalProperties.get(AXIOS_VERSION).toString()); + } + additionalProperties.put("axiosVersion", getAxiosVersion()); + } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index e22cb70cdae..591af01ad77 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -23,13 +23,14 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; @@ -84,6 +85,7 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp private static final String NPM_REPOSITORY = "npmRepository"; // NPM Option Values + @Getter @Setter protected String npmRepository = null; protected String snapshot = null; protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase; @@ -181,30 +183,6 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp apiDocTemplateFiles.put("api_doc.mustache", ".md"); } - public String getNpmName() { - return npmName; - } - - public void setNpmName(String npmName) { - this.npmName = npmName; - } - - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - - public String getNpmVersion() { - return npmVersion; - } - - public void setNpmVersion(String npmVersion) { - this.npmVersion = npmVersion; - } - @Override public Map postProcessSupportingFileData(Map objs) { final Object propFramework = additionalProperties.get(FRAMEWORK_SWITCH); @@ -499,12 +477,8 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp @Override public String getTypeDeclaration(Schema p) { - Schema inner; - if (ModelUtils.isArraySchema(p)) { - inner = ModelUtils.getSchemaItems(p); - return this.getSchemaType(p) + "<" + this.getTypeDeclaration(unaliasSchema(inner)) + ">"; - } else if (ModelUtils.isMapSchema(p)) { - inner = getSchemaAdditionalProperties(p); + if (ModelUtils.isMapSchema(p)) { + Schema inner = getSchemaAdditionalProperties(p); String postfix = ""; if (Boolean.TRUE.equals(inner.getNullable())) { postfix = " | null"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index e6e49222e2b..ae6cbce2f0c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -26,6 +26,8 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; @@ -39,6 +41,7 @@ import java.io.File; import java.util.*; import java.util.stream.Collectors; +import static java.util.Objects.nonNull; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; @@ -56,8 +59,11 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege public static final String KEBAB_CASE = "kebab-case"; public static final String CAMEL_CASE = "camelCase"; public static final String PASCAL_CASE = "PascalCase"; + public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames"; + @Getter @Setter protected String npmRepository = null; + @Getter @Setter protected String importFileExtension = ""; private boolean useSingleRequestParameter = true; private boolean prefixParameterInterfaces = false; @@ -80,10 +86,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege private static final String X_KEEP_AS_JS_OBJECT = "x-keepAsJSObject"; protected boolean sagasAndRecords = false; + @Getter @Setter protected String detectPassthroughModelsWithSuffixAndField = null; // Ex: "Response;data" - protected boolean inferUniqueIdFromNameSuffix = false; + @Setter protected boolean inferUniqueIdFromNameSuffix = false; + @Getter @Setter protected String inferEntityFromUniqueIdWithName = null; - protected boolean packageAsSourceOnlyLibrary = false; + @Setter protected boolean packageAsSourceOnlyLibrary = false; public TypeScriptFetchClientCodegen() { @@ -114,6 +122,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC, SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(IMPORT_FILE_EXTENSION_SWITCH, IMPORT_FILE_EXTENSION_SWITCH_DESC).defaultValue("")); this.cliOptions.add(new CliOption(FILE_NAMING, "Naming convention for the output files: 'PascalCase', 'camelCase', 'kebab-case'.").defaultValue(this.fileNaming)); + this.cliOptions.add(new CliOption(USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, "Setting this property to true will add brackets to array attribute names, e.g. my_values[].", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); } @Override @@ -152,22 +161,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege return "Generates a TypeScript client library using Fetch API (beta)."; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - - public String getImportFileExtension() { - return importFileExtension; - } - - public void setImportFileExtension(String importFileExtension) { - this.importFileExtension = importFileExtension; - } - public Boolean getWithoutRuntimeChecks() { return withoutRuntimeChecks; } @@ -213,38 +206,14 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege return detectPassthroughModelsWithSuffixAndField != null ? detectPassthroughModelsWithSuffixAndField.split("\\.")[1] : null; } - public String getDetectPassthroughModelsWithSuffixAndField() { - return detectPassthroughModelsWithSuffixAndField; - } - - public void setDetectPassthroughModelsWithSuffixAndField(String detectPassthroughModelsWithSuffixAndField) { - this.detectPassthroughModelsWithSuffixAndField = detectPassthroughModelsWithSuffixAndField; - } - public boolean getInferUniqueIdFromNameSuffix() { return inferUniqueIdFromNameSuffix; } - public void setInferUniqueIdFromNameSuffix(boolean inferUniqueIdFromNameSuffix) { - this.inferUniqueIdFromNameSuffix = inferUniqueIdFromNameSuffix; - } - - public String getInferEntityFromUniqueIdWithName() { - return inferEntityFromUniqueIdWithName; - } - - public void setInferEntityFromUniqueIdWithName(String inferEntityFromUniqueIdWithName) { - this.inferEntityFromUniqueIdWithName = inferEntityFromUniqueIdWithName; - } - public boolean getPackageAsSourceOnlyLibrary() { return packageAsSourceOnlyLibrary; } - public void setPackageAsSourceOnlyLibrary(boolean packageAsSourceOnlyLibrary) { - this.packageAsSourceOnlyLibrary = packageAsSourceOnlyLibrary; - } - public boolean isUniqueIdAccordingToNameSuffix(String name) { if (name == null) { return false; @@ -419,8 +388,32 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege for (ModelsMap entry : result.values()) { for (ModelMap model : entry.getModels()) { ExtendedCodegenModel codegenModel = (ExtendedCodegenModel) model.getModel(); - model.put("hasImports", codegenModel.imports.size() > 0); + boolean importsPresent = !codegenModel.imports.isEmpty(); + + // When legacyDiscriminatorBehaviour = false, DefaultCodegen will add the mapped models of the + // discriminator to codegenModel.imports, causing us to duplicate the import if we don't remove them + CodegenDiscriminator discriminator = codegenModel.discriminator; + boolean mappedDiscriminatorModelsPresent = nonNull(discriminator) + && nonNull(discriminator.getMappedModels()); + if (importsPresent && mappedDiscriminatorModelsPresent) { + Set mappedDiscriminatorModelNames = discriminator.getMappedModels() + .stream() + .map(CodegenDiscriminator.MappedModel::getModelName) + .collect(Collectors.toSet()); + Set filteredImports = codegenModel.imports + .stream() + .filter(modelImport -> + !mappedDiscriminatorModelNames.contains(modelImport)) + .collect(Collectors.toSet()); + + codegenModel.imports.clear(); + codegenModel.imports.addAll(filteredImports); + } + + model.put("hasImports", importsPresent); model.put("tsImports", toTsImports(codegenModel, parseImports(codegenModel))); + + allModels.add(codegenModel); if (codegenModel.isEntity) { entityModelClassnames.add(codegenModel.classname); @@ -836,10 +829,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege newItemsDataType = "string"; var.dataTypeAlternate = var.dataTypeAlternate.replace("number", newItemsDataType); } - - if (var.itemsAreNullable()) { - var.dataTypeAlternate = var.dataTypeAlternate.replace(newItemsDataType, newItemsDataType + " | null"); - } } else if (var.isEnum) { var.dataTypeAlternate = var.datatypeWithEnum; } else if (var.isModel) { @@ -857,10 +846,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege return parentIsEntity; } - private boolean itemsAreNullable(ExtendedCodegenProperty var) { - return var.items.isNullable || (var.items.items != null && var.items.items.isNullable); - } - private void escapeOperationIds(OperationsMap operations) { for (CodegenOperation _op : operations.getOperations().getOperation()) { ExtendedCodegenOperation op = (ExtendedCodegenOperation) _op; @@ -957,10 +942,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege newItemsDataType = "string"; param.dataTypeAlternate = param.dataTypeAlternate.replace("number", newItemsDataType); } - - if (param.itemsAreNullable()) { - param.dataTypeAlternate = param.dataTypeAlternate.replace(newItemsDataType, newItemsDataType + " | null"); - } } else if (param.isEnum) { param.dataTypeAlternate = param.datatypeWithEnum; } else if (param.isModel) { @@ -1047,34 +1028,24 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege private static boolean itemsAreUniqueId(CodegenProperty items) { if (items != null && items.items != null) { return itemsAreUniqueId(items.items); - }; + } if (items != null && items.vendorExtensions.get(X_IS_UNIQUE_ID) instanceof Boolean) { return Boolean.TRUE.equals(items.vendorExtensions.get(X_IS_UNIQUE_ID)); } return false; } - private static boolean itemsAreNullable(CodegenProperty items) { - if (items == null) { - return true; - } - if (items.items != null) { - return itemsAreNullable(items.items); - }; - return items.isNullable; - } - private static String getItemsDataType(CodegenProperty items) { if (items == null) { return null; } if (items.items != null) { return getItemsDataType(items.items); - }; + } return items.dataType; } - class ExtendedCodegenParameter extends CodegenParameter { + public class ExtendedCodegenParameter extends CodegenParameter { public String dataTypeAlternate; public boolean isUniqueId; // this parameter represents a unique id (x-isUniqueId: true) public List readOnlyVars; // a list of read-only properties @@ -1084,10 +1055,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege return TypeScriptFetchClientCodegen.itemsAreUniqueId(this.items); } - public boolean itemsAreNullable() { - return TypeScriptFetchClientCodegen.itemsAreNullable(this.items); - } - public String getItemsDataType() { return TypeScriptFetchClientCodegen.getItemsDataType(this.items); } @@ -1152,6 +1119,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.isMap = cp.isMap; this.isFile = cp.isFile; this.isEnum = cp.isEnum; + this.isEnumRef = cp.isEnumRef; this._enum = cp._enum; this.allowableValues = cp.allowableValues; this.items = cp.items; @@ -1226,7 +1194,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege } } - class ExtendedCodegenProperty extends CodegenProperty { + public class ExtendedCodegenProperty extends CodegenProperty { public String dataTypeAlternate; public boolean isEntity; //Is a model containing an "id" property marked as isUniqueId and which matches the 'x-entityId' value. public boolean isUniqueId; // The property represents a unique id (x-isUniqueId: true) @@ -1237,10 +1205,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege return TypeScriptFetchClientCodegen.itemsAreUniqueId(this.items); } - public boolean itemsAreNullable() { - return TypeScriptFetchClientCodegen.itemsAreNullable(this.items); - } - public String getItemsDataType() { return TypeScriptFetchClientCodegen.getItemsDataType(this.items); } @@ -1312,6 +1276,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.isArray = cp.isArray; this.isMap = cp.isMap; this.isEnum = cp.isEnum; + this.isEnumRef = cp.isEnumRef; this.isReadOnly = cp.isReadOnly; this.isWriteOnly = cp.isWriteOnly; this.isNullable = cp.isNullable; @@ -1382,7 +1347,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege } } - class ExtendedCodegenOperation extends CodegenOperation { + public class ExtendedCodegenOperation extends CodegenOperation { boolean hasReturnPassthroughVoid, returnTypeSupportsEntities, returnTypeIsModel, returnTypeIsArray; String returnTypeAlternate, returnBaseTypeAlternate, returnPassthrough; @@ -1499,7 +1464,8 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege } } - class ExtendedCodegenModel extends CodegenModel { + public class ExtendedCodegenModel extends CodegenModel { + @Getter @Setter public Set modelImports = new TreeSet(); public boolean isEntity; // Is a model containing an "id" property marked as isUniqueId public String returnPassthrough; @@ -1599,14 +1565,6 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.setIsModel(cm.getIsModel()); } - public Set getModelImports() { - return modelImports; - } - - public void setModelImports(Set modelImports) { - this.modelImports = modelImports; - } - @Override public boolean equals(Object o) { if (o == null) @@ -1641,7 +1599,5 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege sb.append(", hasReturnPassthroughVoid=").append(hasReturnPassthroughVoid); return sb.toString(); } - } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java index a9479562c19..63663beaa50 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java @@ -21,6 +21,8 @@ import io.swagger.v3.oas.models.media.BinarySchema; import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.model.ModelMap; @@ -43,6 +45,7 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo public static final String USE_RXJS6 = "useRxJS6"; public static final String TAGGED_UNIONS = "taggedUnions"; + @Getter @Setter protected String npmRepository = null; private boolean taggedUnions = false; @@ -335,14 +338,6 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo return modelPackage() + "/" + toModelFilename(name); } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - private String getApiFilenameFromClassname(String classname) { String name = classname.substring(0, classname.length() - "Service".length()); return toApiFilename(name); @@ -352,5 +347,4 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo String name = filename.substring((modelPackage() + "/").length()); return camelize(name); } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java index fed4fca0584..b2ec4d7a542 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptJqueryClientCodegen.java @@ -19,6 +19,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.SupportingFile; @@ -35,6 +37,7 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg public static final String NPM_REPOSITORY = "npmRepository"; public static final String JQUERY_ALREADY_IMPORTED = "jqueryAlreadyImported"; + @Getter @Setter protected String npmRepository = null; public TypeScriptJqueryClientCodegen() { @@ -67,14 +70,6 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg return "Generates a TypeScript jquery client library."; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - @Override public void processOpts() { super.processOpts(); @@ -164,6 +159,4 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.'))); return indexPackage.replace('.', File.separatorChar); } - - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java index f0c10ee0e73..520d69e2d62 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java @@ -17,6 +17,8 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -56,13 +58,14 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; protected String nestVersion = "8.0.0"; + @Getter @Setter protected String npmRepository = null; protected String serviceSuffix = "Service"; protected String serviceFileSuffix = ".service"; protected String modelSuffix = ""; protected String modelFileSuffix = ""; protected String fileNaming = "camelCase"; - protected Boolean stringEnums = false; + @Getter protected Boolean stringEnums = false; private boolean taggedUnions = false; @@ -218,10 +221,6 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg stringEnums = value; } - public Boolean getStringEnums() { - return stringEnums; - } - @Override public boolean isDataTypeFile(final String dataType) { return "Blob".equals(dataType); @@ -452,14 +451,6 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg return modelPackage() + "/" + toModelFilename(name); } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - private String getApiFilenameFromClassname(String classname) { String name = classname.substring(0, classname.length() - serviceSuffix.length()); return toApiFilename(name); @@ -550,6 +541,4 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg } return name; } - } - diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java index c4068a21fef..5f238151060 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java @@ -18,12 +18,12 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.responses.ApiResponse; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; @@ -47,6 +47,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen private static final String DEFAULT_MODEL_FILENAME_DIRECTORY_PREFIX = "./"; private static final String DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX = "../"; + @Getter @Setter protected String npmRepository = null; protected String apiSuffix = "Api"; @@ -237,14 +238,6 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen return operations; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - @Override public void processOpts() { super.processOpts(); @@ -355,5 +348,4 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen public String toEnumDefaultValue(String value, String datatype) { return datatype + "." + value; } - } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java index 2f2af10c5f3..81ac377f9b1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java @@ -19,8 +19,9 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; @@ -38,6 +39,7 @@ public class TypeScriptReduxQueryClientCodegen extends AbstractTypeScriptClientC public static final String WITH_INTERFACES = "withInterfaces"; public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; + @Getter @Setter protected String npmRepository = null; private boolean useSingleRequestParameter = true; protected boolean addedApiIndex = false; @@ -83,14 +85,6 @@ public class TypeScriptReduxQueryClientCodegen extends AbstractTypeScriptClientC return "Generates a TypeScript client library using redux-query API (beta)."; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java index 3f6d95655ab..fb51165d000 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java @@ -18,8 +18,9 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.parser.util.SchemaTypeUtil; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.model.ModelMap; @@ -38,6 +39,7 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen public static final String NPM_REPOSITORY = "npmRepository"; public static final String WITH_PROGRESS_SUBSCRIBER = "withProgressSubscriber"; + @Getter @Setter protected String npmRepository = null; protected Set reservedParamNames = new HashSet<>(); @@ -77,14 +79,6 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen return "Generates a TypeScript client library using Rxjs API."; } - public String getNpmRepository() { - return npmRepository; - } - - public void setNpmRepository(String npmRepository) { - this.npmRepository = npmRepository; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java index 2dc1e6764a0..b16a66ae0ef 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -29,6 +30,7 @@ import java.io.File; import java.text.Normalizer; import java.util.*; +@Setter public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; @@ -36,14 +38,17 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { protected boolean useSpecifiedOperationId = false; + @Override public CodegenType getTag() { return CodegenType.SCHEMA; } + @Override public String getName() { return "wsdl-schema"; } + @Override public String getHelp() { return "Generates WSDL files."; } @@ -78,6 +83,7 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { "jaxb-customization.xml")); } + @Override public void preprocessOpenAPI(OpenAPI openAPI) { Info info = openAPI.getInfo(); @@ -372,14 +378,6 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { return input; } - public void setContentTypeVersion(String contentTypeVersion) { - this.contentTypeVersion = contentTypeVersion; - } - - public void setUseSpecifiedOperationId(boolean useSpecifiedOperationId) { - this.useSpecifiedOperationId = useSpecifiedOperationId; - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.WSDL; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/XojoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/XojoClientCodegen.java index 2f05000f345..c9101b86328 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/XojoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/XojoClientCodegen.java @@ -16,9 +16,10 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Getter; +import lombok.Setter; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; @@ -49,10 +50,10 @@ public class XojoClientCodegen extends DefaultCodegen implements CodegenConfig { public enum SERIALIZATION_LIBRARY_TYPE {xoson} - protected String projectName = "OpenAPIClient"; - protected boolean nonPublicApi = false; + @Setter protected String projectName = "OpenAPIClient"; + @Setter protected boolean nonPublicApi = false; protected boolean supportsAsync = true; - protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.xoson; + @Getter protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.xoson; // Number for each object that appears in the xojo_project file. // We start with a relatively high value, to have space for other static objects. @@ -60,14 +61,6 @@ public class XojoClientCodegen extends DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(XojoClientCodegen.class); - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setNonPublicApi(boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - public void setSupportsAsync(Boolean supportsAsync) { this.supportsAsync = supportsAsync; } @@ -693,10 +686,6 @@ public class XojoClientCodegen extends DefaultCodegen implements CodegenConfig { } } - public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() { - return this.serializationLibrary; - } - /** * Sets the serialization engine for Xojo * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java index a4610e3ac0a..4740460f676 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ZapierClientCodegen.java @@ -35,14 +35,17 @@ public class ZapierClientCodegen extends DefaultCodegen implements CodegenConfig private final Logger LOGGER = LoggerFactory.getLogger(ZapierClientCodegen.class); + @Override public CodegenType getTag() { return CodegenType.CLIENT; } + @Override public String getName() { return "zapier"; } + @Override public String getHelp() { return "Generates a zapier client."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java index b4edcaea5df..03ad3c19cae 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java @@ -1,5 +1,7 @@ package org.openapitools.codegen.languages.features; +import lombok.Getter; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -59,7 +61,7 @@ public interface DocumentationProviderFeatures { void setAnnotationLibrary(AnnotationLibrary annotationLibrary); - enum DocumentationProvider { + @Getter enum DocumentationProvider { NONE("withoutDocumentationProvider", "Do not publish an OpenAPI specification.", AnnotationLibrary.NONE, AnnotationLibrary.values()), @@ -78,6 +80,12 @@ public interface DocumentationProviderFeatures { SPRINGDOC("springDocDocumentationProvider", "Generate an OpenAPI 3 specification using SpringDoc.", AnnotationLibrary.SWAGGER2, AnnotationLibrary.SWAGGER2); + /** + * -- GETTER -- + * The property name should be used in the codegen model as a boolean property. + * + * @return the property name for this documentation provider + */ private final String propertyName; private final String description; @@ -100,27 +108,6 @@ public interface DocumentationProviderFeatures { return valueOf(optVal); } - /** - * The property name should be used in the codegen model as a boolean property. - * - * @return the property name for this documentation provider - */ - public String getPropertyName() { - return propertyName; - } - - public String getDescription() { - return description; - } - - public AnnotationLibrary getPreferredAnnotationLibrary() { - return preferredAnnotationLibrary; - } - - public AnnotationLibrary[] getSupportedAnnotationLibraries() { - return supportedAnnotationLibraries; - } - public List supportedAnnotationLibraries() { return Arrays.asList(getSupportedAnnotationLibraries()); } @@ -130,7 +117,7 @@ public interface DocumentationProviderFeatures { } } - enum AnnotationLibrary { + @Getter enum AnnotationLibrary { NONE("withoutAnnotationLibrary", "Do not annotate Model and Api with complementary annotations."), SWAGGER1("swagger1AnnotationLibrary", "Annotate Model and Api using the Swagger Annotations 1.x library."), @@ -139,6 +126,12 @@ public interface DocumentationProviderFeatures { MICROPROFILE("microprofileAnnotationLibrary", "Annotate Model and Api using the Microprofile annotations."); + /** + * -- GETTER -- + * The property name is used in the codegen model as a boolean property. + * + * @return the property name for this annotation library + */ private final String propertyName; private final String description; @@ -148,19 +141,6 @@ public interface DocumentationProviderFeatures { return valueOf(optVal); } - /** - * The property name is used in the codegen model as a boolean property. - * - * @return the property name for this annotation library - */ - public String getPropertyName() { - return propertyName; - } - - public String getDescription() { - return description; - } - AnnotationLibrary(String propertyName, String description) { this.propertyName = propertyName; this.description = description; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java index 2a24644cbfc..554843d7e4e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/model/OperationsMap.java @@ -1,12 +1,8 @@ package org.openapitools.codegen.model; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; - -import org.openapitools.codegen.CodegenOperation; public class OperationsMap extends HashMap { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java index e8ecea1b244..95feb4d6510 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java @@ -30,6 +30,7 @@ import com.github.jknack.handlebars.io.AbstractTemplateLoader; import com.github.jknack.handlebars.io.StringTemplateSource; import com.github.jknack.handlebars.io.TemplateLoader; import com.github.jknack.handlebars.io.TemplateSource; +import lombok.Setter; import org.openapitools.codegen.api.AbstractTemplatingEngineAdapter; import org.openapitools.codegen.api.TemplatingExecutor; import org.slf4j.Logger; @@ -50,7 +51,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter { // We use this as a simple lookup for valid file name extensions. This adapter will inspect .mustache (built-in) and infer the relevant handlebars filename private final String[] canCompileFromExtensions = {".handlebars",".hbs",".mustache"}; private boolean infiniteLoops = false; - private boolean prettyPrint = false; + @Setter private boolean prettyPrint = false; /** * Provides an identifier used to load the adapter. This could be a name, uuid, or any other string. @@ -62,6 +63,7 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter { return "handlebars"; } + @Override public String compileTemplate(TemplatingExecutor executor, Map bundle, String templateFile) throws IOException { TemplateLoader loader = new AbstractTemplateLoader() { @@ -165,8 +167,5 @@ public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter { return this; } - public void setPrettyPrint(boolean prettyPrint) { - this.prettyPrint = prettyPrint; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java index b7819988056..9d7e96099df 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/MustacheEngineAdapter.java @@ -18,6 +18,9 @@ package org.openapitools.codegen.templating; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; +import lombok.Getter; +import lombok.Setter; +import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.api.TemplatingExecutor; import org.slf4j.Logger; @@ -26,6 +29,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.Reader; import java.io.StringReader; +import java.io.StringWriter; import java.util.Map; @@ -44,6 +48,7 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter { } private final String[] extensions = {"mustache"}; + @Getter @Setter Mustache.Compiler compiler = Mustache.compiler(); /** @@ -61,8 +66,19 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter { .withLoader(name -> findTemplate(executor, name)) .defaultValue("") .compile(executor.getFullTemplateContents(templateFile)); + StringWriter out = new StringWriter(); - return tmpl.execute(bundle); + // the value of bundle[MUSTACHE_PARENT_CONTEXT] is used a parent content in mustache. + // See description in https://mustache.github.io/mustache.5.html#Variables + // See DefaultCodegen.processOpts() and DefaultCodegen.useCodegenAsMustacheParentContext + Object parent = bundle.get(CodegenConstants.MUSTACHE_PARENT_CONTEXT); + if (parent == null) { + LOGGER.warn("{} not found. super.processOpts needs to be called in processOpts()", CodegenConstants.MUSTACHE_PARENT_CONTEXT); + // avoid NPE + parent = new Object(); + } + tmpl.execute(bundle, parent, out); + return out.toString(); } @SuppressWarnings("java:S108") // catch-all is expected, and is later thrown @@ -79,14 +95,6 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter { throw new TemplateNotFoundException(name); } - public Mustache.Compiler getCompiler() { - return compiler; - } - - public void setCompiler(Mustache.Compiler compiler) { - this.compiler = compiler; - } - @Override public String[] getFileExtensions() { return extensions; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java index d5e8238f6b9..213f162ae93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/TemplateManagerOptions.java @@ -1,10 +1,23 @@ package org.openapitools.codegen.templating; +import lombok.Getter; + /** * Holds the options relevant to template management and execution. */ -public class TemplateManagerOptions { +@Getter public class TemplateManagerOptions { + /** + * Determines whether the template should minimally update a target file. + * A minimal update means the template manager is requested to update a file only if it is newer. + * This option avoids "touching" a file and causing the last modification time (mtime) to change. + */ private final boolean minimalUpdate; + /** + * -- GETTER -- + * Determines whether the template manager should avoid overwriting an existing file. + * This differs from requesting which evaluates contents, while this option only + * evaluates whether the file exists. + */ private final boolean skipOverwrite; /** @@ -18,28 +31,4 @@ public class TemplateManagerOptions { this.skipOverwrite = skipOverwrite; } - /** - * Determines whether the template should minimally update a target file. - * - * A minimal update means the template manager is requested to update a file only if it is newer. - * - * This option avoids "touching" a file and causing the last modification time (mtime) to change. - * - * @return true to prefer updating only changed files, false to disable that suggestion - */ - public boolean isMinimalUpdate() { - return minimalUpdate; - } - - /** - * Determines whether the template manager should avoid overwriting an existing file. - * - * This differs from requesting {@link #isMinimalUpdate()} which evaluates contents, while this option only - * evaluates whether the file exists. - * - * @return true to avoid overwriting existing files (where supported), false to disable that suggestion. - */ - public boolean isSkipOverwrite() { - return skipOverwrite; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/BackSlashLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/BackSlashLambda.java index 50a10b78999..8ada0b4d872 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/BackSlashLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/BackSlashLambda.java @@ -22,8 +22,6 @@ import com.samskivert.mustache.Template; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.underscore; - /** * Replaces forward slash with backslash in the text. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/DoubleQuoteLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/DoubleQuoteLambda.java index 9979e0e817e..1caf4fd2e47 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/DoubleQuoteLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/DoubleQuoteLambda.java @@ -22,8 +22,6 @@ import com.samskivert.mustache.Template; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.underscore; - /** * Double quote the text if it's not already the case. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/ForwardSlashLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/ForwardSlashLambda.java index a9f39b59ae1..33b26dd2e9d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/ForwardSlashLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/ForwardSlashLambda.java @@ -22,8 +22,6 @@ import com.samskivert.mustache.Template; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.underscore; - /** * Replaces backslash with forward slash in the text. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/KebabCaseLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/KebabCaseLambda.java index 7070df93ad5..6997666b118 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/KebabCaseLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/KebabCaseLambda.java @@ -23,8 +23,6 @@ import java.io.IOException; import java.io.Writer; import java.util.Locale; -import static org.openapitools.codegen.utils.StringUtils.underscore; - /** * Converts text in a fragment to snake case. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/UncamelizeLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/UncamelizeLambda.java index 83b739d7a38..ae23a0fa5cb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/UncamelizeLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/UncamelizeLambda.java @@ -24,8 +24,6 @@ import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.io.Writer; -import static org.openapitools.codegen.utils.StringUtils.camelize; - /** * Converts text in a fragment from camelCase or PascalCase to a space separated string * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 7cf7ce61881..b8bf2bcd669 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -17,10 +17,9 @@ package org.openapitools.codegen.utils; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.jsontype.BasicPolymorphicTypeValidator; +import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -46,10 +45,10 @@ import org.openapitools.codegen.model.ModelsMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.net.URI; import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -64,6 +63,8 @@ public class ModelUtils { private static final String URI_FORMAT = "uri"; + private static final Set OPENAPI_TYPES = Set.of("array", "integer", "number", "boolean", "string", "object"); + private static final String generateAliasAsModelKey = "generateAliasAsModel"; // A vendor extension to track the value of the 'swagger' field in a 2.0 doc, if applicable. @@ -76,16 +77,10 @@ public class ModelUtils { private static final ObjectMapper JSON_MAPPER; private static final ObjectMapper YAML_MAPPER; - private static final ObjectMapper TYPED_JSON_MAPPER = new ObjectMapper(); static { JSON_MAPPER = ObjectMapperFactory.createJson(); YAML_MAPPER = ObjectMapperFactory.createYaml(); - - BasicPolymorphicTypeValidator ptv = BasicPolymorphicTypeValidator.builder() - .allowIfSubType(Object.class) - .build(); - TYPED_JSON_MAPPER.activateDefaultTyping(ptv, ObjectMapper.DefaultTyping.EVERYTHING); } public static boolean isDisallowAdditionalPropertiesIfNotPresent() { @@ -400,11 +395,7 @@ public class ModelUtils { return null; } - try { - ref = URLDecoder.decode(ref, "UTF-8"); - } catch (UnsupportedEncodingException ignored) { - once(LOGGER).warn("Found UnsupportedEncodingException: {}", ref); - } + ref = URLDecoder.decode(ref, StandardCharsets.UTF_8); // see https://tools.ietf.org/html/rfc6901#section-3 // Because the characters '~' (%x7E) and '/' (%x2F) have special meanings in @@ -572,7 +563,7 @@ public class ModelUtils { } if (schema instanceof JsonSchema) { // 3.1 spec - return ((schema.getAdditionalProperties() instanceof JsonSchema) || + return ((schema.getAdditionalProperties() instanceof Schema) || (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties())); } else { // 3.0 or 2.x spec return (schema instanceof MapSchema) || @@ -2137,7 +2128,7 @@ public class ModelUtils { } if (schema instanceof JsonSchema) { - if (schema.getTypes() != null) { + if (schema.getTypes() != null && !schema.getTypes().isEmpty()) { return String.valueOf(schema.getTypes().iterator().next()); } else { return null; @@ -2186,13 +2177,19 @@ public class ModelUtils { return false; } - public static Schema cloneSchema(Schema schema) { - try { - String json = TYPED_JSON_MAPPER.writeValueAsString(schema); - return TYPED_JSON_MAPPER.readValue(json, schema.getClass()); - } catch (JsonProcessingException ex) { - LOGGER.error("Can't clone schema {}", schema, ex); - return schema; + public static Schema cloneSchema(Schema schema, boolean openapi31) { + if (openapi31) { + return AnnotationsUtils.clone(schema, openapi31); + } else { + // AnnotationsUtils.clone doesn't support custom schema types for OpenAPI < 3.1 + String schemaType = schema.getType(); + if (schemaType != null && !OPENAPI_TYPES.contains(schemaType)) { + schema.setType(null); + } + Schema result = AnnotationsUtils.clone(schema, openapi31); + schema.setType(schemaType); + result.setType(schemaType); + return result; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java index 556f696c783..b2920bd6f10 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java @@ -6,6 +6,8 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; + +import lombok.Getter; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; @@ -43,7 +45,7 @@ import org.slf4j.LoggerFactory; * needs to be added to `One` and `Two` because of the above point) */ public class OneOfImplementorAdditionalData { - private String implementorName; + @Getter private String implementorName; private List additionalInterfaces = new ArrayList(); private List additionalProps = new ArrayList(); private List> additionalImports = new ArrayList>(); @@ -53,10 +55,6 @@ public class OneOfImplementorAdditionalData { this.implementorName = implementorName; } - public String getImplementorName() { - return implementorName; - } - /** * Add data from a given CodegenModel that the oneOf implementor should implement. For example: * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java index de00e7e8c8b..7b725456f40 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java @@ -1,6 +1,5 @@ package org.openapitools.codegen.validations.oas; -import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.utils.ModelUtils; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java index d23ab1f6918..ab42a52542a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java @@ -3,6 +3,7 @@ package org.openapitools.codegen.validations.oas; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.OpenAPI; +import lombok.Getter; /** * Encapsulates an operation with its HTTP Method. In OAS, the {@link PathItem} structure contains more than what we'd @@ -10,8 +11,20 @@ import io.swagger.v3.oas.models.OpenAPI; */ public class OperationWrapper { OpenAPI specification; - private Operation operation; - private PathItem.HttpMethod httpMethod; + /** + * -- GETTER -- + * Gets the operation associated with the http method + * + * @return An operation instance + */ + @Getter private Operation operation; + /** + * -- GETTER -- + * Gets the http method associated with the operation + * + * @return The http method + */ + @Getter private PathItem.HttpMethod httpMethod; /** * Constructs a new instance of {@link OperationWrapper} @@ -25,24 +38,6 @@ public class OperationWrapper { this.httpMethod = httpMethod; } - /** - * Gets the operation associated with the http method - * - * @return An operation instance - */ - public Operation getOperation() { - return operation; - } - - /** - * Gets the http method associated with the operation - * - * @return The http method - */ - public PathItem.HttpMethod getHttpMethod() { - return httpMethod; - } - /** * Returns the OpenAPI specification. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java index d47738e34de..ab77acd7f65 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ParameterWrapper.java @@ -2,13 +2,20 @@ package org.openapitools.codegen.validations.oas; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.OpenAPI; +import lombok.Getter; /** * Encapsulates an OAS parameter. */ public class ParameterWrapper { OpenAPI specification; - private Parameter parameter; + /** + * -- GETTER -- + * Return the OAS parameter + * + * @return the OAS parameter + */ + @Getter private Parameter parameter; /** * Constructs a new instance of {@link ParameterWrapper} @@ -21,15 +28,6 @@ public class ParameterWrapper { this.parameter = parameter; } - /** - * Return the OAS parameter - * - * @return the OAS parameter - */ - public Parameter getParameter() { - return parameter; - } - /** * Returns the OpenAPI specification. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java index 1f85dad3c67..247eabad547 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java @@ -1,19 +1,148 @@ package org.openapitools.codegen.validations.oas; +import lombok.Getter; +import lombok.Setter; + /** * Allows for configuration of validation rules which will be applied to a specification. */ +@Getter @Setter @SuppressWarnings({"WeakerAccess", "unused"}) public class RuleConfiguration { private static String propertyPrefix = "openapi.generator.rule"; + /** + * -- GETTER -- + * Get whether recommendations are enabled. + *

    + * The 'type' attribute must be one of 'null', 'boolean', 'object', 'array', 'number', 'string', or 'integer' + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable recommendations. Recommendations are either informational or warning level type validations + * which are raised to communicate issues to the user which they may not be aware of, or for which support in the + * tooling/spec may not be clearly defined. + * + * @param enableRecommendations true to enable, false to disable + */ private boolean enableRecommendations = defaultedBoolean(propertyPrefix + ".recommendations", true); + /** + * -- GETTER -- + * Gets whether we will raise awareness that header parameters with underscore may be ignored in Apache or Nginx by default. + * For more details, see https://stackoverflow.com/a/22856867/151445. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for Apache/Nginx potentially ignoring header with underscore by default. + *

    + * For more details, see + * + * @param enableApacheNginxUnderscoreRecommendation true to enable, false to disable + */ private boolean enableApacheNginxUnderscoreRecommendation = defaultedBoolean(propertyPrefix + ".apache-nginx-underscore", true); + /** + * -- GETTER -- + * Gets whether the recommendation check for oneOf with sibling properties exists. + *

    + * JSON Schema defines oneOf as a validation property which can be applied to any schema. + *

    + * OpenAPI Specification is a variant of JSON Schema for which oneOf is defined as: + * "Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema." + *

    + * Where the only examples of oneOf in OpenAPI Specification are used to define either/or type structures rather than validations. + * Because of this ambiguity in the spec about what is non-standard about oneOf support, we'll warn as a recommendation that + * properties on the schema defining oneOf relationships may not be intentional in the OpenAPI Specification. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for schemas containing properties and oneOf definitions. + *

    + * For more details, see + * + * @param enableOneOfWithPropertiesRecommendation true to enable, false to disable + */ private boolean enableOneOfWithPropertiesRecommendation = defaultedBoolean(propertyPrefix + ".oneof-properties-ambiguity", true); + /** + * -- GETTER -- + * Gets whether the recommendation to check for unused schemas is enabled. + *

    + * While the tooling may or may not support generation of models representing unused schemas, we take the stance that + * a schema which is defined but not referenced in an operation or by some schema bound to an operation may be a good + * indicator of a programming error. We surface this information to the user in case the orphaned schema(s) are not + * intentional. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for unused schemas. + *

    + * For more details, see + * + * @param enableUnusedSchemasRecommendation true to enable, false to disable + */ private boolean enableUnusedSchemasRecommendation = defaultedBoolean(propertyPrefix + ".unused-schemas", true); + /** + * -- GETTER -- + * Gets whether the recommendation check for schemas containing type definitions. + *

    + * In OpenAPI 3.0.x, the "type" attribute must be a string value. + * In OpenAPI 3.1, the type attribute may be: + * A string value + * The 'null' value + * An array containing primitive types and the 'null' value. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for schemas containing type definitions, specifically + * for changes between OpenAPI 3.0.x and 3.1. + *

    + * For more details, see + * + * @param enableSchemaTypeRecommendation true to enable, false to disable + */ private boolean enableSchemaTypeRecommendation = defaultedBoolean(propertyPrefix + ".schema-type", true); + /** + * -- GETTER -- + * Gets whether the recommendation check for schemas containing the 'nullable' attribute. + *

    + * In OpenAPI 3.0.x, the "nullable" attribute is supported. However, because it is deprecated in 3.1 + * and above, a warning is logged to prepare for OpenAPI 3.1 recommendations. + * In OpenAPI 3.1, the 'nullable' attribute is deprecated. Instead, the OpenAPI specification should + * use the 'null' type. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for the 'nullable' attribute. + *

    + * For more details, see + * @param enableNullableAttributeRecommendation true to enable, false to disable + */ private boolean enableNullableAttributeRecommendation = defaultedBoolean(propertyPrefix + ".nullable-deprecated", true); + /** + * -- GETTER -- + * Gets whether the recommendation check for schemas containing invalid values for the 'type' attribute. + *

    + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for the 'type' attribute. + *

    + * For more details, see + * + * @param enableInvalidTypeRecommendation true to enable, false to disable + */ private boolean enableInvalidTypeRecommendation = defaultedBoolean(propertyPrefix + ".invalid-type", true); + /** + * -- GETTER -- + * Gets whether we will raise awareness a GET or HEAD operation is defined with body. + * + * @return true if enabled, false if disabled + * -- SETTER -- + * Enable or Disable the recommendation check for GET or HEAD operations with bodies. + *

    + * For more details, see + * + * @param enableApiRequestUriWithBodyRecommendation true to enable, false to disable + */ private boolean enableApiRequestUriWithBodyRecommendation = defaultedBoolean(propertyPrefix + ".anti-patterns.uri-unexpected-body", true); @SuppressWarnings("SameParameterValue") @@ -22,197 +151,4 @@ public class RuleConfiguration { if (property == null) return defaultValue; return Boolean.parseBoolean(property); } - - /** - * Gets whether we will raise awareness that header parameters with underscore may be ignored in Apache or Nginx by default. - * For more details, see https://stackoverflow.com/a/22856867/151445. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableApacheNginxUnderscoreRecommendation() { - return enableApacheNginxUnderscoreRecommendation; - } - - /** - * Enable or Disable the recommendation check for Apache/Nginx potentially ignoring header with underscore by default. - *

    - * For more details, see {@link RuleConfiguration#isEnableApacheNginxUnderscoreRecommendation()} - * - * @param enableApacheNginxUnderscoreRecommendation true to enable, false to disable - */ - public void setEnableApacheNginxUnderscoreRecommendation(boolean enableApacheNginxUnderscoreRecommendation) { - this.enableApacheNginxUnderscoreRecommendation = enableApacheNginxUnderscoreRecommendation; - } - - /** - * Gets whether we will raise awareness a GET or HEAD operation is defined with body. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableApiRequestUriWithBodyRecommendation() { - return enableApiRequestUriWithBodyRecommendation; - } - - /** - * Enable or Disable the recommendation check for GET or HEAD operations with bodies. - *

    - * For more details, see {@link RuleConfiguration#isEnableApiRequestUriWithBodyRecommendation()} - * - * @param enableApiRequestUriWithBodyRecommendation true to enable, false to disable - */ - public void setEnableApiRequestUriWithBodyRecommendation(boolean enableApiRequestUriWithBodyRecommendation) { - this.enableApiRequestUriWithBodyRecommendation = enableApiRequestUriWithBodyRecommendation; - } - - /** - * Gets whether the recommendation check for oneOf with sibling properties exists. - *

    - * JSON Schema defines oneOf as a validation property which can be applied to any schema. - *

    - * OpenAPI Specification is a variant of JSON Schema for which oneOf is defined as: - * "Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema." - *

    - * Where the only examples of oneOf in OpenAPI Specification are used to define either/or type structures rather than validations. - * Because of this ambiguity in the spec about what is non-standard about oneOf support, we'll warn as a recommendation that - * properties on the schema defining oneOf relationships may not be intentional in the OpenAPI Specification. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableOneOfWithPropertiesRecommendation() { - return enableOneOfWithPropertiesRecommendation; - } - - /** - * Enable or Disable the recommendation check for schemas containing properties and oneOf definitions. - *

    - * For more details, see {@link RuleConfiguration#isEnableOneOfWithPropertiesRecommendation()} - * - * @param enableOneOfWithPropertiesRecommendation true to enable, false to disable - */ - public void setEnableOneOfWithPropertiesRecommendation(boolean enableOneOfWithPropertiesRecommendation) { - this.enableOneOfWithPropertiesRecommendation = enableOneOfWithPropertiesRecommendation; - } - - /** - * Enable or Disable the recommendation check for schemas containing type definitions, specifically - * for changes between OpenAPI 3.0.x and 3.1. - * - *

    - * For more details, see {@link RuleConfiguration#isEnableSchemaTypeRecommendation()} - * - * @param enableSchemaTypeRecommendation true to enable, false to disable - */ - public void setEnableSchemaTypeRecommendation(boolean enableSchemaTypeRecommendation) { - this.enableSchemaTypeRecommendation = enableSchemaTypeRecommendation; - } - - /** - * Gets whether the recommendation check for schemas containing type definitions. - *

    - * In OpenAPI 3.0.x, the "type" attribute must be a string value. - * In OpenAPI 3.1, the type attribute may be: - * A string value - * The 'null' value - * An array containing primitive types and the 'null' value. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableSchemaTypeRecommendation() { - return enableSchemaTypeRecommendation; - } - - /** - * Enable or Disable the recommendation check for the 'nullable' attribute. - * - *

    - * For more details, see {@link RuleConfiguration#isEnableNullableAttributeRecommendation()} - * - * @param enableNullableAttributeRecommendation true to enable, false to disable - */ - public void setEnableNullableAttributeRecommendation(boolean enableNullableAttributeRecommendation) { - this.enableNullableAttributeRecommendation = enableNullableAttributeRecommendation; - } - - /** - * Gets whether the recommendation check for schemas containing the 'nullable' attribute. - *

    - * In OpenAPI 3.0.x, the "nullable" attribute is supported. However, because it is deprecated in 3.1 - * and above, a warning is logged to prepare for OpenAPI 3.1 recommendations. - * In OpenAPI 3.1, the 'nullable' attribute is deprecated. Instead the OpenAPI specification should - * use the 'null' type. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableNullableAttributeRecommendation() { - return enableNullableAttributeRecommendation; - } - - /** - * Enable or Disable the recommendation check for the 'type' attribute. - * - *

    - * For more details, see {@link RuleConfiguration#isEnableInvalidTypeRecommendation()} - * - * @param enableInvalidTypeRecommendation true to enable, false to disable - */ - public void setEnableInvalidTypeRecommendation(boolean enableInvalidTypeRecommendation) { - this.enableInvalidTypeRecommendation = enableInvalidTypeRecommendation; - } - - /** - * Gets whether the recommendation check for schemas containing invalid values for the 'type' attribute. - *

    - * - * @return true if enabled, false if disabled - */ - public boolean isEnableInvalidTypeRecommendation() { - return enableInvalidTypeRecommendation; - } - - /** - * Get whether recommendations are enabled. - *

    - * The 'type' attribute must be one of 'null', 'boolean', 'object', 'array', 'number', 'string', or 'integer' - * - * @return true if enabled, false if disabled - */ - public boolean isEnableRecommendations() { - return enableRecommendations; - } - - /** - * Enable or Disable recommendations. Recommendations are either informational or warning level type validations - * which are raised to communicate issues to the user which they may not be aware of, or for which support in the - * tooling/spec may not be clearly defined. - * - * @param enableRecommendations true to enable, false to disable - */ - public void setEnableRecommendations(boolean enableRecommendations) { - this.enableRecommendations = enableRecommendations; - } - - /** - * Gets whether the recommendation to check for unused schemas is enabled. - *

    - * While the tooling may or may not support generation of models representing unused schemas, we take the stance that - * a schema which is defined but not referenced in an operation or by some schema bound to an operation may be a good - * indicator of a programming error. We surface this information to the user in case the orphaned schema(s) are not - * intentional. - * - * @return true if enabled, false if disabled - */ - public boolean isEnableUnusedSchemasRecommendation() { - return enableUnusedSchemasRecommendation; - } - - /** - * Enable or Disable the recommendation check for unused schemas. - *

    - * For more details, see {@link RuleConfiguration#isEnableUnusedSchemasRecommendation()} - * - * @param enableUnusedSchemasRecommendation true to enable, false to disable - */ - public void setEnableUnusedSchemasRecommendation(boolean enableUnusedSchemasRecommendation) { - this.enableUnusedSchemasRecommendation = enableUnusedSchemasRecommendation; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java index 1e7e9c0e0ff..8b95becd6a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SchemaWrapper.java @@ -2,13 +2,20 @@ package org.openapitools.codegen.validations.oas; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.OpenAPI; +import lombok.Getter; /** * Encapsulates an OAS schema. */ public class SchemaWrapper { OpenAPI specification; - private Schema schema; + /** + * -- GETTER -- + * Return the OAS schema + * + * @return the OAS schema + */ + @Getter private Schema schema; /** * Constructs a new instance of {@link SchemaWrapper} @@ -21,15 +28,6 @@ public class SchemaWrapper { this.schema = schema; } - /** - * Return the OAS schema - * - * @return the OAS schema - */ - public Schema getSchema() { - return schema; - } - /** * Returns the OpenAPI specification. * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java index 66b65b6bfa9..3f2d7fbbaac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/SecuritySchemeWrapper.java @@ -2,13 +2,20 @@ package org.openapitools.codegen.validations.oas; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.Getter; /** * Encapsulates an OAS parameter. */ public class SecuritySchemeWrapper { OpenAPI specification; - private SecurityScheme securityScheme; + /** + * -- GETTER -- + * Return the OAS securityScheme + * + * @return the OAS securityScheme + */ + @Getter private SecurityScheme securityScheme; /** * Constructs a new instance of {@link SecuritySchemeWrapper} @@ -21,15 +28,6 @@ public class SecuritySchemeWrapper { this.securityScheme = securityScheme; } - /** - * Return the OAS securityScheme - * - * @return the OAS securityScheme - */ - public SecurityScheme getSecurityScheme() { - return securityScheme; - } - /** * Returns the OpenAPI specification. * diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index 3ff7ec3ebd7..f29780b19bd 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -28,8 +28,8 @@ repositories { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.10" - jackson_databind_version = "2.9.10.8" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache index acdaef19aec..60d2d5ceeb5 100644 --- a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache @@ -2,8 +2,8 @@ package {{invokerPackage}}; import java.util.Set; -import {{javaxPackage}}.validation.ConstraintViolation; -import {{javaxPackage}}.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache index 0b4651d7928..1d0a8138787 100644 --- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache @@ -2,11 +2,11 @@ package {{invokerPackage}}; -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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -33,14 +33,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -57,11 +54,6 @@ public class JSON { {{/jsr310}} private 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() @@ -469,7 +461,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -479,7 +471,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -504,7 +496,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -523,7 +515,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 8168a4775fd..06f9bd5e905 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -114,8 +114,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.6" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache index c7413447479..4fbaf983be8 100644 --- a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache +++ b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache @@ -6,15 +6,9 @@ }} @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#xmlName}} - // xmlName={{.}} - {{/xmlName}} - @JacksonXmlProperty({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/xmlName}}") - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}{{#xmlNamespace}}, namespace="{{.}}"{{/xmlNamespace}}{{#isXmlWrapped}}, localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{/isXmlWrapped}}) - {{/isContainer}} - {{/withXml}} \ No newline at end of file +{{#withXml}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} +{{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index beb564952ac..a00c6dc45f3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -50,6 +50,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -125,8 +126,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -279,16 +280,18 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -863,6 +866,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // convert input stream to string return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", response.getCode(), @@ -1008,12 +1012,15 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { - statusCode = response.getCode(); + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } else { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 16ca3f10f87..f18581f08ba 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -114,8 +114,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.6" - jackson_version = "2.14.1" - jackson_databind_version = "2.14.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache index bbdda91e1bd..74a70a3ea5d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache @@ -351,8 +351,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 5.2.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index af071c56afc..8af1cb136e5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -102,8 +102,10 @@ test { ext { swagger_annotations_version = "1.6.11" - jackson_version = "2.14.3" - jackson_databind_version = "2.14.3" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{/jackson}} {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} @@ -118,20 +120,24 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.github.openfeign:feign-core:$feign_version" + {{#jackson}} implementation "io.github.openfeign:feign-jackson:$feign_version" + {{/jackson}} implementation "io.github.openfeign:feign-slf4j:$feign_version" implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" + {{#jackson}} + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} 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.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#joda}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index fc29d7c9bdf..9af32c27022 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -12,15 +12,19 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.6.11" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "io.github.openfeign" % "feign-core" % "10.12" % "compile", +{{#jackson}} "io.github.openfeign" % "feign-jackson" % "10.12" % "compile", +{{/jackson}} "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.14.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", +{{#jackson}} + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", +{{/jackson}} "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache index f1786f2a495..fe97e3b1b26 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache @@ -47,28 +47,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{#isDateTime}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) - {{/isDateTime}} - {{/isXmlAttribute}} + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -181,7 +168,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -198,7 +185,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} 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 a1d8ecc3ae5..9be4a094faf 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 @@ -392,7 +392,8 @@ 13.2.1 3.8.0 {{#jackson}} - 2.15.2 + 2.17.1 + 2.17.1 {{/jackson}} {{#gson}} 2.10.1 @@ -400,7 +401,6 @@ {{#openApiNullable}} 0.2.6 {{/openApiNullable}} - 2.15.2 {{#useJakartaEe}} 2.1.1 {{/useJakartaEe}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index d6263020401..c8798317140 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} 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 0bbe3ae5143..97c5123e958 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 @@ -310,8 +310,8 @@ {{/swagger2AnnotationLibrary}} 2.2.0 2.40 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache index 417745bc564..d92c85e2672 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index ad68dd5463c..c72fc521b76 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -278,7 +278,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field httpClient.

    * * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -298,7 +298,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -321,7 +321,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -342,7 +342,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -363,7 +363,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -410,7 +410,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -426,7 +426,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -442,7 +442,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -458,7 +458,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -480,7 +480,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -496,7 +496,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -513,7 +513,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -530,7 +530,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -546,7 +546,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -563,7 +563,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -579,7 +579,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -595,7 +595,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -612,7 +612,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -634,7 +634,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -646,7 +646,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -666,7 +666,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -688,7 +688,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -712,7 +712,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -734,7 +734,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -757,7 +757,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -778,7 +778,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache index 25287dcf7f1..a7c61bac316 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -191,9 +191,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -210,7 +210,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -230,7 +230,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache index b54b371a122..d480667f3ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } 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 dd91399c573..8d3e62f2773 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 @@ -134,7 +134,7 @@ public class {{classname}} { {{#hasPathParams}} // Path parameters String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}{{#isUuid}}.toString(){{/isUuid}}{{^isString}}.toString(){{/isString}})){{/pathParams}}; + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; {{/hasPathParams}} {{#queryParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index a0bb4630af5..a9ab9623161 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 78b5e7d0bbe..d055cf378de 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -16,13 +16,13 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index 3b7069c0c29..09906d7b0a2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index b17b14067d5..06be4ddf265 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index e598e0a5be1..214d3ce2b6a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -396,8 +396,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 {{#useJakartaEe}} 2.1.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache index 417745bc564..d92c85e2672 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index ad68dd5463c..c72fc521b76 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -278,7 +278,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field httpClient.

    * * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -298,7 +298,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -321,7 +321,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -342,7 +342,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -363,7 +363,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -410,7 +410,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -426,7 +426,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -442,7 +442,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -458,7 +458,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -480,7 +480,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -496,7 +496,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -513,7 +513,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -530,7 +530,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -546,7 +546,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -563,7 +563,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -579,7 +579,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -595,7 +595,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -612,7 +612,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -634,7 +634,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -646,7 +646,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -666,7 +666,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -688,7 +688,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -712,7 +712,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -734,7 +734,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -757,7 +757,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -778,7 +778,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache index 25287dcf7f1..a7c61bac316 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache @@ -191,9 +191,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -210,7 +210,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -230,7 +230,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache index b54b371a122..d480667f3ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } 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 dd91399c573..8d3e62f2773 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 @@ -134,7 +134,7 @@ public class {{classname}} { {{#hasPathParams}} // Path parameters String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}{{#isUuid}}.toString(){{/isUuid}}{{^isString}}.toString(){{/isString}})){{/pathParams}}; + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; {{/hasPathParams}} {{#queryParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 472f699a460..42908c8bb47 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache index 118b304200d..6e89375a6a1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache @@ -16,13 +16,13 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache index 3b7069c0c29..09906d7b0a2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache @@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache index b17b14067d5..06be4ddf265 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache @@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 5632c267a53..d2f13457c60 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -396,8 +396,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 3.1.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache index 0d9f7886f8d..2539064d171 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache @@ -9,6 +9,10 @@ import java.net.URI; /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ +{{#jsonb}} +@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @@ -36,6 +40,22 @@ import java.net.URI; return String.valueOf(value); } +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); + } + } + +{{/jsonb}} {{#jackson}} @JsonCreator {{/jackson}} @@ -47,5 +67,4 @@ import java.net.URI; } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - } 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 870bf32c1ca..afad09aa3cd 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 @@ -1,10 +1,9 @@ {{#withXml}} -@XmlAccessorType(XmlAccessType.FIELD) -{{#hasVars}} @XmlType(name = "{{classname}}", propOrder = - { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} -}){{/hasVars}} +{{#hasVars}}@XmlType(name = "{{classname}}", propOrder = + { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} } +){{/hasVars}} {{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}} -{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} +{{> xmlAnnotation }} {{/withXml}} {{#jackson}} @JsonPropertyOrder({ @@ -21,7 +20,7 @@ {{#description}} /** * {{{.}}} - **/ + */ {{/description}} {{>additionalModelTypeAnnotations}} {{#vendorExtensions.x-class-extra-annotation}} @@ -35,12 +34,15 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#description}} /** - * {{{.}}} - **/ + * {{{.}}} + */ {{/description}} {{^withXml}} {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}} @@ -71,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -88,7 +90,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{#deprecated}} * @deprecated {{/deprecated}} - **/ + **/ {{#deprecated}} @Deprecated {{/deprecated}} @@ -112,8 +114,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{^isReadOnly}} /** - * Set {{name}} - **/ + * Set {{name}} + */ {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; @@ -148,8 +150,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{/vars}} /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 47aa6b9e234..f814d4c0d90 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 @@ -218,9 +218,9 @@ 3.0.2 {{/useBeanValidation}} 3.2.7 - 2.15.2 + 2.17.1 {{#jackson}} - 2.15.2 + 2.17.1 {{/jackson}} 1.2.2 1.3.5 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 3cda34fa7ec..7accc4cb28c 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 @@ -211,9 +211,9 @@ 3.0.1 {{/useBeanValidation}} 3.2.7 - 2.15.2 + 2.17.1 {{#jackson}} - 2.15.2 + 2.17.1 {{/jackson}} 2.1.0 2.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 14add046a0b..a641525af10 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -57,7 +57,7 @@ public class ApiClient { private Duration readTimeout; private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache index 297ff64d049..dfb6464d579 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache @@ -54,7 +54,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. 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 b706f454f4a..24ea4fef0f5 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 @@ -72,7 +72,7 @@ ext { {{#swagger2AnnotationLibrary}} swagger_annotations_version = "2.2.9" {{/swagger2AnnotationLibrary}} - jackson_version = "2.14.1" + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" junit_version = "5.10.2" {{#hasFormParamsInSpec}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache index 58e25ebe1ee..5f22f755909 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache @@ -59,7 +59,7 @@ import java.net.URI; {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } 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 15bd2f96d24..1250a71eca3 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 @@ -1,6 +1,9 @@ {{#discriminator}} import {{invokerPackage}}.JSON; {{/discriminator}} +{{#supportUrlQuery}} +import {{invokerPackage}}.ApiClient; +{{/supportUrlQuery}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} @@ -52,25 +55,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -179,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -196,7 +184,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} @@ -227,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore {{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { @@ -408,7 +395,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens for ({{{items.dataType}}} _item : {{getter}}()) { joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } i++; } @@ -418,7 +405,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens for (int i = 0; i < {{getter}}().size(); i++) { joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } {{/uniqueItems}} @@ -456,7 +443,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens if (_item != null) { joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } i++; } @@ -468,7 +455,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens if ({{getter}}().get(i) != null) { joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } @@ -483,7 +470,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens for (String _key : {{getter}}().keySet()) { joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + {{getter}}().get(_key), URLEncoder.encode(ApiClient.valueToString({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } {{/items.isModel}} @@ -501,7 +488,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^isMap}} {{#isPrimitiveType}} if ({{getter}}() != null) { - joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } {{/isPrimitiveType}} {{^isPrimitiveType}} @@ -512,7 +499,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isModel}} {{^isModel}} if ({{getter}}() != null) { - joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } {{/isModel}} {{/isPrimitiveType}} 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 4f8cebb65a7..8ed827791d1 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 @@ -291,7 +291,7 @@ {{/swagger2AnnotationLibrary}} 11 11 - 2.15.2 + 2.17.1 0.2.6 {{#useJakartaEe}} 2.1.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache index c6075a08694..6cf7ec7898c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache @@ -2,11 +2,11 @@ package {{invokerPackage}}; -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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -27,16 +27,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -59,11 +57,6 @@ public class JSON { {{/jsr310}} 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() @@ -466,7 +459,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -476,7 +469,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -501,7 +494,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -520,7 +513,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } 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 8549641079c..ada640379e3 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 @@ -30,10 +30,10 @@ import jakarta.validation.constraints.*; import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} -import {{javaxPackage}}.validation.ConstraintViolation; -import {{javaxPackage}}.validation.Validation; -import {{javaxPackage}}.validation.ValidatorFactory; -import {{javaxPackage}}.validation.executable.ExecutableValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; import java.util.Set; import java.lang.reflect.Method; import java.lang.reflect.Type; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache index 417a89e34cc..41f33670741 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/HttpBasicAuth.mustache @@ -11,8 +11,6 @@ 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; 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 859d322d08e..eb67fc11240 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 @@ -116,8 +116,7 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' {{#openApiNullable}} implementation 'org.openapitools:jackson-databind-nullable:0.2.6' {{/openApiNullable}} @@ -135,9 +134,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.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } 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 68d9e7fc8ef..2045b84742e 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 @@ -14,8 +14,7 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} @@ -35,7 +34,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.10.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache index 067ceade0d6..30f4c0135a9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache @@ -59,25 +59,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isEnum}} public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#deprecated}} @Deprecated @@ -148,7 +133,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -165,7 +150,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} @@ -354,12 +339,12 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/requiredVars}} } - /** - * 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 {{classname}} - */ + /** + * 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 {{classname}} + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!{{classname}}.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -585,22 +570,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{/hasChildren}} - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ public static {{{classname}}} fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); } - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } 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 eb30fa5a18b..def53f2fc2a 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 @@ -383,14 +383,9 @@ {{/withAWSV4Signature}} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -417,7 +412,7 @@ {{#swagger2AnnotationLibrary}} 2.2.15 {{/swagger2AnnotationLibrary}} - 4.11.0 + 4.12.0 2.10.1 3.14.0 {{#openApiNullable}} @@ -438,9 +433,9 @@ {{#useBeanValidation}} 3.0.2 {{/useBeanValidation}} - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 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 d63c511a90c..d7d9dae2bff 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 @@ -8,9 +8,9 @@ import {{invokerPackage}}.ApiClient; import {{apiPackage}}.{{classname}}; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -31,12 +31,12 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index a04fdd6c7c9..3ddee453519 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -104,14 +104,13 @@ ext { swagger_annotations_version = "2.2.15" {{/swagger2AnnotationLibrary}} rest_assured_version = "5.3.2" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#jackson}} - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" {{/jackson}} {{#gson}} gson_version = "2.10.1" @@ -121,6 +120,7 @@ ext { jodatime_version = "2.10.5" {{/joda}} okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -163,5 +163,5 @@ dependencies { implementation "org.hibernate:hibernate-validator:6.0.19.Final" {{/performBeanValidation}} 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/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 3476f0659da..ce4037ac501 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -43,7 +43,7 @@ lazy val root = (project in file(".")). "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", {{/performBeanValidation}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) 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 a892488a245..396dd69c20b 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 @@ -271,11 +271,6 @@ ${gson-fire-version} {{/gson}} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - {{#jackson}} @@ -286,6 +281,10 @@ com.fasterxml.jackson.core jackson-annotations + + com.fasterxml.jackson.core + jackson-databind + org.openapitools jackson-databind-nullable @@ -332,8 +331,8 @@ {{/performBeanValidation}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -352,9 +351,9 @@ {{#joda}} 2.10.5 {{/joda}} - 2.15.2 {{#jackson}} - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 {{/jackson}} {{#useJakartaEe}} @@ -367,6 +366,6 @@ 3.0.2 {{/useBeanValidation}} 3.6.0 - 4.13.2 + 5.10.3 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 index d6e0baeaee0..416e5ea895a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache @@ -1,5 +1,9 @@ package {{invokerPackage}}; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +{{/withXml}} import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @@ -12,8 +16,8 @@ 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.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; {{#withXml}} import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; {{/withXml}} 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 index 247b48b0e19..ec6244a82dc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache @@ -23,12 +23,7 @@ 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 @@ -87,33 +82,6 @@ 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: @@ -128,7 +96,7 @@ import {{{package}}}.{{{classname}}}; public class {{{classname}}}Example { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("{{{basePath}}}"); {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -173,10 +141,10 @@ public class {{{classname}}}Example { try { {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} - } catch (ApiException e) { + } catch (HttpStatusCodeException 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("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } 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 index 4af2faaa3c0..4aec430eb7c 100644 --- 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 @@ -103,8 +103,8 @@ ext { {{#swagger2AnnotationLibrary}} swagger_annotations_version = "2.2.9" {{/swagger2AnnotationLibrary}} - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} 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 index ee672099e93..d3f6ab6500e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pom.mustache @@ -353,8 +353,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} 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 483cf84422a..de86eb0bd65 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 @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} 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 aa656c54f08..8ebcd90926d 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 @@ -13,11 +13,11 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.assertj" % "assertj-core" % "3.23.1" % "test", "junit" % "junit" % "5.10.2" % "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 3674b48b990..1b0dec8c444 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 @@ -298,8 +298,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 4.7.6.Final - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index fe355ec358f..7953c007459 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -331,9 +331,18 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/auth/OAuth.mustache index 7889f1582de..3c1d84f8acc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/auth/OAuth.mustache @@ -1,24 +1,48 @@ package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ {{>generatedAnnotation}} public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 13c7d8d9adf..a900fc8065d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -115,8 +115,8 @@ ext { {{#swagger2AnnotationLibrary}} swagger_annotations_version = "2.2.9" {{/swagger2AnnotationLibrary}} - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} 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 7c1337eba0b..250417d7870 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 @@ -373,8 +373,8 @@ {{^useJakartaEe}} 5.3.33 {{/useJakartaEe}} - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache deleted file mode 100644 index c4c422b7ba0..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/ApiClient.mustache +++ /dev/null @@ -1,448 +0,0 @@ -package {{invokerPackage}}; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Type; -import java.util.LinkedHashMap; -import java.util.Map; - -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -{{/hasOAuthMethods}} - -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import retrofit.RestAdapter; -import retrofit.client.OkClient; -import retrofit.converter.ConversionException; -import retrofit.converter.Converter; -import retrofit.converter.GsonConverter; -import retrofit.mime.TypedByteArray; -import retrofit.mime.TypedInput; -import retrofit.mime.TypedOutput; - -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.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; - -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.OAuth.AccessTokenListener; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -public class ApiClient { - - private Map apiAuthorizations; - private OkHttpClient okClient; - private RestAdapter.Builder adapterBuilder; - - public ApiClient() { - apiAuthorizations = new LinkedHashMap(); - createDefaultAdapter(); - } - - public ApiClient(String[] authNames) { - this(); - for(String authName : authNames) { - {{#hasAuthMethods}} - Interceptor auth = null; - {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasicBasic}} - auth = new HttpBasicAuth(); - {{/isBasicBasic}} - {{#isBasicBearer}} - auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBearer}} - {{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); - {{/isApiKey}} - {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); - {{/isOAuth}} - } else {{/authMethods}}{ - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - } - if (auth != null) { - addAuthorization(authName, auth); - } - {{/hasAuthMethods}} - {{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - {{/hasAuthMethods}} - } - } - - /** - * Basic constructor for single auth name - * @param authName Authentication name - */ - public ApiClient(String authName) { - this(new String[]{authName}); - } - - /** - * Helper constructor for single api key - * @param authName Authentication name - * @param apiKey API key - */ - public ApiClient(String authName, String apiKey) { - this(authName); - this.setApiKey(apiKey); - } - - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName Authentication name - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - {{#hasOAuthMethods}} - /** - * Helper constructor for single password oauth2 - * @param authName Authentication name - * @param clientId Client ID - * @param secret Client secret - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - - {{/hasOAuthMethods}} - public void createDefaultAdapter() { - Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) - .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) - .create(); - - okClient = new OkHttpClient(); - - adapterBuilder = new RestAdapter - .Builder() - .setEndpoint("{{{basePath}}}") - .setClient(new OkClient(okClient)) - .setConverter(new GsonConverterWrapper(gson)); - } - - public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); - - } - - /** - * Helper method to configure the first api key found - * @param apiKey API key - */ - private void setApiKey(String apiKey) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return; - } - } - } - - /** - * Helper method to set token for the first Http Bearer authentication found. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - } - - /** - * Helper method to configure the username/password for basic auth or password oauth - * @param username Username - * @param password Password - */ - private void setCredentials(String username, String password) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - {{#hasOAuthMethods}} - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - {{/hasOAuthMethods}} - } - } - - {{#hasOAuthMethods}} - /** - * 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(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken); - return; - } - } - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - */ - public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - */ - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } - } - {{/hasOAuthMethods}} - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization - */ - public void addAuthorization(String authName, Interceptor authorization) { - if (apiAuthorizations.containsKey(authName)) { - throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); - } - apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); - } - - public Map getApiAuthorizations() { - return apiAuthorizations; - } - - public void setApiAuthorizations(Map apiAuthorizations) { - this.apiAuthorizations = apiAuthorizations; - } - - public RestAdapter.Builder getAdapterBuilder() { - return adapterBuilder; - } - - public void setAdapterBuilder(RestAdapter.Builder adapterBuilder) { - this.adapterBuilder = adapterBuilder; - } - - public OkHttpClient getOkClient() { - return okClient; - } - - public void addAuthsToOkClient(OkHttpClient okClient) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); - } - } - - /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the RestAdapter - * @param okClient OkHttp client - */ - public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.clone(); - addAuthsToOkClient(clone); - adapterBuilder.setClient(new OkClient(clone)); - } -} - -/** - * This wrapper is to take care of this case: - * when the deserialization fails due to JsonParseException and the - * expected type is String, then just return the body string. - */ -class GsonConverterWrapper implements Converter { - private GsonConverter converter; - - public GsonConverterWrapper(Gson gson) { - converter = new GsonConverter(gson); - } - - @Override public Object fromBody(TypedInput body, Type type) throws ConversionException { - byte[] bodyBytes = readInBytes(body); - TypedByteArray newBody = new TypedByteArray(body.mimeType(), bodyBytes); - try { - return converter.fromBody(newBody, type); - } catch (ConversionException e) { - if (e.getCause() instanceof JsonParseException && type.equals(String.class)) { - return new String(bodyBytes); - } else { - throw e; - } - } - } - - @Override public TypedOutput toBody(Object object) { - return converter.toBody(object); - } - - private byte[] readInBytes(TypedInput body) throws ConversionException { - InputStream in = null; - try { - in = body.in(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[0xFFFF]; - for (int len; (len = in.read(buffer)) != -1;) - os.write(buffer, 0, len); - os.flush(); - return os.toByteArray(); - } catch (IOException e) { - throw new ConversionException(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ignored) { - } - } - } - - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class DateTimeTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); - private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(printFormatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return parseFormatter.parseDateTime(date); - } - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class LocalDateTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter formatter = ISODateTimeFormat.date(); - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache deleted file mode 100644 index dbfa4ae767b..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache +++ /dev/null @@ -1,99 +0,0 @@ -package {{invokerPackage}}; - -import java.util.Arrays; -import java.util.List; - -public class CollectionFormats { - - public static class CSVParams { - - protected List params; - - public CSVParams() { - } - - public CSVParams(List params) { - this.params = params; - } - - public CSVParams(String... params) { - this.params = Arrays.asList(params); - } - - public List getParams() { - return params; - } - - public void setParams(List params) { - this.params = params; - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), ","); - } - - } - - public static class SPACEParams extends SSVParams { - - } - - public static class SSVParams extends CSVParams { - - public SSVParams() { - } - - public SSVParams(List params) { - super(params); - } - - public SSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), " "); - } - } - - public static class TSVParams extends CSVParams { - - public TSVParams() { - } - - public TSVParams(List params) { - super(params); - } - - public TSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join( params.toArray(new String[0]), "\t"); - } - } - - public static class PIPESParams extends CSVParams { - - public PIPESParams() { - } - - public PIPESParams(List params) { - super(params); - } - - public PIPESParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), "|"); - } - } - -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache deleted file mode 100644 index c9877589b5f..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache +++ /dev/null @@ -1,42 +0,0 @@ -# {{artifactId}} - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation & Usage - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*: - -```xml - - {{groupId}} - {{artifactId}} - {{artifactVersion}} - compile - - -``` - -## 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/retrofit/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache deleted file mode 100644 index bd3d62f8b7a..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache +++ /dev/null @@ -1,72 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.CollectionFormats.*; - -import retrofit.Callback; -import retrofit.http.*; -import retrofit.mime.*; - -{{#imports}}import {{import}}; -{{/imports}} - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -{{#operations}} -public interface {{classname}} { - {{#operation}} - /** - * {{summary}} - * Sync method - * {{notes}} -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @return {{returnType}}{{^returnType}}Void{{/returnType}} -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} - );{{/-last}}{{/allParams}} - - /** - * {{summary}} - * Async method -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @param cb callback method -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb - ); - {{/operation}} -} -{{/operations}} 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 deleted file mode 100644 index 771b84de223..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache +++ /dev/null @@ -1,42 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.ApiClient; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.jupiter.api.BeforeEach; -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 {{classname}} - */ -public class {{classname}}Test { - - private {{classname}} api; - - @Before - public void setup() { - api = new ApiClient().createService({{classname}}.class); - } - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - */ - @Test - public void {{operationId}}Test() { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/ApiKeyAuth.mustache deleted file mode 100644 index 69205bb2083..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,72 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class ApiKeyAuth implements Interceptor { - private final String location; - private final String paramName; - - private String apiKey; - - 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; - } - - @Override - public Response intercept(Chain chain) throws IOException { - String paramValue; - Request request = chain.request(); - - if ("query".equals(location)) { - String newQuery = request.uri().getQuery(); - paramValue = paramName + "=" + apiKey; - if (newQuery == null) { - newQuery = paramValue; - } else { - newQuery += "&" + paramValue; - } - - URI newUri; - try { - newUri = new URI(request.uri().getScheme(), request.uri().getAuthority(), - request.uri().getPath(), newQuery, request.uri().getFragment()); - } catch (URISyntaxException e) { - throw new IOException(e); - } - - request = request.newBuilder().url(newUri.toURL()).build(); - } else if ("header".equals(location)) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build(); - } else if ("cookie".equals(location)) { - request = request.newBuilder() - .addHeader("Cookie", String.format("%s=%s", paramName, apiKey)) - .build(); - } - return chain.proceed(request); - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache deleted file mode 100644 index cf82b2775a7..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,49 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBasicAuth implements Interceptor { - - 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; - } - - public void setCredentials(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null) { - String credentials = Credentials.basic(username, password); - request = request.newBuilder() - .addHeader("Authorization", credentials) - .build(); - } - return chain.proceed(request); - } -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBearerAuth.mustache deleted file mode 100644 index 9b910c461cb..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,42 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBearerAuth implements Interceptor { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - public String getBearerToken() { - return bearerToken; - } - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null && bearerToken != null) { - request = request.newBuilder() - .addHeader("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken) - .build(); - } - return chain.proceed(request); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } - -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache deleted file mode 100644 index bc0bad71144..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache +++ /dev/null @@ -1,185 +0,0 @@ -package {{invokerPackage}}.auth; - -import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static java.net.HttpURLConnection.HTTP_FORBIDDEN; - -import java.io.IOException; -import java.util.Map; - -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.AuthenticationRequestBuilder; -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 org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Request.Builder; -import com.squareup.okhttp.Response; - -public class OAuth implements Interceptor { - - public interface AccessTokenListener { - public void notify(BasicOAuthToken token); - } - - private volatile String accessToken; - private OAuthClient oauthClient; - - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - - private AccessTokenListener accessTokenListener; - - public OAuth( OkHttpClient client, TokenRequestBuilder requestBuilder ) { - this.oauthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = requestBuilder; - } - - public OAuth(TokenRequestBuilder requestBuilder ) { - this(new OkHttpClient(), requestBuilder); - } - - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - public void setFlow(OAuthFlow flow) { - switch(flow) { - case ACCESS_CODE: - case IMPLICIT: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - 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 have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // If first time, get the token - OAuthClientRequest oAuthRequest; - if (getAccessToken() == null) { - updateAccessToken(null); - } - - if (getAccessToken() != null) { - // Build the request - Builder rb = request.newBuilder(); - - String requestAccessToken = new String(getAccessToken()); - try { - oAuthRequest = new OAuthBearerClientRequest(request.urlString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { - rb.addHeader(header.getKey(), header.getValue()); - } - rb.url( oAuthRequest.getLocationUri()); - - //Execute the request - Response response = chain.proceed(rb.build()); - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == 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 - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - return !getAccessToken().equals(requestAccessToken); - } else { - return false; - } - } catch (OAuthSystemException e) { - throw new IOException(e); - } catch (OAuthProblemException e) { - throw new IOException(e); - } - } - return true; - } - - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } - - public synchronized String getAccessToken() { - return accessToken; - } - - public synchronized void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index 48fc7ea4c1f..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,69 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -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 com.squareup.okhttp.MediaType; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - - -public class OAuthOkHttpClient implements HttpClient { - - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - 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(mediaType, request.getBody()) : 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(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - public void shutdown() { - // Nothing to do here - } - -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/bodyParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/bodyParams.mustache deleted file mode 100644 index 81de324b691..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/bodyParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache deleted file mode 100644 index 2496d2edb50..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache +++ /dev/null @@ -1,118 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - mavenCentral() -} - - -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_7 - targetCompatibility = JavaVersion.VERSION_1_7 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - okhttp_version = "2.7.5" - oltu_version = "1.0.1" - retrofit_version = "1.9.0" - swagger_annotations_version = "1.5.21" - jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" - jodatime_version = "2.9.3" -} - -dependencies { - implementation "com.squareup.okhttp:okhttp:$okhttp_version" - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "com.squareup.retrofit:retrofit:$retrofit_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" - implementation "joda-time:joda-time:$jodatime_version" - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" -} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache deleted file mode 100644 index 2cd243945a2..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.sbt.mustache +++ /dev/null @@ -1,21 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.okhttp" % "okhttp" % "2.7.5" % "compile", - "com.squareup.retrofit" % "retrofit" % "1.9.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "joda-time" % "joda-time" % "2.9.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/formParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/formParams.mustache deleted file mode 100644 index 851072b3f65..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/formParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/headerParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/headerParams.mustache deleted file mode 100644 index 5d6da4a9437..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/headerParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pathParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pathParams.mustache deleted file mode 100644 index 7b8be8442e0..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pathParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache deleted file mode 100644 index b44c2fbd30f..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache +++ /dev/null @@ -1,293 +0,0 @@ - - 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.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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.6.1 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.2 - - none - 1.8 - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - 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 - - - com.squareup.retrofit - retrofit - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - joda-time - joda-time - ${jodatime-version} - - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - {{#swagger1AnnotationLibrary}} - 1.6.6 - {{/swagger1AnnotationLibrary}} - {{#swagger2AnnotationLibrary}} - 2.2.15 - {{/swagger2AnnotationLibrary}} - 1.9.0 - 2.7.5 - 2.9.9 - 1.0.1 - {{#useJakartaEe}} - 2.1.1 - {{/useJakartaEe}} - {{^useJakartaEe}} - 1.3.5 - {{/useJakartaEe}} - 1.0.0 - 4.13.2 - - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/queryParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/queryParams.mustache deleted file mode 100644 index 2a580ab34ec..00000000000 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/queryParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache index 2d791d4ff58..2ff8b1cb739 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache @@ -2,11 +2,11 @@ package {{invokerPackage}}; -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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -32,14 +32,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -54,11 +51,6 @@ public class JSON { private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/jsr310}} - private static final StdDateFormat sdf = new StdDateFormat() - .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) - .withColonInTimeZone(true); - private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() {{#models}}{{#model}}{{#discriminator}} .registerTypeSelector({{classname}}.class, new TypeSelector() { @@ -370,7 +362,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -380,7 +372,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -406,7 +398,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -425,7 +417,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } 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 9227bbb78b0..dab62f328cb 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 @@ -3,8 +3,9 @@ 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.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -25,7 +26,7 @@ public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService({{classname}}.class); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index a36624da899..96a0a66ca1e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -99,20 +99,20 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_databind_version = "2.15.2" {{#jackson}} - jackson_version = "2.15.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" javax_ws_rs_api_version = "2.1.1" - {{#openApiNullable}} + {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" - {{/openApiNullable}} + {{/openApiNullable}} {{/jackson}} {{#usePlayWS}} play_version = "2.6.7" {{/usePlayWS}} jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -154,13 +154,13 @@ dependencies { implementation "com.squareup.retrofit2:converter-jackson:$retrofit_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 "javax.ws.rs:javax.ws.rs-api:$javax_ws_rs_api_version" {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/jackson}} - implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_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/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index bc1f613088b..7e7f69093ba 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.15.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.15.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{/usePlayWS}} {{#useRxJava2}} "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", @@ -37,7 +37,7 @@ lazy val root = (project in file(".")). {{/joda}} "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) 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 20b5c80c7c2..a365e18f29a 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 @@ -211,11 +211,6 @@ swagger-annotations ${swagger-annotations-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.google.code.findbugs @@ -305,6 +300,11 @@ jackson-annotations ${jackson-version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + {{#openApiNullable}} org.openapitools @@ -344,6 +344,11 @@ play-ahc-ws_2.12 ${play-version} + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + {{/usePlayWS}} {{#parcelableModel}} @@ -362,8 +367,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -377,12 +382,12 @@ 1.9.0 {{/gson}} 1.6.3 - 2.15.2 {{#jackson}} - 2.15.2 - {{#openApiNullable}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} 0.2.6 - {{/openApiNullable}} + {{/openApiNullable}} 2.1.1 {{/jackson}} {{#usePlayWS}} @@ -408,6 +413,6 @@ 3.0.2 {{/useBeanValidation}} 1.0.1 - 4.13.2 + 5.10.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache index df1c211856e..1469d11fb76 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache @@ -6,11 +6,10 @@ package {{package}}; import {{invokerPackage}}.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,24 +30,18 @@ import java.util.Map; /** * API tests for {{classname}} */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new {{classname}}Impl(); } - {{#operations}}{{#operation}} + + {{#operations}} + {{#operation}} /** * {{summary}} * {{notes}} @@ -66,5 +59,6 @@ public class {{classname}}Test { async.complete(); }); } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 34fed083474..0e8fd590ce5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -30,10 +30,10 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} @@ -56,6 +56,6 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index 6cd6fb422b6..b9b44cd85df 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -284,8 +284,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -306,8 +306,8 @@ {{#swagger2AnnotationLibrary}} 2.2.15 {{/swagger2AnnotationLibrary}} - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 {{#useJakartaEe}} 2.1.1 @@ -315,6 +315,6 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} - 4.13.2 + 5.10.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index d3a75e16528..ef13e46a42c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -43,7 +43,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache index a065cb1a90e..0194ccf07d5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache @@ -1,6 +1,5 @@ package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBearerAuth.mustache index 42765f0fd9b..353a8c7a5f0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBearerAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBearerAuth.mustache @@ -1,8 +1,5 @@ package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; 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 3ccc98e214d..59741163853 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 @@ -142,8 +142,8 @@ ext { reactor_version = "3.4.34" reactor_netty_version = "1.0.39" {{/useJakartaEe}} - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} 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 8547b9dc5a5..4180b2d5f51 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 @@ -167,8 +167,8 @@ {{#swagger2AnnotationLibrary}} 2.2.15 {{/swagger2AnnotationLibrary}} - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index 55e6678d2f0..b5041679372 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -49,8 +49,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/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index d4c6ec8d154..05be7e5c538 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -52,28 +52,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{#isDateTime}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) - {{/isDateTime}} - {{/isXmlAttribute}} + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -115,8 +102,8 @@ 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}} - */ + * 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}} @@ -133,8 +120,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#vendorExtensions.x-java-all-args-constructor}} /** - * Constructor with all args parameters - */ + * 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}}); @@ -202,7 +189,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -219,7 +206,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index e3e1f21b44a..b733ab9bb61 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -364,8 +364,8 @@ 2.2.15 {{/swagger2AnnotationLibrary}} 1.19.4 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 {{#useJakartaEe}} 2.1.1 {{/useJakartaEe}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index f08cf3a743a..4900c6d27de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -224,8 +224,8 @@ for this project used jakarta.validation-api --> {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} - 3.3.0 - 2.15.2 + 3.5.9 + 2.17.1 UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 5e6c879857c..dc1d394348d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -344,8 +344,8 @@ for this project used jakarta.validation-api --> 4.13.2 1.2.12 {{/generateSpringBootApplication}} - 3.3.0 - 2.15.2 + 3.5.9 + 2.17.1 UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index c00a8bb549c..cbee8696090 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -99,6 +99,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -234,14 +245,14 @@ for this project used jakarta.validation-api --> {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} - 3.3.0 - 2.15.2 - {{#useJakartaEe}} - 2.1.1 - {{/useJakartaEe}} - {{^useJakartaEe}} - 1.3.5 - {{/useJakartaEe}} + 3.5.9 + 2.17.1 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.3.5 + {{/useJakartaEe}} UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index ad727bc4af4..961cd74d157 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -108,6 +108,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -291,14 +302,14 @@ for this project used jakarta.validation-api --> {{#generateSpringBootApplication}} 1.5.9.RELEASE {{/generateSpringBootApplication}} - 3.3.0 - 2.15.2 - {{#useJakartaEe}} - 2.1.1 - {{/useJakartaEe}} - {{^useJakartaEe}} - 1.3.5 - {{/useJakartaEe}} + 3.5.9 + 2.17.1 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.3.5 + {{/useJakartaEe}} UTF-8 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache index 8817255f4d9..5734fc17ddf 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pom.mustache @@ -220,7 +220,7 @@ {{/useBeanValidation}} 11.0.15 3.1.3 - 2.15.2 + 2.17.1 4.13.2 1.4.14 5.0.0 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index eddab3b1569..3b2a9f2dc3e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -220,7 +220,7 @@ for this project used jakarta.validation-api --> {{/useBeanValidation}} 9.2.9.v20150224 2.35 - 2.15.2 + 2.17.1 4.13.2 1.4.14 4.0.4 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 2df567dd810..863cd4c916a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -1,5 +1,4 @@ import io.swagger.annotations.*; -{{#useBeanValidation}}import javax.validation.Valid;{{/useBeanValidation}} {{#description}}@ApiModel(description="{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} {{#vendorExtensions.x-class-extra-annotation}} 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 ab482a0590a..eec20b1f5de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -212,7 +212,7 @@ for this project used jakarta.validation-api --> UTF-8 1.5.22 - 2.15.2 + 2.17.1 9.2.9.v20150224 3.13.0.Final 1.6.3 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 efd11d223ff..a7f26465482 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}}@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 +{{#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/spec/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache index 87985b167bd..d9b74552408 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -43,6 +43,6 @@ return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache index 17f29417c6d..c13a2f69986 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache @@ -53,6 +53,6 @@ import com.fasterxml.jackson.annotation.JsonValue; return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } } 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 f44c6083fdd..e3e888baf17 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -176,7 +176,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 {{#useJakartaEe}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index 5b10c93fa73..20ed2e4ac0d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -66,7 +66,7 @@ public interface {{classname}}Delegate { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}{{#isFormParam}}MultipartFile{{/isFormParam}}{{^isFormParam}}{{>optionalDataType}}{{/isFormParam}}{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache index 1e347f2f950..569f7060be4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -1,4 +1,4 @@ -{{#pattern}}{{^isByteArray}}@Pattern(regexp = "{{{pattern}}}"{{#vendorExtensions.x-pattern-message}}, message="{{vendorExtensions.x-pattern-message}}"{{/vendorExtensions.x-pattern-message}}) {{/isByteArray}}{{/pattern}}{{! +{{^isUuid}}{{#pattern}}{{^isByteArray}}@Pattern(regexp = "{{{pattern}}}"{{#vendorExtensions.x-pattern-message}}, message="{{vendorExtensions.x-pattern-message}}"{{/vendorExtensions.x-pattern-message}}) {{/isByteArray}}{{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}}@Size(min = {{minLength}}, max = {{maxLength}}) {{/maxLength}}{{/minLength}}{{! minLength set, maxLength not @@ -21,4 +21,4 @@ isInteger set isLong set }}{{#isLong}}{{#minimum}}@Min({{.}}L) {{/minimum}}{{#maximum}}@Max({{.}}L) {{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{#minimum}}@DecimalMin({{#exclusiveMinimum}}value = {{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive = false{{/exclusiveMinimum}}) {{/minimum}}{{#maximum}}@DecimalMax({{#exclusiveMaximum}}value = {{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive = false{{/exclusiveMaximum}}) {{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file +}}{{^isInteger}}{{^isLong}}{{#minimum}}@DecimalMin({{#exclusiveMinimum}}value = {{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive = false{{/exclusiveMinimum}}) {{/minimum}}{{#maximum}}@DecimalMax({{#exclusiveMaximum}}value = {{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive = false{{/exclusiveMaximum}}) {{/maximum}}{{/isLong}}{{/isInteger}}{{/isUuid}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache index 943a6822273..c148ee898d3 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache @@ -55,6 +55,6 @@ return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache index 24c1057d9a8..12c679ba993 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache @@ -56,6 +56,6 @@ public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatyp return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index b9589c14778..a9b35fe854b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache index 9f369e65cfc..c210b33e7fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache @@ -28,9 +28,6 @@ this.instance.{{name}}({{name}}); return this; } - {{#deprecated}} - @Deprecated - {{/deprecated}} {{#openApiNullable}}{{#isNullable}} public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { this.instance.{{name}} = {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index c343e07fefc..23cf601c88e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -25,6 +25,7 @@ import org.hibernate.validator.constraints.*; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; {{/withXml}} {{/jackson}} {{#swagger2AnnotationLibrary}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index a0ce56314d1..a5f2e6e454b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 44be9a40898..e94b47c326f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -128,8 +128,8 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#vendorExtensions.x-java-all-args-constructor}} /** - * Constructor with all args parameters - */ + * 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}}); @@ -215,7 +215,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#deprecated}} * @deprecated {{/deprecated}} - */ + */ {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -234,9 +234,18 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#jackson}} @JsonProperty("{{baseName}}") {{#withXml}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} {{/withXml}} {{/jackson}} + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{/withXml}} {{#deprecated}} @Deprecated {{/deprecated}} @@ -249,7 +258,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#deprecated}} /** * @deprecated - */ + */ {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 1b7fac3512e..b8226381ee1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache index a9e6fb0fa0b..b3a89fa362f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache @@ -1,7 +1,6 @@ {{#withXml}} {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") {{/jackson}} -@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") -@XmlAccessorType(XmlAccessType.FIELD) -{{/withXml}} \ No newline at end of file +@XmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlAccessorType(XmlAccessType.FIELD){{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index d28185a38d2..2bd28bb433f 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -17,7 +17,7 @@ 3.8.1 {{vertxSwaggerRouterVersion}} 2.3 - 2.7.4 + 2.17.1 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache index fa61f24de73..12513d60824 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache @@ -20,7 +20,7 @@ 4.2.4 5.10.0 1.7.30 - 2.15.2 + 2.17.1 {{invokerPackage}}.HttpServerVerticle diff --git a/modules/openapi-generator/src/main/resources/android/build.mustache b/modules/openapi-generator/src/main/resources/android/build.mustache index 729df266d1e..4034e0a79f6 100644 --- a/modules/openapi-generator/src/main/resources/android/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/build.mustache @@ -1,50 +1,26 @@ -{{#useAndroidMavenGradlePlugin}} -group = '{{groupId}}' -project.version = '{{artifactVersion}}' -{{/useAndroidMavenGradlePlugin}} - -buildscript { - repositories { - maven { url "https://repo1.maven.org/maven2" } - jcenter() - } - dependencies { - {{#androidGradleVersion}} - classpath 'com.android.tools.build:gradle:{{{.}}}' - {{/androidGradleVersion}} - {{^androidGradleVersion}} - classpath 'com.android.tools.build:gradle:2.3.+' - {{/androidGradleVersion}} - {{#useAndroidMavenGradlePlugin}} - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - {{/useAndroidMavenGradlePlugin}} - } +plugins { + {{#androidGradleVersion}} + id 'com.android.library' version '{{{.}}}' + {{/androidGradleVersion}} + {{^androidGradleVersion}} + id 'com.android.library' version '8.0.0' + {{/androidGradleVersion}} + id 'maven-publish' } -allprojects { - repositories { - jcenter() - } -} - - -apply plugin: 'com.android.library' -{{#useAndroidMavenGradlePlugin}} -apply plugin: 'com.github.dcendents.android-maven' -{{/useAndroidMavenGradlePlugin}} - android { + namespace "{{invokerPackage}}" {{#androidSdkVersion}} compileSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} - compileSdkVersion 25 + compileSdkVersion 33 {{/androidSdkVersion}} {{#androidBuildToolsVersion}} buildToolsVersion '{{{.}}}' {{/androidBuildToolsVersion}} {{^androidBuildToolsVersion}} - buildToolsVersion '25.0.2' + buildToolsVersion '34.0.0' {{/androidBuildToolsVersion}} useLibrary 'org.apache.http.legacy' defaultConfig { @@ -53,27 +29,20 @@ android { targetSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} - targetSdkVersion 25 + targetSdkVersion 33 {{/androidSdkVersion}} } 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) - } + publishing { + singleVariant('release') { + withSourcesJar() } } } - ext { swagger_annotations_version = "1.6.6" gson_version = "2.10.1" @@ -83,38 +52,29 @@ ext { } dependencies { - compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "com.google.code.gson:gson:$gson_version" - compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpclient:$httpclient_version" - compile ("org.apache.httpcomponents:httpcore:$httpcore_version") { + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "org.apache.httpcomponents:httpcore:$httpcore_version" + implementation "org.apache.httpcomponents:httpclient:$httpclient_version" + implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") { exclude(group: 'org.apache.httpcomponents', module: 'httpclient') } - compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { + implementation ("org.apache.httpcomponents:httpmime:$httpclient_version") { exclude(group: 'org.apache.httpcomponents', module: 'httpclient') } - testCompile "junit:junit:$junit_version" + testImplementation "junit:junit:$junit_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); +publishing { + publications { + release(MavenPublication) { + groupId = '{{groupId}}' + artifactId = '{{artifactId}}' + version = '{{artifactVersion}}' + + afterEvaluate { + from components.release + } + } } } - -{{#useAndroidMavenGradlePlugin}} -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} -{{/useAndroidMavenGradlePlugin}} diff --git a/modules/openapi-generator/src/main/resources/android/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/android/gradle-wrapper.properties.mustache index 4d9ca164914..d951fac2bf3 100644 --- a/modules/openapi-generator/src/main/resources/android/gradle-wrapper.properties.mustache +++ b/modules/openapi-generator/src/main/resources/android/gradle-wrapper.properties.mustache @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache index b21fdcb60c3..58e7b7dc269 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache @@ -1,44 +1,35 @@ -{{#useAndroidMavenGradlePlugin}} -group = '{{groupId}}' -project.version = '{{artifactVersion}}' -{{/useAndroidMavenGradlePlugin}} - -buildscript { - repositories { - mavenLocal() - google() - maven { - url 'https://dl.google.com/dl/android/maven2' - } - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.2.+' - {{#useAndroidMavenGradlePlugin}} - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - {{/useAndroidMavenGradlePlugin}} - } +plugins { + {{#androidGradleVersion}} + id 'com.android.library' version '{{{.}}}' + {{/androidGradleVersion}} + {{^androidGradleVersion}} + id 'com.android.library' version '8.0.0' + {{/androidGradleVersion}} + id 'maven-publish' } -allprojects { - repositories { - google() - jcenter() - } -} - - -apply plugin: 'com.android.library' -{{#useAndroidMavenGradlePlugin}} -apply plugin: 'com.github.dcendents.android-maven' -{{/useAndroidMavenGradlePlugin}} - android { - compileSdkVersion 26 - buildToolsVersion '28.0.3' + namespace "{{invokerPackage}}" + {{#androidSdkVersion}} + compileSdkVersion {{{.}}} + {{/androidSdkVersion}} + {{^androidSdkVersion}} + compileSdkVersion 33 + {{/androidSdkVersion}} + {{#androidBuildToolsVersion}} + buildToolsVersion '{{{.}}}' + {{/androidBuildToolsVersion}} + {{^androidBuildToolsVersion}} + buildToolsVersion '34.0.0' + {{/androidBuildToolsVersion}} defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + {{#androidSdkVersion}} + targetSdkVersion {{{.}}} + {{/androidSdkVersion}} + {{^androidSdkVersion}} + targetSdkVersion 33 + {{/androidSdkVersion}} } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -47,60 +38,51 @@ android { lintOptions { abortOnError false } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.all { output -> - if (outputFile != null && outputFileName.endsWith('.aar')) { - outputFileName = "${archivesBaseName}-${version}.aar" - } - } + packagingOptions { + resources.excludes += "META-INF/DEPENDENCIES" } - testOptions { unitTests.returnDefaultValues = true } + publishing { + singleVariant('release') { + withSourcesJar() + } + } } ext { swagger_annotations_version = "1.6.6" gson_version = "2.10.1" + httpcore_version = "4.4.16" httpmime_version = "4.5.14" volley_version = "1.2.1" junit_version = "4.13.2" - robolectric_version = "4.5.1" - concurrent_unit_version = "0.4.6" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.gson:gson:$gson_version" - implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") { + exclude(group: "org.apache.httpcomponents", module: "httpclient") + } + implementation ("org.apache.httpcomponents:httpmime:$httpmime_version") { + exclude(group: "org.apache.httpcomponents", module: "httpclient") + } implementation "com.android.volley:volley:${volley_version}" testImplementation "junit:junit:$junit_version" - testImplementation "org.robolectric:robolectric:${robolectric_version}" - testImplementation "net.jodah:concurrentunit:${concurrent_unit_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); +publishing { + publications { + release(MavenPublication) { + groupId = '{{groupId}}' + artifactId = '{{artifactId}}' + version = '{{artifactVersion}}' + + afterEvaluate { + from components.release + } + } } } - -{{#useAndroidMavenGradlePlugin}} -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} -{{/useAndroidMavenGradlePlugin}} diff --git a/modules/openapi-generator/src/main/resources/android/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/android/settings.gradle.mustache index ba0114cb176..457e1537fda 100644 --- a/modules/openapi-generator/src/main/resources/android/settings.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/android/settings.gradle.mustache @@ -1 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + rootProject.name = "{{artifactId}}" diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache index a9e04767cdc..1bb50410d06 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache @@ -77,7 +77,7 @@ namespace {{modelPackage}} public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}}{{#nullableReferenceTypes}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/nullableReferenceTypes}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} + public {{{dataType}}}{{#nullableReferenceTypes}}{{^isContainer}}{{^required}}{{^isNullable}}?{{/isNullable}}{{/required}}{{/isContainer}}{{/nullableReferenceTypes}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache index b8c4e8b2747..2e6f70491ec 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache @@ -65,7 +65,7 @@ private: {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - virtual void {{operationIdSnakeCase}}({{#allParams}}const {{#isModel}}{{modelNamespace}}::{{/isModel}}{{{dataType}}} &{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Pistache::Http::ResponseWriter &response) = 0; + virtual void {{operationIdSnakeCase}}({{#allParams}}const {{#isModel}}{{^isOptional}}{{modelNamespace}}::{{/isOptional}}{{/isModel}}{{{dataType}}} &{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Pistache::Http::ResponseWriter &response) = 0; {{/vendorExtensions.x-codegen-pistache-is-parsing-supported}} {{^vendorExtensions.x-codegen-pistache-is-parsing-supported}} virtual void {{operationIdSnakeCase}}(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpFileElement.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpFileElement.cpp.mustache index a1348541e91..a3aac7067f6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpFileElement.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpFileElement.cpp.mustache @@ -57,11 +57,7 @@ QJsonValue {{prefix}}HttpFileElement::asJsonValue() const { if (!result) { qDebug() << "Error opening file " << local_filename; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) return QJsonDocument::fromJson(bArray.data()).object(); -#else - return QJsonDocument::fromBinaryData(bArray.data()).object(); -#endif } bool {{prefix}}HttpFileElement::fromStringValue(const QString &instr) { @@ -86,11 +82,7 @@ bool {{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { file.remove(); } result = file.open(QIODevice::WriteOnly); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) file.write(QJsonDocument(jval.toObject()).toJson()); -#else - file.write(QJsonDocument(jval.toObject()).toBinaryData()); -#endif file.close(); if (!result) { qDebug() << "Error creating file " << local_filename; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache index a241ce842c3..d5aa5f863e6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache @@ -7,11 +7,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - #define SKIP_EMPTY_PARTS Qt::SkipEmptyParts -#else - #define SKIP_EMPTY_PARTS QString::SkipEmptyParts -#endif{{#contentCompression}} +{{#contentCompression}} #include {{/contentCompression}} #include "{{prefix}}HttpRequest.h" @@ -440,14 +436,14 @@ void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { } if (!contentDispositionHdr.isEmpty()) { - auto contentDisposition = contentDispositionHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto contentDisposition = contentDispositionHdr.split(QString(";"), Qt::SkipEmptyParts); auto contentType = - !contentTypeHdr.isEmpty() ? contentTypeHdr.split(QString(";"), SKIP_EMPTY_PARTS).first() : QString(); + !contentTypeHdr.isEmpty() ? contentTypeHdr.split(QString(";"), Qt::SkipEmptyParts).first() : QString(); if ((contentDisposition.count() > 0) && (contentDisposition.first() == QString("attachment"))) { QString filename = QUuid::createUuid().toString(); for (const auto &file : contentDisposition) { if (file.contains(QString("filename"))) { - filename = file.split(QString("="), SKIP_EMPTY_PARTS).at(1); + filename = file.split(QString("="), Qt::SkipEmptyParts).at(1); break; } } @@ -457,14 +453,14 @@ void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { } } else if (!contentTypeHdr.isEmpty()) { - auto contentType = contentTypeHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto contentType = contentTypeHdr.split(QString(";"), Qt::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { // TODO : Handle Multipart responses } else { if(!contentEncodingHdr.isEmpty()){ - auto encoding = contentEncodingHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto encoding = contentEncodingHdr.split(QString(";"), Qt::SkipEmptyParts); if(encoding.count() > 0){ - auto compressionTypes = encoding.first().split(',', SKIP_EMPTY_PARTS); + auto compressionTypes = encoding.first().split(',', Qt::SkipEmptyParts); if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ response = decompress(reply->readAll()); } else if(compressionTypes.contains("identity", Qt::CaseInsensitive)){ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.h.mustache index 84220c68db1..660ef759050 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.h.mustache @@ -14,9 +14,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - #include -#endif +#include #include "{{prefix}}HttpFileElement.h" @@ -89,9 +87,7 @@ private: bool isResponseCompressionEnabled; bool isRequestCompressionEnabled; int httpResponseCode; -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QRandomGenerator randomGenerator; -#endif void on_reply_timeout(QNetworkReply *reply); void on_reply_finished(QNetworkReply *reply); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache index a53db5ba8c3..56e90e5c479 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache @@ -129,15 +129,9 @@ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl & * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } -#else - for (auto &e : _serverIndices.keys()) { - setServerIndex(e, addServerConfiguration(e, url, description, variables)); - } -#endif } /** @@ -662,15 +656,9 @@ void {{classname}}::{{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} } } {{/cookieParams}} -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); connect(this, &{{classname}}::abortRequestsSignal, worker, &QObject::deleteLater); diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache index 5338b5a9dc2..f4275fd66e9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache @@ -265,7 +265,7 @@ pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{classname}}::{{ {{/authMethods}} return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("{{httpMethod}}"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -299,7 +299,7 @@ pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{classname}}::{{ {{#vendorExtensions.x-codegen-response-ishttpcontent}} return localVarResponse.extract_vector(); }) - .then([=](std::vector localVarResponse) + .then([=, this](std::vector localVarResponse) { {{{returnType}}} localVarResult = std::make_shared(); std::shared_ptr stream = std::make_shared(std::string(localVarResponse.begin(), localVarResponse.end())); @@ -309,7 +309,7 @@ pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{classname}}::{{ {{^vendorExtensions.x-codegen-response-ishttpcontent}} return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { {{^returnType}} return void(); diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache index 0b21eeb050c..f3b23e27b31 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache @@ -8,16 +8,27 @@ # # NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech). -cmake_minimum_required (VERSION 3.1) +cmake_minimum_required (VERSION 3.5) -project({{{packageName}}}) +project({{{packageName}}} CXX) # Force -fPIC even if the project is configured for building a static library. set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CXX_STANDARD_REQUIRED ON) +set(CXX_STANDARD_REQUIRED ON) if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) + if(DEFINED CMAKE_CXX20_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX20_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 20) + elseif(DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX17_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 17) + elseif(DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX14_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 14) + else() + set(CMAKE_CXX_STANDARD 11) + endif() endif() if(NOT CMAKE_BUILD_TYPE) @@ -38,12 +49,12 @@ add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) target_compile_options(${PROJECT_NAME} PRIVATE $<$,$,$>: - -Wall -Wno-unused-variable> + -Wall -Wno-unused-variable -Wno-unused-lambda-capture> ) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $ ) @@ -90,4 +101,4 @@ install( install( EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) \ No newline at end of file +) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index b5f070074df..e7374f4a101 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -8,6 +8,11 @@ #ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_ #define {{modelHeaderGuardPrefix}}_{{classname}}_H_ +{{#oneOf}} +{{#-first}} +#include +{{/-first}} +{{/oneOf}} {{^parent}} {{{defaultInclude}}} #include "{{packageName}}/ModelBase.h" @@ -24,6 +29,60 @@ namespace {{this}} { {{#vendorExtensions.x-forward-declarations}}{{.}} {{/vendorExtensions.x-forward-declarations}} {{/vendorExtensions.x-has-forward-declarations}} +{{#oneOf}}{{#-first}} + +class {{declspec}} {{classname}} +{ +public: + {{classname}}() = default; + ~{{classname}}() = default; + + ///////////////////////////////////////////// + + void validate(); + + web::json::value toJson() const; + + template + bool fromJson(const web::json::value& json) { + // convert json to Target type + Target target; + if (!target.fromJson(json)) { + return false; + } + + m_variantValue = target; + return true; + } + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const; + + template + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) { + // convert multipart to Target type + Target target; + if (!target.fromMultiPart(multipart, namePrefix)) { + return false; + } + + m_variantValue = target; + return true; + } + + ///////////////////////////////////////////// + /// {{classname}} members + + using VariantType = std::variant<{{#oneOf}}{{^-first}}, {{/-first}}{{{.}}}{{/oneOf}}>; + + const VariantType& getVariant() const; + void setVariant(VariantType value); + +protected: + VariantType m_variantValue; +}; + +{{/-first}}{{/oneOf}} +{{^oneOf}} {{#isEnum}} class {{declspec}} {{classname}} : public {{{parent}}}{{^parent}}ModelBase{{/parent}} @@ -120,6 +179,7 @@ protected: }; {{/isEnum}} +{{/oneOf}} {{#modelNamespaceDeclarations}} } diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index e8d2ea96a40..49e9894da56 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -6,7 +6,56 @@ {{#modelNamespaceDeclarations}} namespace {{this}} { {{/modelNamespaceDeclarations}} +{{#oneOf}}{{#-first}} +void {{classname}}::validate() +{ + // TODO: implement validation +} + +const {{classname}}::VariantType& {{classname}}::getVariant() const +{ + return m_variantValue; +} + +void {{classname}}::setVariant({{classname}}::VariantType value) +{ + m_variantValue = value; +} + +web::json::value {{classname}}::toJson() const +{ + web::json::value val = web::json::value::object(); + + std::visit([&](auto&& arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + val = web::json::value::null(); + } else { + val = arg.toJson(); + } + }, m_variantValue); + + return val; +} + +void {{classname}}::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + std::visit([&](auto&& arg) { + using T = std::decay_t; + if constexpr (!std::is_same_v) { + arg.toMultipart(multipart, prefix); + } + }, m_variantValue); +} + +{{#oneOf}} +template bool {{classname}}::fromJson<{{.}}>(const web::json::value& json); +template bool {{classname}}::fromMultiPart<{{.}}>(std::shared_ptr multipart, const utility::string_t& namePrefix); +{{/oneOf}} + +{{/-first}}{{/oneOf}} +{{^oneOf}} {{#isEnum}} namespace @@ -269,6 +318,7 @@ void {{classname}}::unset{{name}}() {{/isInherited}} {{/vars}} {{/isEnum}} +{{/oneOf}} {{#modelNamespaceDeclarations}} } {{/modelNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index ee908eb8994..0d826c87c9d 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -14,20 +14,22 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -{{^netStandard}} +{{^net60OrLater}} using System.Web; -{{/netStandard}} +{{/net60OrLater}} using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; {{#supportsRetry}} using Polly; {{/supportsRetry}} {{#hasOAuthMethods}} using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; namespace {{packageName}}.Client { @@ -68,10 +70,10 @@ namespace {{packageName}}.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -116,7 +118,7 @@ namespace {{packageName}}.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -127,7 +129,7 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -149,13 +151,13 @@ namespace {{packageName}}.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +205,7 @@ namespace {{packageName}}.Client /// public ApiClient() { - _baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +262,14 @@ namespace {{packageName}}.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +377,7 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +387,13 @@ namespace {{packageName}}.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,31 +438,32 @@ namespace {{packageName}}.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + {{#hasOAuthMethods}} if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && @@ -464,6 +474,7 @@ namespace {{packageName}}.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -475,27 +486,14 @@ namespace {{packageName}}.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -553,111 +551,85 @@ namespace {{packageName}}.Client } } - {{#supportsAsync}} - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - {{/hasOAuthMethods}} - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - {{/supportsRetry}} - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} + return client.Execute(request); } - {{/supportsRetry}} + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -670,7 +642,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -685,7 +657,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -700,7 +672,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -715,7 +687,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -730,7 +702,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -745,7 +717,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -760,7 +732,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache index a765ebf138d..71ff47f971d 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache @@ -366,6 +366,12 @@ namespace {{packageName}}.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -711,6 +717,7 @@ namespace {{packageName}}.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, {{/hasOAuthMethods}} {{/useRestSharp}} diff --git a/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache index 78c998b3458..5981728b466 100644 --- a/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/IReadableConfiguration.mustache @@ -43,6 +43,12 @@ namespace {{packageName}}.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/modules/openapi-generator/src/main/resources/csharp/auth/OAuthAuthenticator.mustache b/modules/openapi-generator/src/main/resources/csharp/auth/OAuthAuthenticator.mustache index ae8f3c75391..d71f262a810 100644 --- a/modules/openapi-generator/src/main/resources/csharp/auth/OAuthAuthenticator.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/auth/OAuthAuthenticator.mustache @@ -16,6 +16,7 @@ namespace {{packageName}}.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string{{nrt?}} _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -27,6 +28,7 @@ namespace {{packageName}}.Client.Auth string tokenUrl, string clientId, string clientSecret, + string{{nrt?}} scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -34,6 +36,7 @@ namespace {{packageName}}.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -80,6 +83,12 @@ namespace {{packageName}}.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ApiResponse`1.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ApiResponse`1.mustache index 12fd56a6f9e..5b097c2241d 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ApiResponse`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ApiResponse`1.mustache @@ -164,7 +164,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - bool Try{{.}}({{^netStandard}}[NotNullWhen(true)]{{/netStandard}}out TType{{nrt?}} result); + bool Try{{.}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); } {{/x-http-statuses-with-return}} } diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache index f0087b1dfc6..96bedfa464e 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/AsModel.mustache @@ -1,4 +1,4 @@ // This logic may be modified with the AsModel.mustache template return Is{{vendorExtensions.x-http-status}} ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) - : {{^netStandard}}null{{/netStandard}}{{#netStandard}}default{{/netStandard}}; + : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; 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 d2917e45195..271dfa6789b 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 @@ -103,7 +103,7 @@ using System.Runtime.CompilerServices; /// /// /// - public static bool TryDeserialize(string json, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(string json, JsonSerializerOptions options, {{#net60OrLater}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { @@ -125,7 +125,7 @@ using System.Runtime.CompilerServices; /// /// /// - public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{#net60OrLater}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { 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 2b8fe63b201..189acfd7421 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 @@ -360,10 +360,24 @@ {{#model.hasDiscriminatorWithNonEmptyMapping}} {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) { + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { {{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(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); } + {{/isPrimitiveType}} {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} @@ -373,10 +387,23 @@ {{#composedSchemas}} {{#anyOf}} 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}}) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} { {{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(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); } + {{/isPrimitiveType}} {{/anyOf}} {{/composedSchemas}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache index a2294050f0d..4e44b3fd5ba 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache @@ -7,12 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; -{{^netStandard}} using System.Threading.Channels; -{{/netStandard}} -{{#netStandard}} -using System.Threading.Channels; -{{/netStandard}} namespace {{packageName}}.{{clientPackage}} { diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache index ac482b8d274..eccb02d5318 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache @@ -606,13 +606,13 @@ namespace {{packageName}}.{{apiPackage}} httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); {{/-first}} {{/produces}} - {{^netStandard}} + {{#net60OrLater}} httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; - {{/netStandard}} - {{#netStandard}} + {{/net60OrLater}} + {{^net60OrLater}} httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); - {{/netStandard}} + {{/net60OrLater}} DateTime requestedAtLocalVar = DateTime.UtcNow; @@ -747,7 +747,7 @@ namespace {{packageName}}.{{apiPackage}} /// /// /// - public bool Try{{vendorExtensions.x-http-status}}({{^netStandard}}[NotNullWhen(true)]{{/netStandard}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) { result = null; 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 556d6f0e9d4..ad8214873f4 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 @@ -17,7 +17,7 @@ /// {{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}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{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}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; @@ -55,7 +55,7 @@ {{^composedSchemas.anyOf}} [JsonConstructor] {{/composedSchemas.anyOf}} - {{#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}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; diff --git a/modules/openapi-generator/src/main/resources/csharp/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp/modelAnyOf.mustache index 9b17ec27bc3..f3eac973d7c 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelAnyOf.mustache @@ -18,8 +18,8 @@ /// public {{classname}}() { - this.IsNullable = true; - this.SchemaType= "anyOf"; + IsNullable = true; + SchemaType= "anyOf"; } {{/isNullable}} @@ -33,9 +33,9 @@ /// An instance of {{dataType}}. public {{classname}}({{{dataType}}} actualInstance) { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + SchemaType= "anyOf"; + ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; } {{/isNull}} @@ -58,7 +58,7 @@ {{#anyOf}} {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) { - this._actualInstance = value; + _actualInstance = value; } {{/anyOf}} else @@ -78,7 +78,7 @@ /// An instance of {{dataType}} public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() { - return ({{{dataType}}})this.ActualInstance; + return ({{{dataType}}})ActualInstance; } {{/isNull}} {{/vendorExtensions.x-duplicated-data-type}} @@ -92,7 +92,7 @@ { var sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,7 +103,7 @@ /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); } /// @@ -150,7 +150,7 @@ return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; {{/useCompareNetObjects}} {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); + return Equals(input as {{classname}}); {{/useCompareNetObjects}} } @@ -168,7 +168,7 @@ if (input == null) return false; - return this.ActualInstance.Equals(input.ActualInstance); + return ActualInstance.Equals(input.ActualInstance); {{/useCompareNetObjects}} } @@ -181,8 +181,8 @@ unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache index 0729bf9f582..432b6e34b8e 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache @@ -219,7 +219,9 @@ {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} + {{^supportsDateOnly}} [JsonConverter(typeof(OpenAPIDateConverter))] + {{/supportsDateOnly}} {{/isDate}} {{#deprecated}} [Obsolete] diff --git a/modules/openapi-generator/src/main/resources/csharp/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp/modelOneOf.mustache index f9c39b02cd2..ab42e4eef99 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelOneOf.mustache @@ -56,7 +56,7 @@ set { {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) { this._actualInstance = value; } 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 a7113a6cb80..7dd6228f62a 100644 --- a/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache @@ -32,27 +32,30 @@ {{/useGenericHost}} - {{#useRestSharp}} + {{#useRestSharp}} - {{/useRestSharp}} - {{#useGenericHost}} + {{/useRestSharp}} + {{#useGenericHost}} - {{#supportsRetry}} + {{#supportsRetry}} - {{/supportsRetry}} - {{#net80OrLater}} + {{/supportsRetry}} + {{#net80OrLater}} - {{/net80OrLater}} - {{#netStandard}} + {{/net80OrLater}} + {{^net60OrLater}} - {{/netStandard}} - {{/useGenericHost}} - {{^useGenericHost}} - {{#supportsRetry}} + {{#net47OrLater}} + + {{/net47OrLater}} + {{/net60OrLater}} + {{/useGenericHost}} + {{^useGenericHost}} + {{#supportsRetry}} - {{/supportsRetry}} - {{/useGenericHost}} + {{/supportsRetry}} + {{/useGenericHost}} {{#validatable}} {{^net60OrLater}} @@ -62,13 +65,17 @@ {{^useGenericHost}} + {{^net60OrLater}} + {{/net60OrLater}} {{#net48}} {{/net48}} + {{^net60OrLater}} + {{/net60OrLater}} {{#net48}} {{/net48}} diff --git a/modules/openapi-generator/src/main/resources/csharp/validatable.mustache b/modules/openapi-generator/src/main/resources/csharp/validatable.mustache index b06b98fc636..a79db1a641a 100644 --- a/modules/openapi-generator/src/main/resources/csharp/validatable.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/validatable.mustache @@ -4,7 +4,7 @@ /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -14,7 +14,7 @@ /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { {{/discriminator}} {{^discriminator}} @@ -24,7 +24,7 @@ /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -34,7 +34,7 @@ /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { {{/parent}} {{^parent}} @@ -43,7 +43,7 @@ /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { {{/parent}} {{/discriminator}} @@ -64,7 +64,7 @@ // {{{name}}} ({{{dataType}}}) maxLength if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); } {{/maxLength}} @@ -72,7 +72,7 @@ // {{{name}}} ({{{dataType}}}) minLength if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); } {{/minLength}} @@ -80,7 +80,7 @@ // {{{name}}} ({{{dataType}}}) maximum if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} > ({{{dataType}}}){{maximum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); } {{/maximum}} @@ -88,7 +88,7 @@ // {{{name}}} ({{{dataType}}}) minimum if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} < ({{{dataType}}}){{minimum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); } {{/minimum}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 1ac71181061..63b1ce28e03 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -2,6 +2,7 @@ export 'package:{{pubName}}/{{sourceFolder}}/api.dart'; export 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; export 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart'; {{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}} @@ -9,4 +10,4 @@ export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} {{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}} \ No newline at end of file +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache index 2f62fbda426..e395e876333 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache @@ -1 +1,2 @@ +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index eeeb79b5929..0b7f22f2dcb 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -15,10 +15,10 @@ publish_to: {{.}} environment: sdk: '>=2.12.0 <4.0.0' dependencies: - collection: '^1.17.0' - http: '>=0.13.0 <0.14.0' + collection: '>=1.17.0 <2.0.0' + http: '>=0.13.0 <2.0.0' intl: any - meta: '^1.1.8' + meta: '>=1.1.8 <2.0.0' dev_dependencies: test: '>=1.21.6 <1.22.0' {{#json_serializable}} diff --git a/modules/openapi-generator/src/main/resources/elixir/README.md.mustache b/modules/openapi-generator/src/main/resources/elixir/README.md.mustache index 11d51400e80..3decdbe8eb4 100644 --- a/modules/openapi-generator/src/main/resources/elixir/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/README.md.mustache @@ -18,7 +18,7 @@ your list of dependencies in `mix.exs`: ```elixir {{=<% %>=}}def deps do - [{<%#atom%><%#underscored%><%packageName%><%/underscored%><%/atom%>, "~> <%appVersion%>"}] + [{<%#atom%><%#underscored%><%packageName%><%/underscored%><%/atom%>, "~> <%packageVersion%>"}] end<%={{ }}=%> ``` diff --git a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache index 234db287ad1..6683a7a456b 100644 --- a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache @@ -225,7 +225,7 @@ defmodule {{moduleName}}.Connection do Keyword.get( tesla_options, :user_agent, - "openapi-generator - {{moduleName}} {{appVersion}} - elixir" + "openapi-generator - {{moduleName}} {{packageVersion}} - elixir" ) ) diff --git a/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache b/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache index 712c2fff3ed..967e7343940 100644 --- a/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache @@ -4,7 +4,7 @@ defmodule {{moduleName}}.Mixfile do def project do [ app: {{#atom}}{{#underscored}}{{packageName}}{{/underscored}}{{/atom}}, - version: "{{appVersion}}", + version: "{{packageVersion}}", elixir: "~> {{supportedElixirVersion}}", build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index 21cbc2ed198..4470bb93b11 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -8,7 +8,6 @@ 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: @@ -31,6 +30,8 @@ To run the server, follow these simple steps: go run main.go ``` +The server will be available on `http://localhost:{{serverPort}}`. + To run the server in a docker container ``` docker build --network=host -t {{{packageName}}} . diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 2b43d4d1b31..a5f058b8e84 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -585,18 +585,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache index 3b221d80fb6..050f8a6e48a 100644 --- a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache @@ -1,7 +1,7 @@ // {{classname}} {{{description}}}{{^description}}struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#anyOf}} - {{{.}}} *{{{.}}} + {{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} *{{{.}}} {{/anyOf}} } @@ -45,17 +45,17 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{/mappedModels}} {{/discriminator}} {{#anyOf}} - // try to unmarshal JSON data into {{{.}}} - err = json.Unmarshal(data, &dst.{{{.}}}); + // try to unmarshal JSON data into {{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} + err = json.Unmarshal(data, &dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}); if err == nil { - json{{{.}}}, _ := json.Marshal(dst.{{{.}}}) - if string(json{{{.}}}) == "{}" { // empty struct - dst.{{{.}}} = nil + json{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}, _ := json.Marshal(dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}) + if string(json{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}) == "{}" { // empty struct + dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil } else { - return nil // data stored in dst.{{{.}}}, return on the first match + return nil // data stored in dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}, return on the first match } } else { - dst.{{{.}}} = nil + dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil } {{/anyOf}} @@ -65,8 +65,8 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src *{{classname}}) MarshalJSON() ([]byte, error) { {{#anyOf}} - if src.{{{.}}} != nil { - return json.Marshal(&src.{{{.}}}) + if src.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} != nil { + return json.Marshal(&src.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}) } {{/anyOf}} diff --git a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache index 83660147cf0..3e9ee103887 100644 --- a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache @@ -93,7 +93,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { if string(json{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}) == "{}" { // empty struct dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil } else { - match++ + if err = validator.Validate(dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}); err != nil { + dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil + } else { + match++ + } } } else { dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil 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 9299b9e5b94..0d66d03c4ef 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -20,7 +20,7 @@ type {{classname}} struct { {{#deprecated}} // Deprecated {{/deprecated}} - {{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{{baseName}}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{{baseName}}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` + {{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{{baseName}}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{{baseName}}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#withValidate}} validate:"{{validate}}"{{/withValidate}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/vars}} {{#isAdditionalPropertiesTrue}} AdditionalProperties map[string]interface{} diff --git a/modules/openapi-generator/src/main/resources/go/utils.mustache b/modules/openapi-generator/src/main/resources/go/utils.mustache index 602eaf30c1d..1907ea5c1eb 100644 --- a/modules/openapi-generator/src/main/resources/go/utils.mustache +++ b/modules/openapi-generator/src/main/resources/go/utils.mustache @@ -2,7 +2,9 @@ package {{packageName}} import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -336,3 +338,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache index e910264bdd0..3ed2df43812 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache @@ -14,6 +14,7 @@ Module : {{baseModule}}.Core {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} diff --git a/modules/openapi-generator/src/main/resources/haskell-servant/haskell-servant-codegen.mustache b/modules/openapi-generator/src/main/resources/haskell-servant/haskell-servant-codegen.mustache index a55ed07ed2c..910fcf094e7 100644 --- a/modules/openapi-generator/src/main/resources/haskell-servant/haskell-servant-codegen.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-servant/haskell-servant-codegen.mustache @@ -38,12 +38,9 @@ library , http-types , swagger2 , uuid + , bytestring {{#authMethods}} -{{#isApiKey}} - , bytestring -{{/isApiKey}} {{#isBasicBearer}} - , bytestring , wai-extra {{/isBasicBearer}} {{#isBasicBasic}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache deleted file mode 100644 index ccde126f54e..00000000000 --- a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache +++ /dev/null @@ -1,19 +0,0 @@ -{{! - If this is map and items are nullable, make sure that nulls are included. - To determine what JsonInclude.Include method to use, consider the following: - * If the field is required, always include it, even if it is null. - * Else use custom behaviour, IOW use whatever is defined on the object mapper - }} - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache deleted file mode 100644 index ccde126f54e..00000000000 --- a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache +++ /dev/null @@ -1,19 +0,0 @@ -{{! - If this is map and items are nullable, make sure that nulls are included. - To determine what JsonInclude.Include method to use, consider the following: - * If the field is required, always include it, even if it is null. - * Else use custom behaviour, IOW use whatever is defined on the object mapper - }} - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache index 41afad00289..571375ebe94 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache @@ -7,15 +7,9 @@ @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) {{/isContainer}} {{/withXml}} {{#jackson}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache index f100a893156..2d05a31d159 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache @@ -48,25 +48,10 @@ Declare the class with extends and implements {{/isEnum}} public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}" - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#vendorExtensions.x-field-extra-annotation}} {{{vendorExtensions.x-field-extra-annotation}}} @@ -184,7 +169,7 @@ Declare the class with extends and implements * maximum: {{maximum}} {{/maximum}} * @return {{name}} - **/ + */ {{>common/model/beanValidation}}{{! }}{{#generateSwagger1Annotations}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache index 04566fa1167..7f2067308e2 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache @@ -1,6 +1,6 @@ {{#withXml}} -@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlRootElement({{#xmlNamespace}}namespace = "{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD) {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file +@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-msf4j-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-msf4j-server/pom.mustache index c459025164c..c5c65025d6c 100644 --- a/modules/openapi-generator/src/main/resources/java-msf4j-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-msf4j-server/pom.mustache @@ -96,7 +96,7 @@ ${java.version} ${java.version} 4.0.4 - 2.15.2 + 2.17.1 {{#useJakartaEe}} 2.1.1 {{/useJakartaEe}} diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/model.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/model.mustache index 7a71d8c0720..2d287ef5e7c 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/model.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/model.mustache @@ -15,6 +15,7 @@ import {{javaxPackage}}.validation.constraints.*; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; {{/withXml}} {{/jackson}} {{#withXml}} diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache index f9161d58c58..39ba1ad15c6 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache @@ -21,8 +21,13 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isContainer}} {{/isEnum}} {{#jackson}} - @JsonProperty("{{baseName}}"){{#withXml}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}} + @JsonProperty("{{baseName}}") + {{#withXml}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} + {{/withXml}} {{/jackson}} {{#gson}} @SerializedName("{{baseName}}") @@ -62,7 +67,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{/isMap}} - /** + /** {{#description}} * {{{.}}} {{/description}} @@ -76,7 +81,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens * maximum: {{.}} {{/maximum}} * @return {{name}} - **/ + */ {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} 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 77db3bd6efa..4511ccee5a3 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.12.Final + 2.3.14.Final 2.2.0 4.5.13 4.1.2 diff --git a/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache b/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache index 56b48b17eb8..63a1962eee0 100644 --- a/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/jetbrains-http-client/api.mustache @@ -5,13 +5,16 @@ {{#vendorExtensions.requests}} ### {{#summary}}{{summary}}{{/summary}} ## {{name}} -{{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{path}}{{/lambda.doubleMustache}}{{#authMethods}}{{#isKeyInQuery}}?{{keyParamName}}={{#lambda.doubleMustache}}{queryKey}{{/lambda.doubleMustache}}{{/isKeyInQuery}}{{/authMethods}} +{{httpMethod}} {{basePath}}{{#lambda.doubleMustache}}{{path}}{{/lambda.doubleMustache}}{{>queryParams}} {{#consumes}} Content-Type: {{{mediaType}}} {{/consumes}} {{#produces}} Accept: {{{mediaType}}} {{/produces}} +{{#headerParams}} +{{baseName}}: {{=<% %>=}}{{<%paramName%>}}<%={{ }}=%> +{{/headerParams}} {{#vendorExtensions.customHeaders}} {{{.}}} {{/vendorExtensions.customHeaders}} diff --git a/modules/openapi-generator/src/main/resources/jetbrains-http-client/http-client.template.env.mustache b/modules/openapi-generator/src/main/resources/jetbrains-http-client/http-client.template.env.mustache new file mode 100644 index 00000000000..2da1302cbec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/jetbrains-http-client/http-client.template.env.mustache @@ -0,0 +1,7 @@ +{ + "dev": { +{{#vendorExtensionsVariables}} + "{{.}}" : ""{{^-last}},{{/-last}} +{{/vendorExtensionsVariables}} + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/jetbrains-http-client/queryParams.mustache b/modules/openapi-generator/src/main/resources/jetbrains-http-client/queryParams.mustache new file mode 100644 index 00000000000..6b4aae0c52e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/jetbrains-http-client/queryParams.mustache @@ -0,0 +1 @@ +{{! Case where there is no query params, auth does everything}}{{^queryParams}}{{#authMethods}}{{#isKeyInQuery}}?{{keyParamName}}={{#lambda.doubleMustache}}{queryKey}{{/lambda.doubleMustache}}{{/isKeyInQuery}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{! If there are query params, auth has no logic}}{{#-first}}?{{/-first}}{{paramName}}={{=<% %>=}}{{<%paramName%>}}<%={{ }}=%>{{^-last}}&{{/-last}}{{#-last}}{{#authMethods}}{{#isKeyInQuery}}&{{keyParamName}}={{#lambda.doubleMustache}}{queryKey}{{/lambda.doubleMustache}}{{/isKeyInQuery}}{{/authMethods}}{{/-last}}{{/queryParams}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/julia-client/api.mustache b/modules/openapi-generator/src/main/resources/julia-client/api.mustache index c56a5cc8620..3881e7b5d59 100644 --- a/modules/openapi-generator/src/main/resources/julia-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-client/api.mustache @@ -51,7 +51,7 @@ function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#requir OpenAPI.Clients.set_param(_ctx.path, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} {{/pathParams}} {{#queryParams}} - OpenAPI.Clients.set_param(_ctx.query, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} + OpenAPI.Clients.set_param(_ctx.query, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}; style="{{style}}", is_explode={{isExplode}}{{#isListContainer}},collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} {{/queryParams}} {{#headerParams}} OpenAPI.Clients.set_param(_ctx.header, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} diff --git a/modules/openapi-generator/src/main/resources/julia-server/api.mustache b/modules/openapi-generator/src/main/resources/julia-server/api.mustache index 8d98de8e7f2..e65bb670f8e 100644 --- a/modules/openapi-generator/src/main/resources/julia-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-server/api.mustache @@ -8,7 +8,7 @@ function {{operationId}}_read(handler) path_params = HTTP.getparams(req){{#pathParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, path_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/pathParams}}{{/hasPathParams}}{{#hasQueryParams}} query_params = HTTP.queryparams(URIs.URI(req.target)){{#queryParams}} - openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, query_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, query_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}style="{{style}}", is_explode={{isExplode}}{{#isListContainer}},collection_format="{{collectionFormat}}"{{/isListContainer}}){{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} headers = Dict{String,String}(HTTP.headers(req)){{#headerParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, headers, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/headerParams}}{{/hasHeaderParams}}{{#hasBodyParam}}{{#bodyParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param_type({{dataType}}, String(req.body)){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/k6/script.mustache b/modules/openapi-generator/src/main/resources/k6/script.mustache index fe21844d837..fd45a84781f 100644 --- a/modules/openapi-generator/src/main/resources/k6/script.mustache +++ b/modules/openapi-generator/src/main/resources/k6/script.mustache @@ -30,7 +30,13 @@ export default function() { let body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; {{/body}} {{#params}} - let params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; + let params = {{#params}}{{=<% %>=}}{ + headers: { + <%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%> + }<%#hasCookie%>, cookies: { + <%# cookies%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/cookies%> + }<%/hasCookie%><%# auth%>, auth: "<%& auth%>"<%/auth%> + }<%={{ }}=%>{{/params}}; {{/params}} {{#isDelete}} {{#params}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache index 3835db56073..5d4f0e1cdf8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache @@ -59,9 +59,9 @@ This runs all tests and packages the library. All URIs are relative to *{{{basePath}}}* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}| *{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} {{/generateApiDocs}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache new file mode 100644 index 00000000000..a745e7745f0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache @@ -0,0 +1,241 @@ +{{^multiplatform}} +{{#gson}} +{{#generateOneOfAnyOfWrappers}} +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +{{/generateOneOfAnyOfWrappers}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass +{{/moshi}} +{{#jackson}} +{{#enumUnknownDefaultCase}} +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +{{/enumUnknownDefaultCase}} +import com.fasterxml.jackson.annotation.JsonProperty +{{#discriminator}} +import com.fasterxml.jackson.annotation.JsonSubTypes +import com.fasterxml.jackson.annotation.JsonTypeInfo +{{/discriminator}} +{{/jackson}} +{{#kotlinx_serialization}} +import {{#serializableModel}}kotlinx.serialization.Serializable as KSerializable{{/serializableModel}}{{^serializableModel}}kotlinx.serialization.Serializable{{/serializableModel}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +{{#enumUnknownDefaultCase}} +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +{{/enumUnknownDefaultCase}} +{{#hasEnums}} +{{/hasEnums}} +{{/kotlinx_serialization}} +{{#parcelizeModels}} +import android.os.Parcelable +import kotlinx.parcelize.Parcelize +{{/parcelizeModels}} +{{/multiplatform}} +{{#multiplatform}} +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +{{/multiplatform}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} +{{#generateRoomModels}} +import {{roomModelPackage}}.{{classname}}RoomModel +import {{packageName}}.infrastructure.ITransformForStorage +{{/generateRoomModels}} +import java.io.IOException + +/** + * {{{description}}} + * + */ +{{#parcelizeModels}} +@Parcelize +{{/parcelizeModels}} +{{#multiplatform}}{{^discriminator}}@Serializable{{/discriminator}}{{/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}}{{/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}{{#jackson}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{/jackson}} +{{#isDeprecated}} +@Deprecated(message = "This schema is deprecated.") +{{/isDeprecated}} +{{>additionalModelTypeAnnotations}} +{{#nonPublicApi}}internal {{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!{{classname}}::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes '{{classname}}' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + {{#composedSchemas}} + {{#anyOf}} + {{^isArray}} + {{^vendorExtensions.x-duplicated-data-type}} + val adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}::class.java)) + {{/vendorExtensions.x-duplicated-data-type}} + {{/isArray}} + {{#isArray}} + @Suppress("UNCHECKED_CAST") + val adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = gson.getDelegateAdapter(this, TypeToken.get(object : TypeToken<{{{dataType}}}>() {}.type)) as TypeAdapter<{{{dataType}}}> + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter<{{classname}}?>() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: {{classname}}?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.actualInstance is {{#isArray}}List<*>{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isArray}} + val list = value.actualInstance as List + if (list.get(0) is {{{items.dataType}}}) { + val array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(value.actualInstance as {{{dataType}}}?).getAsJsonArray() + elementAdapter.write(out, array) + return + } + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + val primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(value.actualInstance as {{{dataType}}}?).getAsJsonPrimitive() + elementAdapter.write(out, primitive) + return + {{/isPrimitiveType}} + {{^isPrimitiveType}} + val element = adapter{{{dataType}}}.toJsonTree(value.actualInstance as {{{dataType}}}?) + elementAdapter.write(out, element) + return + {{/isPrimitiveType}} + {{/isArray}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): {{classname}} { + val jsonElement = elementAdapter.read(jsonReader) + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> + val ret = {{classname}}() + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{#isNumber}} + require(jsonElement.getAsJsonPrimitive().isNumber()) { + String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()) + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + require(jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString()) + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement) + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + require(jsonElement.isJsonArray) { + String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString()) + } + + // validate array items + for(element in jsonElement.getAsJsonArray()) { + {{#items}} + {{#isNumber}} + require(jsonElement.getAsJsonPrimitive().isNumber) { + String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()) + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + require(element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}) { + 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}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + {{/isArray}} + //log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e) + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement) + log.log(Level.FINER, "Input data matches schema '{{{.}}}'") + actualAdapter = adapter{{.}} + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e) + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + throw IOException(String.format("Failed deserialization for {{classname}}: no schema match result. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache index 5104b96904e..16eafac78f4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache @@ -3,9 +3,9 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -42,10 +42,15 @@ try { ``` ### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{^allParams}} +This endpoint does not need any parameter. +{{/allParams}} +{{#allParams}} +{{#-last}} +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +{{/-last}} +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type @@ -84,4 +89,4 @@ Configure {{name}}: - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} {{/operation}} -{{/operations}} +{{/operations}} \ No newline at end of file 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 8d6b5c9733f..1dfe6fd0636 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 @@ -137,8 +137,8 @@ dependencies { {{/gson}} {{#jackson}} 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" {{/jackson}} {{#kotlinx_serialization}} implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3" @@ -155,9 +155,6 @@ dependencies { implementation "io.ktor:ktor-serialization-jackson:$ktor_version" {{/jackson}} {{/jvm-ktor}} - {{#jvm-okhttp3}} - implementation "com.squareup.okhttp3:okhttp:3.14.9" - {{/jvm-okhttp3}} {{#jvm-okhttp4}} implementation "com.squareup.okhttp3:okhttp:4.12.0" {{/jvm-okhttp4}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache index b6b482afb78..6ab282918f3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache @@ -1,15 +1,15 @@ # {{classname}} ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +{{#vars}}| **{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | {{/vars}} {{#vars}}{{#isEnum}} {{!NOTE: see java's resources "pojo_doc.mustache" once enums are fully implemented}} ## Enum: {{baseName}} -Name | Value ----- | -----{{#allowableValues}} -{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +| Name | Value | +| ---- | ----- |{{#allowableValues}} +| {{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} | {{/isEnum}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index 6135a50b0e0..9290173fd6b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -1,5 +1,16 @@ {{^multiplatform}} {{#gson}} +{{#generateOneOfAnyOfWrappers}} +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException +{{/generateOneOfAnyOfWrappers}} import com.google.gson.annotations.SerializedName {{/gson}} {{#moshi}} @@ -128,7 +139,9 @@ import {{packageName}}.infrastructure.ITransformForStorage {{/multiplatform}} {{/enumVars}} {{/allowableValues}} - }{{#kotlinx_serialization}}{{#enumUnknownDefaultCase}} + } + {{#kotlinx_serialization}} + {{#enumUnknownDefaultCase}} @Serializer(forClass = {{{nameInPascalCase}}}::class) internal object {{nameInPascalCase}}Serializer : KSerializer<{{nameInPascalCase}}> { @@ -143,10 +156,208 @@ import {{packageName}}.infrastructure.ITransformForStorage override fun serialize(encoder: Encoder, value: {{nameInPascalCase}}) { encoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) } - }{{/enumUnknownDefaultCase}}{{/kotlinx_serialization}} + } + {{/enumUnknownDefaultCase}} + {{/kotlinx_serialization}} {{/isEnum}} {{/vars}} {{/hasEnums}} +{{#generateOneOfAnyOfWrappers}} + {{#gson}} + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!{{classname}}::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes '{{classname}}' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get({{classname}}::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter<{{classname}}>() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: {{classname}}) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): {{classname}} { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + {{#allVars}} + {{#-first}} + // a set of all properties/fields (JSON key names) + {{/-first}} + openapiFields.add("{{baseName}}") + {{/allVars}} + + {{#requiredVars}} + {{#-first}} + // a set of required properties/fields (JSON key names) + {{/-first}} + openapiRequiredFields.add("{{baseName}}") + {{/requiredVars}} + } + + /** + * 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 {{classname}} + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString()) + } + } + {{^hasChildren}} + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (requiredField in openapiRequiredFields) { + requireNotNull(jsonElement!!.getAsJsonObject()[requiredField]) { + String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()) + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#hasVars}} + val jsonObj = jsonElement!!.getAsJsonObject() + {{/hasVars}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + {{#required}} + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray) { + throw IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString())) + } + + // validate the required field `{{{baseName}}}` (array) + for (i in 0 until jsonObj.getAsJsonArray("{{{baseName}}}").size()) { + {{{items.dataType}}}.validateJsonElement(jsonObj.getAsJsonArray("{{{baseName}}}").get(i)) + } + {{/required}} + {{^required}} + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + if (jsonObj.getAsJsonArray("{{{baseName}}}") != null) { + // ensure the json data is an array + require(jsonObj["{{{baseName}}}"].isJsonArray) { + String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + + // validate the optional field `{{{baseName}}}` (array) + for (i in 0 until jsonObj.getAsJsonArray("{{{baseName}}}").size()) { + {{{items.dataType}}}.validateJsonElement(jsonObj.getAsJsonArray("{{{baseName}}}").get(i)) + } + } + } + {{/required}} + {{/items.isModel}} + {{^items.isModel}} + {{^required}} + // ensure the optional json data is an array if present + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + require(jsonObj["{{{baseName}}}"].isJsonArray()) { + String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + } + {{/required}} + {{#required}} + // ensure the required json array is present + requireNotNull(jsonObj["{{{baseName}}}"]) { + "Expected the field `{{{baseName}}}` to be an array in the JSON string but got `null`" + } + require(jsonObj["{{{baseName}}}"].isJsonArray()) { + String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + {{/required}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isString}} + {{#notRequiredOrIsNullable}} + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + require(jsonObj.get("{{{baseName}}}").isJsonPrimitive) { + String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + } + {{/notRequiredOrIsNullable}} + {{^notRequiredOrIsNullable}} + require(jsonObj["{{{baseName}}}"].isJsonPrimitive) { + String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + {{/notRequiredOrIsNullable}} + {{/isString}} + {{#isModel}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj["{{{baseName}}}"]) + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + {{{dataType}}}.validateJsonElement(jsonObj["{{{baseName}}}"]) + } + {{/required}} + {{/isModel}} + {{#isEnum}} + {{#required}} + // validate the required field `{{{baseName}}}` + require({{{datatypeWithEnum}}}.values().any { it.value == jsonObj["{{{baseName}}}"].asString }) { + String.format("Expected the field `{{{baseName}}}` to be valid `{{{datatypeWithEnum}}}` enum value in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + require({{{datatypeWithEnum}}}.values().any { it.value == jsonObj["{{{baseName}}}"].asString }) { + String.format("Expected the field `{{{baseName}}}` to be valid `{{{datatypeWithEnum}}}` enum value in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + } + {{/required}} + {{/isEnum}} + {{#isEnumRef}} + {{#required}} + // validate the required field `{{{baseName}}}` + require({{{dataType}}}.values().any { it.value == jsonObj["{{{baseName}}}"].asString }) { + String.format("Expected the field `{{{baseName}}}` to be valid `{{{dataType}}}` enum value in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj["{{{baseName}}}"] != null && !jsonObj["{{{baseName}}}"].isJsonNull) { + require({{{dataType}}}.values().any { it.value == jsonObj["{{{baseName}}}"].asString }) { + String.format("Expected the field `{{{baseName}}}` to be valid `{{{dataType}}}` enum value in the JSON string but got `%s`", jsonObj["{{{baseName}}}"].toString()) + } + } + {{/required}} + {{/isEnumRef}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + } + } + {{/gson}} +{{/generateOneOfAnyOfWrappers}} + {{#vendorExtensions.x-has-data-class-body}} } {{/vendorExtensions.x-has-data-class-body}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index 1b328da49ea..1609fa8656e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index 4a31e0d01ed..3c9387d1015 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 7a436279e40..3e3199c5804 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -68,20 +68,20 @@ import {{packageName}}.infrastructure.toMultiValue {{#enumVars}} {{^multiplatform}} {{#moshi}} - @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/moshi}} {{#gson}} - @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/gson}} {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/jackson}} {{#kotlinx_serialization}} - @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/kotlinx_serialization}} {{/multiplatform}} {{#multiplatform}} - @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/multiplatform}} {{/enumVars}} {{/allowableValues}} @@ -89,28 +89,35 @@ import {{packageName}}.infrastructure.toMultiValue {{#enumUnknownDefaultCase}} {{#allowableValues}} {{#enumVars}} - {{^-last}} {{^multiplatform}} {{#moshi}} - @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/moshi}} {{#gson}} - @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/gson}} {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/jackson}} {{#kotlinx_serialization}} - @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/kotlinx_serialization}} {{/multiplatform}} {{#multiplatform}} - @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/multiplatform}} - {{/-last}} {{/enumVars}} {{/allowableValues}} {{/enumUnknownDefaultCase}} + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } {{/isEnum}} @@ -190,7 +197,7 @@ import {{packageName}}.infrastructure.toMultiValue }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{! }}{{#hasFormParams}}mapOf({{#formParams}} - "{{#lambda.escapeDollar}}{{{baseName}}}{{/lambda.escapeDollar}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! + "{{#lambda.escapeDollar}}{{{baseName}}}{{/lambda.escapeDollar}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! }}{{/formParams}}){{/hasFormParams}}{{! }}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() @@ -225,7 +232,7 @@ import {{packageName}}.infrastructure.toMultiValue return RequestConfig( method = RequestMethod.{{httpMethod}}, - path = "{{path}}"{{#pathParams}}.replace("{"+"{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}}, + path = "{{path}}"{{#pathParams}}.replace("{"+"{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}, @@ -236,6 +243,6 @@ import {{packageName}}.infrastructure.toMultiValue {{/operation}} private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String = - HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments{{#jvm-okhttp3}}(){{/jvm-okhttp3}}[0] + HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0] } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 025d8b908bb..7b691594659 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -5,36 +5,19 @@ import android.os.Build {{/supportAndroidApiLevel25AndBelow}} import okhttp3.OkHttpClient import okhttp3.RequestBody -{{#jvm-okhttp3}} -import okhttp3.MediaType -{{/jvm-okhttp3}} -{{#jvm-okhttp4}} import okhttp3.RequestBody.Companion.asRequestBody import okhttp3.RequestBody.Companion.toRequestBody -{{/jvm-okhttp4}} import okhttp3.FormBody -{{#jvm-okhttp3}} -import okhttp3.HttpUrl -{{/jvm-okhttp3}} -{{#jvm-okhttp4}} import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -{{/jvm-okhttp4}} import okhttp3.ResponseBody -{{#jvm-okhttp4}} import okhttp3.MediaType.Companion.toMediaTypeOrNull -{{/jvm-okhttp4}} import okhttp3.Request import okhttp3.Headers -{{#jvm-okhttp4}} import okhttp3.Headers.Companion.toHeaders -{{/jvm-okhttp4}} import okhttp3.MultipartBody import okhttp3.Call import okhttp3.Callback import okhttp3.Response -{{#jvm-okhttp3}} -import okhttp3.internal.Util.EMPTY_REQUEST -{{/jvm-okhttp3}} import java.io.BufferedWriter import java.io.File import java.io.FileWriter @@ -48,6 +31,7 @@ import java.time.OffsetDateTime import java.time.OffsetTime {{/threetenbp}} import java.util.Locale +import java.util.regex.Pattern {{#useCoroutines}} import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException @@ -74,9 +58,7 @@ import com.fasterxml.jackson.core.type.TypeReference import com.squareup.moshi.adapter {{/moshi}} -{{#jvm-okhttp4}} -{{#nonPublicApi}}internal {{/nonPublicApi}} val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() -{{/jvm-okhttp4}} +{{#nonPublicApi}}internal {{/nonPublicApi}}val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() {{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { @@ -118,12 +100,7 @@ import com.squareup.moshi.adapter protected inline fun requestBody(content: T, mediaType: String?): RequestBody = when { - {{#jvm-okhttp3}} - content is File -> RequestBody.create(MediaType.parse(mediaType ?: guessContentTypeFromFile(content)), content) - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} content is File -> content.asRequestBody((mediaType ?: guessContentTypeFromFile(content)).toMediaTypeOrNull()) - {{/jvm-okhttp4}} mediaType == FormDataMediaType -> MultipartBody.Builder() .setType(MultipartBody.FORM) @@ -134,35 +111,18 @@ import com.squareup.moshi.adapter if (part.body is File) { val partHeaders = part.headers.toMutableMap() + ("Content-Disposition" to "form-data; name=\"$name\"; filename=\"${part.body.name}\"") - {{#jvm-okhttp3}} - val fileMediaType = MediaType.parse(guessContentTypeFromFile(part.body)) - addPart( - Headers.of(partHeaders), - RequestBody.create(fileMediaType, part.body) - ) - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} val fileMediaType = guessContentTypeFromFile(part.body).toMediaTypeOrNull() addPart( partHeaders.toHeaders(), part.body.asRequestBody(fileMediaType) ) - {{/jvm-okhttp4}} } else { val partHeaders = part.headers.toMutableMap() + ("Content-Disposition" to "form-data; name=\"$name\"") - {{#jvm-okhttp3}} - addPart( - Headers.of(partHeaders), - RequestBody.create(null, parameterToString(part.body)) - ) - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} addPart( partHeaders.toHeaders(), parameterToString(part.body).toRequestBody(null) ) - {{/jvm-okhttp4}} } } }.build() @@ -176,27 +136,6 @@ import com.squareup.moshi.adapter }.build() } mediaType == null || mediaType.startsWith("application/") && mediaType.endsWith("json") -> - {{#jvm-okhttp3}} - if (content == null) { - EMPTY_REQUEST - } else { - RequestBody.create( - {{#moshi}} - MediaType.parse(mediaType ?: JsonMediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - {{/moshi}} - {{#gson}} - MediaType.parse(mediaType ?: JsonMediaType), Serializer.gson.toJson(content, T::class.java) - {{/gson}} - {{#jackson}} - MediaType.parse(mediaType ?: JsonMediaType), Serializer.jacksonObjectMapper.writeValueAsString(content) - {{/jackson}} - {{#kotlinx_serialization}} - MediaType.parse(mediaType ?: JsonMediaType), Serializer.kotlinxSerializationJson.encodeToString(content) - {{/kotlinx_serialization}} - ) - } - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} if (content == null) { EMPTY_REQUEST } else { @@ -214,15 +153,9 @@ import com.squareup.moshi.adapter {{/kotlinx_serialization}} .toRequestBody((mediaType ?: JsonMediaType).toMediaTypeOrNull()) } - {{/jvm-okhttp4}} mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") mediaType == OctetMediaType && content is ByteArray -> - {{#jvm-okhttp3}} - RequestBody.create(MediaType.parse(OctetMediaType), content) - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} content.toRequestBody(OctetMediaType.toMediaTypeOrNull()) - {{/jvm-okhttp4}} // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } @@ -230,22 +163,60 @@ import com.squareup.moshi.adapter {{#moshi}} @OptIn(ExperimentalStdlibApi::class) {{/moshi}} - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + {{^supportAndroidApiLevel25AndBelow}} // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.{{packageName}}", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() {{/supportAndroidApiLevel25AndBelow}} {{#supportAndroidApiLevel25AndBelow}} val tempFile = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - java.nio.file.Files.createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null).toFile() + java.nio.file.Files.createTempFile(prefix, suffix).toFile() } else { @Suppress("DEPRECATION") - createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null) + createTempFile(prefix, suffix) } {{/supportAndroidApiLevel25AndBelow}} tempFile.deleteOnExit() @@ -337,12 +308,7 @@ import com.squareup.moshi.adapter {{/hasAuthMethods}} protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiResponse { - {{#jvm-okhttp3}} - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - {{/jvm-okhttp3}} - {{#jvm-okhttp4}} val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - {{/jvm-okhttp4}} {{#hasAuthMethods}} // take authMethod from operation @@ -413,33 +379,35 @@ import com.squareup.moshi.adapter // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.headers{{#jvm-okhttp3}}(){{/jvm-okhttp3}}.toMultimap() - ) - response.isInformational -> Informational( - response.message{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.headers{{#jvm-okhttp3}}(){{/jvm-okhttp3}}.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, accept), - response.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.headers{{#jvm-okhttp3}}(){{/jvm-okhttp3}}.toMultimap() - ) - response.isClientError -> ClientError( - response.message{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.body{{#jvm-okhttp3}}(){{/jvm-okhttp3}}?.string(), - response.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.headers{{#jvm-okhttp3}}(){{/jvm-okhttp3}}.toMultimap() - ) - else -> ServerError( - response.message{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.body{{#jvm-okhttp3}}(){{/jvm-okhttp3}}?.string(), - response.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}}, - response.headers{{#jvm-okhttp3}}(){{/jvm-okhttp3}}.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache index d301ca6f23d..8bf8d157f6c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache @@ -5,20 +5,20 @@ import okhttp3.Response /** * Provides an extension to evaluation whether the response is a 1xx code */ -{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isInformational : Boolean get() = this.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}} in 100..199 +{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isInformational : Boolean get() = this.code in 100..199 /** * Provides an extension to evaluation whether the response is a 3xx code */ @Suppress("EXTENSION_SHADOWED_BY_MEMBER") -{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isRedirect : Boolean get() = this.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}} in 300..399 +{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isRedirect : Boolean get() = this.code in 300..399 /** * Provides an extension to evaluation whether the response is a 4xx code */ -{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isClientError : Boolean get() = this.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}} in 400..499 +{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isClientError : Boolean get() = this.code in 400..499 /** * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code */ -{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isServerError : Boolean get() = this.code{{#jvm-okhttp3}}(){{/jvm-okhttp3}} in 500..999 +{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isServerError : Boolean get() = this.code in 500..999 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 d99122333d6..4381539414c 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 @@ -69,7 +69,7 @@ import okhttp3.MultipartBody {{/isMultipart}} {{/x-kotlin-multipart-import}} -interface {{classname}} { +{{#nonPublicApi}}internal {{/nonPublicApi}}interface {{classname}} { {{#operation}} {{#allParams}} {{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache index 3c83a2edec6..f764206df12 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache @@ -3,9 +3,9 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -48,10 +48,15 @@ launch(Dispatchers.IO) { ``` ### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{^allParams}} +This endpoint does not need any parameter. +{{/allParams}} +{{#allParams}} +{{#-last}} +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +{{/-last}} +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type 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 1683b45e2ea..a10257b657f 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 @@ -64,9 +64,9 @@ import okhttp3.MediaType.Companion.toMediaType private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, {{^kotlinx_serialization}} - private val serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}}, + private val serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = {{#generateOneOfAnyOfWrappers}}{{#gson}}registerTypeAdapterFactoryForAllModels({{/gson}}{{/generateOneOfAnyOfWrappers}}Serializer.{{#gson}}gsonBuilder{{/gson}}{{#generateOneOfAnyOfWrappers}}{{#gson}}){{/gson}}{{/generateOneOfAnyOfWrappers}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}}, {{/kotlinx_serialization}} - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( {{#useRxJava}} RxJavaCallAdapterFactory.create(), @@ -148,6 +148,21 @@ import okhttp3.MediaType.Companion.toMediaType addAuthorization(authName, auth) } } + {{#generateOneOfAnyOfWrappers}} + {{^kotlinx_serialization}} + {{#gson}} + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + serializerBuilder.registerTypeAdapterFactory({{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + {{/gson}} + {{/kotlinx_serialization}} + {{/generateOneOfAnyOfWrappers}} } {{#authMethods}} @@ -238,9 +253,9 @@ import okhttp3.MediaType.Companion.toMediaType {{/hasAuthMethods}} {{#hasOAuthMethods}} /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -250,9 +265,9 @@ import okhttp3.MediaType.Companion.toMediaType } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -262,10 +277,10 @@ import okhttp3.MediaType.Companion.toMediaType } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -274,12 +289,12 @@ import okhttp3.MediaType.Companion.toMediaType } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -294,10 +309,10 @@ import okhttp3.MediaType.Companion.toMediaType } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -331,6 +346,20 @@ import okhttp3.MediaType.Companion.toMediaType return retrofitBuilder.callFactory(usedCallFactory).build().create(serviceClass) } + {{#generateOneOfAnyOfWrappers}} + {{^kotlinx_serialization}} + {{#gson}} + /** + * Gets the serializer builder. + * @return serial builder + */ + fun getSerializerBuilder(): GsonBuilder { + return serializerBuilder + } + + {{/gson}} + {{/kotlinx_serialization}} + {{/generateOneOfAnyOfWrappers}} private fun normalizeBaseUrl() { if (!baseUrl.endsWith("/")) { baseUrl += "/" @@ -339,7 +368,7 @@ import okhttp3.MediaType.Companion.toMediaType private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } @@ -356,3 +385,28 @@ import okhttp3.MediaType.Companion.toMediaType } } } +{{#generateOneOfAnyOfWrappers}} +{{^kotlinx_serialization}} +{{#gson}} + +/** + * Registers all models with the type adapter factory. + * + * @param gsonBuilder gson builder + * @return GSON builder + */ +fun registerTypeAdapterFactoryForAllModels(gsonBuilder: GsonBuilder): GsonBuilder { + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + gsonBuilder.registerTypeAdapterFactory({{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + return gsonBuilder +} +{{/gson}} +{{/kotlinx_serialization}} +{{/generateOneOfAnyOfWrappers}} 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 7af6f39c4eb..1c533aae70a 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 @@ -92,7 +92,7 @@ import {{packageName}}.infrastructure.* }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{! }}{{#hasFormParams}}mapOf({{#formParams}} - "{{{baseName}}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! + "{{{baseName}}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! }}{{/formParams}}){{/hasFormParams}}{{! }}{{/hasBodyParam}} val localVariableQuery = {{^hasQueryParams}}mutableMapOf>() @@ -127,7 +127,7 @@ import {{packageName}}.infrastructure.* val params = mutableMapOf( {{#pathParams}} - "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{/isContainer}}, + "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, {{/pathParams}} ) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache index 875a0fe7538..55639746351 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache @@ -94,7 +94,7 @@ import {{packageName}}.infrastructure.* }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{! }}{{#hasFormParams}}mapOf({{#formParams}} - "{{{baseName}}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! + "{{{baseName}}}" to PartConfig(body = {{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}, headers = mutableMapOf({{#contentType}}"Content-Type" to "{{contentType}}"{{/contentType}})),{{! }}{{/formParams}}){{/hasFormParams}}{{! }}{{/hasBodyParam}} val localVariableQuery = {{^hasQueryParams}}mutableMapOf>() @@ -129,7 +129,7 @@ import {{packageName}}.infrastructure.* val params = mutableMapOf( {{#pathParams}} - "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{/isContainer}}, + "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, {{/pathParams}} ) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache index ab300fe3134..c84f15f0b3f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache @@ -136,7 +136,7 @@ import {{packageName}}.infrastructure.* {{/isDeprecated}} fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : Future> { val vertxClient = WebClient.create(vertx) - val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}})) + val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}})) {{#hasFormParams}}request.putHeader("Content-Type", {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}){{/hasFormParams}} {{#headerParams}}{{{paramName}}}{{^required}}?{{/required}}.apply { request.putHeader("{{baseName}}", {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}})}{{/headerParams}} @@ -150,7 +150,7 @@ import {{packageName}}.infrastructure.* {{#hasFormParams}} val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); {{#formParams}} - {{{paramName}}}{{^required}}?{{/required}}.let { form.add("{{{baseName}}}", {{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{^isString}}.toString(){{/isString}}) } + {{{paramName}}}{{^required}}?{{/required}}.let { form.add("{{{baseName}}}", {{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{^isString}}.toString(){{/isString}}) } {{/formParams}} {{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model.mustache index abd168abce8..831a0e79b93 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model.mustache @@ -6,6 +6,11 @@ package {{modelPackage}} {{#models}} {{#model}} +{{^generateOneOfAnyOfWrappers}} {{#isEnum}}{{>enum_class}}{{/isEnum}}{{^isEnum}}{{#isAlias}}typealias {{classname}} = {{{dataType}}}{{/isAlias}}{{^isAlias}}{{>data_class}}{{/isAlias}}{{/isEnum}} +{{/generateOneOfAnyOfWrappers}} +{{#generateOneOfAnyOfWrappers}} +{{#isEnum}}{{>enum_class}}{{/isEnum}}{{^isEnum}}{{#isAlias}}typealias {{classname}} = {{{dataType}}}{{/isAlias}}{{^isAlias}}{{#oneOf}}{{#-first}}{{>oneof_class}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>anyof_class}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>data_class}}{{/anyOf}}{{/oneOf}}{{/isAlias}}{{/isEnum}} +{{/generateOneOfAnyOfWrappers}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache new file mode 100644 index 00000000000..eebf9858773 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache @@ -0,0 +1,239 @@ +{{^multiplatform}} +{{#gson}} +{{#generateOneOfAnyOfWrappers}} +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +{{/generateOneOfAnyOfWrappers}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass +{{/moshi}} +{{#jackson}} +{{#enumUnknownDefaultCase}} +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +{{/enumUnknownDefaultCase}} +import com.fasterxml.jackson.annotation.JsonProperty +{{#discriminator}} +import com.fasterxml.jackson.annotation.JsonSubTypes +import com.fasterxml.jackson.annotation.JsonTypeInfo +{{/discriminator}} +{{/jackson}} +{{#kotlinx_serialization}} +import {{#serializableModel}}kotlinx.serialization.Serializable as KSerializable{{/serializableModel}}{{^serializableModel}}kotlinx.serialization.Serializable{{/serializableModel}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +{{#enumUnknownDefaultCase}} +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +{{/enumUnknownDefaultCase}} +{{#hasEnums}} +{{/hasEnums}} +{{/kotlinx_serialization}} +{{#parcelizeModels}} +import android.os.Parcelable +import kotlinx.parcelize.Parcelize +{{/parcelizeModels}} +{{/multiplatform}} +{{#multiplatform}} +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* +{{/multiplatform}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} +{{#generateRoomModels}} +import {{roomModelPackage}}.{{classname}}RoomModel +import {{packageName}}.infrastructure.ITransformForStorage +{{/generateRoomModels}} +import java.io.IOException + +/** + * {{{description}}} + * + */ +{{#parcelizeModels}} +@Parcelize +{{/parcelizeModels}} +{{#multiplatform}}{{^discriminator}}@Serializable{{/discriminator}}{{/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}}{{/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}{{#jackson}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{/jackson}} +{{#isDeprecated}} +@Deprecated(message = "This schema is deprecated.") +{{/isDeprecated}} +{{>additionalModelTypeAnnotations}} +{{#nonPublicApi}}internal {{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!{{classname}}::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes '{{classname}}' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + {{#composedSchemas}} + {{#oneOf}} + {{^isArray}} + {{^vendorExtensions.x-duplicated-data-type}} + val adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}::class.java)) + {{/vendorExtensions.x-duplicated-data-type}} + {{/isArray}} + {{#isArray}} + @Suppress("UNCHECKED_CAST") + val adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = gson.getDelegateAdapter(this, TypeToken.get(object : TypeToken<{{{dataType}}}>() {}.type)) as TypeAdapter<{{{dataType}}}> + {{/isArray}} + {{/oneOf}} + {{/composedSchemas}} + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter<{{classname}}?>() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: {{classname}}?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.actualInstance is {{#isArray}}List<*>{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isArray}} + val list = value.actualInstance as List + if (list.get(0) is {{{items.dataType}}}) { + val array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(value.actualInstance as {{{dataType}}}?).getAsJsonArray() + elementAdapter.write(out, array) + return + } + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + val primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(value.actualInstance as {{{dataType}}}?).getAsJsonPrimitive() + elementAdapter.write(out, primitive) + return + {{/isPrimitiveType}} + {{^isPrimitiveType}} + val element = adapter{{{dataType}}}.toJsonTree(value.actualInstance as {{{dataType}}}?) + elementAdapter.write(out, element) + return + {{/isPrimitiveType}} + {{/isArray}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): {{classname}} { + val jsonElement = elementAdapter.read(jsonReader) + var match = 0 + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> = elementAdapter + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{#isNumber}} + require(jsonElement.getAsJsonPrimitive().isNumber()) { + String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()) + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + require(jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString()) + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement) + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + require(jsonElement.isJsonArray) { + String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString()) + } + + // validate array items + for(element in jsonElement.getAsJsonArray()) { + {{#items}} + {{#isNumber}} + require(jsonElement.getAsJsonPrimitive().isNumber) { + String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()) + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + require(element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}) { + 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}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} + {{/isArray}} + match++ + //log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e) + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement) + actualAdapter = adapter{{.}} + match++ + //log.log(Level.FINER, "Input data matches schema '{{{.}}}'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e) + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + if (match == 1) { + val ret = {{classname}}() + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + } + + throw IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache index 2f24a1de76b..6203806394d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/enum_class.mustache @@ -4,6 +4,11 @@ */ enum class {{classname}}(val value: {{dataType}}) { {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/build.gradle.kts.mustache index 7ca2fab59f8..b3ca461c6b0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/build.gradle.kts.mustache @@ -20,8 +20,8 @@ dependencies { implementation("io.javalin:javalin:5.6.3") implementation("io.javalin.community.routing:routing-core:5.6.2-RC.1") implementation("io.javalin.community.routing:routing-dsl:5.6.2-RC.1") - implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.16.1") + implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1") implementation("org.slf4j:slf4j-simple:2.0.7") testImplementation("org.jetbrains.kotlin:kotlin-test") diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/Main.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/Main.kt.mustache new file mode 100644 index 00000000000..c3413301359 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/Main.kt.mustache @@ -0,0 +1,36 @@ +package {{packageName}} + +import io.javalin.Javalin +import io.javalin.apibuilder.ApiBuilder.* + +{{#apiInfo}} +{{#apis}} +{{#operations}}import {{apiPackage}}.{{classname}} +import {{apiPackage}}.{{classname}}ServiceImpl +{{/operations}} +{{/apis}} + +fun main() { + {{#apis}} + {{#operations}} + val {{#camelcase}}{{classname}}{{/camelcase}} = {{classname}}({{classname}}ServiceImpl()) + {{/operations}} + {{/apis}} + + val app = Javalin + .create { config -> + config.router.apiBuilder { + {{#apis}} + {{#operations}} + {{#operation}} + path("{{path}}") { {{#lowercase}}{{httpMethod}}{{/lowercase}}({{#camelcase}}{{classname}}{{/camelcase}}::{{operationId}}) } + {{/operation}} + {{/operations}} + + {{/apis}} + } + } + + app.start({{serverPort}}) +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/README.mustache new file mode 100644 index 00000000000..2c5d5f19518 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/README.mustache @@ -0,0 +1,94 @@ +# {{packageName}} - Kotlin Server library for {{appName}} + +{{#unescapedAppDescription}} +{{.}} +{{/unescapedAppDescription}} + +Generated by OpenAPI Generator {{generatorVersion}}{{^hideGenerationTimestamp}} ({{generatedDate}}){{/hideGenerationTimestamp}}. + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Running + +The server builds as a fat jar with a main entrypoint. To start the service, run `java -jar ./build/libs/{{artifactId}}.jar`. + +You may also run in docker: + +``` +docker build -t {{artifactId}} . +docker run -p 8080:8080 {{artifactId}} +``` + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs (see ktor documentation for more info). +* ~Supports collection formats for query parameters: csv, tsv, ssv, pipes.~ +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. + +{{#generateApiDocs}} + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} +{{/generateModelDocs}} + + +## 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}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/api.mustache new file mode 100644 index 00000000000..5d6920acaed --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/api.mustache @@ -0,0 +1,26 @@ +package {{apiPackage}} + +import io.javalin.http.Context +import io.javalin.http.bodyAsClass +import io.javalin.http.pathParamAsClass +import io.javalin.http.queryParamAsClass + +{{#imports}}import {{import}} +{{/imports}} + +{{#operations}} +class {{classname}}(private val service: {{classname}}Service) { + {{#operation}} + /**{{#summary}} + * {{.}}{{/summary}} + * {{unescapedNotes}} + {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}}*/ + fun {{operationId}}(ctx: Context) { + val result = service.{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}ctx) + ctx.status({{#responses}}{{#-first}}{{code}}{{/-first}}{{/responses}}).json(result) + } + + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/bodyParams.mustache new file mode 100644 index 00000000000..63063e10d76 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{#isArray}}ctx.bodyAsClass>(){{/isArray}}{{^isArray}}ctx.bodyAsClass<{{{baseType}}}>(){{/isArray}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/build.gradle.kts.mustache new file mode 100644 index 00000000000..e7ca78dba68 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/build.gradle.kts.mustache @@ -0,0 +1,33 @@ +plugins { + kotlin("jvm") version "2.0.0" +} + +group = "{{groupId}}" +version = "{{artifactVersion}}" + +kotlin { + jvmToolchain(21) +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation("io.javalin:javalin:6.1.6") + implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1") + implementation("org.slf4j:slf4j-simple:2.0.13") + + testImplementation("org.jetbrains.kotlin:kotlin-test") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/formParams.mustache new file mode 100644 index 00000000000..8dc63bc3ca6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{^isFile}}ctx.formParam("{{baseName}}"){{/isFile}}{{#isFile}}ctx.uploadedFile("{{baseName}}"){{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/gradle.properties b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/gradle.properties new file mode 100644 index 00000000000..5f1ed7bbe02 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/headerParams.mustache new file mode 100644 index 00000000000..a5b25b1a993 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}ctx.header("{{baseName}}"){{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/optionalDataType.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/optionalDataType.mustache new file mode 100644 index 00000000000..7c026fa826f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/optionalDataType.mustache @@ -0,0 +1 @@ +{{#required}}{{{dataType}}}{{/required}}{{^required}}{{#defaultValue}}{{{dataType}}}{{/defaultValue}}{{^defaultValue}}{{{dataType}}}?{{/defaultValue}}{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/pathParams.mustache new file mode 100644 index 00000000000..4f1cfe9bfc7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}ctx.pathParamAsClass<{{{dataType}}}>("{{baseName}}").get(){{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/queryParams.mustache new file mode 100644 index 00000000000..157e39c9778 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{#isArray}}ctx.queryParams("{{baseName}}"){{/isArray}}{{^isArray}}ctx.queryParamAsClass<{{{dataType}}}>("{{baseName}}"){{^required}}.allowNullable(){{/required}}.get(){{/isArray}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/returnTypes.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/returnTypes.mustache new file mode 100644 index 00000000000..12a74e5ad7a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/returnTypes.mustache @@ -0,0 +1 @@ +{{#isMap}}Map{{/isMap}}{{#isArray}}{{#reactive}}Flow{{/reactive}}{{^reactive}}{{{returnContainer}}}{{/reactive}}<{{{returnType}}}>{{/isArray}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/service.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/service.mustache new file mode 100644 index 00000000000..0c524ab1ec6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/service.mustache @@ -0,0 +1,35 @@ +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} +import io.javalin.http.Context + +{{#operations}} +interface {{classname}}Service { +{{#operation}} + + /** + * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} + {{#notes}} + * {{.}} + {{/notes}} + * + {{#allParams}} + * @param {{{paramName}}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return {{#responses}}{{message}} (status code {{code}}){{^-last}} + * or {{/-last}}{{/responses}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + * @see {{classname}}#{{operationId}} + */ + {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}ctx: Context): {{>returnTypes}} +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/serviceImpl.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/serviceImpl.mustache new file mode 100644 index 00000000000..7358a3492ea --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/serviceImpl.mustache @@ -0,0 +1,19 @@ +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} +import io.javalin.http.Context +{{#reactive}} +import kotlinx.coroutines.flow.Flow +{{/reactive}} +{{#operations}} + +class {{classname}}ServiceImpl : {{classname}}Service { +{{#operation}} + + override {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}ctx: Context): {{>returnTypes}} { + TODO("Implement me") + } +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache index 206a8720e0c..b7943e1aefc 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache @@ -20,7 +20,7 @@ buildscript { {{#useMutiny}} ext.mutiny_version = "2.2.0" {{/useMutiny}} - ext.jackson_version = "2.9.9" + ext.jackson_version = "2.17.1" {{#useBeanValidation}} ext.beanvalidation_version = "2.0.2" {{/useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache index 005b9daa596..8cd1d96e8d3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache @@ -13,6 +13,12 @@ import kotlinx.serialization.Serializable {{>additionalModelTypeAnnotations}} {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}) { {{#allowableValues}}{{#enumVars}} + + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{#kotlinx_serialization}} @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index aa8c390b34c..0a0ccabc42f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -57,9 +57,11 @@ import kotlin.collections.Map {{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}", description = "The {{{baseName}}} API") {{/swagger1AnnotationLibrary}} +{{#useRequestMappingOnController}} {{=<% %>=}} @RequestMapping("\${api.base-path:<%contextPath%>}") <%={{ }}=%> +{{/useRequestMappingOnController}} {{#operations}} class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) val service: {{classname}}Service{{/serviceInterface}}) { {{#operation}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache index fcbc8cc37bc..4d1af3ad52c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache @@ -6,18 +6,27 @@ import java.util.Optional {{>generatedAnnotation}} @Controller{{#beanQualifiers}}("{{package}}.{{classname}}Controller"){{/beanQualifiers}} +{{#useRequestMappingOnController}} {{=<% %>=}} @RequestMapping("\${openapi.<%title%>.base-path:<%>defaultBasePath%>}") <%={{ }}=%> +{{/useRequestMappingOnController}} {{#operations}} class {{classname}}Controller( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: {{classname}}Delegate? + {{#skipDefaultDelegateInterface}} + private val delegate: {{classname}}Delegate + {{/skipDefaultDelegateInterface}} + {{^skipDefaultDelegateInterface}} + delegate: {{classname}}Delegate? + {{/skipDefaultDelegateInterface}} ) : {{classname}} { +{{^skipDefaultDelegateInterface}} private lateinit var delegate: {{classname}}Delegate init { this.delegate = Optional.ofNullable(delegate).orElse(object : {{classname}}Delegate {}) } +{{/skipDefaultDelegateInterface}} override fun getDelegate(): {{classname}}Delegate = delegate } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache index b1203ff381b..47bd58a4818 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiDelegate.mustache @@ -7,6 +7,9 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +{{#appendRequestToHandler}} +import org.springframework.http.server.reactive.ServerHttpRequest +{{/appendRequestToHandler}} {{#reactive}} import kotlinx.coroutines.flow.Flow {{/reactive}} @@ -31,9 +34,9 @@ interface {{classname}}Delegate { * @see {{classname}}#{{operationId}} */ {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}}, - {{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} { + {{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} { {{>methodBody}} - } + }{{/skipDefaultDelegateInterface}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index ce47ed8fdbe..6f92da7db7f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -55,22 +55,23 @@ import kotlinx.coroutines.flow.Flow import kotlin.collections.List import kotlin.collections.Map +@RestController {{#useBeanValidation}} @Validated {{/useBeanValidation}} {{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}", description = "The {{{baseName}}} API") {{/swagger1AnnotationLibrary}} -{{^useFeignClient}} +{{#useRequestMappingOnInterface}} {{=<% %>=}} @RequestMapping("\${api.base-path:<%contextPath%>}") <%={{ }}=%> -{{/useFeignClient}} +{{/useRequestMappingOnInterface}} {{#operations}} interface {{classname}} { {{#isDelegate}} - fun getDelegate(): {{classname}}Delegate = object: {{classname}}Delegate {} + fun getDelegate(): {{classname}}Delegate{{^skipDefaultDelegateInterface}} = object: {{classname}}Delegate {}{{/skipDefaultDelegateInterface}} {{/isDelegate}} {{#operation}} @@ -102,14 +103,14 @@ interface {{classname}} { produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}} ) - {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultInterface}} { + {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{>requesObject}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultApiInterface}} { {{^isDelegate}} return {{>returnValue}} {{/isDelegate}} {{#isDelegate}} return getDelegate().{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{/isDelegate}} - }{{/skipDefaultInterface}} + }{{/skipDefaultApiInterface}} {{/operation}} } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache index 996353148d6..583ee37f90e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/beanValidationModel.mustache @@ -4,7 +4,7 @@ format: email @get:Email{{/isEmail}}{{! pattern set }}{{#pattern}} - @get:Pattern(regexp="{{{.}}}"){{/pattern}}{{! + @get:Pattern(regexp="{{{pattern}}}"{{#vendorExtensions.x-pattern-message}}, message="{{vendorExtensions.x-pattern-message}}"{{/vendorExtensions.x-pattern-message}}){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @get:Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index 695dbaee260..3e3c269dc61 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -8,13 +8,16 @@ {{#additionalModelTypeAnnotations}} {{{.}}} {{/additionalModelTypeAnnotations}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{.}}} +{{/vendorExtensions.x-class-extra-annotation}} {{#discriminator}}interface {{classname}}{{/discriminator}}{{^discriminator}}{{#hasVars}}data {{/hasVars}}class {{classname}}( {{#requiredVars}} {{>dataClassReqVar}}{{^-last}}, {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>dataClassOptVar}}{{^-last}}, {{/-last}}{{/optionalVars}} -) {{/discriminator}}{{#parent}}: {{{.}}}{{/parent}}{ +) {{/discriminator}}{{#parent}}: {{{.}}}{{#serializableModel}}, Serializable{{/serializableModel}}{{/parent}}{{#serializableModel}}: Serializable{{/serializableModel}}{ {{#discriminator}} {{#requiredVars}} {{>interfaceReqVar}} @@ -28,9 +31,22 @@ * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{{nameInPascalCase}}}(val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { + enum class {{{nameInPascalCase}}}(@get:JsonValue val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { {{#allowableValues}}{{#enumVars}} - @JsonProperty({{{value}}}) {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}; + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}): {{{nameInPascalCase}}} { + return values().first{it -> it.value == value} + } + } } {{/isEnum}}{{/vars}}{{/hasEnums}} +{{#serializableModel}} + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } +{{/serializableModel}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 7232af07e29..ab575d4bf9d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,5 +1,6 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} - @Deprecated(message = ""){{/deprecated}} + @Deprecated(message = ""){{/deprecated}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} @get:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 80b7ea4c7e1..92e2875ac08 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,5 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache index 572875356af..fafbb66708d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache @@ -2,7 +2,15 @@ * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ -enum class {{classname}}(val value: {{dataType}}) { +enum class {{classname}}(@get:JsonValue val value: {{dataType}}) { {{#allowableValues}}{{#enumVars}} - @JsonProperty({{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}; + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: {{dataType}}): {{classname}} { + return values().first{it -> it.value == value} + } + } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache index 6d725334a16..3d1a5787e38 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache index 660726f0c51..f8d228d1710 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache @@ -1,4 +1,5 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache index 0f46b49c2b6..710ae9c450c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache @@ -1,4 +1,5 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} - @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} + {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradle-sb3-Kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradle-sb3-Kts.mustache index 7f4a6f3105e..bb76a5d0239 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradle-sb3-Kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradle-sb3-Kts.mustache @@ -13,6 +13,12 @@ tasks.withType { kotlinOptions.jvmTarget = "17" } +{{#interfaceOnly}} +tasks.bootJar { + enabled = false +} + +{{/interfaceOnly}} plugins { val kotlinVersion = "1.7.10" id("org.jetbrains.kotlin.jvm") version kotlinVersion @@ -30,8 +36,8 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion"){{/reactive}}{{#springDocDocumentationProvider}}{{#useSwaggerUI}} - implementation("org.springdoc:springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui:2.0.0-M5"){{/useSwaggerUI}}{{^useSwaggerUI}} - implementation("org.springdoc:springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core:2.0.0-M5"){{/useSwaggerUI}}{{/springDocDocumentationProvider}}{{#springFoxDocumentationProvider}} + implementation("org.springdoc:springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui:2.2.0"){{/useSwaggerUI}}{{^useSwaggerUI}} + implementation("org.springdoc:springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core:2.2.0-M5"){{/useSwaggerUI}}{{/springDocDocumentationProvider}}{{#springFoxDocumentationProvider}} implementation("io.springfox:springfox-swagger2:2.9.2"){{/springFoxDocumentationProvider}}{{#useSwaggerUI}}{{^springDocDocumentationProvider}} implementation("org.webjars:swagger-ui:4.10.3") implementation("org.webjars:webjars-locator-core"){{/springDocDocumentationProvider}}{{/useSwaggerUI}}{{^springFoxDocumentationProvider}}{{^springDocDocumentationProvider}}{{#swagger1AnnotationLibrary}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache index 77abd068b75..4a0cd0fdaee 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache @@ -20,6 +20,12 @@ tasks.withType { kotlinOptions.jvmTarget = "1.8" } +{{#interfaceOnly}} +tasks.bootJar { + enabled = false +} + +{{/interfaceOnly}} plugins { val kotlinVersion = "1.6.21" id("org.jetbrains.kotlin.jvm") version kotlinVersion @@ -51,9 +57,8 @@ dependencies { compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") {{#useBeanValidation}} - compile("jakarta.validation:jakarta.validation-api"){{/useBeanValidation}} - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api"){{/useBeanValidation}} + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache index 2f8bc8e8111..3a385815ffd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache @@ -13,7 +13,7 @@ 1.6.6{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}} 2.2.0{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}} 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -168,13 +168,13 @@ {{#useBeanValidation}} - jakarta.validation - jakarta.validation-api + javax.validation + validation-api {{/useBeanValidation}} - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/buildGradleKts.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/buildGradleKts.mustache index b1a7e08ce4b..c362c3ac6cb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/buildGradleKts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/buildGradleKts.mustache @@ -69,7 +69,7 @@ dependencies { implementation("org.springframework.cloud:spring-cloud-starter-oauth2:2.2.5.RELEASE"){{/hasAuthMethods}} {{#useBeanValidation}} - implementation("jakarta.validation:jakarta.validation-api"){{/useBeanValidation}} - implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + implementation("javax.validation:validation-api"){{/useBeanValidation}} + implementation("javax.annotation:javax.annotation-api:1.3.2") } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache index fd0678f55c3..1fddfdbb51e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom.mustache @@ -13,7 +13,7 @@ 1.6.6{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}} 2.2.0{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}} 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -191,13 +191,13 @@ {{#useBeanValidation}} - jakarta.validation - jakarta.validation-api + javax.validation + validation-api {{/useBeanValidation}} - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache index f6005b5340f..75aa97afd0d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache @@ -3,6 +3,9 @@ package {{package}} import java.util.Objects {{#imports}}import {{import}} {{/imports}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} {{#useBeanValidation}} import {{javaxPackage}}.validation.constraints.DecimalMax import {{javaxPackage}}.validation.constraints.DecimalMin diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache index 8d5b61c8b05..bf6684029a8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#enumVars}}"{{#lambdaEscapeInNormalString}}{{{value}}}{{/lambdaEscapeInNormalString}}"{{^-last}}, {{/-last}}{{/enumVars}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}{{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#enumVars}}"{{#lambdaEscapeInNormalString}}{{{value}}}{{/lambdaEscapeInNormalString}}"{{^-last}}, {{/-last}}{{/enumVars}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambda.escapeDoubleQuote}}{{{value}}}{{/lambda.escapeDoubleQuote}}{{^-last}}, {{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} @PathVariable("{{baseName}}") {{{paramName}}}: {{>optionalDataType}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#enumVars}}"{{#lambdaEscapeInNormalString}}{{{value}}}{{/lambdaEscapeInNormalString}}"{{^-last}}, {{/-last}}{{/enumVars}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#enumVars}}"{{#lambdaEscapeInNormalString}}{{{value}}}{{/lambdaEscapeInNormalString}}"{{^-last}}, {{/-last}}{{/enumVars}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambda.escapeDoubleQuote}}{{{value}}}{{/lambda.escapeDoubleQuote}}{{^-last}}, {{/-last}}{{/enumVars}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} @PathVariable("{{baseName}}") {{{paramName}}}: {{>optionalDataType}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache index b8926af0307..20c65b329d5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/pom.mustache @@ -25,7 +25,7 @@ 3.10.0 1.0.2 3.2.4 - 2.15.2 + 2.17.1 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 index 9d0ce634cb1..107acd32c4e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.bat.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.bat.mustache @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache index 31766db08e7..6720e351fb7 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/ApiException.mustache @@ -39,7 +39,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -55,10 +55,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -68,7 +68,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache index abaf5d09f4b..98d660c6c01 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache @@ -206,19 +206,19 @@ class RegisterRoutes 'header' => $authMethod['keyParamName'], 'parameter' => null, 'cookie' => null, - ] + ]; } else if ($authMethod['isKeyInQuery']) { $authenticatorConfig = [ 'header' => null, 'parameter' => $authMethod['keyParamName'], 'cookie' => null, - ] + ]; } else if ($authMethod['isKeyInCookie']) { $authenticatorConfig = [ 'header' => null, 'parameter' => null, 'cookie' => $authMethod['keyParamName'], - ] + ]; } $route->add(new TokenAuthentication($authenticatorConfig)); } 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 026bd4fb3ac..3a061043642 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache @@ -28,6 +28,7 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", + "doctrine/annotations": "^2.0", "symfony/validator": "^6.4|^7.0", "jms/serializer-bundle": "^5.4", "symfony/framework-bundle": "^6.4|^7.0" diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache index 620051725de..9dba64f5345 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache @@ -30,6 +30,20 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} return $this->{{name}}; } + /** + * Sets {{name}}. + * + * @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}} + * + * @return $this + */ + public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}): self + { + $this->{{name}} = ${{name}}; + + return $this; + } + {{#isEnumRef}} /** * Gets {{name}} for serialization. @@ -40,6 +54,24 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} { return $this->{{name}}?->value ? (string) $this->{{name}}->value : null; } + + /** + * Sets {{name}}. + * + * @param string|{{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}} + * + * @return $this + */ + public function setDeserialized{{nameInPascalCase}}(string|{{#vendorExtensions.x-comment-type}}{{vendorExtensions.x-comment-type}} {{/vendorExtensions.x-comment-type}}${{name}}{{^required}} = null{{/required}}): self + { + if (is_string(${{name}})) { + ${{name}} = {{baseType}}::tryFrom(${{name}}); + } + + $this->{{name}} = ${{name}}; + + return $this; + } {{/isEnumRef}} {{#isContainer}} @@ -53,26 +85,36 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} public function getSerialized{{nameInPascalCase}}(): array { return array_map( - static fn ($value) => (string) $value->value, - $this->test ?? [] + static fn ($value) => $value?->value ? (string) $value->value : null, + $this->{{name}} ?? [] ); } + + /** + * Sets {{name}}. + * + * @param {{^required}}?{{/required}}array ${{name}}{{#description}} {{{.}}}{{/description}} + * + * @return $this + */ + public function setDeserialized{{nameInPascalCase}}({{^required}}?{{/required}}array ${{name}}{{^required}} = []{{/required}}): self + { + $this->{{name}} = array_map( + static function ($value) { + if (is_string($value)) { + $value = {{baseType}}::tryFrom($value); + } + + return $value; + }, + ${{name}} ?? [] + ); + + return $this; + } {{/isEnumRef}} {{/items}} {{/isContainer}} - /** - * Sets {{name}}. - * - * @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}} - * - * @return $this - */ - public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}): self - { - $this->{{name}} = ${{name}}; - - return $this; - } {{/vars}} } diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache index 8e403f45891..f52d6b065af 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache @@ -5,30 +5,7 @@ {{/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") @@ -37,7 +14,7 @@ {{^isMap}} {{#items}} {{#isEnumRef}} - * @Accessor(getter="getSerialized{{nameInPascalCase}}") + * @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}") * @Type("array") {{/isEnumRef}} {{^isEnumRef}} @@ -48,66 +25,95 @@ {{/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") + * @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}") + * @Type("string") {{/isEnumRef}} {{^isDate}} {{^isDateTime}} {{^isEnumRef}} - * @Assert\Type("{{dataType}}") * @Type("{{dataType}}") {{/isEnumRef}} {{/isDateTime}} {{/isDate}} +{{/isContainer}} + */ +{{#required}} + #[Assert\NotNull] + {{^isPrimitiveType}} + #[Assert\Valid] + {{/isPrimitiveType}} +{{/required}} +{{#isEnum}} + {{#isContainer}} + #[Assert\All([ + {{#items}} + new 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}} + new Assert\Type("{{dataType}}"), + {{/items}} + ])] +{{/isContainer}} +{{^isContainer}} + {{#isDate}} + #[Assert\Type("\DateTime")] + {{/isDate}} + {{#isDateTime}} + #[Assert\Type("\DateTime")] + {{/isDateTime}} + {{^isDate}} + {{^isDateTime}} + {{^isEnumRef}} + #[Assert\Type("{{dataType}}")] + {{/isEnumRef}} + {{/isDateTime}} + {{/isDate}} {{/isContainer}} {{#hasValidation}} {{#maxLength}} - * @Assert\Length( - * max = {{.}} - * ) + #[Assert\Length(max: {{.}})] {{/maxLength}} {{#minLength}} - * @Assert\Length( - * min = {{.}} - * ) + #[Assert\Length(min: {{.}})] {{/minLength}} {{#minimum}} {{#exclusiveMinimum}} - * @Assert\GreaterThan({{minimum}}) + #[Assert\GreaterThan({{minimum}})] {{/exclusiveMinimum}} {{^exclusiveMinimum}} - * @Assert\GreaterThanOrEqual({{minimum}}) + #[Assert\GreaterThanOrEqual({{minimum}})] {{/exclusiveMinimum}} {{/minimum}} {{#maximum}} {{#exclusiveMaximum}} - * @Assert\LessThan({{maximum}}) + #[Assert\LessThan({{maximum}})] {{/exclusiveMaximum}} {{^exclusiveMaximum}} - * @Assert\LessThanOrEqual({{maximum}}) + #[Assert\LessThanOrEqual({{maximum}})] {{/exclusiveMaximum}} {{/maximum}} {{#pattern}} - * @Assert\Regex("/{{.}}/") + #[Assert\Regex("/{{.}}/")] {{/pattern}} {{#maxItems}} - * @Assert\Count( - * max = {{.}} - * ) + #[Assert\Count(max: {{.}})] {{/maxItems}} {{#minItems}} - * @Assert\Count( - * min = {{.}} - * ) + #[Assert\Count(min: {{.}})] {{/minItems}} {{/hasValidation}} - */ protected {{{vendorExtensions.x-parameter-type}}} ${{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}; 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 e5ff50c3f7f..9dfabc9733a 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 @@ -101,12 +101,16 @@ class JmsSerializer implements SerializerInterface case '\DateTime': return is_null($data) ? null :new DateTime($data); default: + if (is_null($data)) { + return null; + } + if (!class_exists($type)) { throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } $reflectionClass = new \ReflectionClass($type); - if (!$reflectionClass->implementsInterface('\BackedENum')) { + if (!$reflectionClass->implementsInterface('\BackedEnum')) { throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } diff --git a/modules/openapi-generator/src/main/resources/php/ApiException.mustache b/modules/openapi-generator/src/main/resources/php/ApiException.mustache index e9d6544b21c..c5c3995dd54 100644 --- a/modules/openapi-generator/src/main/resources/php/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php/ApiException.mustache @@ -40,7 +40,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -56,7 +56,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -69,7 +69,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache index 5a96f2f6f5a..83aaec422dd 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/ApiException.mustache @@ -44,7 +44,7 @@ class ApiException extends RequestException /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -72,7 +72,7 @@ class ApiException extends RequestException /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/modules/openapi-generator/src/main/resources/powershell/api.mustache b/modules/openapi-generator/src/main/resources/powershell/api.mustache index 79d632682cf..c13395de842 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api.mustache @@ -177,15 +177,20 @@ function {{{vendorExtensions.x-powershell-method-name}}} { {{/bodyParam}} {{#authMethods}} {{#isApiKey}} + if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"]) { + $apiKeyPrefix = $Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"] + } else { + $apiKeyPrefix = "" + } {{#isKeyInHeader}} if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) { - $LocalVarHeaderParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"] + $LocalVarHeaderParameters['{{{keyParamName}}}'] = $apiKeyPrefix + $Configuration["ApiKey"]["{{{keyParamName}}}"] Write-Verbose ("Using API key '{{{keyParamName}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand) } {{/isKeyInHeader}} {{#isKeyInQuery}} if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) { - $LocalVarQueryParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"] + $LocalVarQueryParameters['{{{keyParamName}}}'] = $apiKeyPrefix + $Configuration["ApiKey"]["{{{keyParamName}}}"] Write-Verbose ("Using API key `{{{keyParamName}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand) } {{/isKeyInQuery}} diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache index 400685f0abc..48bbdc26783 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/api.mustache @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -65,7 +66,9 @@ async def {{operationId}}( {{/hasAuthMethods}} ) -> {{returnType}}{{^returnType}}None{{/returnType}}: {{#notes}}"""{{.}}""" - return Base{{classname}}.subclasses[0]().{{operationId}}({{#allParams}}{{>impl_argument}}{{^-last}}, {{/-last}}{{/allParams}}){{/notes}}{{^notes}}...{{/notes}} + {{/notes}}if not Base{{classname}}.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await Base{{classname}}.subclasses[0]().{{operationId}}({{#allParams}}{{>impl_argument}}{{^-last}}, {{/-last}}{{/allParams}}) {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache index 2e80168a328..d1d95c12eff 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/base_api.mustache @@ -15,7 +15,7 @@ class Base{{classname}}: Base{{classname}}.subclasses = Base{{classname}}.subclasses + (cls,) {{#operations}} {{#operation}} - def {{operationId}}( + async def {{operationId}}( self, {{#allParams}} {{>impl_argument_definition}}, 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 1a745348960..fb2a5e79c9b 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 @@ -3,6 +3,7 @@ {{#description}}{{&description}} {{/description}} +{{^isEnum}} ## Properties Name | Type | Description | Notes @@ -10,7 +11,6 @@ Name | Type | Description | Notes {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} -{{^isEnum}} ## Example ```python @@ -29,6 +29,12 @@ print {{classname}}.to_json() {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} +{{/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) {{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/model_generic.mustache index 1b676e46955..3b01c4fa9ab 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/model_generic.mustache @@ -351,7 +351,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} "{{{baseName}}}": {{{dataType}}}.from_dict(obj.get("{{{baseName}}}")) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} {{/isEnumOrRef}} {{#isEnumOrRef}} - "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{defaultValue}}{{/defaultValue}}{{^-last}},{{/-last}} {{/isEnumOrRef}} {{/isPrimitiveType}} {{#isPrimitiveType}} 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 b54bc7478ed..4cdf1cc2c8e 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache @@ -2,7 +2,7 @@ aiofiles==23.1.0 aniso8601==7.0.0 async-exit-stack==1.0.1 async-generator==1.10 -certifi==2023.7.22 +certifi==2024.7.4 chardet==4.0.0 click==7.1.2 dnspython==2.6.1 @@ -29,7 +29,7 @@ Rx==1.6.1 starlette==0.36.3 typing-extensions==4.8.0 ujson==4.0.2 -urllib3==1.26.18 +urllib3==1.26.19 uvicorn==0.13.4 uvloop==0.19.0 watchgod==0.7 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 1f8d55555f7..f0c05c6011f 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 @@ -3,13 +3,13 @@ {{#description}}{{&description}} {{/description}} +{{^isEnum}} ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} -{{^isEnum}} ## Example ```python @@ -28,6 +28,12 @@ print {{classname}}.to_json() {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} +{{/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) {{/model}}{{/models}} 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 9a24a9b6553..9a5b0c7fe8f 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 @@ -343,7 +343,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} "{{{name}}}": {{{dataType}}}.from_dict(obj.get("{{{baseName}}}")) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} {{/isEnumOrRef}} {{#isEnumOrRef}} - "{{{name}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + "{{{name}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{defaultValue}}{{/defaultValue}}{{^-last}},{{/-last}} {{/isEnumOrRef}} {{/isPrimitiveType}} {{#isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index fe34567ac5a..2aa70299a17 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -186,11 +186,12 @@ class {{classname}}: {{#hasProduces}} # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [{{#produces}} - '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} + ] + ) {{/hasProduces}} {{#hasConsumes}} diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 97b8f8d84c7..aad33bcc06c 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -5,6 +5,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -59,6 +60,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -232,7 +234,7 @@ class ApiClient: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -322,10 +324,7 @@ class ApiClient: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -349,6 +348,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -374,6 +374,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -393,21 +395,35 @@ class ApiClient: for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -451,6 +467,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache index 7cf3499fadf..edfcc66727e 100644 --- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache @@ -177,10 +177,10 @@ class RESTClientObject: data.add_field(k, v) args["data"] = data - # Pass a `bytes` parameter directly in the body to support + # Pass a `bytes` or `str` parameter directly in the body to support # other content types than Json when `body` argument is provided # in serialized form - elif isinstance(body, bytes): + elif isinstance(body, str) or isinstance(body, bytes): args["data"] = body else: # Cannot generate the request from given parameters diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index aafd0d6f535..8b9a6f4854e 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -24,6 +24,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -50,6 +53,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. {{#hasAuthMethods}} :Example: @@ -147,7 +151,11 @@ conf = {{{packageName}}}.Configuration( {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -162,6 +170,9 @@ conf = {{{packageName}}}.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -212,7 +223,10 @@ conf = {{{packageName}}}.Configuration( self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -263,7 +277,7 @@ conf = {{{packageName}}}.Configuration( self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation 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 6099ddf1954..98d50cf8e6e 100644 --- a/modules/openapi-generator/src/main/resources/python/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_doc.mustache @@ -3,6 +3,7 @@ {{#description}}{{&description}} {{/description}} +{{^isEnum}} ## Properties Name | Type | Description | Notes @@ -10,7 +11,6 @@ Name | Type | Description | Notes {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} -{{^isEnum}} ## Example ```python @@ -29,6 +29,12 @@ print({{classname}}.to_json()) {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} +{{/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) {{/model}}{{/models}} 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 fb9ece0f463..2fadb736571 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -363,7 +363,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} "{{{baseName}}}": {{{dataType}}}.from_dict(obj["{{{baseName}}}"]) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} {{/isEnumOrRef}} {{#isEnumOrRef}} - "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{defaultValue}}{{/defaultValue}}{{^-last}},{{/-last}} {{/isEnumOrRef}} {{/isPrimitiveType}} {{#isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python/model_test.mustache index e0364ce8c16..08088557cda 100644 --- a/modules/openapi-generator/src/main/resources/python/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_test.mustache @@ -20,7 +20,7 @@ class Test{{classname}}(unittest.TestCase): def make_instance(self, include_optional) -> {{classname}}: """Test {{classname}} - include_option is a boolean, when False only required + include_optional 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 `{{{classname}}}` diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index cbbf0d9ad4c..07aa7ee3fef 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -168,7 +168,7 @@ class RESTClientObject: ): request_body = None if body is not None: - request_body = json.dumps(body) + request_body = json.dumps(body{{#setEnsureAsciiToFalse}}, ensure_ascii=False{{/setEnsureAsciiToFalse}}) r = self.pool_manager.request( method, url, diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api.mustache index 9e966c22ce4..f33530dde30 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api.mustache @@ -188,7 +188,7 @@ module {{moduleName}} header_params = opts[:header_params] || {} {{#hasProduces}} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) + header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) unless header_params['Accept'] {{/hasProduces}} {{#hasConsumes}} # HTTP header 'Content-Type' diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache index 1a85fc69c3d..11ae6450f71 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -117,35 +117,41 @@ request.options.on_data = Proc.new do |chunk, overall_received_bytes| stream << chunk end + stream end def deserialize_file(response, stream) - body = response.body - if @config.return_binary_data == true - # return byte stream - encoding = body.encoding - stream.join.force_encoding(encoding) + body = response.body + encoding = body.encoding + + # reconstruct content + content = stream.join + content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary' + content = content.force_encoding(encoding) + + # return byte stream + return content if @config.return_binary_data == true + + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) else - # return file instead of binary data - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - tempfile.write(stream.join.force_encoding(encoding)) - tempfile.close - config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - tempfile + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(content) + tempfile.close + + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile end def connection(opts) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache index 518596cb536..39c5d76741d 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache @@ -71,6 +71,14 @@ module {{moduleName}} # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -146,6 +154,7 @@ module {{moduleName}} @configure_session_blocks = [] {{/isHttpx}} @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -180,6 +189,7 @@ module {{moduleName}} # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) 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 c33a490b163..959f09f174f 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 @@ -45,7 +45,7 @@ async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( {{/x-consumes-multipart-related}} {{/vendorExtensions}} ) -> Result -where +where I: AsRef + Send + Sync, A: apis::{{classFilename}}::{{classnamePascalCase}}, { @@ -94,21 +94,21 @@ where } }; - {{/-last}} + {{/-last}} {{/headerParams}} {{^disableValidator}} {{^allowBlockingValidator}} #[allow(clippy::redundant_closure)] - let validation = tokio::task::spawn_blocking(move || - {{/allowBlockingValidator}} + let validation = tokio::task::spawn_blocking(move || + {{/allowBlockingValidator}} {{#allowBlockingValidator}} let validation = {{/allowBlockingValidator}} {{#vendorExtensions}}{{{x-operation-id}}}_validation{{/vendorExtensions}}( {{#headerParams.size}} header_params, - {{/headerParams.size}} + {{/headerParams.size}} {{#pathParams.size}} path_params, {{/pathParams.size}} @@ -120,7 +120,7 @@ where {{#bodyParam}} body, {{/bodyParam}} - {{/x-consumes-multipart}} + {{/x-consumes-multipart}} {{/x-consumes-multipart-related}} ) {{^allowBlockingValidator}}).await.unwrap(){{/allowBlockingValidator}}; @@ -128,7 +128,7 @@ where let Ok(( {{#headerParams.size}} header_params, - {{/headerParams.size}} + {{/headerParams.size}} {{#pathParams.size}} path_params, {{/pathParams.size}} @@ -140,13 +140,13 @@ where {{#bodyParam}} body, {{/bodyParam}} - {{/x-consumes-multipart}} + {{/x-consumes-multipart}} {{/x-consumes-multipart-related}} )) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) - .map_err(|_| StatusCode::BAD_REQUEST); + .map_err(|_| StatusCode::BAD_REQUEST); }; {{/disableValidator}} @@ -228,7 +228,7 @@ where } }; - + { let mut response_headers = response.headers_mut().unwrap(); response_headers.insert( @@ -240,8 +240,12 @@ where } {{/required}} {{/headers}} - +{{#range}} + response.status::(body.code.parse().unwrap()); // {{{code}}} +{{/range}} +{{^range}} let mut response = response.status({{{code}}}); +{{/range}} {{#produces}} {{#-first}} {{#dataType}} @@ -264,7 +268,7 @@ where let body_content = tokio::task::spawn_blocking(move || {{/allowBlockingResponseSerialize}} {{#allowBlockingResponseSerialize}} - let body_content = + let body_content = {{/allowBlockingResponseSerialize}} serde_json::to_vec(&body).map_err(|e| { error!(error = ?e); @@ -276,7 +280,7 @@ where let body_content = tokio::task::spawn_blocking(move || {{/allowBlockingResponseSerialize}} {{#allowBlockingResponseSerialize}} - let body_content = + let body_content = {{/allowBlockingResponseSerialize}} serde_urlencoded::to_string(body).map_err(|e| { error!(error = ?e); 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 17d2f3cbaaa..e6d2bf19013 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache index 7b4e15d2505..7be71a10b82 100644 --- a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache @@ -37,11 +37,19 @@ serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } {{/serdeWith}} serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } {{#hyper}} +{{#hyper0x}} hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" +{{/hyper0x}} +{{^hyper0x}} +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } +{{/hyper0x}} http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache index f59705ea7b7..7d99ca76c79 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache @@ -6,18 +6,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct {{{classname}}}Client +pub struct {{{classname}}}Client where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl {{{classname}}}Client +impl {{{classname}}}Client where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> {{{classname}}}Client { {{{classname}}}Client { @@ -34,7 +35,7 @@ pub trait {{{classname}}} { {{/operations}} } -impl{{{classname}}} for {{{classname}}}Client +impl{{{classname}}} for {{{classname}}}Client where C: Clone + std::marker::Send + Sync { {{#operations}} {{#operation}} 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 51a42ef361a..67baa441cea 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 @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache index 25124d94b36..54203d36e4f 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -18,7 +19,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache index ee6f407d31b..3581bf0ee32 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache @@ -1,11 +1,15 @@ {{>partial_header}} use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -19,9 +23,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "{{{basePath}}}".to_owned(), user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, @@ -32,3 +68,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper0x/api.mustache b/modules/openapi-generator/src/main/resources/rust/hyper0x/api.mustache new file mode 100644 index 00000000000..f59705ea7b7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust/hyper0x/api.mustache @@ -0,0 +1,173 @@ +{{>partial_header}} +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct {{{classname}}}Client + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> {{{classname}}}Client { + {{{classname}}}Client { + configuration, + } + } +} + +pub trait {{{classname}}} { +{{#operations}} +{{#operation}} + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; +{{/operation}} +{{/operations}} +} + +impl{{{classname}}} for {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + {{#operations}} + {{#operation}} + #[allow(unused_mut)] + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) + {{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: {{#isKeyInHeader}}true{{/isKeyInHeader}}{{^isKeyInHeader}}false{{/isKeyInHeader}}, + in_query: {{#isKeyInQuery}}true{{/isKeyInQuery}}{{^isKeyInQuery}}false{{/isKeyInQuery}}, + param_name: "{{{keyParamName}}}".to_owned(), + })) + {{/isApiKey}} + {{#isBasicBasic}} + .with_auth(__internal_request::Auth::Basic) + {{/isBasicBasic}} + {{#isOAuth}} + .with_auth(__internal_request::Auth::Oauth) + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + ; + {{#queryParams}} + {{#required}} + {{^isNullable}} + req = req.with_query_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_query_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_query_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(ref s) = {{{paramName}}} { + let query_value = {{#isArray}}s.iter().map(|s| s.to_string()).collect::>().join(","){{/isArray}}{{^isArray}}s.to_string(){{/isArray}}; + req = req.with_query_param("{{{baseName}}}".to_string(), query_value); + } + {{/required}} + {{/queryParams}} + {{#pathParams}} + {{#required}} + {{^isNullable}} + req = req.with_path_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_path_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/pathParams}} + {{#hasHeaderParams}} + {{#headerParams}} + {{#required}} + {{^isNullable}} + req = req.with_header_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_header_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasFormParams}} + {{#formParams}} + {{#isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), unimplemented!()); + } + {{/required}} + {{/isFile}} + {{^isFile}} + {{#required}} + {{^isNullable}} + req = req.with_form_param("{{{baseName}}}".to_string(), {{{paramName}}}{{#isArray}}.join(","){{/isArray}}.to_string()); + {{/isNullable}} + {{#isNullable}} + match {{{paramName}}} { + Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), "".to_string()); }, + } + {{/isNullable}} + {{/required}} + {{^required}} + if let Some(param_value) = {{{paramName}}} { + req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); + } + {{/required}} + {{/isFile}} + {{/formParams}} + {{/hasFormParams}} + {{#hasBodyParam}} + {{#bodyParams}} + req = req.with_body_param({{{paramName}}}); + {{/bodyParams}} + {{/hasBodyParam}} + {{^returnType}} + req = req.returns_nothing(); + {{/returnType}} + + req.execute(self.configuration.borrow()) + } + +{{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper0x/api_mod.mustache b/modules/openapi-generator/src/main/resources/rust/hyper0x/api_mod.mustache new file mode 100644 index 00000000000..51a42ef361a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust/hyper0x/api_mod.mustache @@ -0,0 +1,64 @@ +use http; +use hyper; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Body, +} + +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +mod request; + +{{#apiInfo}} +{{#apis}} +mod {{{classFilename}}}; +{{#operations}} +{{#operation}} +{{#-last}} +pub use self::{{{classFilename}}}::{ {{{classname}}}, {{{classname}}}Client }; +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +pub mod configuration; +pub mod client; diff --git a/modules/openapi-generator/src/main/resources/rust/hyper0x/client.mustache b/modules/openapi-generator/src/main/resources/rust/hyper0x/client.mustache new file mode 100644 index 00000000000..25124d94b36 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust/hyper0x/client.mustache @@ -0,0 +1,54 @@ +use std::rc::Rc; + +use hyper; +use super::configuration::Configuration; + +pub struct APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box, + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Rc::new(configuration); + + APIClient { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-last}} + {{{classFilename}}}: Box::new(crate::apis::{{{classname}}}Client::new(rc.clone())), + {{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + } + } + +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-last}} + pub fn {{{classFilename}}}(&self) -> &dyn crate::apis::{{{classname}}}{ + self.{{{classFilename}}}.as_ref() + } + +{{/-last}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper0x/configuration.mustache b/modules/openapi-generator/src/main/resources/rust/hyper0x/configuration.mustache new file mode 100644 index 00000000000..ee6f407d31b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust/hyper0x/configuration.mustache @@ -0,0 +1,34 @@ +{{>partial_header}} +use hyper; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/modules/openapi-generator/src/main/resources/rust/lib.mustache b/modules/openapi-generator/src/main/resources/rust/lib.mustache index 276ad12cfbb..b51df2b1f1e 100644 --- a/modules/openapi-generator/src/main/resources/rust/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust/lib.mustache @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index dd7ac5a1cdf..79d3cda1c2b 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -6,11 +6,43 @@ use serde::{Deserialize, Serialize}; {{^isEnum}}{{#vendorExtensions.x-rust-has-byte-array}} use serde_with::serde_as; {{/vendorExtensions.x-rust-has-byte-array}}{{/isEnum}} +{{#isEnum}} +{{#isInteger}} +use serde_repr::{Serialize_repr,Deserialize_repr}; +{{/isInteger}} +{{/isEnum}} {{#description}} /// {{{classname}}} : {{{description}}} {{/description}} +{{!-- for repr(int) enum schemas --}} +{{#isEnum}} +{{#isInteger}} +/// {{{description}}} +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum {{{classname}}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}} = {{{value}}}, +{{/enumVars}}{{/allowableValues}} +} + +impl ToString for {{{classname}}} { + fn to_string(&self) -> String { + match self { + {{#allowableValues}} + {{#enumVars}} + Self::{{{name}}} => String::from("{{{value}}}"), + {{/enumVars}} + {{/allowableValues}} + } + } +} +{{/isInteger}} +{{/isEnum}} {{!-- for enum schemas --}} {{#isEnum}} +{{^isInteger}} /// {{{description}}} #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum {{{classname}}} { @@ -33,6 +65,7 @@ impl std::fmt::Display for {{{classname}}} { } } +{{/isInteger}} impl Default for {{{classname}}} { fn default() -> {{{classname}}} { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/rust/request.rs b/modules/openapi-generator/src/main/resources/rust/request.rs index db4d55e47b1..b92c977b726 100644 --- a/modules/openapi-generator/src/main/resources/rust/request.rs +++ b/modules/openapi-generator/src/main/resources/rust/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } diff --git a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache index 1ca68437d0c..eeb76d81c4d 100644 --- a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache @@ -102,12 +102,12 @@ open class {{classname}} { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - {{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} path = "{{path}}" + {{#pathParams}}{{#-last}}var{{/-last}}{{/pathParams}}{{^pathParams}}let{{/pathParams}} localVarPath = "{{path}}" {{#pathParams}} - {{#required}}path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}){{/required}}{{^required}}if let {{paramName}} = {{paramName}} { path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}) } {{/required}} + {{#required}}localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}){{/required}}{{^required}}if let {{paramName}} = {{paramName}} { localVarPath = localVarPath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{> toString}}) } {{/required}} {{/pathParams}} - let url = baseURL.appendingPathComponent(path) - {{#hasQueryParams}}var{{/hasQueryParams}}{{^hasQueryParams}}let{{/hasQueryParams}} components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarURL = baseURL.appendingPathComponent(localVarPath) + {{#hasQueryParams}}var{{/hasQueryParams}}{{^hasQueryParams}}let{{/hasQueryParams}} components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) {{#hasQueryParams}} var queryItems: [URLQueryItem] = [] {{#queryParams}} diff --git a/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache index 2111f340881..d4583787564 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache @@ -62,6 +62,8 @@ import Vapor{{/useVapor}} return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/modules/openapi-generator/src/main/resources/swift5/OpenAPIDateWithoutTime.mustache b/modules/openapi-generator/src/main/resources/swift5/OpenAPIDateWithoutTime.mustache index ff51e00b7f9..5a0c0b0d6fb 100644 --- a/modules/openapi-generator/src/main/resources/swift5/OpenAPIDateWithoutTime.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/OpenAPIDateWithoutTime.mustache @@ -81,3 +81,18 @@ extension OpenAPIDateWithoutTime: JSONEncodable { return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate()) } } + +extension OpenAPIDateWithoutTime: RawRepresentable { + public typealias RawValue = String + public init?(rawValue: String) { + if let date = OpenISO8601DateFormatter.withoutTime.date(from: rawValue) { + self.init(wrappedDate: date) + } else { + return nil + } + } + + public var rawValue: String { + OpenISO8601DateFormatter.withoutTime.string(from: normalizedWrappedDate()) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache index 8457a891fdc..70e3abfb505 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache @@ -20,6 +20,12 @@ import Foundation {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var multipleOf: T? } +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ArrayRule { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var minItems: Int? + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var maxItems: Int? + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var uniqueItems: Bool +} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ import Foundation case minimum, maximum, multipleOf } +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ValidationError: Error { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ import Foundation } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index 58105900d60..71025d94699 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -16,6 +16,9 @@ {{#isNumeric}} static let {{{name}}}Rule = NumericRule<{{{dataType}}}>(minimum: {{#minimum}}{{{.}}}{{/minimum}}{{^minimum}}nil{{/minimum}}, exclusiveMinimum: {{#exclusiveMinimum}}true{{/exclusiveMinimum}}{{^exclusiveMinimum}}false{{/exclusiveMinimum}}, maximum: {{#maximum}}{{{.}}}{{/maximum}}{{^maximum}}nil{{/maximum}}, exclusiveMaximum: {{#exclusiveMaximum}}true{{/exclusiveMaximum}}{{^exclusiveMaximum}}false{{/exclusiveMaximum}}, multipleOf: {{#multipleOf}}{{{.}}}{{/multipleOf}}{{^multipleOf}}nil{{/multipleOf}}) {{/isNumeric}} +{{#isArray}} + static let {{{name}}}Rule = ArrayRule(minItems: {{#minItems}}{{{.}}}{{/minItems}}{{^minItems}}nil{{/minItems}}, maxItems: {{#maxItems}}{{{.}}}{{/maxItems}}{{^maxItems}}nil{{/maxItems}}, uniqueItems: {{#uniqueItems}}true{{/uniqueItems}}{{^uniqueItems}}false{{/uniqueItems}}) +{{/isArray}} {{/hasValidation}} {{/validatable}} {{/allVars}} 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 f45e74d2339..3e53fa057d6 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 @@ -342,16 +342,16 @@ export class {{classname}} { if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - localVarFormParams = localVarFormParams.append('{{baseName}}', element) as any || localVarFormParams; + localVarFormParams = localVarFormParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element) as any || localVarFormParams; }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} if (localVarUseForm) { {{paramName}}.forEach((element) => { - localVarFormParams = localVarFormParams.append('{{baseName}}', element) as any || localVarFormParams; + localVarFormParams = localVarFormParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element) as any || localVarFormParams; }) } else { - localVarFormParams = localVarFormParams.append('{{baseName}}', [...{{paramName}}].join(COLLECTION_FORMATS['{{collectionFormat}}'])) as any || localVarFormParams; + localVarFormParams = localVarFormParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', [...{{paramName}}].join(COLLECTION_FORMATS['{{collectionFormat}}'])) as any || localVarFormParams; } {{/isCollectionFormatMulti}} } 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 47c95f0e354..1e991b81022 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -194,12 +194,12 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/contentType}} {{^contentType}} {{paramName}}.forEach((element) => { - localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', element as any); + localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element as any); }) {{/contentType}} {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}})); + localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}})); {{/isCollectionFormatMulti}} }{{/isArray}} {{^isArray}} @@ -308,7 +308,7 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas }, {{/useSingleRequestParameter}} {{^useSingleRequestParameter}} - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: any): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}options?: RawAxiosRequestConfig): AxiosPromise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return localVarFp.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(axios, basePath)); }, {{/useSingleRequestParameter}} 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 b5ab30bba8f..57504af7415 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache @@ -26,7 +26,7 @@ "prepare": "npm run build" }, "dependencies": { - "axios": "^1.6.1" + "axios": "{{axiosVersion}}" }, "devDependencies": { "@types/node": "12.11.5 - 12.20.42", diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index f3732e6b0cb..53276d5bf06 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -24,7 +24,7 @@ import { {{#allParams.0}} export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request { {{#allParams}} - {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{#hasReadOnly}}Omit<{{{dataType}}}, {{#readOnlyVars}}'{{baseName}}'{{^-last}}|{{/-last}}{{/readOnlyVars}}>{{/hasReadOnly}}{{^hasReadOnly}}{{{dataType}}}{{/hasReadOnly}}{{#isNullable}}{{#required}} | null{{/required}}{{/isNullable}}{{/isEnum}}; + {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{#hasReadOnly}}Omit<{{{dataType}}}, {{#readOnlyVars}}'{{baseName}}'{{^-last}}|{{/-last}}{{/readOnlyVars}}>{{/hasReadOnly}}{{^hasReadOnly}}{{{dataType}}}{{/hasReadOnly}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; {{/allParams}} } @@ -70,7 +70,7 @@ export interface {{classname}}Interface { {{/isDeprecated}} */ {{^useSingleRequestParameter}} - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}}{{#required}} | null{{/required}}{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}>; @@ -241,27 +241,37 @@ export class {{classname}} extends runtime.BaseAPI { if (requestParameters['{{paramName}}'] != null) { {{#isCollectionFormatMulti}} requestParameters['{{paramName}}'].forEach((element) => { - formParams.append('{{baseName}}', element as any); + formParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element as any); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formParams.append('{{baseName}}', {{#uniqueItems}}Array.from({{/uniqueItems}}requestParameters['{{paramName}}']{{#uniqueItems}}){{/uniqueItems}}!.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"])); + formParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', {{#uniqueItems}}Array.from({{/uniqueItems}}requestParameters['{{paramName}}']{{#uniqueItems}}){{/uniqueItems}}!.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"])); {{/isCollectionFormatMulti}} } {{/isArray}} {{^isArray}} if (requestParameters['{{paramName}}'] != null) { + {{#isDateTimeType}} + formParams.append('{{baseName}}', (requestParameters['{{paramName}}'] as any).toISOString()); + {{/isDateTimeType}} + {{^isDateTimeType}} {{#isPrimitiveType}} formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any); {{/isPrimitiveType}} {{^isPrimitiveType}} + {{#isEnumRef}} + formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any); + {{/isEnumRef}} + {{^isEnumRef}} {{^withoutRuntimeChecks}} formParams.append('{{baseName}}', new Blob([JSON.stringify({{{dataType}}}ToJSON(requestParameters['{{paramName}}']))], { type: "application/json", })); {{/withoutRuntimeChecks}}{{#withoutRuntimeChecks}} formParams.append('{{baseName}}', new Blob([JSON.stringify(requestParameters['{{paramName}}'])], { type: "application/json", })); {{/withoutRuntimeChecks}} + {{/isEnumRef}} {{/isPrimitiveType}} + {{/isDateTimeType}} } {{/isArray}} @@ -354,7 +364,7 @@ export class {{classname}} extends runtime.BaseAPI { {{/isDeprecated}} */ {{^useSingleRequestParameter}} - async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}}{{#required}} | null{{/required}}{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/returnType}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/returnType}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}{ {{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }, {{/allParams.0}}initOverrides); {{#isResponseOptional}} 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 312b6320e0d..5bab7a5a98c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache @@ -3,7 +3,7 @@ export function instanceOf{{classname}}(value: any): boolean { for (const key in {{classname}}) { if (Object.prototype.hasOwnProperty.call({{classname}}, key)) { - if ({{classname}}[key] === value) { + if ({{classname}}[key as keyof typeof {{classname}}] === value) { return true; } } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache index 4b8bfa06a1b..68e5747598a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGenericInterfaces.mustache @@ -16,7 +16,7 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ * @deprecated {{/deprecated}} */ - {{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{#isNullable}}{{#required}} | null{{/required}}{{/isNullable}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{#isNullable}}{{#required}} | null{{/required}}{{/isNullable}}{{/isEnum}}; + {{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}; {{/vars}} }{{#hasEnums}} 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 37018c1172c..9a9f56b5f3d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache @@ -24,7 +24,7 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole switch (json['{{discriminator.propertyBaseName}}']) { {{#discriminator.mappedModels}} case '{{mappingName}}': - return Object.assign({}, {{modelName}}FromJSONTyped(json, true), { {{discriminator.propertyName}}: '{{mappingName}}' }); + return Object.assign({}, {{modelName}}FromJSONTyped(json, true), { {{discriminator.propertyName}}: '{{mappingName}}' } as const); {{/discriminator.mappedModels}} default: throw new Error(`No variant of {{classname}} exists with '{{discriminator.propertyName}}=${json['{{discriminator.propertyName}}']}'`); @@ -36,6 +36,8 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole return {{{.}}}FromJSONTyped(json, true); } {{/oneOf}} + + return {} as any; {{/discriminator}} } diff --git a/modules/openapi-generator/src/main/resources/typescript/package.mustache b/modules/openapi-generator/src/main/resources/typescript/package.mustache index fe5d0cc19ec..12e08d180d2 100644 --- a/modules/openapi-generator/src/main/resources/typescript/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/package.mustache @@ -33,6 +33,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/modules/openapi-generator/src/main/resources/zapier/api.mustache b/modules/openapi-generator/src/main/resources/zapier/api.mustache index cb56c783b93..1c512e665c9 100644 --- a/modules/openapi-generator/src/main/resources/zapier/api.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/api.mustache @@ -103,7 +103,7 @@ module.exports = { {{/allParams}} },{{/isMultipart}} } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return {{#returnType}}{{#returnTypeIsPrimitive}}{ data: results }{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}results{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}results{{/returnType}}; diff --git a/modules/openapi-generator/src/main/resources/zapier/utils.mustache b/modules/openapi-generator/src/main/resources/zapier/utils.mustache index 201a15fb582..b00174f3f7b 100644 --- a/modules/openapi-generator/src/main/resources/zapier/utils.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/utils.mustache @@ -23,6 +23,13 @@ const searchMiddleware = (action) => { return action } +const requestOptionsMiddleware = (z, bundle, requestOptions) => { + // TODO: modify the request options for all outgoing request to your api + // if you are using session authentication without a Bearer token. + // This may be true if your API uses basic authentication or api keys. + return requestOptions +} + module.exports = { replacePathParameters: replacePathParameters, childMapping: childMapping, @@ -31,4 +38,5 @@ module.exports = { hasSearchRequisites: hasSearchRequisites, isSearchAction: isSearchAction, searchMiddleware: searchMiddleware, -} \ No newline at end of file + requestOptionsMiddleware: requestOptionsMiddleware, +} diff --git a/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheEvaluator.java b/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheEvaluator.java new file mode 100644 index 00000000000..7814da20570 --- /dev/null +++ b/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheEvaluator.java @@ -0,0 +1,37 @@ +package com.samskivert.mustache; + +import java.io.StringReader; +import java.util.Map; + +/** +* Evaluate a mustache variable using the same mustache context as MustacheEngineAdapter. +*/ +public class MustacheEvaluator { + private final Template template; + private final Template.Context context; + + private MustacheEvaluator(Template.Context context) { + this.context = context; + this.template = Mustache.compiler().compile(new StringReader("")); + } + + /** + * Create a mustache context from the additionalProperties. + * + * @param additionalProperties + * @return a mustache evaluator with the context constructed as in MustacheEngineAdapter. + */ + public static MustacheEvaluator create(Map additionalProperties) { + return new MustacheEvaluator(new MustacheTemplateContext(additionalProperties)); + } + + /** + * Compute the value from the mustache context. + * + * @param name variable name + * @return the value as mustache would see + */ + public Object getValue(String name) { + return template.getValue(context, name, 0, false); + } +} diff --git a/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheTemplateContext.java b/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheTemplateContext.java new file mode 100644 index 00000000000..df78c5b521e --- /dev/null +++ b/modules/openapi-generator/src/test/java/com/samskivert/mustache/MustacheTemplateContext.java @@ -0,0 +1,14 @@ +package com.samskivert.mustache; + +import org.openapitools.codegen.CodegenConstants; + +import java.util.Map; + +class MustacheTemplateContext extends Template.Context { + MustacheTemplateContext(Object parent) { + super(parent, null, 0, false, false); + } + public MustacheTemplateContext(Map additionalProperties) { + super(additionalProperties, new MustacheTemplateContext(additionalProperties.get(CodegenConstants.MUSTACHE_PARENT_CONTEXT)), 0, false, false); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllGeneratorsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllGeneratorsTest.java index 28619f3156f..18f0de29646 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllGeneratorsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllGeneratorsTest.java @@ -17,19 +17,27 @@ package org.openapitools.codegen; import org.openapitools.codegen.config.CodegenConfigurator; -import org.testng.Assert; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.io.File; -import java.io.IOException; import java.nio.file.Files; +import java.util.Iterator; import java.util.List; +import java.util.Locale; +import java.util.stream.Collectors; + +import static org.assertj.core.api.Assertions.assertThat; public class AllGeneratorsTest { - @Test - public void testEachWithPetstore() throws IOException { - for (final CodegenConfig codegenConfig : CodegenConfigLoader.getAll()) { + @DataProvider(name = "generators") Iterator generators() { + return CodegenConfigLoader.getAll().iterator(); + } + + @Test(dataProvider = "generators") + public void testEachWithPetstore(CodegenConfig codegenConfig) { + try { File output = Files.createTempDirectory("test").toFile(); output.deleteOnExit(); @@ -38,14 +46,64 @@ public class AllGeneratorsTest { .setInputSpec("src/test/resources/3_0/petstore.yaml") .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + // Main intention of this test is to check that nothing crashes. Besides, we check here that // at least 1 file is generated, besides the common ".openapi-generator-ignore", "FILES" and "VERSION" files. - Assert.assertTrue(files.size() >= 4); + assertThat(files).hasSizeGreaterThanOrEqualTo(4); + } catch (Exception e) { + throw new RuntimeException( + String.format( + Locale.ROOT, + "Generator %s threw an exception (generating %s): %s", + codegenConfig.getName(), codegenConfig.getInputSpec(), e.getMessage() + ), e + ); } } + /** + * Regression test for #18810 + */ + @Test(dataProvider = "generators") void noDuplicateCliOptions(CodegenConfig codegenConfig) { + final List cliOptionKeys = codegenConfig.cliOptions() + .stream().map(CliOption::getOpt).collect(Collectors.toList()); + + assertThat(cliOptionKeys).allSatisfy( + opt -> assertThat(cliOptionKeys) + .as("Generator '%s' defines CliOption '%s' more than once!", codegenConfig.getName(), opt) + .containsOnlyOnce(opt) + ); + } + + @Test(dataProvider = "generators") void noDuplicateSupportedLibraries(CodegenConfig codegenConfig) { + final var supportedLibraries = codegenConfig.supportedLibraries().keySet(); + + assertThat(supportedLibraries).allSatisfy( + lib -> assertThat(supportedLibraries) + .as("Generator '%s' defines '%s' more than once in supportedLibraries!", codegenConfig.getName(), lib) + .containsOnlyOnce(lib) + ); + } + + @Test(dataProvider = "generators") void noDuplicateSupportingFiles(CodegenConfig codegenConfig) { + final List supportingFiles = codegenConfig.supportingFiles() + .stream().map(SupportingFile::toString).collect(Collectors.toList()); + + assertThat(supportingFiles).allSatisfy( + file -> assertThat(supportingFiles) + .as("Generator '%s' defines '%s' more than once in supportingFiles!", codegenConfig.getName(), file) + .containsOnlyOnce(file) + ); + } + + @Test(dataProvider = "generators") void noDuplicateSupportedVendorExtensions(CodegenConfig codegenConfig) { + final List supportedVendorExtensions = codegenConfig.getSupportedVendorExtensions(); + + assertThat(supportedVendorExtensions).allSatisfy( + extension -> assertThat(supportedVendorExtensions) + .as("Generator '%s' defines '%s' more than once in supportedVendorExtensions!", codegenConfig.getName(), extension) + .containsOnlyOnce(extension) + ); + } } 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 daaea9a2637..1c0631f98cc 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 @@ -2592,9 +2592,9 @@ public class DefaultCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormWithValidation.java"); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormInterface.java"); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/model/FreeForm.java"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormWithValidation.java"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/java/org/openapitools/client/model/FreeFormInterface.java"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/java/org/openapitools/client/model/FreeForm.java"); output.deleteOnExit(); } 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 33cee613021..ae5f43ab69a 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 @@ -17,7 +17,6 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; import java.io.File; @@ -87,29 +86,29 @@ public class DefaultGeneratorTest { TestUtils.ensureContainsFile(files, output, "build.gradle"); Assert.assertTrue(new File(output, "build.gradle").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "api/openapi.yaml"); + TestUtils.ensureDoesNotContainFile(files, output, "api/openapi.yaml"); Assert.assertFalse(new File(output, "api").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, ".github/workflows/"); + TestUtils.ensureDoesNotContainFile(files, output, ".github/workflows/"); Assert.assertFalse(new File(output, ".github").exists()); // Check excluded files - TestUtils.ensureDoesNotContainsFile(files, output, ".travis.yml"); + TestUtils.ensureDoesNotContainFile(files, output, ".travis.yml"); Assert.assertFalse(new File(output, ".travis.yml").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "build.sbt"); + TestUtils.ensureDoesNotContainFile(files, output, "build.sbt"); Assert.assertFalse(new File(output, "build.sbt").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/AndroidManifest.xml"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/AndroidManifest.xml"); Assert.assertFalse(new File(output, "src/main/AndroidManifest.xml").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "pom.xml"); + TestUtils.ensureDoesNotContainFile(files, output, "pom.xml"); Assert.assertFalse(new File(output, "pom.xml").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "src/test/java/org/openapitools/client/model/CategoryTest.java"); + TestUtils.ensureDoesNotContainFile(files, output, "src/test/java/org/openapitools/client/model/CategoryTest.java"); Assert.assertFalse(new File(output, "src/test/java/org/openapitools/client/model/CategoryTest.java").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/java/org/openapitools/client/api/UserApi.java"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/java/org/openapitools/client/api/UserApi.java"); Assert.assertFalse(new File(output, "src/main/java/org/openapitools/client/api/UserApi.java").exists()); } finally { output.deleteOnExit(); @@ -163,7 +162,7 @@ public class DefaultGeneratorTest { TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/api/PetApi.java"); Assert.assertTrue(new File(output, "src/main/java/org/openapitools/client/api/PetApi.java").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, apiTestRelativePath); + TestUtils.ensureDoesNotContainFile(files, output, apiTestRelativePath); Assert.assertTrue(apiTestFile.exists()); String apiTestContents = Files.readAllLines(apiTestFile.toPath()).get(0); Assert.assertEquals(apiTestContents, "empty", "Expected test file to retain original contents."); @@ -172,7 +171,7 @@ public class DefaultGeneratorTest { TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/Category.java"); Assert.assertTrue(new File(output, "src/test/java/org/openapitools/client/model/CategoryTest.java").exists()); - TestUtils.ensureDoesNotContainsFile(files, output, modelTestRelativePath); + TestUtils.ensureDoesNotContainFile(files, output, modelTestRelativePath); Assert.assertTrue(modelTestFile.exists()); String modelTestContents = Files.readAllLines(modelTestFile.toPath()).get(0); Assert.assertEquals(modelTestContents, "empty", "Expected test file to retain original contents."); @@ -828,19 +827,19 @@ public class DefaultGeneratorTest { // Check not generated cause backwards compatibility files String ft1FileName = "src/main/java/org/openapitools/model/FT1.java"; - TestUtils.ensureDoesNotContainsFile(files, output, ft1FileName); + TestUtils.ensureDoesNotContainFile(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); + TestUtils.ensureDoesNotContainFile(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); + TestUtils.ensureDoesNotContainFile(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); + TestUtils.ensureDoesNotContainFile(files, output, bttFileName); Assert.assertFalse(new File(output, bttFileName).exists()); } finally { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index 0303e161a2f..133f9b1c512 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -1171,4 +1171,30 @@ public class InlineModelResolverTest { ((Schema) inlineFormParaemter.getProperties().get("enum_form_string")).get$ref()); } + + @Test + public void doNotWrapSingleAllOfRefs() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/issue_15077.yaml"); + new InlineModelResolver().flatten(openAPI); + + // None of these cases should be wrapped in an inline schema and should reference the original schema "NumberRange" + Schema limitsModel = (Schema) openAPI.getComponents().getSchemas().get("Limits"); + final String numberRangeRef = "#/components/schemas/NumberRange"; + + Schema allOfRef = (Schema) limitsModel.getProperties().get("allOfRef"); + assertNotNull(allOfRef.getAllOf()); + assertEquals(numberRangeRef, ((Schema) allOfRef.getAllOf().get(0)).get$ref()); + + Schema allOfRefWithDescription = (Schema) limitsModel.getProperties().get("allOfRefWithDescription"); + assertNotNull(allOfRefWithDescription.getAllOf()); + assertEquals(numberRangeRef, ((Schema) allOfRefWithDescription.getAllOf().get(0)).get$ref()); + + Schema allOfRefWithReadonly = (Schema) limitsModel.getProperties().get("allOfRefWithReadonly"); + assertNotNull(allOfRefWithReadonly.getAllOf()); + assertEquals(numberRangeRef, ((Schema) allOfRefWithReadonly.getAllOf().get(0)).get$ref()); + + Schema allOfRefWithDescriptionAndReadonly = (Schema) limitsModel.getProperties().get("allOfRefWithDescriptionAndReadonly"); + assertNotNull(allOfRefWithDescriptionAndReadonly.getAllOf()); + assertEquals(numberRangeRef, ((Schema) allOfRefWithDescriptionAndReadonly.getAllOf().get(0)).get$ref()); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java deleted file mode 100644 index c9a1cbf4878..00000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/MockDefaultGenerator.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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; -import org.openapitools.codegen.templating.TemplateManagerOptions; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Decorates {@link DefaultCodegen and tracks some internal calls}. - * - * @deprecated Please avoid using this type, as it is not a mock and invokes real generation. Prefer {@link DefaultGenerator#DefaultGenerator(Boolean)} with dryRun=true and/or true mocked spies. - */ -@Deprecated -public class MockDefaultGenerator extends DefaultGenerator { - public List getTemplateBasedFiles() { - return templateBasedFiles; - } - - public Map getFiles() { - return files; - } - - // public static final String INPUT_STREAM_CONTENT = "INPUT STREAM CONTENT"; - private List templateBasedFiles = new ArrayList<>(); - private Map files = new HashMap<>(); - - public MockDefaultGenerator() { - super(true); - } - - public MockDefaultGenerator(boolean dryRun) { - super(dryRun); - } - - @Override - public Generator opts(ClientOptInput opts) { - Generator o = super.opts(opts); - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.config.isEnableMinimalUpdate(),this.config.isSkipOverwrite()); - this.templateProcessor = new ObservableDryRunTemplateManager(templateManagerOptions); - return o; - } - - public static class WrittenTemplateBasedFile { - private Map templateData; - private String templateName; - private String outputFilename; - - public WrittenTemplateBasedFile(Map templateData, String templateName, String outputFilename) { - this.templateData = templateData; - this.templateName = templateName; - this.outputFilename = outputFilename; - } - - public Map getTemplateData() { - return templateData; - } - - public String getTemplateName() { - return templateName; - } - - public String getOutputFilename() { - return outputFilename; - } - - @Override - public String toString() { - return "WrittenTemplateBasedFile [" + - "outputFilename=" + outputFilename + ", " + - "templateName=" + templateName + ", " + - "templateData=" + templateData + "]"; - } - } - - class ObservableDryRunTemplateManager extends DryRunTemplateManager { - public ObservableDryRunTemplateManager(TemplateManagerOptions options) { - super(options); - } - - private String normalizePath(String filename) { - return filename.replace("\\", "/").replace("//", "/"); - } - - @Override - public File write(Map data, String template, File target) throws IOException { - String filename = normalizePath(target.toPath().normalize().toString()); - templateBasedFiles.add(new WrittenTemplateBasedFile(data, template, filename)); - - File file = super.write(data, template, target); - if (file != null && file.exists()) { - byte[] contents = Files.readAllBytes(file.toPath()); - files.put(normalizePath(filename), new String(contents, StandardCharsets.UTF_8)); - } - - return file; - } - - @Override - public File writeToFile(String filename, byte[] contents) throws IOException { - files.put(normalizePath(filename), new String(contents, StandardCharsets.UTF_8)); - return super.writeToFile(filename, contents); - } - } -} 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 d7b85e4be6f..174536e8492 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 @@ -16,43 +16,14 @@ package org.openapitools.codegen; -import com.google.common.collect.Sets; -import com.samskivert.mustache.Mustache.Lambda; - -import io.swagger.parser.OpenAPIParser; -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.headers.Header; import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.QueryParameter; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.responses.ApiResponses; -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.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.templating.mustache.CamelCaseAndSanitizeLambda; -import org.openapitools.codegen.templating.mustache.IndentedLambda; -import org.openapitools.codegen.templating.mustache.LowercaseLambda; -import org.openapitools.codegen.templating.mustache.TitlecaseLambda; -import org.openapitools.codegen.templating.mustache.UppercaseLambda; import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.SemVer; -import org.testng.Assert; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; -import java.io.File; -import java.nio.file.Files; import java.util.*; -import java.util.stream.Collectors; import static org.testng.Assert.*; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index 045e8898574..72288ac05af 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -1,14 +1,12 @@ package org.openapitools.codegen; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.fail; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertFalse; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.github.javaparser.JavaParser; -import com.github.javaparser.ParserConfiguration; import com.github.javaparser.ParseResult; +import com.github.javaparser.ParserConfiguration; import com.github.javaparser.ast.CompilationUnit; +import com.google.common.collect.ImmutableMap; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -17,30 +15,18 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; - -import org.apache.commons.io.IOUtils; -import org.openapitools.codegen.MockDefaultGenerator.WrittenTemplateBasedFile; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.utils.ModelUtils; -import org.openrewrite.maven.internal.RawPom; -import org.testng.Assert; -import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; -import com.google.common.collect.ImmutableMap; +import static org.testng.Assert.*; public class TestUtils { @@ -100,82 +86,53 @@ public class TestUtils { return openAPI; } - public static OpenAPI createOpenAPIWithOneSchema(String name, Schema schema) { + public static OpenAPI createOpenAPIWithOneSchema(String name, Schema schema) { OpenAPI openAPI = createOpenAPI(); openAPI.setComponents(new Components()); openAPI.getComponents().addSchemas(name, schema); return openAPI; } - /** - * Extract file from {@link MockDefaultGenerator} - * - * @param generator Generator - * @param root root path - * @param filename filename under root - * - * @return a {@link WrittenTemplateBasedFile} - * @deprecated Since 5.0. Please avoid this method and usage of {@link MockDefaultGenerator}, prefer {@link DefaultGenerator#DefaultGenerator(Boolean)} with dryRun=true. - */ - @Deprecated - public static WrittenTemplateBasedFile getTemplateBasedFile(MockDefaultGenerator generator, File root, String filename) { - String defaultApiFilename = new File(root, filename).getAbsolutePath().replace("\\", "/"); - Optional optional = generator.getTemplateBasedFiles().stream().filter(f -> defaultApiFilename.equals(f.getOutputFilename())).findFirst(); - Assert.assertTrue(optional.isPresent()); - return optional.get(); - } - public static void ensureContainsFile(List generatedFiles, File root, String filename) { Path path = root.toPath().resolve(filename); assertTrue(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath() + "' was not found in the list of generated files"); } - public static void ensureDoesNotContainsFile(List generatedFiles, File root, String filename) { + public static void ensureDoesNotContainFile(List generatedFiles, File root, String filename) { Path path = root.toPath().resolve(filename); assertFalse(generatedFiles.contains(path.toFile()), "File '" + path.toAbsolutePath() + "' was found in the list of generated files"); } - public static void validatePomXmlFiles(final Map fileMap) { - fileMap.forEach( (fileName, fileContents) -> { - if ("pom.xml".equals(fileName)) { - assertValidPomXml(fileContents); - } - }); - } - public static void validatePomXmlFiles(final List files) { - files.forEach( f -> { - String fileName = f.getName(); - if ("pom.xml".equals(fileName)) { - try { - String fileContents = new String(Files.readAllBytes(f.toPath()), StandardCharsets.UTF_8); - assertValidPomXml(fileContents); - } catch (IOException exception) { - throw new RuntimeException(exception); - } - } - } - ); + if (files == null + || files.isEmpty() + || files.stream().noneMatch(f -> f.getName().equals("pom.xml"))) return; + + final XmlMapper mapper = new XmlMapper(); + for (File file : files) { + if (!"pom.xml".equals(file.getName())) continue; + + try { + JsonNode pomContents = mapper.readTree(file); + assertValidPomXml(pomContents); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + }; } - private static void assertValidPomXml(final String fileContents) { - final InputStream input = new ByteArrayInputStream(fileContents.getBytes(StandardCharsets.UTF_8)); - try { - RawPom pom = RawPom.parse(input, null); - assertTrue(pom.getDependencies().getDependencies().size() > 0); - assertNotNull(pom.getName()); - assertNotNull(pom.getArtifactId()); - assertNotNull(pom.getGroupId()); - assertNotNull(pom.getVersion()); - } finally { - IOUtils.closeQuietly(input); - } + private static void assertValidPomXml(final JsonNode pom) { + assertFalse(pom.path("dependencies").isEmpty()); + assertNotNull(pom.get("name")); + assertNotNull(pom.get("artifactId")); + assertNotNull(pom.get("groupId")); + assertNotNull(pom.get("version")); } public static void validateJavaSourceFiles(Map fileMap) { fileMap.forEach( (fileName, fileContents) -> { if (fileName.endsWith(".java")) { - assertValidJavaSourceCode(fileContents, fileName); + assertValidJavaSourceCode(fileContents); } } ); @@ -183,21 +140,20 @@ public class TestUtils { public static void validateJavaSourceFiles(List files) { files.forEach( f -> { - String fileName = f.getName(); - if (fileName.endsWith(".java")) { + if (f.getName().endsWith(".java")) { String fileContents = ""; try { - fileContents = new String(Files.readAllBytes(f.toPath()), StandardCharsets.UTF_8); + fileContents = Files.readString(f.toPath()); } catch (IOException ignored) { } - assertValidJavaSourceCode(fileContents, fileName); + assertValidJavaSourceCode(fileContents); } } ); } - public static void assertValidJavaSourceCode(String javaSourceCode, String filename) { + public static void assertValidJavaSourceCode(String javaSourceCode) { ParserConfiguration config = new ParserConfiguration(); config.setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_11); JavaParser parser = new JavaParser(config); @@ -207,7 +163,7 @@ public class TestUtils { public static void assertFileContains(Path path, String... lines) { try { - String generatedFile = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + String generatedFile = Files.readString(path); String file = linearize(generatedFile); assertNotNull(file); for (String line : lines) @@ -224,7 +180,7 @@ public class TestUtils { public static void assertFileNotContains(Path path, String... lines) { String generatedFile = null; try { - generatedFile = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + generatedFile = Files.readString(path); } catch (IOException e) { fail("Unable to evaluate file " + path); } @@ -236,7 +192,7 @@ public class TestUtils { public static void assertFileNotExists(Path path) { try { - new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + Files.readString(path); fail("File exists when it should not: " + path); } catch (IOException e) { // File exists, pass. @@ -246,7 +202,7 @@ public class TestUtils { public static void assertFileExists(Path path) { try { - new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + Files.readString(path); // File exists, pass. assertTrue(true); } catch (IOException e) { @@ -261,7 +217,7 @@ public class TestUtils { .containsWithName("javax.persistence.Entity") .containsWithNameAndAttributes("javax.persistence.Table", ImmutableMap.of("name", "\"employees\"")) .toType() - .hasProperty("assignments") + .assertProperty("assignments") .assertPropertyAnnotations() .containsWithNameAndAttributes("javax.persistence.OneToMany", ImmutableMap.of("mappedBy", "\"employee\"")) .toProperty() @@ -271,17 +227,17 @@ public class TestUtils { .assertTypeAnnotations() .containsWithName("javax.persistence.MappedSuperclass") .toType() - .hasProperty("id") + .assertProperty("id") .assertPropertyAnnotations() .containsWithName("javax.persistence.Id") .toProperty() .toType() - .hasProperty("email") + .assertProperty("email") .assertPropertyAnnotations() .containsWithName("org.hibernate.annotations.Formula") .toProperty() .toType() - .hasProperty("hasAcceptedTerms") + .assertProperty("hasAcceptedTerms") .assertPropertyAnnotations() .containsWithName("javax.persistence.Transient") .toProperty() @@ -292,13 +248,13 @@ public class TestUtils { .containsWithName("javax.persistence.Entity") .containsWithNameAndAttributes("javax.persistence.Table", ImmutableMap.of("name", "\"survey_groups\"")) .toType() - .hasProperty("assignments") + .assertProperty("assignments") .assertPropertyAnnotations() .containsWithName("javax.persistence.OneToMany") .containsWithNameAndAttributes("javax.persistence.JoinColumn", ImmutableMap.of("name", "\"survey_group_id\"")) .toProperty() .toType() - .hasProperty("disabled") + .assertProperty("disabled") .assertPropertyAnnotations() .containsWithNameAndAttributes("javax.persistence.Column", ImmutableMap.of("nullable", "false")) .toProperty() @@ -309,7 +265,7 @@ public class TestUtils { .containsWithName("javax.persistence.MappedSuperclass") .containsWithName("javax.persistence.EntityListeners") .toType() - .hasProperty("id") + .assertProperty("id") .assertPropertyAnnotations() .containsWithName("javax.persistence.Id") .containsWithNameAndAttributes("javax.persistence.GeneratedValue", ImmutableMap.of("generator", "\"UUID\"")) @@ -317,39 +273,39 @@ public class TestUtils { .containsWithNameAndAttributes("javax.persistence.Column", ImmutableMap.of("name", "\"id\"","updatable", "false","nullable", "false")) .toProperty() .toType() - .hasProperty("createdDate") + .assertProperty("createdDate") .assertPropertyAnnotations() .containsWithName("org.springframework.data.annotation.CreatedDate") .toProperty() .toType() - .hasProperty("createdBy") + .assertProperty("createdBy") .assertPropertyAnnotations() .containsWithName("org.springframework.data.annotation.CreatedBy") .toProperty() .toType() - .hasProperty("modifiedDate") + .assertProperty("modifiedDate") .assertPropertyAnnotations() .containsWithName("org.springframework.data.annotation.LastModifiedDate") .toProperty() .toType() - .hasProperty("modifiedBy") + .assertProperty("modifiedBy") .assertPropertyAnnotations() .containsWithName("org.springframework.data.annotation.LastModifiedBy") .toProperty() .toType() - .hasProperty("opportunityId") + .assertProperty("opportunityId") .assertPropertyAnnotations() .containsWithNameAndAttributes("javax.persistence.Column", ImmutableMap.of("unique", "true")) .toProperty() .toType() - .hasProperty("submissionStatus") + .assertProperty("submissionStatus") .assertPropertyAnnotations() .containsWithName("javax.persistence.Transient") .toProperty() .toType(); JavaFileAssert.assertThat(java.nio.file.Paths.get(baseOutputPath + "/CompanyDto.java")) - .hasProperty("priceCategory") + .assertProperty("priceCategory") .assertPropertyAnnotations() .containsWithNameAndAttributes("IgnoreForRoles", ImmutableMap.of("value", "\"MEDIA_ADMIN\"")); } @@ -363,4 +319,16 @@ public class TestUtils { objs.setModels(modelMaps); return objs; } + + public static Path newTempFolder() { + final Path tempDir; + try { + tempDir = Files.createTempDirectory("test"); + } catch (IOException e) { + throw new RuntimeException(e); + } + tempDir.toFile().deleteOnExit(); + + return tempDir; + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtilsTest.java new file mode 100644 index 00000000000..1bc8ba5090f --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtilsTest.java @@ -0,0 +1,175 @@ +package org.openapitools.codegen; + +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.util.List; +import java.util.Locale; + +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +@SuppressWarnings("NewClassNamingConvention") +public class TestUtilsTest { + + // forbiddenapis check will fail if we don't explicitly define localization when using String.format + static final Locale L = null; + + public static class validatePomXmlFiles { + + static final String POM_SCAFFOLD = "%s%s"; + static final String POM_PROJECT_INFO = "foofoo.barfoobar13.12"; + + @Test void doesNotThrow_ifNotPom_doesNotExist() { + final var vaporFile = newTempDir().resolve("other.xml").toFile(); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(vaporFile))) + .doesNotThrowAnyException(); + } + + @Test void throwsRuntimeException_ifPomDoesNotExist() { + final var vaporBom = newTempDir().resolve("pom.xml").toFile(); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(vaporBom))) + .isExactlyInstanceOf(RuntimeException.class); + } + + @Test void throwsRuntimeException_ifXmlIsJson() { + Path testFile = newPomXmlFile("{\"not_xml\": 12345}"); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(RuntimeException.class); + } + + @Test void throwsRuntimeException_ifXmlIsInvalid() { + final Path testFile = newPomXmlFile(""); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(RuntimeException.class); + } + + @Test void throwsAssertionError_ifNameTagIsMissing() { + final Path testFile = newPomXmlFile(replaceTag("name", "", getMinimalValidPomContent())); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_ifNameIsEmpty() { + final Path testFile = newPomXmlFile( + replaceTag("name", "", getMinimalValidPomContent()) + ); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .doesNotThrowAnyException(); + } + + @Test void throwsAssertionError_ifArtifactIdTagIsMissing() { + final Path testFile = newPomXmlFile(replaceTag("artifactId", "", getMinimalValidPomContent())); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_ifArtifactIdIsEmpty() { + final Path testFile = newPomXmlFile( + replaceTag("artifactId", "", getMinimalValidPomContent()) + ); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .doesNotThrowAnyException(); + } + + @Test void throwsAssertionError_ifGroupIdTagIsMissing() { + final Path testFile = newPomXmlFile(replaceTag("groupId", "", getMinimalValidPomContent())); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_ifGroupIdIsEmpty() { + final Path testFile = newPomXmlFile( + replaceTag("groupId", "", getMinimalValidPomContent()) + ); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .doesNotThrowAnyException(); + } + + @Test void throwsAssertionError_ifVersionTagIsMissing() { + final Path testFile = newPomXmlFile(replaceTag("version", "", getMinimalValidPomContent())); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_ifVersionIsEmpty() { + final Path testFile = newPomXmlFile( + replaceTag("version", "", getMinimalValidPomContent()) + ); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .doesNotThrowAnyException(); + } + + @Test void throwsAssertionError_ifZeroDependencies() { + final Path testFile = newPomXmlFile(String.format(L, POM_SCAFFOLD, POM_PROJECT_INFO, "")); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_ifAtLeastOneDependency() { + final Path testFile = newPomXmlFile(String.format(L, POM_SCAFFOLD, POM_PROJECT_INFO, "")); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile.toFile()))) + .doesNotThrowAnyException(); + } + + @Test void throwsAssertionError_withTwoValidPoms_whereSecondHasNoName() { + final File testFile1 = newPomXmlFile(getMinimalValidPomContent()).toFile(); + final File testFile2 = newPomXmlFile(replaceTag("name", "", getMinimalValidPomContent())).toFile(); + + assertThatThrownBy(() -> TestUtils.validatePomXmlFiles(List.of(testFile1, testFile2))) + .isExactlyInstanceOf(AssertionError.class); + } + + @Test void doesNotThrow_withTwoValidPoms() { + final File testFile1 = newPomXmlFile(getMinimalValidPomContent()).toFile(); + final File testFile2 = newPomXmlFile(getMinimalValidPomContent()).toFile(); + + assertThatCode(() -> TestUtils.validatePomXmlFiles(List.of(testFile1, testFile2))) + .doesNotThrowAnyException(); + } + + private String replaceTag(String tagToReplace, String replaceWith, String xml) { + return xml.replaceAll("<" + tagToReplace + ">[\\s\\S]*?", replaceWith); + } + + private String getMinimalValidPomContent() { + return String.format(L, POM_SCAFFOLD, POM_PROJECT_INFO, ""); + } + + private Path newPomXmlFile(String content) { + try { + return Files.writeString(newTempDir().resolve("pom.xml"), content); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private Path newTempDir() { + final Path tempDir; + try { + tempDir = Files.createTempDirectory("test"); + } catch (IOException e) { + throw new RuntimeException(e); + } + tempDir.toFile().deleteOnExit(); + return tempDir; + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java index 50373d6ed95..9d56cf5812d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java @@ -19,6 +19,7 @@ package org.openapitools.codegen.config; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.annotations.Test; import java.io.File; @@ -31,8 +32,8 @@ import java.util.Map; import static org.testng.Assert.*; public class CodegenConfiguratorTest { - private void want(Map additionalProperties, String key, Object expected) { - assertEquals(additionalProperties.getOrDefault(key, null), expected); + private void want(ConfigAssert configAssert, String key, Object expected) { + configAssert.assertValue(key, expected); } @Test @@ -90,7 +91,7 @@ public class CodegenConfiguratorTest { CodegenConfig config = clientOptInput.getConfig(); config.processOpts(); - Map props = config.additionalProperties(); + ConfigAssert props = new ConfigAssert(config.additionalProperties()); // This verifies that things we expect to make it into the template will, as a result of this CodegenConfigurator. want(props, CodegenConstants.MODEL_PACKAGE, "model_package"); // * mutated by codegen @@ -122,4 +123,4 @@ public class CodegenConfiguratorTest { want(props, "foo", "bar"); want(props, "baz", "quux"); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java index a7d6db4c0f4..f3feed5c126 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/MergedSpecBuilderTest.java @@ -77,8 +77,8 @@ public class MergedSpecBuilderTest { .assertMethodAnnotations() .containsWithNameAndAttributes("RequestMapping", ImmutableMap.of("value", "\"/spec1/complex/{param1}/path\"")) .toMethod() - .hasParameter("param1") - .withType("String") + .assertParameter("param1") + .hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("PathVariable", ImmutableMap.of("value", "\"param1\"")); @@ -92,4 +92,4 @@ public class MergedSpecBuilderTest { .assertMethod("getSpec2Field").hasReturnType("BigDecimal"); } -} \ No newline at end of file +} 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 index 95b2ddddcb5..59abc88bab0 100644 --- 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 @@ -32,6 +32,7 @@ public class ObjectAnyTypeSetTest extends AbstractGeneratorsTest { /** 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"; + private static final String ISSUE_6726 = "src/test/resources/3_0/issue_6726.yaml"; /** Soft assert to check all the generators before eventually failing a test */ private final SoftAssert softAssert = new SoftAssert(); @@ -44,7 +45,7 @@ public class ObjectAnyTypeSetTest extends AbstractGeneratorsTest { public void testSomeWithPetstoreWithAbstract() throws IOException { // assertGeneratedFiles("c"); // assertGeneratedFiles("cpp-restsdk"); - generateFiles("cpp-pistache-server"); + generateFiles("cpp-pistache-server", ISSUE_6726); // assertGeneratedFiles("typescript"); this.softAssert.assertAll(); } @@ -52,11 +53,12 @@ public class ObjectAnyTypeSetTest extends AbstractGeneratorsTest { /** * Asserts that a generator has produced some files * @param generatorName The generator name to test + * @param inputSpec The inputspec to use. * @return List of files generated * @throws IOException if the test folder cannot be created */ - private List generateFiles(String generatorName) throws IOException { + private List generateFiles(String generatorName, String inputSpec) throws IOException { Objects.requireNonNull(generatorName, "A generator name is expected for this assertion"); - return oneWith(generatorName, INPUT_SPEC); + return oneWith(generatorName, inputSpec); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpprestbed/CppRestbedServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpprestbed/CppRestbedServerTest.java index cb47b78b87d..0fb2360e502 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpprestbed/CppRestbedServerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpprestbed/CppRestbedServerTest.java @@ -10,7 +10,6 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java index da97ae45645..462266da88c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpptiny/CppTinyClientModelTest.java @@ -1,15 +1,5 @@ package org.openapitools.codegen.cpptiny; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.*; -import org.openapitools.codegen.languages.CppTinyClientCodegen; -import org.testng.Assert; -import org.testng.annotations.Test; - - public class CppTinyClientModelTest extends CppTinyBaseTest { 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 8ee09093d5a..4617ec5044a 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 @@ -37,7 +37,6 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.CSharpClientCodegen; -import org.openapitools.codegen.languages.JavaClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -116,4 +115,29 @@ public class CSharpClientCodegenTest { assertFileContains(apiFile.toPath(), "localVarRequestOptions.HeaderParameters.Add(\"X-CUSTOM_CONSTANT_HEADER\", Org.OpenAPITools.Client.ClientUtils.ParameterToString(\"CONSTANT_VALUE\"));"); } + + @Test + public void test31specAdditionalPropertiesOfOneOf() throws IOException { + // for https://github.com/OpenAPITools/openapi-generator/pull/18772 + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_1/csharp/additional_properties_oneof.yaml"); + final DefaultGenerator defaultGenerator = new DefaultGenerator(); + final ClientOptInput clientOptInput = new ClientOptInput(); + clientOptInput.openAPI(openAPI); + CSharpClientCodegen cSharpClientCodegen = new CSharpClientCodegen(); + cSharpClientCodegen.setOutputDir(output.getAbsolutePath()); + cSharpClientCodegen.setAutosetConstants(true); + clientOptInput.config(cSharpClientCodegen); + defaultGenerator.opts(clientOptInput); + + Map files = defaultGenerator.generate().stream() + .collect(Collectors.toMap(File::getPath, Function.identity())); + + File modelFile = files + .get(Paths.get(output.getAbsolutePath(), "src", "Org.OpenAPITools", "Model", "Response.cs").toString()); + assertNotNull(modelFile); + assertFileContains(modelFile.toPath(), + " Dictionary results = default(Dictionary"); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java index 36b3e4edb65..ae403621c0a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientCodegenTest.java @@ -20,7 +20,6 @@ package org.openapitools.codegen.dart; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; 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 90136ff895a..87dabbbfd00 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,7 +20,6 @@ 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/DartDioClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java index 1967ceb6672..a48e2dbbc6c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java @@ -33,8 +33,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Locale; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/eiffel/AbstractEiffelCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/eiffel/AbstractEiffelCodegenTest.java index e0b2dc42507..144bfe7c2d0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/eiffel/AbstractEiffelCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/eiffel/AbstractEiffelCodegenTest.java @@ -17,17 +17,32 @@ package org.openapitools.codegen.eiffel; +import org.mockito.Answers; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractEiffelCodegen; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; + public class AbstractEiffelCodegenTest { + private AbstractEiffelCodegen 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 = mock( + AbstractEiffelCodegen.class, withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } + @Test public void testInitialConfigValues() throws Exception { - final AbstractEiffelCodegen codegen = new P_AbstractEiffelCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); @@ -36,7 +51,6 @@ public class AbstractEiffelCodegenTest { @Test public void testSettersForConfigValues() throws Exception { - final AbstractEiffelCodegen codegen = new P_AbstractEiffelCodegen(); codegen.setHideGenerationTimestamp(true); codegen.processOpts(); @@ -46,28 +60,10 @@ public class AbstractEiffelCodegenTest { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final AbstractEiffelCodegen codegen = new P_AbstractEiffelCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, true); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); Assert.assertTrue(codegen.isHideGenerationTimestamp()); } - - private static class P_AbstractEiffelCodegen extends AbstractEiffelCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/AbstractGoCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/AbstractGoCodegenTest.java index c232ff4d8ea..af4f8bdfdd3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/AbstractGoCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/AbstractGoCodegenTest.java @@ -24,18 +24,33 @@ import io.swagger.v3.oas.models.media.IntegerSchema; import io.swagger.v3.oas.models.media.MapSchema; import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; +import org.mockito.Answers; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractGoCodegen; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; + public class AbstractGoCodegenTest { + private AbstractGoCodegen 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 = mock( + AbstractGoCodegen.class, withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } + @Test public void testInitialConfigValues() throws Exception { - final AbstractGoCodegen codegen = new P_AbstractGoCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); @@ -44,7 +59,6 @@ public class AbstractGoCodegenTest { @Test public void testSettersForConfigValues() throws Exception { - final AbstractGoCodegen codegen = new P_AbstractGoCodegen(); codegen.setHideGenerationTimestamp(true); codegen.processOpts(); @@ -54,7 +68,6 @@ public class AbstractGoCodegenTest { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final AbstractGoCodegen codegen = new P_AbstractGoCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, true); codegen.processOpts(); @@ -64,7 +77,6 @@ public class AbstractGoCodegenTest { @Test public void getTypeDeclarationTest() { - final AbstractGoCodegen codegen = new P_AbstractGoCodegen(); // Create an alias to an array schema Schema nestedArraySchema = new ArraySchema().items(new IntegerSchema().format("int32")); @@ -99,21 +111,4 @@ public class AbstractGoCodegenTest { defaultValue = codegen.getTypeDeclaration(schema); Assert.assertEquals(defaultValue, "map[string]interface{}"); } - - private static class P_AbstractGoCodegen extends AbstractGoCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellModelTest.java index 82e4f915fde..b3f2dcda3d1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellModelTest.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.haskellservant; -import org.testng.Assert; import org.testng.annotations.Test; public class HaskellModelTest { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerCodegenTest.java index 830c159f08d..548e08aaa57 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerCodegenTest.java @@ -1,7 +1,7 @@ package org.openapitools.codegen.haskellyesod; import java.util.*; -import org.openapitools.codegen.TestUtils; + import org.openapitools.codegen.languages.HaskellYesodServerCodegen; import org.testng.Assert; import org.testng.annotations.Test; 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 b3233495371..5f58dc56c79 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 @@ -36,6 +36,7 @@ import org.mockito.Answers; import org.mockito.Mockito; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.AbstractJavaCodegen; +import org.openapitools.codegen.testutils.ConfigAssert; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.BeforeMethod; @@ -79,8 +80,8 @@ public class AbstractJavaCodegenTest { */ @Test public void toEnumVarNameShouldNotResultInSingleUnderscore() { - Assert.assertEquals(codegen.toEnumVarName(" ", "String"), "SPACE"); - Assert.assertEquals(codegen.toEnumVarName("==", "String"), "u"); + Assert.assertNotEquals(codegen.toEnumVarName(" ", "String"), "_"); + Assert.assertNotEquals(codegen.toEnumVarName("==", "String"), "_"); } @Test @@ -182,17 +183,13 @@ public class AbstractJavaCodegenTest { codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "invalidPackageName"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "invalidPackageName"); - Assert.assertEquals(codegen.apiPackage(), "invalidPackageName"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "invalidPackageName"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "get"); - Assert.assertEquals(codegen.getArtifactVersion(), openAPI.getInfo().getVersion()); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), openAPI.getInfo().getVersion()); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "invalidPackageName"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "invalidPackageName"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools"); + configAssert.assertValue(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "get"); + configAssert.assertValue(CodegenConstants.ARTIFACT_VERSION, codegen::getArtifactVersion, openAPI.getInfo().getVersion()); } @Test @@ -209,18 +206,13 @@ public class AbstractJavaCodegenTest { codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); - - 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(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "is"); - Assert.assertEquals(codegen.getArtifactVersion(), "0.9.0-SNAPSHOT"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.9.0-SNAPSHOT"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.zzzzzzz.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.zzzzzzz.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.zzzzzzz.invoker"); + configAssert.assertValue(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "is"); + configAssert.assertValue(CodegenConstants.ARTIFACT_VERSION, codegen::getArtifactVersion, "0.9.0-SNAPSHOT"); } @Test @@ -234,18 +226,13 @@ public class AbstractJavaCodegenTest { codegen.processOpts(); codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.model.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.model.oooooo"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.api.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.api.oooooo"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.invoker.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.invoker.oooooo"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "getBoolean"); - Assert.assertEquals(codegen.getArtifactVersion(), "0.8.0-SNAPSHOT"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.ARTIFACT_VERSION), "0.8.0-SNAPSHOT"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.model.oooooo"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.api.oooooo"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.invoker.oooooo"); + configAssert.assertValue(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "getBoolean"); + configAssert.assertValue(CodegenConstants.ARTIFACT_VERSION, codegen::getArtifactVersion, "0.8.0-SNAPSHOT"); } @Test @@ -885,7 +872,7 @@ public class AbstractJavaCodegenTest { @Test public void AnnotationsContainerTest() { - codegen.additionalProperties().put("useBeanValidation", true); + codegen.setUseBeanValidation(true); // 1. string type Schema schema = new ArraySchema().items(new Schema<>().type("string").pattern("^[a-z]$").minLength(0).maxLength(36)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaCXFClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaCXFClientCodegenTest.java index 0f1b2315f2a..1b0eb9772b8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaCXFClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaCXFClientCodegenTest.java @@ -32,11 +32,11 @@ import org.openapitools.codegen.languages.features.LoggingTestFeatures; import org.openapitools.codegen.languages.features.UseGenericResponseFeatures; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.testutils.ConfigAssert; 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; @@ -90,15 +90,11 @@ public class JavaCXFClientCodegenTest { final JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::apiPackage, "org.openapitools.api"); } @Test @@ -108,14 +104,11 @@ public class JavaCXFClientCodegenTest { codegen.setInvokerPackage("org.openapitools.client.xyz.invoker"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client.xyz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client.xyz.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.client.xyz.invoker"); } @Test @@ -125,14 +118,11 @@ public class JavaCXFClientCodegenTest { codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE,"org.openapitools.client.xyz.invoker"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client.xyz.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client.xyz.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.client.xyz.invoker"); } @Test @@ -196,13 +186,14 @@ public class JavaCXFClientCodegenTest { JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); codegen.processOpts(); - Assert.assertNotNull(codegen.additionalProperties().get(AbstractJavaCodegen.OPENAPI_NULLABLE)); - Assert.assertTrue(codegen.isOpenApiNullable()); + + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(AbstractJavaCodegen.OPENAPI_NULLABLE, codegen::isOpenApiNullable, Boolean.TRUE); codegen.additionalProperties().put(AbstractJavaCodegen.OPENAPI_NULLABLE, false); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.OPENAPI_NULLABLE), Boolean.FALSE); - Assert.assertFalse(codegen.isOpenApiNullable()); + + configAssert.assertValue(AbstractJavaCodegen.OPENAPI_NULLABLE, codegen::isOpenApiNullable, Boolean.FALSE); } @Test @@ -300,13 +291,13 @@ public class JavaCXFClientCodegenTest { JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); codegen.processOpts(); - Assert.assertNull(codegen.additionalProperties().get(AbstractJavaCodegen.JACKSON)); - Assert.assertFalse(codegen.isUseJackson()); + + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(AbstractJavaCodegen.JACKSON, false); codegen.additionalProperties().put(AbstractJavaCodegen.JACKSON, true); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaCodegen.JACKSON), Boolean.TRUE); - Assert.assertTrue(codegen.isUseJackson()); + configAssert.assertValue(AbstractJavaCodegen.JACKSON, true); } @Test 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 dcb6aa56ea1..a16014271aa 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,68 +17,19 @@ package org.openapitools.codegen.java; -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; -import static org.openapitools.codegen.languages.JavaClientCodegen.USE_ENUM_CASE_INSENSITIVE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - import com.google.common.collect.ImmutableMap; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.SchemaTypeUtil; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -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; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import junit.framework.AssertionFailedError; +import lombok.Getter; import lombok.SneakyThrows; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenResponse; -import org.openapitools.codegen.CodegenSecurity; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.TestUtils; +import org.junit.jupiter.api.Assertions; +import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.AbstractJavaCodegen; @@ -88,41 +39,123 @@ import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; -import org.testng.Assert; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.annotations.DataProvider; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.entry; +import static org.assertj.core.api.InstanceOfAssertFactories.FILE; +import static org.openapitools.codegen.CodegenConstants.SERIALIZATION_LIBRARY; +import static org.openapitools.codegen.TestUtils.newTempFolder; +import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; +import static org.openapitools.codegen.languages.JavaClientCodegen.*; +import static org.testng.Assert.*; + public class JavaClientCodegenTest { - @Test - public void arraysInRequestBody() { + // This is the kind of information that ideally would be defined and available system-wide + @Getter enum Library { + APACHE_HTTPCLIENT("apache-httpclient", Serializer.JACKSON), + FEIGN("feign", Serializer.JACKSON, Set.of(Serializer.GSON)), + GOOGLE_API_CLIENT("google-api-client", Serializer.JACKSON), + JERSEY_2("jersey2", Serializer.JACKSON), + JERSEY_3("jersey3", Serializer.JACKSON), + MICROPROFILE("microprofile", Serializer.JSONB, Set.of(Serializer.JACKSON)), + NATIVE("native", Serializer.JACKSON), + OKHTTP("okhttp-gson", Serializer.GSON), + REST_ASSURED("rest-assured", Serializer.GSON, Set.of(Serializer.JACKSON)), + RESTEASY("resteasy", Serializer.JACKSON), + REST_CLIENT("restclient", Serializer.JACKSON), + REST_TEMPLATE("resttemplate", Serializer.JACKSON), + RETROFIT_2("retrofit2", Serializer.GSON), + VERTX("vertx", Serializer.JACKSON), + WEBCLIENT("webclient", Serializer.JACKSON); + + public final String value; + public final Set supportedSerializers; + public final Serializer defaultSerializer; + + Library(String identifier, Serializer defaultSerializer) { + this(identifier, defaultSerializer, Set.of()); + } + + Library(String identifier, Serializer defaultSerializer, Set otherSupportedSerializers) { + otherSupportedSerializers = new HashSet<>(otherSupportedSerializers); + otherSupportedSerializers.add(defaultSerializer); + this.supportedSerializers = Set.copyOf(otherSupportedSerializers); + this.defaultSerializer = defaultSerializer; + this.value = identifier; + } + } + + enum Serializer { + GSON, JACKSON, JSONB; + public String toString() { + return this.name().toLowerCase(Locale.ROOT); + } + } + + @DataProvider Iterator supportedLibraries() { + return Arrays.stream(Library.values()).iterator(); + } + + @DataProvider Iterator librariesSupportingGson() { + return Arrays.stream(Library.values()) + .filter(library -> library.getSupportedSerializers().contains(Serializer.GSON)) + .iterator(); + } + + @DataProvider Iterator librariesSupportingJackson() { + return Arrays.stream(Library.values()) + .filter(library -> library.getSupportedSerializers().contains(Serializer.JACKSON)) + .iterator(); + } + + @DataProvider Iterator librariesNotSupportingJackson() { + return Arrays.stream(Library.values()) + .filter(library -> !library.getSupportedSerializers().contains(Serializer.JACKSON)) + .iterator(); + } + + + @Test public void arraysInRequestBody() { OpenAPI openAPI = TestUtils.createOpenAPI(); final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setOpenAPI(openAPI); RequestBody body1 = new RequestBody(); body1.setDescription("A list of ids"); - body1.setContent( - new Content() - .addMediaType( - "application/json", - new MediaType().schema(new ArraySchema().items(new StringSchema())))); - CodegenParameter codegenParameter1 = codegen.fromRequestBody(body1, new HashSet(), null); + body1.setContent(new Content().addMediaType( + "application/json", + new MediaType().schema(new ArraySchema().items(new StringSchema())) + )); + CodegenParameter codegenParameter1 = codegen.fromRequestBody(body1, new HashSet<>(), null); 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"); - body2.setContent( - new Content() - .addMediaType( - "application/json", - new MediaType() - .schema( - new ArraySchema().items(new ArraySchema().items(new IntegerSchema()))))); - CodegenParameter codegenParameter2 = codegen.fromRequestBody(body2, new HashSet(), null); + body2.setContent(new Content().addMediaType( + "application/json", + new MediaType().schema(new ArraySchema().items(new ArraySchema().items(new IntegerSchema()))) + )); + CodegenParameter codegenParameter2 = codegen.fromRequestBody(body2, new HashSet<>(), null); Assertions.assertEquals(codegenParameter2.description, "A list of list of values"); Assertions.assertEquals(codegenParameter2.dataType, "List>"); Assertions.assertEquals(codegenParameter2.baseType, "List"); @@ -141,7 +174,7 @@ public class JavaClientCodegenTest { point.addProperty("message", new StringSchema()); 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); + CodegenParameter codegenParameter3 = codegen.fromRequestBody(body3, new HashSet<>(), null); Assertions.assertEquals(codegenParameter3.description, "A list of points"); Assertions.assertEquals(codegenParameter3.dataType, "List"); Assertions.assertEquals(codegenParameter3.baseType, "Point"); @@ -184,23 +217,13 @@ public class JavaClientCodegenTest { public void testInitialConfigValues() throws Exception { final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.processOpts(); - - Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assertions.assertFalse(codegen.isHideGenerationTimestamp()); - - Assertions.assertEquals(codegen.modelPackage(), "org.openapitools.client.model"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), - "org.openapitools.client.model"); - Assertions.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), - "org.openapitools.client.api"); - Assertions.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), - "org.openapitools.client"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.client.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.client.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.client"); Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); + configAssert.assertValue(JavaClientCodegen.SERIALIZATION_LIBRARY_GSON, "true"); } @Test @@ -212,20 +235,12 @@ public class JavaClientCodegenTest { codegen.setInvokerPackage("xyz.yyyyy.zzzzzzz.invoker"); codegen.setSerializationLibrary("JACKSON"); codegen.processOpts(); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); - 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"); - Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); - Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), - "xyz.yyyyy.zzzzzzz.invoker"); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.zzzzzzz.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.zzzzzzz.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.zzzzzzz.invoker"); Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); // the library JavaClientCodegen.OKHTTP_GSON only supports GSON } @@ -244,79 +259,51 @@ public class JavaClientCodegenTest { codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY2); codegen.processOpts(); - 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"); - Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), - "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.iiii.invoker"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), - "xyz.yyyyy.zzzzzzz.iiii.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.zzzzzzz.iiii.invoker"); Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); } - @Test - public void testGeneratedAuthClassesJersey() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + @Test public void testGeneratedAuthClassesJersey() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.JERSEY3) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) + .setInputSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - File output = Files.createTempDirectory("test").toFile(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - final CodegenConfigurator configurator = - new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.JERSEY3) - .setAdditionalProperties(properties) - .setInputSpec( - "src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - - DefaultGenerator generator = new DefaultGenerator(); - - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/auth/Authentication.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/HttpBasicAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/auth/HttpBearerAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/auth/HttpSignatureAuth.java"); + assertThat(files).contains( + output.resolve("src/main/java/xyz/abcdef/auth/ApiKeyAuth.java").toFile(), + output.resolve("src/main/java/xyz/abcdef/auth/Authentication.java").toFile(), + output.resolve("src/main/java/xyz/abcdef/auth/HttpBasicAuth.java").toFile(), + output.resolve("src/main/java/xyz/abcdef/auth/HttpBearerAuth.java").toFile(), + output.resolve("src/main/java/xyz/abcdef/auth/HttpSignatureAuth.java").toFile() + ); } - @Test - public void testImportMappingResult() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testImportMappingResult() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .addTypeMapping("OffsetDateTime", "Instant") .addImportMapping("OffsetDateTime", "java.time.Instant") .setGeneratorName("java") .setInputSpec("src/test/resources/3_0/echo_api.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - DefaultGenerator generator = new DefaultGenerator(); - - List files = generator.opts(clientOptInput).generate(); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/QueryApi.java"), - "import java.time.Instant;"); + assertThat(output.resolve("src/main/java/org/openapitools/client/api/QueryApi.java")) + .content().contains("import java.time.Instant;"); } @Test - public void testSupportedSecuritySchemesJersey() throws Exception { + public void testSupportedSecuritySchemesJersey() { final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY3); codegen.processOpts(); @@ -324,72 +311,48 @@ public class JavaClientCodegenTest { Assertions.assertTrue(codegen.getFeatureSet().getSecurityFeatures().contains(SecurityFeature.SignatureAuth)); } - @Test - public void testPackageNamesSetInvokerDerivedFromApi() { + @Test public void testPackageNamesSetInvokerDerivedFromApi() { final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen - .additionalProperties() - .put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); + codegen.processOpts(); - Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), - "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), - "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.aaaaa"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), - "xyz.yyyyy.zzzzzzz.aaaaa"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.zzzzzzz.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.zzzzzzz.aaaaa"); } - @Test - public void testPackageNamesSetInvokerDerivedFromModel() { + @Test public void testPackageNamesSetInvokerDerivedFromModel() { final JavaClientCodegen codegen = new JavaClientCodegen(); - codegen - .additionalProperties() - .put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + codegen.processOpts(); - Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), - "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assertions.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), - "org.openapitools.client.api"); - Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.mmmmm"); - Assertions.assertEquals( - codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), - "xyz.yyyyy.zzzzzzz.mmmmm"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.zzzzzzz.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.client.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.zzzzzzz.mmmmm"); } - @Test - public void testGetSchemaTypeWithComposedSchemaWithAllOf() { - final OpenAPI openAPI = - TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); - final JavaClientCodegen codegen = new JavaClientCodegen(); - + @Test public void testGetSchemaTypeWithComposedSchemaWithAllOf() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); Operation operation = openAPI.getPaths().get("/ping").getPost(); - CodegenOperation co = codegen.fromOperation("/ping", "POST", operation, null); - Assertions.assertEquals(co.allParams.size(), 1); - Assertions.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries"); + + CodegenOperation co = new JavaClientCodegen().fromOperation("/ping", "POST", operation, null); + + assertThat(co.allParams).hasSize(1) + .first().hasFieldOrPropertyWithValue("baseType", "MessageEventCoreWithTimeListEntries"); } - @Test - public void updateCodegenPropertyEnum() { + @Test public void updateCodegenPropertyEnum() { final JavaClientCodegen codegen = new JavaClientCodegen(); CodegenProperty array = codegenPropertyWithArrayOfIntegerValues(); codegen.updateCodegenPropertyEnum(array); - List> enumVars = - (List>) array.getItems().getAllowableValues().get("enumVars"); + var enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); Assertions.assertNotNull(enumVars); Map testedEnumVar = enumVars.get(0); Assertions.assertNotNull(testedEnumVar); @@ -397,19 +360,14 @@ public class JavaClientCodegenTest { Assertions.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); } - @Test - public void updateCodegenPropertyEnumWithCustomNames() { + @Test public void updateCodegenPropertyEnumWithCustomNames() { final JavaClientCodegen codegen = new JavaClientCodegen(); CodegenProperty array = codegenPropertyWithArrayOfIntegerValues(); - array - .getItems() - .setVendorExtensions( - Collections.singletonMap("x-enum-varnames", Collections.singletonList("ONE"))); + array.getItems().setVendorExtensions(Map.of("x-enum-varnames", Collections.singletonList("ONE"))); codegen.updateCodegenPropertyEnum(array); - List> enumVars = - (List>) array.getItems().getAllowableValues().get("enumVars"); + var enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); Assertions.assertNotNull(enumVars); Map testedEnumVar = enumVars.get(0); Assertions.assertNotNull(testedEnumVar); @@ -417,300 +375,217 @@ public class JavaClientCodegenTest { Assertions.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); } - @Test - public void testGeneratePing() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testGeneratePing() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.OKHTTP_GSON) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/ping.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assertions.assertEquals(files.size(), 40); - TestUtils.ensureContainsFile(files, output, ".gitignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/VERSION"); - TestUtils.ensureContainsFile(files, output, ".travis.yml"); - TestUtils.ensureContainsFile(files, output, "build.gradle"); - TestUtils.ensureContainsFile(files, output, "build.sbt"); - TestUtils.ensureContainsFile(files, output, "docs/DefaultApi.md"); - TestUtils.ensureContainsFile(files, output, "git_push.sh"); - TestUtils.ensureContainsFile(files, output, "gradle.properties"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.jar"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.properties"); - TestUtils.ensureContainsFile(files, output, "gradlew.bat"); - TestUtils.ensureContainsFile(files, output, "gradlew"); - TestUtils.ensureContainsFile(files, output, "pom.xml"); - TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "settings.gradle"); - TestUtils.ensureContainsFile(files, output, "api/openapi.yaml"); - TestUtils.ensureContainsFile(files, output, "src/main/AndroidManifest.xml"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/api/DefaultApi.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiCallback.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiException.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ApiResponse.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/ServerConfiguration.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/ServerVariable.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/auth/Authentication.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/auth/HttpBasicAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/auth/HttpBearerAuth.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/Configuration.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/GzipRequestInterceptor.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/JSON.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/Pair.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/ProgressRequestBody.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/xyz/abcdef/ProgressResponseBody.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/xyz/abcdef/StringUtil.java"); - TestUtils.ensureContainsFile(files, output, "src/test/java/xyz/abcdef/api/DefaultApiTest.java"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "public class DefaultApi"); - - output.deleteOnExit(); + assertThat(files).hasSize(40).map(File::toPath).contains( + output.resolve(".gitignore"), + output.resolve(".openapi-generator-ignore"), + output.resolve(".openapi-generator/FILES"), + output.resolve(".openapi-generator/VERSION"), + output.resolve(".travis.yml"), + output.resolve("build.gradle"), + output.resolve("build.sbt"), + output.resolve("docs/DefaultApi.md"), + output.resolve("git_push.sh"), + output.resolve("gradle.properties"), + output.resolve("gradle/wrapper/gradle-wrapper.jar"), + output.resolve("gradle/wrapper/gradle-wrapper.properties"), + output.resolve("gradlew.bat"), + output.resolve("gradlew"), + output.resolve("pom.xml"), + output.resolve("README.md"), + output.resolve("settings.gradle"), + output.resolve("api/openapi.yaml"), + output.resolve("src/main/AndroidManifest.xml"), + output.resolve("src/main/java/xyz/abcdef/api/DefaultApi.java"), + output.resolve("src/main/java/xyz/abcdef/ApiCallback.java"), + output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), + output.resolve("src/main/java/xyz/abcdef/ApiException.java"), + output.resolve("src/main/java/xyz/abcdef/ApiResponse.java"), + output.resolve("src/main/java/xyz/abcdef/ServerVariable.java"), + output.resolve("src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"), + output.resolve("src/main/java/xyz/abcdef/ServerConfiguration.java"), + output.resolve("src/main/java/xyz/abcdef/auth/Authentication.java"), + output.resolve("src/main/java/xyz/abcdef/auth/HttpBasicAuth.java"), + output.resolve("src/main/java/xyz/abcdef/auth/HttpBearerAuth.java"), + output.resolve("src/main/java/xyz/abcdef/Configuration.java"), + output.resolve("src/main/java/xyz/abcdef/GzipRequestInterceptor.java"), + output.resolve("src/main/java/xyz/abcdef/JSON.java"), + output.resolve("src/main/java/xyz/abcdef/ProgressRequestBody.java"), + output.resolve("src/main/java/xyz/abcdef/Pair.java"), + output.resolve("src/main/java/xyz/abcdef/ProgressResponseBody.java"), + output.resolve("src/main/java/xyz/abcdef/StringUtil.java"), + output.resolve("src/test/java/xyz/abcdef/api/DefaultApiTest.java") + ); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/DefaultApi.java")).content() + .contains("public class DefaultApi"); } - @Test - public void testGeneratePingSomeObj() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.MODEL_PACKAGE, "zz.yyyy.model.xxxx"); - properties.put(CodegenConstants.API_PACKAGE, "zz.yyyy.api.xxxx"); - properties.put(CodegenConstants.INVOKER_PACKAGE, "zz.yyyy.invoker.xxxx"); - properties.put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "is"); - - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testGeneratePingSomeObj(){ + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.OKHTTP_GSON) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.MODEL_PACKAGE, "zz.yyyy.model.xxxx") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "zz.yyyy.api.xxxx") + .addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, "zz.yyyy.invoker.xxxx") + .addAdditionalProperty(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "is") + .setLibrary(JavaClientCodegen.OKHTTP_GSON) + .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assertions.assertEquals(files.size(), 43); - TestUtils.ensureContainsFile(files, output, ".gitignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); - TestUtils.ensureContainsFile(files, output, ".openapi-generator/VERSION"); - TestUtils.ensureContainsFile(files, output, ".travis.yml"); - TestUtils.ensureContainsFile(files, output, "build.gradle"); - TestUtils.ensureContainsFile(files, output, "build.sbt"); - TestUtils.ensureContainsFile(files, output, "docs/PingApi.md"); - TestUtils.ensureContainsFile(files, output, "docs/SomeObj.md"); - TestUtils.ensureContainsFile(files, output, "git_push.sh"); - TestUtils.ensureContainsFile(files, output, "gradle.properties"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.jar"); - TestUtils.ensureContainsFile(files, output, "gradle/wrapper/gradle-wrapper.properties"); - TestUtils.ensureContainsFile(files, output, "gradlew.bat"); - TestUtils.ensureContainsFile(files, output, "gradlew"); - TestUtils.ensureContainsFile(files, output, "pom.xml"); - TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "settings.gradle"); - TestUtils.ensureContainsFile(files, output, "api/openapi.yaml"); - TestUtils.ensureContainsFile(files, output, "src/main/AndroidManifest.xml"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/api/xxxx/PingApi.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiCallback.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiClient.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiException.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiResponse.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerConfiguration.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerVariable.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/Authentication.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBasicAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBearerAuth.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/Configuration.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/GzipRequestInterceptor.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/JSON.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/invoker/xxxx/Pair.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressRequestBody.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/ProgressResponseBody.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/zz/yyyy/invoker/xxxx/StringUtil.java"); - TestUtils.ensureContainsFile(files, output, "src/main/java/zz/yyyy/model/xxxx/SomeObj.java"); - TestUtils.ensureContainsFile(files, output, "src/test/java/zz/yyyy/api/xxxx/PingApiTest.java"); - TestUtils.ensureContainsFile( - files, output, "src/test/java/zz/yyyy/model/xxxx/SomeObjTest.java"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/zz/yyyy/model/xxxx/SomeObj.java"), - "public class SomeObj", - "Boolean isActive()"); - - output.deleteOnExit(); + assertThat(output.resolve("src/main/java/zz/yyyy/model/xxxx/SomeObj.java")).content() + .contains("public class SomeObj", "Boolean isActive()"); + assertThat(files).hasSize(43).map(File::toPath).contains( + output.resolve(".gitignore"), + output.resolve(".openapi-generator-ignore"), + output.resolve(".openapi-generator/FILES"), + output.resolve(".openapi-generator/VERSION"), + output.resolve(".travis.yml"), + output.resolve("build.gradle"), + output.resolve("build.sbt"), + output.resolve("docs/PingApi.md"), + output.resolve("docs/SomeObj.md"), + output.resolve("git_push.sh"), + output.resolve("gradle.properties"), + output.resolve("gradle/wrapper/gradle-wrapper.jar"), + output.resolve("gradle/wrapper/gradle-wrapper.properties"), + output.resolve("gradlew.bat"), + output.resolve("gradlew"), + output.resolve("pom.xml"), + output.resolve("README.md"), + output.resolve("settings.gradle"), + output.resolve("api/openapi.yaml"), + output.resolve("src/main/AndroidManifest.xml"), + output.resolve("src/main/java/zz/yyyy/api/xxxx/PingApi.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ApiCallback.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ApiClient.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ApiException.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ApiResponse.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ServerConfiguration.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ServerVariable.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/auth/Authentication.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBasicAuth.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBearerAuth.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/Configuration.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/GzipRequestInterceptor.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/JSON.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/Pair.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ProgressRequestBody.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/ProgressResponseBody.java"), + output.resolve("src/main/java/zz/yyyy/invoker/xxxx/StringUtil.java"), + output.resolve("src/main/java/zz/yyyy/model/xxxx/SomeObj.java"), + output.resolve("src/test/java/zz/yyyy/api/xxxx/PingApiTest.java"), + output.resolve("src/test/java/zz/yyyy/model/xxxx/SomeObjTest.java") + ); } - @Test - public void testJdkHttpClient() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testJdkHttpClient() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/ping.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - Assertions.assertEquals(files.size(), 32); + assertThat(files).hasSize(32); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "public class DefaultApi", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;", - "import java.net.http.HttpResponse;"); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), - "public class ApiClient", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;"); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/DefaultApi.java")).content().contains( + "public class DefaultApi", + "import java.net.http.HttpClient;", + "import java.net.http.HttpRequest;", + "import java.net.http.HttpResponse;" + ); + assertThat(output.resolve("src/main/java/xyz/abcdef/ApiClient.java")).content().contains( + "public class ApiClient", + "import java.net.http.HttpClient;", + "import java.net.http.HttpRequest;" + ); } - @Test - public void testJdkHttpClientWithUseBeanValidationEnabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_BEANVALIDATION, true); - properties.put(JavaClientCodegen.USE_JAKARTA_EE, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testJdkHttpClientWithUseBeanValidationEnabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_1/issue-17485.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_BEANVALIDATION, true) + .addAdditionalProperty(JavaClientCodegen.USE_JAKARTA_EE, true) + .setInputSpec("src/test/resources/3_1/issue-17485.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/UserApi.java"), - "@Pattern", "import jakarta.validation.constraints.*"); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/UserApi.java")).content() + .contains("@Pattern", "import jakarta.validation.constraints.*"); } - @Test - public void testJdkHttpClientWithAndWithoutDiscriminator() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(CodegenConstants.MODEL_PACKAGE, "xyz.abcdef.model"); - properties.put(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker"); + @Test public void testJdkHttpClientWithAndWithoutDiscriminator() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(CodegenConstants.MODEL_PACKAGE, "xyz.abcdef.model") + .addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker") + .setInputSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = - new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec( - "src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - List files = generator.opts(clientOptInput).generate(); + List files = generator.opts(configurator.toClientOptInput()).generate(); - Assertions.assertEquals(files.size(), 153); + assertThat(files).hasSize(153); validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/Dog.java"), - "import xyz.abcdef.invoker.JSON;"); + assertThat(output.resolve("src/main/java/xyz/abcdef/model/Dog.java")).content() + .contains("import xyz.abcdef.invoker.JSON;"); } - @Test - public void testJdkHttpAsyncClient() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.ASYNC_NATIVE, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testJdkHttpAsyncClient() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.ASYNC_NATIVE, true) + .setLibrary(JavaClientCodegen.NATIVE) + .setInputSpec("src/test/resources/3_0/pingSomeObj.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + assertThat(files).hasSize(35); - Assertions.assertEquals(files.size(), 35); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PingApi.java"); - TestUtils.assertFileContains(defaultApi, - "public class PingApi", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;", - "import java.net.http.HttpResponse;", - "import java.util.concurrent.CompletableFuture;"); - - Path apiClient = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(apiClient, - "public class ApiClient", - "import java.net.http.HttpClient;", - "import java.net.http.HttpRequest;"); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/PingApi.java")).content().contains( + "public class PingApi", + "import java.net.http.HttpClient;", + "import java.net.http.HttpRequest;", + "import java.net.http.HttpResponse;", + "import java.util.concurrent.CompletableFuture;" + ); + assertThat(output.resolve("src/main/java/xyz/abcdef/ApiClient.java")).content().contains( + "public class ApiClient", + "import java.net.http.HttpClient;", + "import java.net.http.HttpRequest;" + ); } @Test @@ -765,19 +640,14 @@ public class JavaClientCodegenTest { assertEquals(postScopes.size(), 2, "POST scopes don't match. actual:" + postScopes); } - @Test - public void testAuthorizationScopeValues_Issue6733() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testAuthorizationScopeValues_Issue6733() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTEASY) .setValidateSpec(false) .setInputSpec("src/test/resources/3_0/regression-6734.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); + .setOutputDir(output.toString().replace("\\", "/")); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); @@ -787,27 +657,20 @@ public class JavaClientCodegenTest { // tests if NPE will crash generation when path in yaml arent provided generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.setGenerateMetadata(false); - List files = generator.opts(clientOptInput).generate(); + List files = generator.opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - Assertions.assertEquals(files.size(), 1); - files.forEach(File::deleteOnExit); } - @Test - public void testTypedAndNonTypedComposedSchemaGeneration_3_1() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testTypedAndNonTypedComposedSchemaGeneration_3_1() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTEASY) .setValidateSpec(false) .setInputSpec("src/test/resources/3_1/composed-schemas-with-and-without-type.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); + .setOutputDir(output.toString().replace("\\", "/")); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); @@ -816,27 +679,20 @@ public class JavaClientCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.setGenerateMetadata(false); - List files = generator.opts(clientOptInput).generate(); + List files = generator.opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - Assertions.assertEquals(files.size(), 9); - files.forEach(File::deleteOnExit); } - @Test - public void testMultiPartSpecifiesFileName_Issue17367() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testMultiPartSpecifiesFileName_Issue17367() throws IOException { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTEASY) .setValidateSpec(false) .setInputSpec("src/test/resources/3_0/issue-17367.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); + .setOutputDir(output.toString().replace("\\", "/")); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); @@ -845,79 +701,64 @@ public class JavaClientCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true"); generator.setGenerateMetadata(false); - List files = generator.opts(clientOptInput).generate(); - try { - validateJavaSourceFiles(files); - File apiClient = files.stream() - .filter(f -> f.getName().equals("ApiClient.java")) - .findFirst() - .orElseThrow(() -> new AssertionFailedError( - "ApiClient.java not found")); - - Stream contents = Arrays.stream(Files.readString(apiClient.toPath(), - StandardCharsets.UTF_8).split("\n")); - - // https://docs.jboss.org/resteasy/docs/6.2.5.Final/javadocs/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataOutput.html#addFormData(java.lang.String,java.lang.Object,jakarta.ws.rs.core.MediaType,java.lang.String) - assertTrue(contents.anyMatch(l -> l.matches( - ".*multipart\\.addFormData\\(param.getKey\\(\\),\\s*" + - "new\\s+FileInputStream\\(file\\),\\s*" + - "MediaType\\.APPLICATION_OCTET_STREAM_TYPE,\\s*" + - "file.getName\\(\\)\\);.*"))); - } finally { - files.forEach(File::deleteOnExit); - } + List files = generator.opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + File apiClient = files.stream() + .filter(f -> f.getName().equals("ApiClient.java")) + .findFirst() + .orElseThrow(() -> new AssertionError("ApiClient.java not found")); + var contents = Arrays.stream(Files.readString(apiClient.toPath(), StandardCharsets.UTF_8).split("\n")); + // https://docs.jboss.org/resteasy/docs/6.2.5.Final/javadocs/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataOutput.html#addFormData(java.lang.String,java.lang.Object,jakarta.ws.rs.core.MediaType,java.lang.String) + assertTrue(contents.anyMatch(l -> l.matches( + ".*multipart\\.addFormData\\(param.getKey\\(\\),\\s*" + + "new\\s+FileInputStream\\(file\\),\\s*" + + "MediaType\\.APPLICATION_OCTET_STREAM_TYPE,\\s*" + + "file.getName\\(\\)\\);.*"))); } - @Test - public void testAuthorizationsMethodsSizeWhenFiltered() { + @Test public void testAuthorizationsMethodsSizeWhenFiltered() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue4584.yaml"); - + final ClientOptInput clientOptInput = new ClientOptInput().openAPI(openAPI).config(new JavaClientCodegen()); final DefaultGenerator defaultGenerator = new DefaultGenerator(); - - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - clientOptInput.config(new JavaClientCodegen()); - defaultGenerator.opts(clientOptInput); - final List codegenOperations = - defaultGenerator.processPaths(openAPI.getPaths()).get("Pet"); + + final List codegenOperations = defaultGenerator.processPaths(openAPI.getPaths()).get("Pet"); - final CodegenOperation getCodegenOperation = - codegenOperations.stream() - .filter(it -> it.httpMethod.equals("GET")) - .collect(Collectors.toList()) - .get(0); + final CodegenOperation getCodegenOperation = codegenOperations.stream() + .filter(it -> it.httpMethod.equals("GET")) + .collect(Collectors.toList()) + .get(0); assertTrue(getCodegenOperation.hasAuthMethods); assertEquals(getCodegenOperation.authMethods.size(), 2); } - @Test - public void testFreeFormObjects() { + @Test public void testFreeFormObjects() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue796.yaml"); JavaClientCodegen codegen = new JavaClientCodegen(); - Schema test1 = openAPI.getComponents().getSchemas().get("MapTest1"); + Schema test1 = openAPI.getComponents().getSchemas().get("MapTest1"); codegen.setOpenAPI(openAPI); CodegenModel cm1 = codegen.fromModel("MapTest1", test1); Assertions.assertEquals(cm1.getDataType(), "Map"); Assertions.assertEquals(cm1.getParent(), "HashMap"); Assertions.assertEquals(cm1.getClassname(), "MapTest1"); - Schema test2 = openAPI.getComponents().getSchemas().get("MapTest2"); + Schema test2 = openAPI.getComponents().getSchemas().get("MapTest2"); codegen.setOpenAPI(openAPI); CodegenModel cm2 = codegen.fromModel("MapTest2", test2); Assertions.assertEquals(cm2.getDataType(), "Map"); Assertions.assertEquals(cm2.getParent(), "HashMap"); Assertions.assertEquals(cm2.getClassname(), "MapTest2"); - Schema test3 = openAPI.getComponents().getSchemas().get("MapTest3"); + Schema test3 = openAPI.getComponents().getSchemas().get("MapTest3"); codegen.setOpenAPI(openAPI); CodegenModel cm3 = codegen.fromModel("MapTest3", test3); Assertions.assertEquals(cm3.getDataType(), "Map"); Assertions.assertEquals(cm3.getParent(), "HashMap"); Assertions.assertEquals(cm3.getClassname(), "MapTest3"); - Schema other = openAPI.getComponents().getSchemas().get("OtherObj"); + Schema other = openAPI.getComponents().getSchemas().get("OtherObj"); codegen.setOpenAPI(openAPI); CodegenModel cm = codegen.fromModel("OtherObj", other); Assertions.assertEquals(cm.getDataType(), "Object"); @@ -927,55 +768,32 @@ public class JavaClientCodegenTest { /** * See https://github.com/OpenAPITools/openapi-generator/issues/3589 */ - @Test - public void testSchemaMapping() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - Map schemaMappings = new HashMap<>(); - schemaMappings.put("TypeAlias", "foo.bar.TypeAlias"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() + @Test public void testSchemaMapping() throws IOException { + final Path output = newTempFolder(); + final ClientOptInput clientOptInput = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTEASY) - .setAdditionalProperties(properties) - .setSchemaMappings(schemaMappings) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) + .setSchemaMappings(Map.of("TypeAlias", "foo.bar.TypeAlias")) .setGenerateAliasAsModel(true) .setInputSpec("src/test/resources/3_0/type-alias.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - Assertions.assertEquals( - clientOptInput.getConfig().schemaMapping().get("TypeAlias"), "foo.bar.TypeAlias"); + .setOutputDir(output.toString().replace("\\", "/")) + .toClientOptInput(); 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, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.setGenerateMetadata(false); List files = generator.opts(clientOptInput).generate(); - files.forEach(File::deleteOnExit); validateJavaSourceFiles(files); + Assertions.assertEquals(clientOptInput.getConfig().schemaMapping().get("TypeAlias"), "foo.bar.TypeAlias"); + assertThat(files).hasSize(1) + .contains(output.resolve("src/main/java/org/openapitools/client/model/ParentType.java").toFile()); - Assertions.assertEquals(files.size(), 1); - TestUtils.ensureContainsFile( - files, output, "src/main/java/org/openapitools/client/model/ParentType.java"); - - String parentTypeContents = ""; - try { - File file = - files.stream().filter(f -> f.getName().endsWith("ParentType.java")).findFirst().get(); - parentTypeContents = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8); - } catch (IOException ignored) { - - } + File file = files.stream().filter(f -> f.getName().endsWith("ParentType.java")).findFirst().get(); + String parentTypeContents = Files.readString(file.toPath()); final Pattern FIELD_PATTERN = Pattern.compile(".* private (.*?) typeAlias;.*", Pattern.DOTALL); Matcher fieldMatcher = FIELD_PATTERN.matcher(parentTypeContents); @@ -986,37 +804,28 @@ public class JavaClientCodegenTest { Assertions.assertEquals(fieldMatcher.group(1), "foo.bar.TypeAlias"); } - @Test - public void testBearerAuth() { - final OpenAPI openAPI = - TestUtils.parseFlattenSpec("src/test/resources/3_0/pingBearerAuth.yaml"); - JavaClientCodegen codegen = new JavaClientCodegen(); + @Test public void testBearerAuth() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/pingBearerAuth.yaml"); - List security = codegen.fromSecurity(openAPI.getComponents().getSecuritySchemes()); - 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); + List security = new JavaClientCodegen().fromSecurity(openAPI.getComponents().getSecuritySchemes()); + + assertThat(security).hasSize(1) + .first() + .hasFieldOrPropertyWithValue("isBasic", Boolean.TRUE) + .hasFieldOrPropertyWithValue("isBasicBasic", Boolean.FALSE) + .hasFieldOrPropertyWithValue("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(); - + @Test public void testVertXAuthInfoWithHyphenSeparatedSecurityScheme() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.VERTX) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/ping-with-hyphen-separated-security-scheme.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); // Test that hyphen-separated security scheme names does not // break the Java VertX client code generation @@ -1024,8 +833,8 @@ public class JavaClientCodegenTest { // 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"), + assertThat(output.resolve("src/main/java/xyz/abcdef/ApiClient.java")).content() + .contains( "public static class AuthInfo {", "public void addHyphenatedNameTestAuthentication(String bearerToken) {", "public static AuthInfo forHyphenatedNameTestAuthentication(String bearerToken) {" @@ -1035,9 +844,7 @@ public class JavaClientCodegenTest { private CodegenProperty codegenPropertyWithArrayOfIntegerValues() { CodegenProperty array = new CodegenProperty(); final CodegenProperty items = new CodegenProperty(); - final HashMap allowableValues = new HashMap<>(); - allowableValues.put("values", Collections.singletonList(1)); - items.setAllowableValues(allowableValues); + items.setAllowableValues(new HashMap<>(Map.of("values", Collections.singletonList(1)))); items.dataType = "Integer"; array.setItems(items); array.dataType = "Array"; @@ -1079,7 +886,7 @@ public class JavaClientCodegenTest { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/any_type.yaml"); JavaClientCodegen codegen = new JavaClientCodegen(); - Schema test1 = openAPI.getComponents().getSchemas().get("AnyValueModel"); + Schema test1 = openAPI.getComponents().getSchemas().get("AnyValueModel"); codegen.setOpenAPI(openAPI); CodegenModel cm1 = codegen.fromModel("AnyValueModel", test1); Assertions.assertEquals(cm1.getClassname(), "AnyValueModel"); @@ -1110,7 +917,7 @@ public class JavaClientCodegenTest { Assertions.assertFalse(property3.isFreeFormObject); Assertions.assertTrue(property3.isAnyType); - Schema test2 = openAPI.getComponents().getSchemas().get("AnyValueModelInline"); + Schema test2 = openAPI.getComponents().getSchemas().get("AnyValueModelInline"); codegen.setOpenAPI(openAPI); CodegenModel cm2 = codegen.fromModel("AnyValueModelInline", test2); Assertions.assertEquals(cm2.getClassname(), "AnyValueModelInline"); @@ -1220,35 +1027,20 @@ public class JavaClientCodegenTest { * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. */ - @Test - @Ignore - public void testRestTemplateFormMultipart() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test(enabled = false) public void testRestTemplateFormMultipart() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains( - defaultApi, - // multiple files + assertThat(output.resolve("src/main/java/xyz/abcdef/api/MultipartApi.java")).content() + .contains( "multipartArrayWithHttpInfo(List files)", "formParams.addAll(\"files\"," + " files.stream().map(FileSystemResource::new).collect(Collectors.toList()));", @@ -1259,7 +1051,8 @@ public class JavaClientCodegenTest { // single file "multipartSingleWithHttpInfo(File file)", - "formParams.add(\"file\", new FileSystemResource(file));"); + "formParams.add(\"file\", new FileSystemResource(file));" + ); } /** @@ -1269,34 +1062,20 @@ public class JavaClientCodegenTest { * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. */ - @Test - @Ignore - public void testWebClientFormMultipart() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test(enabled = false) public void testWebClientFormMultipart() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains( - defaultApi, + assertThat(output.resolve("src/main/java/xyz/abcdef/api/MultipartApi.java")).content() + .contains( // multiple files "multipartArray(List files)", "formParams.addAll(\"files\"," @@ -1308,26 +1087,20 @@ public class JavaClientCodegenTest { // single file "multipartSingle(File file)", - "formParams.add(\"file\", new FileSystemResource(file));"); + "formParams.add(\"file\", new FileSystemResource(file));" + ); } @Test - public void shouldGenerateBlockingAndNoBlockingOperationsForWebClient() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.WEBCLIENT_BLOCKING_OPERATIONS, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = - new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec( - "src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + public void shouldGenerateBlockingAndNoBlockingOperationsForWebClient() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.WEBCLIENT_BLOCKING_OPERATIONS, true) + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setInputSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml") + .setOutputDir(output.toString().replace("\\", "/")); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(configurator.toClientOptInput()).generate().stream() @@ -1348,37 +1121,25 @@ public class JavaClientCodegenTest { "List"); // explicit 'x-webclient-blocking: true' which overrides global config } - @Test - public void testAllowModelWithNoProperties() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testAllowModelWithNoProperties() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.OKHTTP_GSON) .setInputSpec("src/test/resources/2_0/emptyBaseModel.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - Assertions.assertEquals(files.size(), 49); - TestUtils.ensureContainsFile( - files, output, "src/main/java/org/openapitools/client/model/RealCommand.java"); - TestUtils.ensureContainsFile( - files, output, "src/main/java/org/openapitools/client/model/Command.java"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/RealCommand.java"), - "class RealCommand {"); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/Command.java"), - "class Command {"); - - output.deleteOnExit(); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/RealCommand.java")) + .content().contains("class RealCommand {"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Command.java")) + .content().contains("class Command {"); + assertThat(files).hasSize(49).contains( + output.resolve("src/main/java/org/openapitools/client/model/RealCommand.java").toFile(), + output.resolve("src/main/java/org/openapitools/client/model/Command.java").toFile() + ); } /** @@ -1388,103 +1149,83 @@ public class JavaClientCodegenTest { * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. */ - @Test - @Ignore - public void testRestTemplateWithUseAbstractionForFiles() 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(); - + @Test(enabled = false) public void testRestTemplateWithUseAbstractionForFiles() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.RESTTEMPLATE) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); + assertThat(output.resolve("/src/main/java/xyz/abcdef/api/MultipartApi.java")).content().contains( + // multiple files + "multipartArray(java.util.Collection files)", + "multipartArrayWithHttpInfo(java.util.Collection" + + " files)", + "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains( - defaultApi, - // multiple files - "multipartArray(java.util.Collection files)", - "multipartArrayWithHttpInfo(java.util.Collection" - + " files)", - "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", + // mixed + "multipartMixed(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", + "multipartMixedWithHttpInfo(org.springframework.core.io.Resource file, MultipartMixedMarker" + + " marker)", + "formParams.add(\"file\", file);", - // mixed - "multipartMixed(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", - "multipartMixedWithHttpInfo(org.springframework.core.io.Resource file, MultipartMixedMarker" - + " marker)", - "formParams.add(\"file\", file);", - - // single file - "multipartSingle(org.springframework.core.io.Resource file)", - "multipartSingleWithHttpInfo(org.springframework.core.io.Resource file)", - "formParams.add(\"file\", file);"); + // single file + "multipartSingle(org.springframework.core.io.Resource file)", + "multipartSingleWithHttpInfo(org.springframework.core.io.Resource file)", + "formParams.add(\"file\", file);" + ); } - @Test - void testNotDuplicateOauth2FlowsScopes() { + @Test void testNotDuplicateOauth2FlowsScopes() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7614.yaml"); - - final ClientOptInput clientOptInput = new ClientOptInput() - .openAPI(openAPI) - .config(new JavaClientCodegen()); - + final ClientOptInput clientOptInput = new ClientOptInput().openAPI(openAPI).config(new JavaClientCodegen()); final DefaultGenerator defaultGenerator = new DefaultGenerator(); defaultGenerator.opts(clientOptInput); final Map> paths = defaultGenerator.processPaths(openAPI.getPaths()); - final List codegenOperations = paths.values().stream().flatMap(Collection::stream).collect(Collectors.toList()); - final CodegenOperation getWithBasicAuthAndOauth = - getByOperationId(codegenOperations, "getWithBasicAuthAndOauth"); + final List codegenOperations = paths.values().stream().flatMap(Collection::stream).collect(Collectors.toList()); + final CodegenOperation getWithBasicAuthAndOauth = getByOperationId(codegenOperations, "getWithBasicAuthAndOauth"); assertEquals(getWithBasicAuthAndOauth.authMethods.size(), 3); assertEquals(getWithBasicAuthAndOauth.authMethods.get(0).name, "basic_auth"); + final Map passwordFlowScope = getWithBasicAuthAndOauth.authMethods.get(1).scopes.get(0); assertEquals(passwordFlowScope.get("scope"), "something:create"); assertEquals(passwordFlowScope.get("description"), "create from password flow"); + final Map clientCredentialsFlow = getWithBasicAuthAndOauth.authMethods.get(2).scopes.get(0); assertEquals(clientCredentialsFlow.get("scope"), "something:create"); assertEquals(clientCredentialsFlow.get("description"), "create from client credentials flow"); - - final CodegenOperation getWithOauthAuth = - getByOperationId(codegenOperations, "getWithOauthAuth"); + + final CodegenOperation getWithOauthAuth = getByOperationId(codegenOperations, "getWithOauthAuth"); assertEquals(getWithOauthAuth.authMethods.size(), 2); + final Map passwordFlow = getWithOauthAuth.authMethods.get(0).scopes.get(0); assertEquals(passwordFlow.get("scope"), "something:create"); assertEquals(passwordFlow.get("description"), "create from password flow"); final Map clientCredentialsCreateFlow = getWithOauthAuth.authMethods.get(1).scopes.get(0); assertEquals(clientCredentialsCreateFlow.get("scope"), "something:create"); - assertEquals( - clientCredentialsCreateFlow.get("description"), "create from client credentials flow"); + assertEquals(clientCredentialsCreateFlow.get("description"), "create from client credentials flow"); final Map clientCredentialsProcessFlow = getWithOauthAuth.authMethods.get(1).scopes.get(1); assertEquals(clientCredentialsProcessFlow.get("scope"), "something:process"); - assertEquals( - clientCredentialsProcessFlow.get("description"), "process from client credentials flow"); + assertEquals(clientCredentialsProcessFlow.get("description"), "process from client credentials flow"); } private CodegenOperation getByOperationId(List codegenOperations, String operationId) { return getByCriteria(codegenOperations, (co) -> co.operationId.equals(operationId)) - .orElseThrow( - () -> - new IllegalStateException( - String.format( - Locale.ROOT, "Operation with id [%s] does not exist", operationId))); + .orElseThrow( + () -> new IllegalStateException( + String.format(Locale.ROOT, "Operation with id [%s] does not exist", operationId) + ) + ); } private Optional getByCriteria(List codegenOperations, Predicate filter) { @@ -1493,39 +1234,28 @@ public class JavaClientCodegenTest { .findFirst(); } - @Test - public void testCustomMethodParamsAreCamelizedWhenUsingFeign() throws IOException { - - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testCustomMethodParamsAreCamelizedWhenUsingFeign() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") - .setLibrary(JavaClientCodegen.FEIGN) + .setLibrary(FEIGN) .setInputSpec("src/test/resources/3_0/issue_7791.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - TestUtils.ensureContainsFile( - files, output, "src/main/java/org/openapitools/client/api/DefaultApi.java"); - validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "@RequestLine(\"POST /events/{eventId}:undelete\")"); - TestUtils.assertFileNotContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "event_id"); - - // baseName is kept for form parameters - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "@Param(\"some_file\") File someFile"); - - output.deleteOnExit(); + var defaultApiFile = output.resolve("src/main/java/org/openapitools/client/api/DefaultApi.java"); + assertThat(files).contains(defaultApiFile.toFile()); + assertThat(defaultApiFile).content() + .doesNotContain("event_id") + .contains( + "@RequestLine(\"POST /events/{eventId}:undelete\")", + // baseName is kept for form parameters + "@Param(\"some_file\") File someFile" + ); } /** @@ -1535,34 +1265,21 @@ public class JavaClientCodegenTest { * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. */ - @Test - @Ignore - public void testWebClientWithUseAbstractionForFiles() 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(); - + @Test(enabled = false) public void testWebClientWithUseAbstractionForFiles() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); - TestUtils.assertFileContains( - defaultApi, + assertThat(output.resolve("src/main/java/xyz/abcdef/api/MultipartApi.java")).content() + .contains( // multiple files "multipartArray(java.util.Collection files)", "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", @@ -1574,351 +1291,192 @@ public class JavaClientCodegenTest { // single file "multipartSingle(org.springframework.core.io.AbstractResource file)", - "formParams.add(\"file\", file);"); + "formParams.add(\"file\", file);" + ); } /** * See https://github.com/OpenAPITools/openapi-generator/issues/8352 */ @Test - public void testRestTemplateWithFreeFormInQueryParameters() throws IOException { - final Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - final File output = Files.createTempDirectory("test") - .toFile(); - output.deleteOnExit(); - + public void testRestTemplateWithFreeFormInQueryParameters() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/issue8352.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final DefaultGenerator generator = new DefaultGenerator(); - final List files = generator.opts(configurator.toClientOptInput()) - .generate(); - files.forEach(File::deleteOnExit); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(defaultApi, "value instanceof Map"); + assertThat(output.resolve("src/main/java/xyz/abcdef/ApiClient.java")).content() + .contains("value instanceof Map"); } /** * See https://github.com/OpenAPITools/openapi-generator/issues/8352 */ - @Test - public void testWebClientWithFreeFormInQueryParameters() throws IOException { - final Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - final File output = Files.createTempDirectory("test") - .toFile(); - output.deleteOnExit(); - + @Test public void testWebClientWithFreeFormInQueryParameters() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/issue8352.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final DefaultGenerator generator = new DefaultGenerator(); - final List files = generator.opts(configurator.toClientOptInput()) - .generate(); - files.forEach(File::deleteOnExit); + final List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(defaultApi, "value instanceof Map"); + assertThat(output.resolve("src/main/java/xyz/abcdef/ApiClient.java")).content() + .contains("value instanceof Map"); } /** * See https://github.com/OpenAPITools/openapi-generator/issues/11242 */ - @Test - public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testNativeClientWhiteSpacePathParamEncoding() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/issue11242.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - Assertions.assertEquals(files.size(), 35); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), - "public static String urlEncode(String s) { return URLEncoder.encode(s," - + " UTF_8).replaceAll(\"\\\\+\", \"%20\"); }"); + assertThat(files).hasSize(35); + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), + "public static String urlEncode(String s) { return URLEncoder.encode(s," + + " UTF_8).replaceAll(\"\\\\+\", \"%20\"); }" + ); } /** * See https://github.com/OpenAPITools/openapi-generator/issues/4808 */ - @Test - public void testNativeClientExplodedQueryParamObject() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testNativeClientExplodedQueryParamObject() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/issue4808.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - Assertions.assertEquals(files.size(), 38); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"since\"," - + " queryObject.getSince()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"sinceBuild\"," - + " queryObject.getSinceBuild()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxBuilds\"," - + " queryObject.getMaxBuilds()));", - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxWaitSecs\"," - + " queryObject.getMaxWaitSecs()));"); + assertThat(files).hasSize(38); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/DefaultApi.java")).content() + .contains( + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"since\", queryObject.getSince()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"sinceBuild\", queryObject.getSinceBuild()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxBuilds\", queryObject.getMaxBuilds()));", + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"maxWaitSecs\", queryObject.getMaxWaitSecs()));" + ); } - @Test - public void testExtraAnnotationsNative() throws IOException { - testExtraAnnotations(JavaClientCodegen.NATIVE); - } - - @Test - public void testExtraAnnotationsJersey2() throws IOException { - testExtraAnnotations(JavaClientCodegen.JERSEY2); - } - - @Test - public void testExtraAnnotationsJersey3() throws IOException { - testExtraAnnotations(JavaClientCodegen.JERSEY3); - } - - @Test - public void testExtraAnnotationsMicroprofile() throws IOException { - testExtraAnnotations(JavaClientCodegen.MICROPROFILE); - } - - @Test - public void testExtraAnnotationsOKHttpGSON() throws IOException { - testExtraAnnotations(JavaClientCodegen.OKHTTP_GSON); - } - - @Test - public void testExtraAnnotationsVertx() throws IOException { - testExtraAnnotations(JavaClientCodegen.VERTX); - } - - @Test - public void testExtraAnnotationsFeign() throws IOException { - testExtraAnnotations(JavaClientCodegen.FEIGN); - } - - @Test - public void testExtraAnnotationsRetrofit2() throws IOException { - testExtraAnnotations(JavaClientCodegen.RETROFIT_2); - } - - @Test - public void testExtraAnnotationsRestTemplate() throws IOException { - testExtraAnnotations(JavaClientCodegen.RESTTEMPLATE); - } - - @Test - public void testExtraAnnotationsWebClient() throws IOException { - testExtraAnnotations(JavaClientCodegen.WEBCLIENT); - } - - @Test - public void testExtraAnnotationsRestEasy() throws IOException { - testExtraAnnotations(JavaClientCodegen.RESTEASY); - } - - @Test - public void testExtraAnnotationsGoogleApiClient() throws IOException { - testExtraAnnotations(JavaClientCodegen.GOOGLE_API_CLIENT); - } - - @Test - public void testExtraAnnotationsRestAssured() throws IOException { - testExtraAnnotations(JavaClientCodegen.REST_ASSURED); - } - - @Test - public void testExtraAnnotationsApache() throws IOException { - testExtraAnnotations(JavaClientCodegen.APACHE); - } - - @Test - public void testDefaultMicroprofileRestClientVersion() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testDefaultMicroprofileRestClientVersion() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.MICROPROFILE) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "2.0"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.2.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.8"); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import javax."); - - output.deleteOnExit(); + assertThat(files).contains(output.resolve("pom.xml").toFile()); + assertThat(output.resolve("src/main/java/org/openapitools/client/api/PetApi.java")).content() + .contains("import javax."); + assertThat(output.resolve("pom.xml")).content() + .contains( + "2.0", + "1.2.1", + "1.8" + ); } - @Test - public void testMicroprofileRestClientVersion_1_4_1() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "1.4.1"); - - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testMicroprofileRestClientVersion_1_4_1() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "1.4.1")) .setGeneratorName("java") .setLibrary(JavaClientCodegen.MICROPROFILE) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/pom.xml"), - "1.4.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.2.1"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "1.8"); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import javax."); - - output.deleteOnExit(); + assertThat(files).contains(output.resolve("pom.xml").toFile()); + assertThat(output.resolve("src/main/java/org/openapitools/client/api/PetApi.java")).content() + .contains("import javax."); + assertThat(output.resolve("pom.xml")).content() + .contains( + "1.4.1", + "1.2.1", + "1.8" + ); } @Test( - expectedExceptions = IllegalArgumentException.class, - expectedExceptionsMessageRegExp = - "Version incorrectVersion of MicroProfile Rest Client is not supported or incorrect." - + " Supported versions are 1.4.1, 2.0, 3.0") - public void testMicroprofileRestClientIncorrectVersion() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "incorrectVersion"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + expectedExceptions = IllegalArgumentException.class, + expectedExceptionsMessageRegExp = + "Version incorrectVersion of MicroProfile Rest Client is not supported or incorrect." + + " Supported versions are 1.4.1, 2.0, 3.0" + ) + public void testMicroprofileRestClientIncorrectVersion() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "incorrectVersion")) .setGeneratorName("java") .setLibrary(JavaClientCodegen.MICROPROFILE) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - generator.opts(clientOptInput).generate(); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + fail("Expected an exception that did not occur"); } - @Test - public void testMicroprofileRestClientVersion_3_0() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); - - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testMicroprofileRestClientVersion_3_0() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0")) .setGeneratorName("java") .setLibrary(JavaClientCodegen.MICROPROFILE) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); - - TestUtils.ensureContainsFile(files, output, "pom.xml"); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "3.0"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "3.0.4"); - TestUtils.assertFileContains(Paths.get(output + "/pom.xml"), - "11"); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/PetApi.java"), - "import jakarta."); - - output.deleteOnExit(); + assertThat(files).contains(output.resolve("pom.xml").toFile()); + assertThat(output.resolve("src/main/java/org/openapitools/client/api/PetApi.java")).content() + .contains("import jakarta."); + assertThat(output.resolve("pom.xml")).content() + .contains( + "3.0", + "3.0.4", + "11" + ); } - @Test - public void testMicroprofileGenerateCorrectJsonbCreator_issue12622() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testMicroprofileGenerateCorrectJsonbCreator_issue12622() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0")) .setGeneratorName("java") .setLibrary(JavaClientCodegen.MICROPROFILE) .setInputSpec("src/test/resources/bugs/issue_12622.json") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate() + .stream().collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("Foo.java")) .assertConstructor("String", "Integer") @@ -1934,56 +1492,70 @@ public class JavaClientCodegenTest { } @Test - public void testJavaClientDefaultValues_issueNoNumber() throws Exception { + public void testMicroprofileGenerateCorrectJacksonGenerator_issue18336() throws Exception { Map properties = new HashMap<>(); properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); + properties.put(CodegenConstants.SERIALIZATION_LIBRARY, JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); File output = Files.createTempDirectory("test").toFile(); output.deleteOnExit(); - final CodegenConfigurator configurator = - new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setInputSpec( - "src/test/resources/bugs/java-codegen-empty-array-as-default-value/issue_wrong-default.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + final CodegenConfigurator configurator = new CodegenConfigurator() + + .setAdditionalProperties(properties) + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.MICROPROFILE) + .setInputSpec("src/test/resources/bugs/issue_18336.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("Pet.java")) + .assertConstructor("String") + .assertConstructorAnnotations() + .containsWithName("JsonCreator") + .toConstructor() + .hasParameter("name") + .assertParameterAnnotations() + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "JSON_PROPERTY_NAME", "required", "true")); + } + + @Test public void testJavaClientDefaultValues_issueNoNumber() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setAdditionalProperties(Map.of(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0")) + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setOutputDir(output.toString().replace("\\", "/")) + .setInputSpec("src/test/resources/bugs/java-codegen-empty-array-as-default-value/issue_wrong-default.yaml"); + + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate() + .stream().collect(Collectors.toMap(File::getName, Function.identity())); + JavaFileAssert.assertThat(files.get("DefaultValuesType.java")) - .hasProperty("stringDefault") + .assertProperty("stringDefault") .asString().endsWith("= new ArrayList<>();"); JavaFileAssert.assertThat(files.get("DefaultValuesType.java")) - .hasProperty("stringDefault2") + .assertProperty("stringDefault2") .asString().endsWith("= new ArrayList<>(Arrays.asList(\"Hallo\", \"Huhu\"));"); JavaFileAssert.assertThat(files.get("DefaultValuesType.java")) - .hasProperty("objectDefault") + .assertProperty("objectDefault") .asString().endsWith("= new ArrayList<>();"); } - @Test - public void testWebClientJsonCreatorWithNullable_issue12790() throws Exception { - Map properties = new HashMap<>(); - properties.put(AbstractJavaCodegen.OPENAPI_NULLABLE, "true"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testWebClientJsonCreatorWithNullable_issue12790() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(AbstractJavaCodegen.OPENAPI_NULLABLE, "true")) .setGeneratorName("java") .setLibrary(JavaClientCodegen.WEBCLIENT) .setInputSpec("src/test/resources/bugs/issue_12790.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("TestObject.java")) @@ -1995,139 +1567,97 @@ public class JavaClientCodegenTest { "this.notNullableProperty = notNullableProperty;"); } - @Test - public void testRestTemplateResponseTypeWithUseAbstractionForFiles() 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(); - + @Test public void testRestTemplateResponseTypeWithUseAbstractionForFiles() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTTEMPLATE) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/ResourceApi.java"); - TestUtils.assertFileContains( - defaultApi, + assertThat(output.resolve("src/main/java/xyz/abcdef/api/ResourceApi.java")).content() + .contains( "org.springframework.core.io.Resource resourceInResponse()", "ResponseEntity resourceInResponseWithHttpInfo()", "ParameterizedTypeReference localReturnType = new" - + " ParameterizedTypeReference()"); + + " ParameterizedTypeReference()" + ); } - public void testExtraAnnotations(String library) throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - - Map properties = new HashMap<>(); - properties.put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - + @Test(dataProvider = "supportedLibraries") void testExtraAnnotations(Library library) { + final Path output = newTempFolder(); + final String outputPath = output.toString().replace('\\', '/'); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") - .setLibrary(library) - .setAdditionalProperties(properties) + .setLibrary(library.value) + .setAdditionalProperties(Map.of(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true")) .setInputSpec("src/test/resources/3_0/issue_11772.yml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); + .setOutputDir(outputPath); + final 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, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(clientOptInput).generate(); + generator.opts(configurator.toClientOptInput()).generate(); - TestUtils.assertExtraAnnotationFiles( - outputPath + "/src/main/java/org/openapitools/client/model"); + TestUtils.assertExtraAnnotationFiles(outputPath + "/src/main/java/org/openapitools/client/model"); } /** * See https://github.com/OpenAPITools/openapi-generator/issues/11340 */ - @Test - public void testReferencedHeader2() throws Exception { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - Map additionalProperties = new HashMap<>(); - additionalProperties.put(BeanValidationFeatures.USE_BEANVALIDATION, "true"); + @Test public void testReferencedHeader2() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") - .setAdditionalProperties(additionalProperties) + .setAdditionalProperties(Map.of(BeanValidationFeatures.USE_BEANVALIDATION, "true")) .setInputSpec("src/test/resources/3_0/issue-11340.yaml") - .setOutputDir(output.getAbsolutePath() - .replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - - Map files = generator.opts(clientOptInput).generate().stream() + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("DefaultApi.java")) .assertMethod("operationWithHttpInfo") - .hasParameter("requestBody") + .assertParameter("requestBody") .assertParameterAnnotations() .containsWithName("NotNull") .toParameter().toMethod() - .hasParameter("xNonNullHeaderParameter") + .assertParameter("xNonNullHeaderParameter") .assertParameterAnnotations() .containsWithName("NotNull"); } - @Test - public void testReturnTypeMapping() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testReturnTypeMapping() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setInputSpec("src/test/resources/3_0/issue14525.yaml") .addTypeMapping("array", "Stack") .addImportMapping("Stack", "java.util.Stack") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - generator.opts(clientOptInput).generate(); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), - "import java.util.Stack;"); + assertThat(output.resolve("src/main/java/org/openapitools/client/api/DefaultApi.java")).content() + .contains("import java.util.Stack;"); } @Test - public void testNativeClientExplodedQueryParamWithArrayProperty() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + public void testNativeClientExplodedQueryParamWithArrayProperty() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/exploded-query-param-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - generator.opts(clientOptInput).generate(); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); TestUtils.assertFileContains( Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), @@ -2135,211 +1665,133 @@ public class JavaClientCodegenTest { + " queryObject.getValues()));"); } - @Test - public void testJdkHttpClientWithAndWithoutParentExtension() throws Exception { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(CodegenConstants.MODEL_PACKAGE, "xyz.abcdef.model"); - properties.put(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testJdkHttpClientWithAndWithoutParentExtension() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - // use default `okhttp-gson` - //.setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/allOf_extension_parent.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + // use default `okhttp-gson` + //.setLibrary(JavaClientCodegen.NATIVE) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(CodegenConstants.MODEL_PACKAGE, "xyz.abcdef.model") + .addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker") + .setInputSpec("src/test/resources/3_0/allOf_extension_parent.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - List files = generator.opts(clientOptInput).generate(); + List files = generator.opts(configurator.toClientOptInput()).generate(); - Assertions.assertEquals(files.size(), 27); validateJavaSourceFiles(files); - - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/model/Child.java"), - "public class Child extends Person {"); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/model/Adult.java"), - "public class Adult extends Person {"); - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/xyz/abcdef/model/AnotherChild.java"), - "public class AnotherChild {"); + assertThat(files).hasSize(27); + assertThat(output.resolve("src/main/java/xyz/abcdef/model/Child.java")) + .content().contains("public class Child extends Person {"); + assertThat(output.resolve("src/main/java/xyz/abcdef/model/Adult.java")) + .content().contains("public class Adult extends Person {"); + assertThat(output.resolve("src/main/java/xyz/abcdef/model/AnotherChild.java")) + .content().contains("public class AnotherChild {"); } - @Test - public void testDiscriminatorWithMappingIssue14731() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()) - .getOpenAPI(); + @Test public void testDiscriminatorWithMappingIssue14731() { + final Path output = newTempFolder(); + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()) + .getOpenAPI(); - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); + final JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); codegen.setUseOneOfInterfaces(true); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseJakartaEe(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/client/model/ChildWithMappingADTO.java"), - "@JsonTypeName"); - assertFileNotContains( - Paths.get( - outputPath + "/src/main/java/org/openapitools/client/model/ChildWithMappingBDTO.java"), - "@JsonTypeName"); - } - - @Test - public void testDiscriminatorWithoutMappingIssue14731() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()) - .getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - codegen.setUseOneOfInterfaces(true); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); + final ClientOptInput input = new ClientOptInput().openAPI(openAPI).config(codegen); DefaultGenerator generator = new DefaultGenerator(); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "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(); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/ChildWithMappingADTO.java")) + .content().doesNotContain("@JsonTypeName"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/ChildWithMappingBDTO.java")) + .content().doesNotContain("@JsonTypeName"); + } + + @Test public void testDiscriminatorWithoutMappingIssue14731() { + final Path output = newTempFolder(); + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()) + .getOpenAPI(); + final JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + codegen.setUseOneOfInterfaces(true); codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseJakartaEe(true); codegen.setModelNameSuffix("DTO"); codegen.setLibrary(JavaClientCodegen.RESTTEMPLATE); + final ClientOptInput input = new ClientOptInput().openAPI(openAPI).config(codegen); + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "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/client/model/ChildWithoutMappingADTO.java"), - "@JsonTypeName"); - assertFileContains( - Paths.get( - outputPath - + "/src/main/java/org/openapitools/client/model/ChildWithoutMappingBDTO.java"), - "@JsonTypeName"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/ChildWithoutMappingADTO.java")) + .content().contains("@JsonTypeName"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/ChildWithoutMappingBDTO.java")) + .content().contains("@JsonTypeName"); } - @Test - public void testForJavaNativeJsonSubtype() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()) - .getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); + @Test public void testForJavaNativeJsonSubtype() { + final Path output = newTempFolder(); + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()) + .getOpenAPI(); + final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setLibrary(JavaClientCodegen.NATIVE); + codegen.setOutputDir(output.toString()); - generator.opts(input).generate(); + new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "mappings.put(\"Cat\", Cat.class)"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "@JsonSubTypes"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "mappings.put(\"cat\", Cat.class);"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "mappings.put(\"dog\", Dog.class);"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "mappings.put(\"lizard\", Lizard.class);"); - - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "mappings.put(\"cat\", Cat.class)"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "mappings.put(\"dog\", Dog.class)"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "mappings.put(\"lizard\", Lizard.class)"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "mappings.put(\"Pet\", Pet.class)"); - - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Cat.java")).content() + .contains("mappings.put(\"Cat\", Cat.class)") + .doesNotContain( + "@JsonSubTypes", + "mappings.put(\"cat\", Cat.class);", + "mappings.put(\"dog\", Dog.class);", + "mappings.put(\"lizard\", Lizard.class);" + ); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java")).content() + .contains( + "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")", + "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")", + "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")", + "mappings.put(\"cat\", Cat.class)", + "mappings.put(\"dog\", Dog.class)", + "mappings.put(\"lizard\", Lizard.class)", + "mappings.put(\"Pet\", Pet.class)" + ).doesNotContain( + "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")", + "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")", + "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")" + ); } - @Test - public void shouldProperlyExplodeRestTemplateQueryParameters_issue907() { + @Test public void shouldProperlyExplodeRestTemplateQueryParameters_issue907() { final Map files = generateFromContract( "src/test/resources/3_0/java/explode-query-parameter.yaml", @@ -2407,95 +1859,64 @@ public class JavaClientCodegenTest { final Map properties, final Consumer consumer ) { - final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(library) - .setAdditionalProperties(properties) - .setInputSpec(pathToSpecification) - .setOutputDir(output.getAbsolutePath()); + .setGeneratorName("java") + .setLibrary(library) + .setAdditionalProperties(properties) + .setInputSpec(pathToSpecification) + .setOutputDir(output.toString()); consumer.accept(configurator); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - final DefaultGenerator generator = new DefaultGenerator(); - return generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + return new DefaultGenerator().opts(configurator.toClientOptInput()).generate() + .stream().collect(Collectors.toMap(File::getName, Function.identity())); } - @Test - public void testForJavaApacheHttpClientJsonSubtype() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()) - .getOpenAPI(); + @Test public void testForJavaApacheHttpClientJsonSubtype() { + final Path output = newTempFolder(); + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()) + .getOpenAPI(); JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); codegen.setLibrary(JavaClientCodegen.APACHE); + codegen.setOutputDir(output.toString()); - generator.opts(input).generate(); + new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Cat.java")).content() + .contains( "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property =" - + " \"petType\", visible = true)"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "mappings.put"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); + + " \"petType\", visible = true)" + ).doesNotContain( + "mappings.put", + "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")", + "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")", + "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")" + ); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java")).content() + .contains( "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property =" - + " \"petType\", visible = true)"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")"); - assertFileNotContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")"); + + " \"petType\", visible = true)", + "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")", + "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")", + "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")" + ).doesNotContain( + "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")", + "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")", + "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")" + ); } - @Test - public void testIsOverriddenProperty() { + @Test public void testIsOverriddenProperty() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); JavaClientCodegen codegen = new JavaClientCodegen(); - - Schema test1 = openAPI.getComponents().getSchemas().get("Cat"); codegen.setOpenAPI(openAPI); - CodegenModel cm1 = codegen.fromModel("Cat", test1); + CodegenModel cm1 = codegen.fromModel("Cat", openAPI.getComponents().getSchemas().get("Cat")); + CodegenProperty cp0 = cm1.getAllVars().get(0); Assertions.assertEquals(cp0.getName(), "petType"); Assertions.assertEquals(cp0.isOverridden, true); @@ -2505,585 +1926,354 @@ public class JavaClientCodegenTest { Assertions.assertEquals(cp1.isOverridden, false); } - @Test - public void testForJavaApacheHttpClientOverrideSetter() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation( - "src/test/resources/3_0/allOf_composition_discriminator.yaml", - null, - new ParseOptions()) - .getOpenAPI(); + @Test public void testForJavaApacheHttpClientOverrideSetter() { + final Path output = newTempFolder(); + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/allOf_composition_discriminator.yaml", null, null) + .getOpenAPI(); JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); + codegen.setOutputDir(output.toString()); codegen.setLibrary(JavaClientCodegen.APACHE); - generator.opts(input).generate(); + new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - " @Override\n" + " public Cat petType(String petType) {"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - " }\n" + "\n" + " public Pet petType(String petType) {\n"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Cat.java")).content() + .contains(" @Override\n" + " public Cat petType(String petType) {"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java")).content() + .contains(" }\n" + "\n" + " public Pet petType(String petType) {\n"); } - @Test - public void testForJavaNativeClientOverrideSetter() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = - new OpenAPIParser() - .readLocation( - "src/test/resources/3_0/allOf_composition_discriminator.yaml", - null, - new ParseOptions()) - .getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); + @Test public void testForJavaNativeClientOverrideSetter() { + final Path output = newTempFolder(); + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/allOf_composition_discriminator.yaml", null, null) + .getOpenAPI(); + final JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); codegen.setLibrary(JavaClientCodegen.NATIVE); - generator.opts(input).generate(); + new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), - " @Override\n" + " public Cat petType(String petType) {"); - assertFileContains( - Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), - " }\n" + "\n" + " public Pet petType(String petType) {\n"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Cat.java")).content() + .contains(" @Override\n" + " public Cat petType(String petType) {"); + assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java")).content() + .contains(" }\n" + "\n" + " public Pet petType(String petType) {\n"); } - @Test - public void testDeprecatedProperty() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testDeprecatedProperty() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.OKHTTP_GSON) .setInputSpec("src/test/resources/3_0/deprecated-properties.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - // deprecated builder method TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" + " public BigDog declawed(Boolean declawed) {"); - - // deprecated getter - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" - + " @javax.annotation.Nullable\n" - + "\n" - + " public Boolean getDeclawed() {"); - // deprecated setter - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" + " public void setDeclawed(Boolean declawed) {"); - - output.deleteOnExit(); + output.resolve("src/main/java/org/openapitools/client/model/BigDog.java"), + "@Deprecated\n public BigDog declawed(Boolean declawed) {", // deprecated builder method + "@Deprecated\n @javax.annotation.Nullable\n\n public Boolean getDeclawed() {", // deprecated getter + "@Deprecated\n" + " public void setDeclawed(Boolean declawed) {" // deprecated setter + ); } - @Test - public void testDeprecatedPropertyJersey3() throws Exception { - File output = Files.createTempDirectory("test").toFile(); - + @Test public void testDeprecatedPropertyJersey3() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.JERSEY3) .setInputSpec("src/test/resources/3_0/deprecated-properties.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(clientOptInput).generate(); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - // deprecated builder method TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" + " public BigDog declawed(Boolean declawed) {"); - - // deprecated getter - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" - + " @jakarta.annotation.Nullable\n" - + " @JsonProperty(JSON_PROPERTY_DECLAWED)\n" - + " @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n" - + "\n" - + " public Boolean getDeclawed() {"); - // deprecated setter - TestUtils.assertFileContains( - Paths.get(output + "/src/main/java/org/openapitools/client/model/BigDog.java"), - "@Deprecated\n" - + " @JsonProperty(JSON_PROPERTY_DECLAWED)\n" - + " @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n" - + " public void setDeclawed(Boolean declawed) {"); - - output.deleteOnExit(); + output.resolve("src/main/java/org/openapitools/client/model/BigDog.java"), + "@Deprecated\n public BigDog declawed(Boolean declawed) {", // deprecated builder method + "@Deprecated\n @jakarta.annotation.Nullable\n @JsonProperty(JSON_PROPERTY_DECLAWED)\n" + + " @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n" + + " public Boolean getDeclawed() {", // deprecated getter + "@Deprecated\n @JsonProperty(JSON_PROPERTY_DECLAWED)\n" + + " @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n" + + " public void setDeclawed(Boolean declawed) {" // deprecated setter + ); } - @DataProvider(name = "shouldNotAddAdditionalModelAnnotationsToAbstractOpenApiSchema_issue15684") - public static Object[][] shouldNotAddAdditionalModelAnnotationsToAbstractOpenApiSchema_issue15684_dataProvider() { + @DataProvider + public static Object[][] librariesToRegressionTestForIssue15684() { return new Object[][]{{"okhttp-gson"}, {"jersey2"}, {"jersey3"}, {"native"}}; } - @Test(dataProvider = "shouldNotAddAdditionalModelAnnotationsToAbstractOpenApiSchema_issue15684") - public void shouldNotAddAdditionalModelAnnotationsToAbstractOpenApiSchema_issue15684(String library) throws Exception { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); + @Test(dataProvider = "librariesToRegressionTestForIssue15684") + public void shouldNotAddAdditionalModelAnnotationsToAbstractOpenApiSchema_issue15684(String library) { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(library) + .addAdditionalProperty(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@annotation1;@annotation2") + .setInputSpec("src/test/resources/3_0/deprecated-properties.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - final CodegenConfigurator configurator = - new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(library) - .addAdditionalProperty( - AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@annotation1;@annotation2") - .setInputSpec("src/test/resources/3_0/deprecated-properties.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("AbstractOpenApiSchema.java")) .assertTypeAnnotations() - .doesNotContainsWithName("annotation1") - .doesNotContainsWithName("annotation2"); + .doesNotContainWithName("annotation1") + .doesNotContainWithName("annotation2"); JavaFileAssert.assertThat(files.get("Animal.java")) .assertTypeAnnotations() .containsWithName("annotation1") .containsWithName("annotation2"); } - @Test - public void testRestTemplateWithGeneratedClientAsBeanDisabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, false); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithGeneratedClientAsBeanDisabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, false) + .setLibrary(JavaClientCodegen.RESTTEMPLATE) + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path apiClient = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileNotContains(apiClient, "@Component"); - - Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PetApi.java"); - TestUtils.assertFileNotContains(petApi, "@Component"); + TestUtils.assertFileNotContains(output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), "@Component"); + TestUtils.assertFileNotContains(output.resolve("src/main/java/xyz/abcdef/api/PetApi.java"), "@Component"); } - @Test - public void testRestTemplateWithGeneratedClientAsBeanEnabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithGeneratedClientAsBeanEnabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, true) + .setLibrary(JavaClientCodegen.RESTTEMPLATE) + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path apiClient = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); - TestUtils.assertFileContains(apiClient, "@Component"); - - Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PetApi.java"); - TestUtils.assertFileContains(petApi, "@Component"); + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), "@Component"); + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/api/PetApi.java"), "@Component"); } - @Test - public void testRestTemplateWithUseBeanValidationEnabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_BEANVALIDATION, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithUseBeanValidationEnabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_BEANVALIDATION, true) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path pomFile = Paths.get(output + "/pom.xml"); - TestUtils.assertFileContains(pomFile, "jakarta.validation-api"); - - Path petModel = Paths.get(output + "/src/main/java/org/openapitools/client/model/Pet.java"); - TestUtils.assertFileContains(petModel, "@Valid"); + TestUtils.assertFileContains(output.resolve("pom.xml"), "jakarta.validation-api"); + TestUtils.assertFileContains(output.resolve("src/main/java/org/openapitools/client/model/Pet.java"), "@Valid"); } - @Test - public void testRestTemplateWithUseBeanValidationDisabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.USE_BEANVALIDATION, false); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithUseBeanValidationDisabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_BEANVALIDATION, false) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path pomFile = Paths.get(output + "/pom.xml"); - TestUtils.assertFileNotContains(pomFile, "jakarta.validation-api"); - - Path petModel = Paths.get(output + "/src/main/java/org/openapitools/client/model/Pet.java"); - TestUtils.assertFileNotContains(petModel, "@Valid"); + TestUtils.assertFileNotContains(output.resolve("pom.xml"), "jakarta.validation-api"); + TestUtils.assertFileNotContains(output.resolve("src/main/java/org/openapitools/client/model/Pet.java"), "@Valid"); } - @Test - public void testRestTemplateWithPerformBeanValidationEnabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.PERFORM_BEANVALIDATION, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithPerformBeanValidationEnabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.PERFORM_BEANVALIDATION, true) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path pomFile = Paths.get(output + "/pom.xml"); - TestUtils.assertFileContains(pomFile, "hibernate-validator"); - - Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/BeanValidationException.java"); - TestUtils.assertFileExists(petApi); + TestUtils.assertFileContains(output.resolve("pom.xml"), "hibernate-validator"); + TestUtils.assertFileExists(output.resolve("src/main/java/xyz/abcdef/BeanValidationException.java")); } - @Test - public void testRestTemplateWithPerformBeanValidationDisabled() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.PERFORM_BEANVALIDATION, false); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testRestTemplateWithPerformBeanValidationDisabled() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.PERFORM_BEANVALIDATION, false) .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) .setInputSpec("src/test/resources/3_0/petstore.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path pomFile = Paths.get(output + "/pom.xml"); - TestUtils.assertFileNotContains(pomFile, "hibernate-validator"); - - Path petApi = Paths.get(output + "/src/main/java/org/openapitools/client/invoker/BeanValidationException.java"); - TestUtils.assertFileNotExists(petApi); + TestUtils.assertFileNotContains(output.resolve("pom.xml"), "hibernate-validator"); + TestUtils.assertFileNotExists(output.resolve("src/main/java/org/openapitools/client/invoker/BeanValidationException.java")); } - - @Test - public void testLogicToAvoidStackOverflow() throws IOException { - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - properties.put(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, true); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testLogicToAvoidStackOverflow() { final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue_12929.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.GENERATE_CLIENT_AS_BEAN, true) + .setLibrary(JavaClientCodegen.RESTTEMPLATE) + .setInputSpec("src/test/resources/3_0/issue_12929.yaml") + .setOutputDir(newTempFolder().toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); // shouldn't throw stackoverflow exception } - @Test - public void testWebClientSupportListOfStringReturnType_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(); - + @Test public void testWebClientSupportListOfStringReturnType_issue7118() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/bugs/issue_7118.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setInputSpec("src/test/resources/bugs/issue_7118.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path userApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/UsersApi.java"); - TestUtils.assertFileContains( - userApi, + assertThat(output.resolve("src/main/java/xyz/abcdef/api/UsersApi.java")).content() + .contains( // set of string "ParameterizedTypeReference> localVarReturnType = new" - + " ParameterizedTypeReference>() {};", + + " ParameterizedTypeReference>() {};", "getUserIdSetRequestCreation().toEntity(localVarReturnType)", // list of string "ParameterizedTypeReference> localVarReturnType = new" - + " ParameterizedTypeReference>() {};", - "getUserIdListRequestCreation().toEntity(localVarReturnType)"); + + " ParameterizedTypeReference>() {};", + "getUserIdListRequestCreation().toEntity(localVarReturnType)" + ); } - @Test - public void testEnumCaseInsensitive_issue8084() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - + @Test public void testEnumCaseInsensitive_issue8084() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/issue8084.yaml"); final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setOpenAPI(openAPI); - codegen.setOutputDir(output.getAbsolutePath()); + codegen.setOutputDir(newTempFolder().toString()); codegen.additionalProperties().put(USE_ENUM_CASE_INSENSITIVE, "true"); - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); + Map files = new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); - DefaultGenerator generator = new DefaultGenerator(); - - Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("EnumTest.java")); - javaFileAssert + JavaFileAssert.assertThat(files.get("EnumTest.java")) .assertMethod("fromValue") .bodyContainsLines("if (b.value.equalsIgnoreCase(value)) {"); } - @Test - public void testEnumCaseSensitive_issue8084() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - + @Test public void testEnumCaseSensitive_issue8084() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/issue8084.yaml"); final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setOpenAPI(openAPI); - codegen.setOutputDir(output.getAbsolutePath()); + codegen.setOutputDir(newTempFolder().toString()); codegen.additionalProperties().put(USE_ENUM_CASE_INSENSITIVE, "false"); - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); + Map files = new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); - DefaultGenerator generator = new DefaultGenerator(); - - Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("EnumTest.java")); - javaFileAssert - .assertMethod("fromValue") - .bodyContainsLines("if (b.value.equals(value)) {"); + JavaFileAssert.assertThat(files.get("EnumTest.java")) + .assertMethod("fromValue") + .bodyContainsLines("if (b.value.equals(value)) {"); } - @Test - public void testWebClientResponseTypeWithUseAbstractionForFiles_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(); - + @Test public void testWebClientResponseTypeWithUseAbstractionForFiles_issue16589() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/ResourceApi.java"); - - TestUtils.assertFileContains(defaultApi, + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/api/ResourceApi.java"), "Mono resourceInResponse()", "Mono> resourceInResponseWithHttpInfo()", "ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference()" ); } - @Test - public void testHandleConstantParams() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); + @Test public void testHandleConstantParams() { + final Path output = newTempFolder(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/java/autoset_constant.yaml"); - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - JavaClientCodegen javaClientCodegen = new JavaClientCodegen(); - javaClientCodegen.setOutputDir(output.getAbsolutePath()); - javaClientCodegen.additionalProperties().put(CodegenConstants.AUTOSET_CONSTANTS, "true"); - javaClientCodegen.setAutosetConstants(true); - clientOptInput.config(javaClientCodegen); - defaultGenerator.opts(clientOptInput); + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); + codegen.additionalProperties().put(CodegenConstants.AUTOSET_CONSTANTS, "true"); + codegen.setAutosetConstants(true); - Map files = defaultGenerator.generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + Map files = new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); File apiFile = files.get("HelloExampleApi.java"); - Assertions.assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile) - .assertMethod("helloCall", "String", "ApiCallback") - .bodyContainsLines( - "localVarHeaderParams.put(\"X-CUSTOM_CONSTANT_HEADER\", \"CONSTANT_VALUE\")"); + .assertMethod("helloCall", "String", "ApiCallback") + .bodyContainsLines("localVarHeaderParams.put(\"X-CUSTOM_CONSTANT_HEADER\", \"CONSTANT_VALUE\")"); } @Test - public void testAllOfWithSinglePrimitiveTypeRef() throws IOException { - File output = Files.createTempDirectory("test_allOf_primitive_type").toFile().getCanonicalFile(); - output.deleteOnExit(); + public void testAllOfWithSinglePrimitiveTypeRef() { + final Path output = newTempFolder(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allof_primitive.yaml"); - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - JavaClientCodegen javaClientCodegen = new JavaClientCodegen(); - javaClientCodegen.setOutputDir(output.getAbsolutePath()); - javaClientCodegen.setAutosetConstants(true); - clientOptInput.config(javaClientCodegen); - defaultGenerator.opts(clientOptInput); + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); + codegen.setAutosetConstants(true); - Map files = defaultGenerator.generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + Map files = new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); - File apiFile = files.get("AllOfDatetime.java"); - assertEquals(apiFile, null); + assertNull(files.get("AllOfDatetime.java")); } - @Test - public void testOpenapiGeneratorIgnoreListOption() throws IOException { - File output = Files.createTempDirectory("openapi_generator_ignore_list_test_folder").toFile().getCanonicalFile(); - output.deleteOnExit(); + @Test public void testOpenapiGeneratorIgnoreListOption() { + final Path output = newTempFolder(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allof_primitive.yaml"); - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - final ClientOptInput clientOptInput = new ClientOptInput(); - clientOptInput.openAPI(openAPI); - JavaClientCodegen javaClientCodegen = new JavaClientCodegen(); - javaClientCodegen.setOutputDir(output.getAbsolutePath()); - javaClientCodegen.setAutosetConstants(true); - javaClientCodegen.openapiGeneratorIgnoreList().add("README.md"); - javaClientCodegen.openapiGeneratorIgnoreList().add("pom.xml"); - clientOptInput.config(javaClientCodegen); - defaultGenerator.opts(clientOptInput); - - Map files = defaultGenerator.generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.toString()); + codegen.setAutosetConstants(true); + codegen.openapiGeneratorIgnoreList().add("README.md"); + codegen.openapiGeneratorIgnoreList().add("pom.xml"); + + Map files = new DefaultGenerator().opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); // make sure README.md and pom.xml are not generated - assertEquals(files.get("README.md"), null); - assertEquals(files.get("pom.xml"), null); + assertNull(files.get("README.md")); + assertNull(files.get("pom.xml")); } @Test - public void testRestTemplateHandleURIEnum() throws IOException { + public void testRestTemplateHandleURIEnum() { String[] expectedInnerEnumLines = new String[] { "V1_SCHEMA_JSON(URI.create(\"https://example.com/v1/schema.json\"))", "V2_SCHEMA_JSON(URI.create(\"https://example.com/v2/schema.json\"))" @@ -3098,7 +2288,7 @@ public class JavaClientCodegenTest { } @Test - public void testOkHttpGsonHandleURIEnum() throws IOException { + public void testOkHttpGsonHandleURIEnum() { String[] expectedInnerEnumLines = new String[] { "V1_SCHEMA_JSON(URI.create(\"https://example.com/v1/schema.json\"))", "V2_SCHEMA_JSON(URI.create(\"https://example.com/v2/schema.json\"))", @@ -3119,7 +2309,7 @@ public class JavaClientCodegenTest { } @Test - public void testMicroprofileHandleURIEnum() throws IOException { + public void testMicroprofileHandleURIEnum() { String[] expectedInnerEnumLines = new String[] { "V1_SCHEMA_JSON(URI.create(\"https://example.com/v1/schema.json\"))", "V2_SCHEMA_JSON(URI.create(\"https://example.com/v2/schema.json\"))", @@ -3134,23 +2324,16 @@ public class JavaClientCodegenTest { testHandleURIEnum(JavaClientCodegen.MICROPROFILE, expectedInnerEnumLines, expectedEnumLines); } - private void testHandleURIEnum(String library, String[] expectedInnerEnumLines, String[] expectedEnumLines) throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - + private void testHandleURIEnum(String library, String[] expectedInnerEnumLines, String[] expectedEnumLines) { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(library) .setInputSpec("src/test/resources/3_0/enum-and-inner-enum-uri.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - final DefaultGenerator defaultGenerator = new DefaultGenerator(); - - defaultGenerator.opts(clientOptInput); - - Map files = defaultGenerator.generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .setOutputDir(output.toString().replace("\\", "/")); + + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate() + .stream().collect(Collectors.toMap(File::getName, Function.identity())); // enum File modelFile = files.get("Metadata.java"); @@ -3163,36 +2346,22 @@ public class JavaClientCodegenTest { JavaFileAssert.assertThat(apiFile).fileContains(expectedInnerEnumLines); } - @Test - public void testQueryParamsExploded_whenQueryParamIsNull() throws IOException { - - Map properties = new HashMap<>(); - properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - + @Test public void testQueryParamsExploded_whenQueryParamIsNull() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTTEMPLATE) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .setInputSpec("src/test/resources/3_0/issue_17555.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setOutputDir(output.toString().replace("\\", "/")); - - DefaultGenerator generator = new DefaultGenerator(); - List files = generator.opts(configurator.toClientOptInput()).generate(); - files.forEach(File::deleteOnExit); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); validateJavaSourceFiles(files); - - - Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/DepartmentApi.java"); - TestUtils.assertFileContains(petApi, "if (filter != null) {"); + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/api/DepartmentApi.java"), "if (filter != null) {"); } - @Test - public void generateAllArgsConstructor() { + @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")); @@ -3223,8 +2392,7 @@ public class JavaClientCodegenTest { .hasParameter("_list").toConstructor(); } - @Test - public void generateAllArgsConstructor_REFACTOR_ALLOF_WITH_PROPERTIES_ONLY() { + @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, @@ -3252,226 +2420,561 @@ public class JavaClientCodegenTest { .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(); - + @Test public void testRestClientFormMultipart() { + final Path output = newTempFolder(); final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("java") .setLibrary(JavaClientCodegen.RESTCLIENT) - .setAdditionalProperties(properties) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) .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); + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); 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()));", + output.resolve("src/main/java/xyz/abcdef/api/MultipartApi.java"), + // 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));", + // 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<>()" + // single file + "multipartSingle(File _file)", + "formParams.add(\"file\", new FileSystemResource(_file));" ); } - @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)); + @Test public void testRestClientWithUseAbstractionForFiles() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/api/MultipartApi.java"), + // 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() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(Map.of(CodegenConstants.API_PACKAGE, "xyz.abcdef.api")) + .setInputSpec("src/test/resources/3_0/issue8352.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + final List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains(output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), "value instanceof Map"); + } + + @Test public void testRestClientJsonCreatorWithNullable_issue12790() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .addAdditionalProperty(AbstractJavaCodegen.OPENAPI_NULLABLE, "true") + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setInputSpec("src/test/resources/bugs/issue_12790.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + Map files = new DefaultGenerator().opts(configurator.toClientOptInput()).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() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setInputSpec("src/test/resources/bugs/issue_7118.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/api/UsersApi.java"), + // 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() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true) + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/api/ResourceApi.java"), + "org.springframework.core.io.Resource resourceInResponse()", + "ResponseEntity resourceInResponseWithHttpInfo()", + "ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>()" + ); + } + + @Test void testBuilderJavaClient() { + 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 {"); + .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())"); + .fileContains( + "toBuilder()", + "builder()", + "public static class Builder extends Reptile.Builder {", + ".petType(getPetType())", + ".name(getName())", + "hasLegs(getHasLegs())" + ); + } + + @DataProvider Iterator serializationLibraries() { + return new JavaClientCodegen().supportedLibraries().keySet().iterator(); + } + + @Test(dataProvider = "serializationLibraries") void setsDefaultSerializationLibrary(String library) { + var codegen = new JavaClientCodegen(); + codegen.setLibrary(library); + codegen.processOpts(); + + assertThat(codegen.additionalProperties()) + .containsAnyOf( + entry(SERIALIZATION_LIBRARY_GSON, "true"), + entry(SERIALIZATION_LIBRARY_JACKSON, "true"), + entry(SERIALIZATION_LIBRARY_JSONB, "true") + ); + } + + /** + * Regression test for #18515: + * When GSON is selected as serializer, there should not be any jackson references + * (except jackson-databind-nullable that is, which is only added when openApiNullable=true) + */ + @Test(dataProvider = "librariesSupportingGson") void gsonCodeDoesNotContainJacksonReferences(Library library) { + final CodegenConfigurator configurator = new CodegenConfigurator() + .addAdditionalProperty(SERIALIZATION_LIBRARY, Serializer.GSON) + .addAdditionalProperty(OPENAPI_NULLABLE, "false") + .setGeneratorName("java") + .setLibrary(library.getValue()) + .setInputSpec("src/test/resources/3_0/java/autoset_constant.yaml") + .setOutputDir(newTempFolder().toString()); + var generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); + + List files = generator.opts(configurator.toClientOptInput()).generate(); + + assertThat(files).allSatisfy( + file -> assertThat(file).content().doesNotContainIgnoringCase("jackson") + ); + } + + /** + * Regression test for #6496 + */ + @Test void doesNotGenerateJacksonToStringSerializerAnnotation_whenLibraryIsGson_andSerializeBigDecimalAsStringIsTrue() { + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.OKHTTP_GSON) + .addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_GSON) + .addAdditionalProperty(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, true) + .addGlobalProperty(CodegenConstants.MODELS, "FormatTest") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, "false") + .addGlobalProperty(CodegenConstants.MODEL_TESTS, "false") + .setInputSpec("src/test/resources/2_0/java/issue-6496.yaml") + .setOutputDir(newTempFolder().toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + assertThat(files).hasSize(1).first(FILE).content() + .doesNotContain( + "@JsonDeserialize(as = LinkedHashSet.class)", + "@JsonSerialize(using = ToStringSerializer.class)", + "com.fasterxml.jackson.databind.ser.std.ToStringSerializer", + "com.fasterxml.jackson.databind.annotation.JsonDeserialize", + "com.fasterxml.jackson.databind.annotation.JsonSerialize" + ); + } + + /** + * Test that fix for #6496 has + * no unwanted side effects on the existing feature (Jackson + bigDecimalAsString) + */ + @Test void generatesJacksonToStringSerializerAnnotation_whenLibraryIsJackson_andSerializeBigDecimalAsStringIsTrue() { + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JACKSON) + .addAdditionalProperty(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, true) + .addAdditionalProperty(OPENAPI_NULLABLE, false) + .addGlobalProperty(CodegenConstants.MODELS, "FormatTest") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, "false") + .addGlobalProperty(CodegenConstants.MODEL_TESTS, "false") + .setInputSpec("src/test/resources/2_0/java/issue-6496.yaml") + .setOutputDir(newTempFolder().toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + assertThat(files).hasSize(1).first(FILE).content() + .contains( + "@JsonDeserialize(as = LinkedHashSet.class)", + "@JsonSerialize(using = ToStringSerializer.class)", + "com.fasterxml.jackson.databind.ser.std.ToStringSerializer", + "com.fasterxml.jackson.databind.annotation.JsonDeserialize", + "com.fasterxml.jackson.databind.annotation.JsonSerialize" + ); + } + + /** + * General XML annotations test (both JAXB and Jackson) + *
    + * Includes regression tests for: + * - Correct Jackson annotation when `wrapped: false` + * - Microprofile generator missing Jackson annotations and namespaces + */ + @Test(dataProvider = "librariesSupportingJackson") + void shouldGenerateCorrectXmlAnnotations(Library library) { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addAdditionalProperty(SERIALIZATION_LIBRARY, "jackson") + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, null) + .addGlobalProperty(CodegenConstants.MODEL_TESTS, null) + .setGeneratorName("java") + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setLibrary(library.value) + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertProperty("tags").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\"")) + .toProperty().toType() + .assertMethod("getTags") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Tag\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("friends").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\"")) + .toProperty().toType() + .assertMethod("getFriends") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"friend-pet\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertProperty("status").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\"")) + .toProperty().toType() + .assertMethod("getStatus") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"PetStatus\"")) + .toFileAssert() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("photoUrls").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\"")) + .toProperty().toType() + .assertMethod("getPhotoUrls") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"photoUrls\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertProperty("name").assertPropertyAnnotations() + .doesNotContainWithName("XmlElement") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\"")) + .toProperty().toType() + .assertMethod("getName") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\"")) + .toFileAssert() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertProperty("id").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toProperty().toType() + .assertMethod("getId") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toFileAssert() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("foods").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\"")) + .toProperty().toType() + .assertMethod("getFoods") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\"")) + .toFileAssert() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("colors").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\"")) + .toProperty().toType() + .assertMethod("getColors") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"color\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"colors\"")) + .toFileAssert() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("categories").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\"")) + .toProperty().toType() + .assertMethod("getCategories") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Category\"")) + // ↓ specific regression test for #2417: (useWrapping=false) needs to be present + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("activities").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\"")) + .toProperty().toType() + .assertMethod("getActivities") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"item\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\"")); + } + + /** + * General XML annotations test (only JAXB) + */ + @Test(dataProvider = "librariesNotSupportingJackson") + void shouldGenerateCorrectJaxbAnnotations(Library library) { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, null) + .addGlobalProperty(CodegenConstants.MODEL_TESTS, null) + .setGeneratorName("java") + .setLibrary(library.value) + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertProperty("tags").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\"")) + .toProperty().toType() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("friends").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\"")) + .toProperty().toType() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertProperty("status").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\"")) + .toProperty().toType() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("photoUrls").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\"")) + .toProperty().toType() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertProperty("name").assertPropertyAnnotations() + .doesNotContainWithName("XmlElement") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\"")) + .toProperty().toType() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertProperty("id").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toProperty().toType() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("foods").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\"")) + .toProperty().toType() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("colors").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\"")) + .toProperty().toType() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("categories").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\"")) + .toProperty().toType() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("activities").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\"")); + } + + + @Test + public void shouldGenerateOAuthTokenSuppliers() { + + final Map files = generateFromContract( + "src/test/resources/3_0/java/oauth.yaml", + JavaClientCodegen.RESTTEMPLATE + ); + + final JavaFileAssert apiClient = JavaFileAssert.assertThat(files.get("ApiClient.java")) + .printFileContent(); + apiClient + .assertMethod("setAccessToken", "String") + .bodyContainsLines("setAccessToken(() -> accessToken);"); + apiClient + .assertMethod("setAccessToken", "Supplier") + .bodyContainsLines("((OAuth) auth).setAccessToken(tokenSupplier);"); + + final JavaFileAssert oAuth = JavaFileAssert.assertThat(files.get("OAuth.java")) + .printFileContent(); + oAuth + .assertMethod("setAccessToken", "String") + .bodyContainsLines("setAccessToken(() -> accessToken);"); + oAuth + .assertMethod("setAccessToken", "Supplier") + .bodyContainsLines("this.tokenSupplier = tokenSupplier;"); + oAuth + .assertMethod("applyToParams") + .bodyContainsLines("Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken ->") + .bodyContainsLines("headerParams.add(HttpHeaders.AUTHORIZATION, \"Bearer \" + accessToken)"); + + } + + @Test public void testRestClientWithXML_issue_19137() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(Map.of( + CodegenConstants.API_PACKAGE, "xyz.abcdef.api", + CodegenConstants.WITH_XML, true + )) + .setInputSpec("src/test/resources/3_1/java/petstore.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + TestUtils.assertFileContains( + output.resolve("src/main/java/xyz/abcdef/ApiClient.java"), + "import com.fasterxml.jackson.dataformat.xml.XmlMapper;", + "import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;" + ); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 848d5d7edf0..91c36f64293 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -31,7 +31,6 @@ import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.JavaClientCodegen; -import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java index 9626647b9fc..06bccb329d7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java @@ -39,73 +39,73 @@ public class JavaValidationArrayPrimitivesTest { private static Consumer> assertWithValidationWithoutJsonNullable() { return files -> JavaFileAssert.assertThat(files.get("Foo.java")) .isNormalClass() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType("Set<@Pattern(regexp = \"[a-z]\") String>") .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType("Set<@Size(min = 1, max = 10) String>") .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType("List<@Size(min = 1) String>") .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType("Set<@Size(max = 1) String>") .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType("List<@Email String>") .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType("List<@Min(1) @Max(10) Integer>") .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType("List<@Min(1) Integer>") .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType("List<@Max(10) Integer>") .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType("List<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType("List<@DecimalMin(value = \"1\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType("List<@DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("stringPatternWithMin") + .assertProperty("stringPatternWithMin") .withType("Set<@Pattern(regexp = \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\") @Size(min = 10) String>") .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType("Set<@Pattern(regexp = \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\") String>") .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType("Set<@Size(min = 1, max = 10) String>") .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType("List<@Size(min = 1) String>") .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType("Set<@Size(max = 1) String>") .toType() - .hasProperty("stringNumbers") + .assertProperty("stringNumbers") .withType("Set<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType("List<@Min(1) @Max(10) Integer>") .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType("List<@Min(1) Integer>") .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType("List<@Max(10) Integer>") .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType("List<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType("List<@DecimalMin(value = \"1\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType("List<@DecimalMax(value = \"10\", inclusive = false) BigDecimal>") .toType(); } @@ -113,76 +113,76 @@ public class JavaValidationArrayPrimitivesTest { private static Consumer> assertWithValidationWithJsonNullable() { return files -> JavaFileAssert.assertThat(files.get("Foo.java")) .isNormalClass() - .hasProperty("category") + .assertProperty("category") .withType("List<@Pattern(regexp = \"^[a-zA-Z0-9 .:!()-]$\") @Size(max = 50) String>") .toType() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType("Set<@Pattern(regexp = \"[a-z]\") String>") .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType("Set<@Size(min = 1, max = 10) String>") .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType("List<@Size(min = 1) String>") .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType("Set<@Size(max = 1) String>") .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType("List<@Email String>") .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType("List<@Min(1) @Max(10) Integer>") .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType("List<@Min(1) Integer>") .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType("List<@Max(10) Integer>") .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType("List<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType("List<@DecimalMin(value = \"1\", inclusive = true) BigDecimal>") .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType("List<@DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("stringPatternWithMin") + .assertProperty("stringPatternWithMin") .withType("JsonNullable>") .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringNumbers") + .assertProperty("stringNumbers") .withType("Set<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>") .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType("JsonNullable>") .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType("JsonNullable>") .toType(); } @@ -231,70 +231,70 @@ public class JavaValidationArrayPrimitivesTest { private static Consumer> assertWithoutValidationWithoutJsonNullable() { return files -> JavaFileAssert.assertThat(files.get("Foo.java")) .isNormalClass() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType("Set") .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType("Set") .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType("List") .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType("Set") .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType("List") .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType("List") .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType("List") .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType("List") .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType("List") .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType("List") .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType("List") .toType() - .hasProperty("stringPatternWithMin") + .assertProperty("stringPatternWithMin") .withType("Set") .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType("Set") .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType("Set") .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType("List") .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType("Set") .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType("List") .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType("List") .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType("List") .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType("List") .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType("List") .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType("List") .toType(); } @@ -302,70 +302,70 @@ public class JavaValidationArrayPrimitivesTest { private static Consumer> assertWithoutValidationWithJsonNullable() { return files -> JavaFileAssert.assertThat(files.get("Foo.java")) .isNormalClass() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType("Set") .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType("Set") .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType("List") .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType("Set") .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType("List") .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType("List") .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType("List") .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType("List") .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType("List") .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType("List") .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType("List") .toType() - .hasProperty("stringPatternWithMin") + .assertProperty("stringPatternWithMin") .withType("JsonNullable>") .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType("JsonNullable>") .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType("JsonNullable>") .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType("JsonNullable>") .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType("JsonNullable>") .toType(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationsAssert.java similarity index 90% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationsAssert.java index fac2af8f7b0..ccda2854b2e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationsAssert.java @@ -17,12 +17,13 @@ import com.github.javaparser.ast.nodeTypes.NodeWithSimpleName; import com.google.common.collect.ImmutableMap; @CanIgnoreReturnValue -public abstract class AbstractAnnotationAssert> extends ListAssert { +public abstract class AbstractAnnotationsAssert> extends ListAssert { - protected AbstractAnnotationAssert(final List annotationExpr) { + protected AbstractAnnotationsAssert(final List annotationExpr) { super(annotationExpr); } + @Override public ACTUAL hasSize(final int size) { super.hasSize(size); return myself(); @@ -35,7 +36,7 @@ public abstract class AbstractAnnotationAssert annotation.getNameAsString().equals(name)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractMethodAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractMethodAssert.java new file mode 100644 index 00000000000..1217d87933a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractMethodAssert.java @@ -0,0 +1,152 @@ +package org.openapitools.codegen.java.assertions; + +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.nodeTypes.NodeWithName; +import org.assertj.core.api.AbstractAssert; +import org.assertj.core.api.Assertions; +import org.assertj.core.util.CanIgnoreReturnValue; + +import java.util.Arrays; +import java.util.Map; +import java.util.stream.Collectors; + +@CanIgnoreReturnValue +public abstract class AbstractMethodAssert> extends AbstractAssert, MethodDeclaration> { + + protected final String methodSignature; + + protected AbstractMethodAssert(MethodDeclaration methodDeclaration, Class selfType) { + super(methodDeclaration, selfType); + this.methodSignature = methodDeclaration.getDeclarationAsString(); + } + + public abstract JavaFileAssert toFileAssert(); + public abstract AbstractAnnotationsAssert assertMethodAnnotations(); + + public ACTUAL hasReturnType(final String returnType) { + Assertions.assertThat(actual.getType().toString()) + .isEqualTo(returnType); + return myself(); + } + + public ACTUAL hasAnnotation(String annotation) { + assertMethodAnnotations().containsWithName(annotation); + return myself(); + } + + public ACTUAL hasAnnotation(String annotation, final Map attributes) { + assertMethodAnnotations().containsWithNameAndAttributes(annotation, attributes); + return myself(); + } + + public ACTUAL doesNotHaveAnnotation(String annotation) { + assertMethodAnnotations().doesNotContainWithName(annotation); + return myself(); + } + + public ACTUAL doesNotHaveParameter(final String paramName) { + Assertions.assertThat(actual.getParameterByName(paramName)) + .withFailMessage("Method %s shouldn't have parameter %s, but it does", methodSignature, paramName) + .isEmpty(); + return myself(); + } + + public ACTUAL doesNotHaveParameters() { + Assertions.assertThat(actual.getParameters()) + .withFailMessage("Method %s shouldn't have parameter, but it does", methodSignature) + .isEmpty(); + return myself(); + } + + public ACTUAL bodyContainsLines(final String... lines) { + Assertions.assertThat(isWithImplementation()) + .withFailMessage("Method %s is abstract", methodSignature) + .isTrue(); + final String actualBody = actual.getTokenRange() + .orElseThrow(() -> new IllegalStateException("Not-abstract method doesn't have body")) + .toString(); + Assertions.assertThat(actualBody) + .withFailMessage( + "Method's %s body should contains lines\n====\n%s\n====\nbut actually was\n====\n%s\n====", + methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualBody + ) + .contains(lines); + + return myself(); + } + + public ACTUAL bodyNotContainsLines(final String... lines) { + Assertions.assertThat(isWithImplementation()) + .withFailMessage("Method %s is abstract", methodSignature) + .isTrue(); + final String actualBody = actual.getTokenRange() + .orElseThrow(() -> new IllegalStateException("Not-abstract method doesn't have body")) + .toString(); + Assertions.assertThat(actualBody) + .withFailMessage( + "Method's %s body shouldn't contains lines\n====\n%s\n====\nbut actually was\n====\n%s\n====", + methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualBody + ) + .doesNotContain(lines); + + return myself(); + } + + public ACTUAL doesNotHaveImplementation() { + Assertions.assertThat(isWithImplementation()) + .withFailMessage("Method %s should be abstract", methodSignature) + .isFalse(); + return myself(); + } + + public ACTUAL doesNotHaveComment() { + Assertions.assertThat(actual.getJavadocComment()) + .withFailMessage("Method %s shouldn't contains comment, but it does", methodSignature) + .isEmpty(); + return myself(); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + public ACTUAL commentContainsLines(final String... lines) { + Assertions.assertThat(actual.getJavadocComment()) + .withFailMessage("Method %s should contains comment, but it doesn't", methodSignature) + .isPresent(); + + final String actualComment = actual.getJavadocComment().get().getContent(); + Assertions.assertThat(actualComment) + .withFailMessage( + "Method's %s comment should contains lines\n====\n%s\n====\nbut actually was\n====%s\n====", + methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualComment + ) + .contains(lines); + + return myself(); + } + + public ACTUAL noneOfParameterHasAnnotation(final String annotationName) { + actual.getParameters() + .forEach( + param -> Assertions.assertThat(param.getAnnotations()) + .withFailMessage("Parameter %s contains annotation %s while it shouldn't", param.getNameAsString(), annotationName) + .extracting(NodeWithName::getNameAsString) + .doesNotContain(annotationName) + ); + + return myself(); + } + + private boolean isWithImplementation() { + final boolean isInterface = actual.getParentNode() + .filter(ClassOrInterfaceDeclaration.class::isInstance) + .map(ClassOrInterfaceDeclaration.class::cast) + .map(ClassOrInterfaceDeclaration::isInterface) + .orElse(false); + return !(actual.isAbstract() || (isInterface && !actual.isDefault())); + } + + @SuppressWarnings("unchecked") + private ACTUAL myself() { + return (ACTUAL) this; + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java index c0296c5cea6..dfe465caba4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ConstructorAssert.java @@ -27,10 +27,11 @@ public class ConstructorAssert extends AbstractAssert parameter = actual.getParameterByName(paramName); Assertions.assertThat(parameter) @@ -67,6 +68,7 @@ public class ConstructorAssert extends AbstractAssert { + + private final JavaFileAssert parent; + private final ClassOrInterfaceDeclaration innerClass; + + protected InnerClassAssert(final JavaFileAssert fileAssert, final ClassOrInterfaceDeclaration bodyDeclaration) { + super(bodyDeclaration, InnerClassAssert.class); + parent = fileAssert; + innerClass = bodyDeclaration; + } + + public JavaFileAssert toFileAssert() { + return parent; + } + + // TODO this effectively duplicates JavaFileAssert.assertMethod, could be moved into a common + // intermediate base class (which would then easily implement property, type & constructor + // assertions for inner classes + public MethodAssert assertMethod(final String methodName, final String... paramTypes) { + + final List methods = paramTypes.length == 0 + ? innerClass.getMethodsByName(methodName) + : innerClass.getMethodsBySignature(methodName, paramTypes); + + final String failMessage = (methods.isEmpty() + ? "No methods matching `%s(%s)` exist" + : "There are " + methods.size() + " methods matching `%s(%s)`") + + " in inner class `" + innerClass.getName() + "`"; + + Assertions.assertThat(methods) + .withFailMessage(failMessage, methodName, Arrays.toString(paramTypes).replaceAll("\\[]", "")) + .hasSize(1); + + return new MethodAssert(this, methods.get(0)); + } + + public static class MethodAssert extends AbstractMethodAssert { + + private final InnerClassAssert innerClassAssert; + + MethodAssert(InnerClassAssert innerClassAssert, MethodDeclaration methodDeclaration) { + super(methodDeclaration, MethodAssert.class); + this.innerClassAssert = innerClassAssert; + } + + public MethodAnnotationsAssert assertMethodAnnotations() { + return new MethodAnnotationsAssert(this, actual.getAnnotations()); + } + + public InnerClassAssert toInnerClassAssert() { + return innerClassAssert; + } + + public JavaFileAssert toFileAssert() { + return innerClassAssert.toFileAssert(); + } + } + + public static class MethodAnnotationsAssert extends AbstractAnnotationsAssert { + + private final MethodAssert parent; + + protected MethodAnnotationsAssert(MethodAssert methodAssert, List annotationExpr) { + super(annotationExpr); + parent = methodAssert; + } + + public InnerClassAssert toInnerClassAssert() { + return parent.innerClassAssert; + } + + public MethodAssert toMethod() { + return parent; + } + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java index 007eb2c40e9..b8ebae768c2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java @@ -1,5 +1,14 @@ package org.openapitools.codegen.java.assertions; +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.CompilationUnit; +import com.github.javaparser.ast.body.*; +import com.github.javaparser.ast.nodeTypes.NodeWithName; +import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier; +import org.assertj.core.api.AbstractAssert; +import org.assertj.core.api.Assertions; +import org.assertj.core.util.CanIgnoreReturnValue; + import java.io.File; import java.io.IOException; import java.nio.file.Path; @@ -8,19 +17,6 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.ConstructorDeclaration; -import org.assertj.core.api.AbstractAssert; -import org.assertj.core.api.Assertions; -import org.assertj.core.util.CanIgnoreReturnValue; - -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.CompilationUnit; -import com.github.javaparser.ast.body.FieldDeclaration; -import com.github.javaparser.ast.body.MethodDeclaration; -import com.github.javaparser.ast.nodeTypes.NodeWithName; -import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier; - @CanIgnoreReturnValue public class JavaFileAssert extends AbstractAssert { @@ -41,11 +37,7 @@ public class JavaFileAssert extends AbstractAssert methods = paramTypes.length == 0 ? actual.getType(0).getMethodsByName(methodName) : actual.getType(0).getMethodsBySignature(methodName, paramTypes); @@ -98,7 +90,23 @@ public class JavaFileAssert extends AbstractAssert innerClass = actual.getType(0).getMembers().stream() + .filter(BodyDeclaration::isClassOrInterfaceDeclaration) + .map(clazz -> (ClassOrInterfaceDeclaration) clazz) + .filter(clazz -> clazz.isInnerClass() || clazz.isStatic() && clazz.getNameAsString().equals(className)) + .findFirst(); + Assertions.assertThat(innerClass) + .withFailMessage("No inner class with name %s found", className) + .isPresent(); + + return new InnerClassAssert(this, innerClass.get ()); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") public ConstructorAssert assertConstructor(final String... paramTypes) { Optional constructorDeclaration = actual.getType(0).getConstructorByParameterTypes(paramTypes); Assertions.assertThat(constructorDeclaration) @@ -108,7 +116,7 @@ public class JavaFileAssert extends AbstractAssert constructorDeclaration = actual.getType(0).getConstructorByParameterTypes(paramTypes); Assertions.assertThat(constructorDeclaration) .withFailMessage("Found constructor with parameter(s) %s", Arrays.toString(paramTypes)) @@ -117,7 +125,8 @@ public class JavaFileAssert extends AbstractAssert fieldOptional = actual.getType(0).getMembers().stream() .filter(FieldDeclaration.class::isInstance) .map(FieldDeclaration.class::cast) @@ -161,7 +170,7 @@ public class JavaFileAssert extends AbstractAssert new IllegalStateException("Empty file")) .toString(); @@ -175,8 +184,7 @@ public class JavaFileAssert extends AbstractAssert { +public class MethodAnnotationsAssert extends AbstractAnnotationsAssert { private final MethodAssert methodAssert; private final ConstructorAssert constructorAssert; - protected MethodAnnotationAssert(final MethodAssert methodAssert, final List annotationExpr) { + protected MethodAnnotationsAssert(final MethodAssert methodAssert, final List annotationExpr) { super(annotationExpr); this.methodAssert = methodAssert; this.constructorAssert = null; } - protected MethodAnnotationAssert(final ConstructorAssert constructorAssert, final List annotationExpr) { + protected MethodAnnotationsAssert(final ConstructorAssert constructorAssert, final List annotationExpr) { super(annotationExpr); this.constructorAssert = constructorAssert; this.methodAssert = null; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java index cdfb564ff75..bdd4f776e76 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/MethodAssert.java @@ -1,148 +1,38 @@ package org.openapitools.codegen.java.assertions; -import java.util.Arrays; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.assertj.core.api.AbstractAssert; -import org.assertj.core.api.Assertions; -import org.assertj.core.util.CanIgnoreReturnValue; - -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.nodeTypes.NodeWithName; +import org.assertj.core.api.Assertions; -@CanIgnoreReturnValue -public class MethodAssert extends AbstractAssert { +import java.util.Optional; + +public class MethodAssert extends AbstractMethodAssert { private final JavaFileAssert fileAssert; - private final String methodSignature; MethodAssert(final JavaFileAssert fileAssert, final MethodDeclaration methodDeclaration) { super(methodDeclaration, MethodAssert.class); this.fileAssert = fileAssert; - this.methodSignature = methodDeclaration.getDeclarationAsString(); } public JavaFileAssert toFileAssert() { return fileAssert; } - public MethodAnnotationAssert assertMethodAnnotations() { - return new MethodAnnotationAssert(this, actual.getAnnotations()); + public MethodAnnotationsAssert assertMethodAnnotations() { + return new MethodAnnotationsAssert(this, actual.getAnnotations()); } - public MethodAssert hasReturnType(final String returnType) { - Assertions.assertThat(actual.getType().toString()) - .isEqualTo(returnType); - return this; - } - - public ParameterAssert hasParameter(final String paramName) { + // TODO move into base class so inner class method parameters can be asserted + // (may need some more Generics Kung-Fu applied to the ParameterAssert class, + // alternatively the f) + @SuppressWarnings("OptionalGetWithoutIsPresent") + public ParameterAssert assertParameter(final String paramName) { final Optional parameter = actual.getParameterByName(paramName); Assertions.assertThat(parameter) .withFailMessage("Method %s should have parameter %s, but it doesn't", methodSignature, paramName) .isPresent(); + return new ParameterAssert(this, parameter.get()); } - - public MethodAssert doesNotHaveParameter(final String paramName) { - Assertions.assertThat(actual.getParameterByName(paramName)) - .withFailMessage("Method %s shouldn't have parameter %s, but it does", methodSignature, paramName) - .isEmpty(); - return this; - } - - public MethodAssert doesNotHaveParameters() { - Assertions.assertThat(actual.getParameters()) - .withFailMessage("Method %s shouldn't have parameter, but it does", methodSignature) - .isEmpty(); - return this; - } - - public MethodAssert bodyContainsLines(final String... lines) { - Assertions.assertThat(isWithImplementation()) - .withFailMessage("Method %s is abstract", methodSignature) - .isTrue(); - final String actualBody = actual.getTokenRange() - .orElseThrow(() -> new IllegalStateException("Not-abstract method doesn't have body")) - .toString(); - Assertions.assertThat(actualBody) - .withFailMessage( - "Method's %s body should contains lines\n====\n%s\n====\nbut actually was\n====\n%s\n====", - methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualBody - ) - .contains(lines); - - return this; - } - - public MethodAssert bodyNotContainsLines(final String... lines) { - Assertions.assertThat(isWithImplementation()) - .withFailMessage("Method %s is abstract", methodSignature) - .isTrue(); - final String actualBody = actual.getTokenRange() - .orElseThrow(() -> new IllegalStateException("Not-abstract method doesn't have body")) - .toString(); - Assertions.assertThat(actualBody) - .withFailMessage( - "Method's %s body shouldn't contains lines\n====\n%s\n====\nbut actually was\n====\n%s\n====", - methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualBody - ) - .doesNotContain(lines); - - return this; - } - - public MethodAssert doesNotHaveImplementation() { - Assertions.assertThat(isWithImplementation()) - .withFailMessage("Method %s should be abstract", methodSignature) - .isFalse(); - return this; - } - - public MethodAssert doesNotHaveComment() { - Assertions.assertThat(actual.getJavadocComment()) - .withFailMessage("Method %s shouldn't contains comment, but it does", methodSignature) - .isEmpty(); - return this; - } - - public MethodAssert commentContainsLines(final String... lines) { - Assertions.assertThat(actual.getJavadocComment()) - .withFailMessage("Method %s should contains comment, but it doesn't", methodSignature) - .isPresent(); - final String actualComment = actual.getJavadocComment().get().getContent(); - Assertions.assertThat(actualComment) - .withFailMessage( - "Method's %s comment should contains lines\n====\n%s\n====\nbut actually was\n====%s\n====", - methodSignature, Arrays.stream(lines).collect(Collectors.joining(System.lineSeparator())), actualComment - ) - .contains(lines); - - return this; - } - - public MethodAssert noneOfParameterHasAnnotation(final String annotationName) { - actual.getParameters() - .forEach( - param -> Assertions.assertThat(param.getAnnotations()) - .withFailMessage("Parameter %s contains annotation %s while it shouldn't", param.getNameAsString(), annotationName) - .extracting(NodeWithName::getNameAsString) - .doesNotContain(annotationName) - ); - - return this; - } - - private boolean isWithImplementation() { - final boolean isInterface = actual.getParentNode() - .filter(ClassOrInterfaceDeclaration.class::isInstance) - .map(ClassOrInterfaceDeclaration.class::cast) - .map(ClassOrInterfaceDeclaration::isInterface) - .orElse(false); - return !(actual.isAbstract() || (isInterface && !actual.isDefault())); - } - } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationsAssert.java similarity index 65% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationsAssert.java index 184943bd4da..bf3cdbcb952 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAnnotationsAssert.java @@ -7,11 +7,11 @@ import org.assertj.core.util.CanIgnoreReturnValue; import com.github.javaparser.ast.expr.AnnotationExpr; @CanIgnoreReturnValue -public class ParameterAnnotationAssert extends AbstractAnnotationAssert { +public class ParameterAnnotationsAssert extends AbstractAnnotationsAssert { private final ParameterAssert parameterAssert; - protected ParameterAnnotationAssert(final ParameterAssert parameterAssert, final List annotationExpr) { + protected ParameterAnnotationsAssert(final ParameterAssert parameterAssert, final List annotationExpr) { super(annotationExpr); this.parameterAssert = parameterAssert; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java index adf73c7063a..a878ad2cd9b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/ParameterAssert.java @@ -38,14 +38,14 @@ public class ParameterAssert extends ObjectAssert { return constructorAssert; } - public ParameterAssert withType(final String expectedType) { + public ParameterAssert hasType(final String expectedType) { Assertions.assertThat(actual.getTypeAsString()) .withFailMessage("Expected parameter to have type %s, but was %s", expectedType, actual.getTypeAsString()) .isEqualTo(expectedType); return this; } - public ParameterAnnotationAssert assertParameterAnnotations() { - return new ParameterAnnotationAssert(this, actual.getAnnotations()); + public ParameterAnnotationsAssert assertParameterAnnotations() { + return new ParameterAnnotationsAssert(this, actual.getAnnotations()); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationsAssert.java similarity index 65% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationsAssert.java index 92636a90730..25b09f31116 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAnnotationsAssert.java @@ -7,11 +7,11 @@ import org.assertj.core.util.CanIgnoreReturnValue; import com.github.javaparser.ast.expr.AnnotationExpr; @CanIgnoreReturnValue -public class PropertyAnnotationAssert extends AbstractAnnotationAssert { +public class PropertyAnnotationsAssert extends AbstractAnnotationsAssert { private final PropertyAssert propertyAssert; - protected PropertyAnnotationAssert(final PropertyAssert propertyAssert, final List annotationExpr) { + protected PropertyAnnotationsAssert(final PropertyAssert propertyAssert, final List annotationExpr) { super(annotationExpr); this.propertyAssert = propertyAssert; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java index 9cf733a05a8..d75727c8bc8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java @@ -27,7 +27,7 @@ public class PropertyAssert extends ObjectAssert { return this; } - public PropertyAnnotationAssert assertPropertyAnnotations() { - return new PropertyAnnotationAssert(this, actual.getAnnotations()); + public PropertyAnnotationsAssert assertPropertyAnnotations() { + return new PropertyAnnotationsAssert(this, actual.getAnnotations()); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationsAssert.java similarity index 65% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationsAssert.java index f8418510049..8da97accd1b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/TypeAnnotationsAssert.java @@ -7,11 +7,11 @@ import org.assertj.core.util.CanIgnoreReturnValue; import com.github.javaparser.ast.expr.AnnotationExpr; @CanIgnoreReturnValue -public class TypeAnnotationAssert extends AbstractAnnotationAssert { +public class TypeAnnotationsAssert extends AbstractAnnotationsAssert { private final JavaFileAssert fileAssert; - protected TypeAnnotationAssert(final JavaFileAssert fileAssert, final List annotationExpr) { + protected TypeAnnotationsAssert(final JavaFileAssert fileAssert, final List annotationExpr) { super(annotationExpr); this.fileAssert = fileAssert; } 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 b784b642ac0..f8d50b337db 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 @@ -26,11 +26,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -76,18 +76,16 @@ public class JavaHelidonCommonCodegenPackagePrefixTest { String explicitPrefix, String generatorName, String libraryName) { - IllegalArgumentException e = Assert.assertThrows("Run invalid combo: " + assertMsg(explicitHelidonVersion, - explicitPrefix, - generatorName, - libraryName), - IllegalArgumentException.class, - () -> runTest(explicitHelidonVersion, explicitPrefix, generatorName, libraryName)); - Assert.assertTrue("Exception message for " + assertMsg(explicitHelidonVersion, - explicitPrefix, - generatorName, - libraryName) - + "'" + e.getMessage() + "' containing '" + EXCEPTION_MESSAGE_FRAGMENT + "'", - e.getMessage().contains(EXCEPTION_MESSAGE_FRAGMENT)); + IllegalArgumentException e = Assert.expectThrows( + "Run invalid combo: " + assertMsg(explicitHelidonVersion, explicitPrefix, generatorName, libraryName), + IllegalArgumentException.class, + () -> runTest(explicitHelidonVersion, explicitPrefix, generatorName, libraryName) + ); + Assert.assertTrue( + e.getMessage().contains(EXCEPTION_MESSAGE_FRAGMENT), + "Exception message for " + assertMsg(explicitHelidonVersion, explicitPrefix, generatorName, libraryName) + + "'" + e.getMessage() + "' containing '" + EXCEPTION_MESSAGE_FRAGMENT + "'" + ); } private static String assertMsg(String explicitHelidonVersion, String explicitPrefix, String generatorName, String libraryName) { 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 7a11ae416e9..5cebf0e858a 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 @@ -26,12 +26,12 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import org.junit.Assert; 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.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -97,7 +97,7 @@ public class JavaHelidonCommonCodegenTest { @Test public void bothNotEqualsVersionTest() { - IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class,() -> runServerVersionTest("1.0.0", "2.0.0")); + IllegalArgumentException e = Assert.expectThrows(IllegalArgumentException.class, () -> runServerVersionTest("1.0.0", "2.0.0")); Assert.assertEquals( "Both parentVersion and helidonVersion properties were set with different value.", e.getMessage()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/AbstractJavaJAXRSServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/AbstractJavaJAXRSServerCodegenTest.java index e1c3d5f710a..9e65458eb1a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/AbstractJavaJAXRSServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/AbstractJavaJAXRSServerCodegenTest.java @@ -19,72 +19,78 @@ package org.openapitools.codegen.java.jaxrs; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.servers.Server; +import org.mockito.Answers; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; + public class AbstractJavaJAXRSServerCodegenTest { - private final AbstractJavaJAXRSServerCodegen fakeJavaJAXRSCodegen = new P_AbstractJavaJAXRSServerCodegen(); + private AbstractJavaJAXRSServerCodegen 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 = mock( + AbstractJavaJAXRSServerCodegen.class, withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } @Test public void convertApiName() { - Assert.assertEquals(fakeJavaJAXRSCodegen.toApiName("name"), "NameApi"); - Assert.assertEquals(fakeJavaJAXRSCodegen.toApiName("$name"), "NameApi"); - Assert.assertEquals(fakeJavaJAXRSCodegen.toApiName("nam#e"), "NameApi"); - Assert.assertEquals(fakeJavaJAXRSCodegen.toApiName("$another-fake?"), "AnotherFakeApi"); - Assert.assertEquals(fakeJavaJAXRSCodegen.toApiName("fake_classname_tags 123#$%^"), "FakeClassnameTags123Api"); + Assert.assertEquals(codegen.toApiName("name"), "NameApi"); + Assert.assertEquals(codegen.toApiName("$name"), "NameApi"); + Assert.assertEquals(codegen.toApiName("nam#e"), "NameApi"); + Assert.assertEquals(codegen.toApiName("$another-fake?"), "AnotherFakeApi"); + Assert.assertEquals(codegen.toApiName("fake_classname_tags 123#$%^"), "FakeClassnameTags123Api"); } @Test public void testInitialConfigValues() throws Exception { - final AbstractJavaJAXRSServerCodegen codegen = new P_AbstractJavaJAXRSServerCodegen(); codegen.processOpts(); OpenAPI openAPI = new OpenAPI(); openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaJAXRSServerCodegen.SERVER_PORT), "8082"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); + configAssert.assertValue(AbstractJavaJAXRSServerCodegen.SERVER_PORT, "8082"); } @Test public void testSettersForConfigValues() throws Exception { - final AbstractJavaJAXRSServerCodegen codegen = new P_AbstractJavaJAXRSServerCodegen(); codegen.setHideGenerationTimestamp(true); codegen.setModelPackage("xx.yyyyyyyy.model"); codegen.setApiPackage("xx.yyyyyyyy.api"); codegen.setInvokerPackage("xx.yyyyyyyy.invoker"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xx.yyyyyyyy.invoker"); } @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final AbstractJavaJAXRSServerCodegen codegen = new P_AbstractJavaJAXRSServerCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.mmmmm.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.aaaaa.api"); @@ -95,21 +101,16 @@ public class AbstractJavaJAXRSServerCodegenTest { OpenAPI openAPI = new OpenAPI(); openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaJAXRSServerCodegen.SERVER_PORT), "8088"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.iiii.invoker"); + configAssert.assertValue(AbstractJavaJAXRSServerCodegen.SERVER_PORT, "8088"); } @Test public void testCommonPath() { - final AbstractJavaJAXRSServerCodegen codegen = new P_AbstractJavaJAXRSServerCodegen(); OperationsMap objs = new OperationsMap(); OperationMap opMap = new OperationMap(); List operations = new ArrayList<>(); @@ -176,22 +177,4 @@ public class AbstractJavaJAXRSServerCodegenTest { co.path = path; return co; } - - private static class P_AbstractJavaJAXRSServerCodegen extends AbstractJavaJAXRSServerCodegen { - - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java index 6dc31e2bd48..2f528391173 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java @@ -48,53 +48,53 @@ public class JavaJAXRSCXFCDIServerCodegenTest extends JavaJaxrsBaseTest { JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") - .hasParameter("headerNumber").withType("BigDecimal") + .assertParameter("headerNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("headerString").withType("String") + .assertParameter("headerString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringWrapped").withType("String") + .assertParameter("headerStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotes").withType("String") + .assertParameter("headerStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotesWrapped").withType("String") + .assertParameter("headerStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerBoolean").withType("Boolean") + .assertParameter("headerBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\"")); JavaFileAssert.assertThat(files.get("TestQueryParamsApi.java")) .assertMethod("queryParamsTest") - .hasParameter("queryNumber").withType("BigDecimal") + .assertParameter("queryNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("queryString").withType("String") + .assertParameter("queryString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringWrapped").withType("String") + .assertParameter("queryStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotes").withType("String") + .assertParameter("queryStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotesWrapped").withType("String") + .assertParameter("queryStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryBoolean").withType("Boolean") + .assertParameter("queryBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\"")); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java index 9c7c181c4bf..7ff20b18ad3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFExtServerCodegenTest.java @@ -12,6 +12,7 @@ import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen; import org.openapitools.codegen.languages.JavaCXFExtServerCodegen; import org.openapitools.codegen.languages.features.*; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -84,10 +85,6 @@ public class JavaJAXRSCXFExtServerCodegenTest extends JavaJaxrsBaseTest { return useAnnotatedBasePath; } - // BeanValidationFeatures.USE_BEANVALIDATION - public boolean isUseBeanValidation() { - return useBeanValidation; - } // BeanValidationExtendedFeatures.USE_BEANVALIDATION_FEATURE public boolean isUseBeanValidationFeature() { @@ -422,58 +419,50 @@ public class JavaJAXRSCXFExtServerCodegenTest extends JavaJaxrsBaseTest { codegen.preprocessOpenAPI(openAPI); Map additionalProperties = codegen.additionalProperties(); - + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); // Options processed by DefaultCodegen assertNull(additionalProperties.get(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS)); - assertEquals(additionalProperties.get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); + // NOT WRITTEN BACK assertEquals(additionalProperties.get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); assertEquals(codegen.apiPackage(), "org.openapitools.api"); assertNull(additionalProperties.get(CodegenConstants.DOCEXTENSION)); assertNull(additionalProperties.get(CodegenConstants.ENSURE_UNIQUE_PARAMS)); - assertEquals(additionalProperties.get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + // NOT WRITTEN BACK assertEquals(additionalProperties.get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, false); + assertEquals(codegen.isHideGenerationTimestamp(), false); - assertEquals(additionalProperties.get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); assertNull(additionalProperties.get(CodegenConstants.MODEL_NAME_PREFIX)); assertNull(additionalProperties.get(CodegenConstants.MODEL_NAME_SUFFIX)); - assertEquals(additionalProperties.get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); - assertEquals(codegen.modelPackage(), "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); assertNull(additionalProperties.get(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS)); assertNull(additionalProperties.get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX)); assertNull(additionalProperties.get(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG)); assertNull(additionalProperties.get(CodegenConstants.TEMPLATE_DIR)); - // Options processed by AbstractJavaCodegen - assertEquals(additionalProperties.get(CodegenConstants.ARTIFACT_DESCRIPTION), "OpenAPI Java"); - assertEquals(additionalProperties.get(CodegenConstants.ARTIFACT_ID), "openapi-cxf-server"); - assertEquals(additionalProperties.get(CodegenConstants.ARTIFACT_VERSION), "1.0.0"); - assertEquals(additionalProperties.get(CodegenConstants.ARTIFACT_URL), - "https://github.com/openapitools/openapi-generator"); - assertEquals(additionalProperties.get(CodegenConstants.DEVELOPER_EMAIL), "team@openapitools.org"); - assertEquals(additionalProperties.get(CodegenConstants.DEVELOPER_NAME), "OpenAPI-Generator Contributors"); - assertEquals(additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION), "OpenAPITools.org"); - assertEquals(additionalProperties.get(CodegenConstants.DEVELOPER_ORGANIZATION_URL), "http://openapitools.org"); - assertEquals(additionalProperties.get(CodegenConstants.GROUP_ID), "org.openapitools"); - assertEquals(additionalProperties.get(CodegenConstants.LICENSE_NAME), "Unlicense"); - assertEquals(additionalProperties.get(CodegenConstants.LICENSE_URL), "http://unlicense.org"); - assertEquals(additionalProperties.get(CodegenConstants.SCM_CONNECTION), - "scm:git:git@github.com:openapitools/openapi-generator.git"); - assertEquals(additionalProperties.get(CodegenConstants.SCM_DEVELOPER_CONNECTION), - "scm:git:git@github.com:openapitools/openapi-generator.git"); - assertEquals(additionalProperties.get(CodegenConstants.SCM_URL), - "https://github.com/openapitools/openapi-generator"); + configAssert.assertValue(CodegenConstants.ARTIFACT_ID, "openapi-cxf-server"); + configAssert.assertValue(CodegenConstants.ARTIFACT_VERSION, "1.0.0"); + configAssert.assertValue(CodegenConstants.ARTIFACT_URL, "https://github.com/openapitools/openapi-generator"); + configAssert.assertValue(CodegenConstants.DEVELOPER_EMAIL, "team@openapitools.org"); + configAssert.assertValue(CodegenConstants.DEVELOPER_NAME, "OpenAPI-Generator Contributors"); + configAssert.assertValue(CodegenConstants.DEVELOPER_ORGANIZATION, "OpenAPITools.org"); + configAssert.assertValue(CodegenConstants.DEVELOPER_ORGANIZATION_URL, "http://openapitools.org"); + configAssert.assertValue(CodegenConstants.GROUP_ID, "org.openapitools"); + configAssert.assertValue(CodegenConstants.LICENSE_NAME, "Unlicense"); + configAssert.assertValue(CodegenConstants.LICENSE_URL, "http://unlicense.org"); + configAssert.assertValue(CodegenConstants.SCM_CONNECTION, "scm:git:git@github.com:openapitools/openapi-generator.git"); + configAssert.assertValue(CodegenConstants.SCM_DEVELOPER_CONNECTION, "scm:git:git@github.com:openapitools/openapi-generator.git"); + configAssert.assertValue(CodegenConstants.SCM_URL, "https://github.com/openapitools/openapi-generator"); assertNull(additionalProperties.get(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING)); - assertEquals(additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL), Boolean.FALSE); - assertEquals(additionalProperties.get(CodegenConstants.SOURCE_FOLDER), "src/gen/java"); - assertEquals(additionalProperties.get(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX), "get"); + configAssert.assertValue(CodegenConstants.SERIALIZABLE_MODEL, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.SOURCE_FOLDER, "src/gen/java"); + configAssert.assertValue(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "get"); assertNull(additionalProperties.get(AbstractJavaCodegen.DATE_LIBRARY)); - assertEquals(additionalProperties.get(AbstractJavaCodegen.DISABLE_HTML_ESCAPING), Boolean.FALSE); + configAssert.assertValue(AbstractJavaCodegen.DISABLE_HTML_ESCAPING, Boolean.FALSE); assertNull(additionalProperties.get(AbstractJavaCodegen.SUPPORT_ASYNC)); - assertEquals(additionalProperties.get(AbstractJavaCodegen.WITH_XML), false); - assertEquals(additionalProperties.get(AbstractJavaCodegen.OPENAPI_NULLABLE), true); - // Options processed by AbstractJavaJAXRSServerCodegen + configAssert.assertValue(AbstractJavaCodegen.WITH_XML, false); + configAssert.assertValue(AbstractJavaCodegen.OPENAPI_NULLABLE, true); assertNull(additionalProperties.get(CodegenConstants.IMPL_FOLDER)); - assertEquals(additionalProperties.get(BeanValidationFeatures.USE_BEANVALIDATION), Boolean.TRUE); - assertEquals(additionalProperties.get(AbstractJavaJAXRSServerCodegen.SERVER_PORT), "8082"); - // Options processed by JavaCXFServerCodegen + configAssert.assertValue(BeanValidationFeatures.USE_BEANVALIDATION, Boolean.TRUE); + configAssert.assertValue(AbstractJavaJAXRSServerCodegen.SERVER_PORT, "8082"); assertNull(additionalProperties.get(BeanValidationExtendedFeatures.USE_BEANVALIDATION_FEATURE)); assertNull(additionalProperties.get(GzipFeatures.USE_GZIP_FEATURE)); assertNull(additionalProperties.get(GzipTestFeatures.USE_GZIP_FEATURE_FOR_TESTS)); @@ -509,14 +498,11 @@ public class JavaJAXRSCXFExtServerCodegenTest extends JavaJaxrsBaseTest { codegen.setInvokerPackage("xx.yyyyyyyy.invoker"); codegen.processOpts(); - Map additionalProperties = codegen.additionalProperties(); - assertEquals(additionalProperties.get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - assertEquals(codegen.isHideGenerationTimestamp(), false); - assertEquals(codegen.modelPackage(), "xx.yyyyyyyy.model"); - assertEquals(additionalProperties.get(CodegenConstants.MODEL_PACKAGE), "xx.yyyyyyyy.model"); - assertEquals(codegen.apiPackage(), "xx.yyyyyyyy.api"); - assertEquals(additionalProperties.get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP,codegen::isHideGenerationTimestamp, false); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xx.yyyyyyyy.invoker"); } } 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 d63754a2747..3463f836759 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 @@ -3,16 +3,15 @@ package org.openapitools.codegen.java.jaxrs; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; -import org.assertj.core.condition.AllOf; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen; import org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -30,7 +29,6 @@ import java.util.stream.Collectors; import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; -import static org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen.USE_TAGS; import static org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen.*; import static org.openapitools.codegen.languages.features.GzipFeatures.USE_GZIP_FEATURE; import static org.testng.Assert.assertTrue; @@ -58,17 +56,13 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.SERVER_PORT), "8082"); - Assert.assertEquals(codegen.getOpenApiSpecFileLocation(), "src/main/openapi/openapi.yaml"); - Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION), "src/main/openapi/openapi.yaml"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP,codegen::isHideGenerationTimestamp, false); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); + codegen.additionalProperties().put(JavaJAXRSSpecServerCodegen.SERVER_PORT, "8082"); + codegen.additionalProperties().put(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "src/main/openapi/openapi.yaml"); } @Test @@ -81,16 +75,12 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { codegen.setOpenApiSpecFileLocation("src/main/resources/META-INF/openapi.yaml"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.getOpenApiSpecFileLocation(), "src/main/resources/META-INF/openapi.yaml"); - Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION), "src/main/resources/META-INF/openapi.yaml"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP,codegen::isHideGenerationTimestamp, true); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xx.yyyyyyyy.invoker"); + configAssert.assertValue(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, "src/main/resources/META-INF/openapi.yaml"); } @Test @@ -109,18 +99,14 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(AbstractJavaJAXRSServerCodegen.SERVER_PORT), "8088"); - Assert.assertEquals(codegen.getOpenApiSpecFileLocation(), "openapi.yml"); - Assert.assertEquals(codegen.additionalProperties().get(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION), "openapi.yml"); - Assert.assertEquals(codegen.additionalProperties().get(SUPPORT_ASYNC), "true"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP,codegen::isHideGenerationTimestamp, true); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.iiii.invoker"); + configAssert.assertValue(AbstractJavaJAXRSServerCodegen.SERVER_PORT, "8088"); + configAssert.assertValue(JavaJAXRSSpecServerCodegen.OPEN_API_SPEC_FILE_LOCATION, codegen::getOpenApiSpecFileLocation, "openapi.yml"); + configAssert.assertValue(SUPPORT_ASYNC, true); } /** @@ -296,7 +282,7 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { List files = generator.opts(clientOptInput).generate(); validateJavaSourceFiles(files); - TestUtils.ensureDoesNotContainsFile(files, output, "src/main/openapi/openapi.yaml"); + TestUtils.ensureDoesNotContainFile(files, output, "src/main/openapi/openapi.yaml"); output.deleteOnExit(); } @@ -663,53 +649,53 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") - .hasParameter("headerNumber").withType("BigDecimal") + .assertParameter("headerNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("headerString").withType("String") + .assertParameter("headerString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringWrapped").withType("String") + .assertParameter("headerStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotes").withType("String") + .assertParameter("headerStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotesWrapped").withType("String") + .assertParameter("headerStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerBoolean").withType("Boolean") + .assertParameter("headerBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"true\"")); JavaFileAssert.assertThat(files.get("TestQueryParamsApi.java")) .assertMethod("queryParamsTest") - .hasParameter("queryNumber").withType("BigDecimal") + .assertParameter("queryNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("queryString").withType("String") + .assertParameter("queryString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringWrapped").withType("String") + .assertParameter("queryStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotes").withType("String") + .assertParameter("queryStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotesWrapped").withType("String") + .assertParameter("queryStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryBoolean").withType("Boolean") + .assertParameter("queryBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"true\"")); } @@ -734,9 +720,9 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { JavaFileAssert.assertThat(files.get("ComplexObject.java")) .fileContains("private @Valid List dates") - .fileDoesNotContains("private @Valid SymbolTypeEnum symbolType") - .fileDoesNotContains("@Valid String") - .fileDoesNotContains("@Valid Double"); + .fileDoesNotContain("private @Valid SymbolTypeEnum symbolType") + .fileDoesNotContain("@Valid String") + .fileDoesNotContain("@Valid Double"); } @Test @@ -924,7 +910,7 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("ReadonlyAndRequiredProperties.java")) - .hasProperty("requiredYesReadonlyYes") + .assertProperty("requiredYesReadonlyYes") .toType() .assertMethod("getRequiredYesReadonlyYes") .assertMethodAnnotations() @@ -934,7 +920,7 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"requiredYesReadonlyYes\"")) .toMethod() .toFileAssert() - .hasProperty("requiredYesReadonlyNo") + .assertProperty("requiredYesReadonlyNo") .toType() .assertMethod("getRequiredYesReadonlyNo") .assertMethodAnnotations() @@ -1036,4 +1022,51 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { " info = @org.eclipse.microprofile.openapi.annotations.info.Info(\n" + " title = \"user\", version=\"1.0.0\", description=\"Operations about user\","); } + + @Test + public void testEnumUnknownDefaultCaseDeserializationTrue_issue13444() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_13444.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, "true"); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("Color.java")) + .assertMethod("fromValue").bodyContainsLines("return UNKNOWN_DEFAULT_OPEN_API"); + + } + + @Test + public void testEnumUnknownDefaultCaseDeserializationNotSet_issue13444() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_13444.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("Color.java")) + .assertMethod("fromValue").bodyContainsLines("throw new IllegalArgumentException(\"Unexpected value '\" + value + \"'\");"); + + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java index 0c7445d82cc..b76b8378039 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java @@ -4,12 +4,7 @@ import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.MockDefaultGenerator; -import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.*; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; @@ -147,51 +142,53 @@ public abstract class JavaJaxrsBaseTest { codegen.setUseTags(true); codegen.setOutputDir(output.getAbsolutePath()); - MockDefaultGenerator generator = new MockDefaultGenerator(); - generator.opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); + DefaultGenerator generator = new DefaultGenerator(true); + generator.opts(new ClientOptInput().openAPI(openAPI).config(codegen)); + var dryRunTMan = ((DryRunTemplateManager) generator.getTemplateProcessor()).enableTemplateDataCapturing(); + generator.generate(); - MockDefaultGenerator.WrittenTemplateBasedFile tag0File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Tag0Api.java"); - Assert.assertEquals(tag0File.getTemplateData().get("baseName"), "Tag0"); - Assert.assertEquals(tag0File.getTemplateData().get("commonPath"), ""); - List tag0 = getOperationsList(tag0File.getTemplateData()); + final var tag0ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Tag0Api.java")); + Assert.assertEquals(tag0ApiTemplateData.get("baseName"), "Tag0"); + Assert.assertEquals(tag0ApiTemplateData.get("commonPath"), ""); + List tag0 = getOperationsList(tag0ApiTemplateData); Assert.assertEquals(tag0.size(), 2); assertOperation(tag0.get(0), "Tag0", "/", false); assertOperation(tag0.get(1), "Tag0", "/{id}", true); - MockDefaultGenerator.WrittenTemplateBasedFile tag1File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Tag1Api.java"); - Assert.assertEquals(tag1File.getTemplateData().get("baseName"), "Tag1"); - Assert.assertEquals(tag1File.getTemplateData().get("commonPath"), "/group1/op1"); - List tag1 = getOperationsList(tag1File.getTemplateData()); + final var tag1ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Tag1Api.java")); + Assert.assertEquals(tag1ApiTemplateData.get("baseName"), "Tag1"); + Assert.assertEquals(tag1ApiTemplateData.get("commonPath"), "/group1/op1"); + List tag1 = getOperationsList(tag1ApiTemplateData); Assert.assertEquals(tag1.size(), 1); assertOperation(tag1.get(0), "Tag1", "", false); - MockDefaultGenerator.WrittenTemplateBasedFile tag2File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Tag2Api.java"); - Assert.assertEquals(tag2File.getTemplateData().get("baseName"), "Tag2"); - Assert.assertEquals(tag2File.getTemplateData().get("commonPath"), ""); - List tag2 = getOperationsList(tag2File.getTemplateData()); + final var tag2ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Tag2Api.java")); + Assert.assertEquals(tag2ApiTemplateData.get("baseName"), "Tag2"); + Assert.assertEquals(tag2ApiTemplateData.get("commonPath"), ""); + List tag2 = getOperationsList(tag2ApiTemplateData); Assert.assertEquals(tag2.size(), 2); assertOperation(tag2.get(0), "Tag2", "/group1/op2", true); assertOperation(tag2.get(1), "Tag2", "/group2/op3", true); - MockDefaultGenerator.WrittenTemplateBasedFile defaultFile = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/DefaultApi.java"); - Assert.assertEquals(defaultFile.getTemplateData().get("baseName"), "Default"); - Assert.assertEquals(defaultFile.getTemplateData().get("commonPath"), "/group3/op4"); - List noTag = getOperationsList(defaultFile.getTemplateData()); + final var defaultApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/DefaultApi.java")); + Assert.assertEquals(defaultApiTemplateData.get("baseName"), "Default"); + Assert.assertEquals(defaultApiTemplateData.get("commonPath"), "/group3/op4"); + List noTag = getOperationsList(defaultApiTemplateData); Assert.assertEquals(noTag.size(), 1); assertOperation(noTag.get(0), "Default", "", false); - MockDefaultGenerator.WrittenTemplateBasedFile group4File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group4Api.java"); - Assert.assertEquals(group4File.getTemplateData().get("baseName"), "Group4"); - Assert.assertEquals(group4File.getTemplateData().get("commonPath"), "/group4"); - List group4 = getOperationsList(group4File.getTemplateData()); + final var group4ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group4Api.java")); + Assert.assertEquals(group4ApiTemplateData.get("baseName"), "Group4"); + Assert.assertEquals(group4ApiTemplateData.get("commonPath"), "/group4"); + List group4 = getOperationsList(group4ApiTemplateData); Assert.assertEquals(group4.size(), 2); assertOperation(group4.get(0), "Group4", "/op5", true); assertOperation(group4.get(1), "Group4", "/op6", true); - MockDefaultGenerator.WrittenTemplateBasedFile group5File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group5Api.java"); - Assert.assertEquals(group5File.getTemplateData().get("baseName"), "Group5"); - Assert.assertEquals(group5File.getTemplateData().get("commonPath"), ""); - List group5 = getOperationsList(group5File.getTemplateData()); + final var group5ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group5Api.java")); + Assert.assertEquals(group5ApiTemplateData.get("baseName"), "Group5"); + Assert.assertEquals(group5ApiTemplateData.get("commonPath"), ""); + List group5 = getOperationsList(group5ApiTemplateData); Assert.assertEquals(group5.size(), 2); assertOperation(group5.get(0), "Group5", "/group5/op7", true); assertOperation(group5.get(1), "Group5", "/group6/op8", true); @@ -206,58 +203,60 @@ public abstract class JavaJaxrsBaseTest { codegen.setUseTags(false); codegen.setOutputDir(output.getAbsolutePath()); - MockDefaultGenerator generator = new MockDefaultGenerator(); - generator.opts(new ClientOptInput().openAPI(openAPI).config(codegen)).generate(); + DefaultGenerator generator = new DefaultGenerator(true); + generator.opts(new ClientOptInput().openAPI(openAPI).config(codegen)); + var dryRunTMan = ((DryRunTemplateManager) generator.getTemplateProcessor()).enableTemplateDataCapturing(); + generator.generate(); - MockDefaultGenerator.WrittenTemplateBasedFile tag0File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/DefaultApi.java"); - Assert.assertEquals(tag0File.getTemplateData().get("baseName"), "default"); - Assert.assertEquals(tag0File.getTemplateData().get("commonPath"), ""); - List tag0 = getOperationsList(tag0File.getTemplateData()); + final var defaultApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/DefaultApi.java")); + Assert.assertEquals(defaultApiTemplateData.get("baseName"), "default"); + Assert.assertEquals(defaultApiTemplateData.get("commonPath"), ""); + List tag0 = getOperationsList(defaultApiTemplateData); Assert.assertEquals(tag0.size(), 2); assertOperation(tag0.get(0), "default", "/", false); assertOperation(tag0.get(1), "default", "/{id}", true); - - MockDefaultGenerator.WrittenTemplateBasedFile group1File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group1Api.java"); - Assert.assertEquals(group1File.getTemplateData().get("baseName"), "group1"); - Assert.assertEquals(group1File.getTemplateData().get("commonPath"), "/group1"); - List group1 = getOperationsList(group1File.getTemplateData()); + + final var group1ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group1Api.java")); + Assert.assertEquals(group1ApiTemplateData.get("baseName"), "group1"); + Assert.assertEquals(group1ApiTemplateData.get("commonPath"), "/group1"); + List group1 = getOperationsList(group1ApiTemplateData); Assert.assertEquals(group1.size(), 2); assertOperation(group1.get(0), "group1", "/op1", true); assertOperation(group1.get(1), "group1", "/op2", true); - MockDefaultGenerator.WrittenTemplateBasedFile group2File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group2Api.java"); - Assert.assertEquals(group2File.getTemplateData().get("baseName"), "group2"); - Assert.assertEquals(group2File.getTemplateData().get("commonPath"), "/group2/op3"); - List group2 = getOperationsList(group2File.getTemplateData()); + final var group2ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group2Api.java")); + Assert.assertEquals(group2ApiTemplateData.get("baseName"), "group2"); + Assert.assertEquals(group2ApiTemplateData.get("commonPath"), "/group2/op3"); + List group2 = getOperationsList(group2ApiTemplateData); Assert.assertEquals(group2.size(), 1); assertOperation(group2.get(0), "group2", "", false); - MockDefaultGenerator.WrittenTemplateBasedFile group3File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group3Api.java"); - Assert.assertEquals(group3File.getTemplateData().get("baseName"), "group3"); - Assert.assertEquals(group3File.getTemplateData().get("commonPath"), "/group3/op4"); - List group3 = getOperationsList(group3File.getTemplateData()); + final var group3ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group3Api.java")); + Assert.assertEquals(group3ApiTemplateData.get("baseName"), "group3"); + Assert.assertEquals(group3ApiTemplateData.get("commonPath"), "/group3/op4"); + List group3 = getOperationsList(group3ApiTemplateData); Assert.assertEquals(group3.size(), 1); assertOperation(group3.get(0), "group3", "", false); - MockDefaultGenerator.WrittenTemplateBasedFile group4File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group4Api.java"); - Assert.assertEquals(group4File.getTemplateData().get("baseName"), "group4"); - Assert.assertEquals(group4File.getTemplateData().get("commonPath"), "/group4"); - List group4 = getOperationsList(group4File.getTemplateData()); + final var group4ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group4Api.java")); + Assert.assertEquals(group4ApiTemplateData.get("baseName"), "group4"); + Assert.assertEquals(group4ApiTemplateData.get("commonPath"), "/group4"); + List group4 = getOperationsList(group4ApiTemplateData); Assert.assertEquals(group4.size(), 2); assertOperation(group4.get(0), "group4", "/op5", true); assertOperation(group4.get(1), "group4", "/op6", true); - MockDefaultGenerator.WrittenTemplateBasedFile group5File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group5Api.java"); - Assert.assertEquals(group5File.getTemplateData().get("baseName"), "group5"); - Assert.assertEquals(group5File.getTemplateData().get("commonPath"), "/group5/op7"); - List group5 = getOperationsList(group5File.getTemplateData()); + final var group5ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group5Api.java")); + Assert.assertEquals(group5ApiTemplateData.get("baseName"), "group5"); + Assert.assertEquals(group5ApiTemplateData.get("commonPath"), "/group5/op7"); + List group5 = getOperationsList(group5ApiTemplateData); Assert.assertEquals(group5.size(), 1); assertOperation(group5.get(0), "group5", "", false); - MockDefaultGenerator.WrittenTemplateBasedFile group6File = TestUtils.getTemplateBasedFile(generator, output, "src/gen/java/org/openapitools/api/Group6Api.java"); - Assert.assertEquals(group6File.getTemplateData().get("baseName"), "group6"); - Assert.assertEquals(group6File.getTemplateData().get("commonPath"), "/group6/op8"); - List group6 = getOperationsList(group6File.getTemplateData()); + final var group6ApiTemplateData = dryRunTMan.getCapturedTemplateData(output.toPath().resolve("src/gen/java/org/openapitools/api/Group6Api.java")); + Assert.assertEquals(group6ApiTemplateData.get("baseName"), "group6"); + Assert.assertEquals(group6ApiTemplateData.get("commonPath"), "/group6/op8"); + List group6 = getOperationsList(group6ApiTemplateData); Assert.assertEquals(group6.size(), 1); assertOperation(group6.get(0), "group6", "", false); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsResteasyServerCodegenModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsResteasyServerCodegenModelTest.java index 2d075457c9d..025d1d94d9f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsResteasyServerCodegenModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsResteasyServerCodegenModelTest.java @@ -97,53 +97,53 @@ public class JavaJaxrsResteasyServerCodegenModelTest extends JavaJaxrsBaseTest { JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") - .hasParameter("headerNumber").withType("BigDecimal") + .assertParameter("headerNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("headerString").withType("String") + .assertParameter("headerString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringWrapped").withType("String") + .assertParameter("headerStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotes").withType("String") + .assertParameter("headerStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotesWrapped").withType("String") + .assertParameter("headerStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerBoolean").withType("Boolean") + .assertParameter("headerBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\"")); JavaFileAssert.assertThat(files.get("TestQueryParamsApi.java")) .assertMethod("queryParamsTest") - .hasParameter("queryNumber").withType("BigDecimal") + .assertParameter("queryNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("queryString").withType("String") + .assertParameter("queryString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringWrapped").withType("String") + .assertParameter("queryStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotes").withType("String") + .assertParameter("queryStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotesWrapped").withType("String") + .assertParameter("queryStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryBoolean").withType("Boolean") + .assertParameter("queryBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("DefaultValue", ImmutableMap.of("value", "\"true\"")); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java index 8bfc4b12815..cb91ae2c1e5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJerseyServerCodegenTest.java @@ -19,6 +19,7 @@ import org.openapitools.codegen.languages.JavaJerseyServerCodegen; import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.templating.MustacheEngineAdapter; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -58,15 +59,12 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(JavaJerseyServerCodegen.SERVER_PORT), "8082"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, "org.openapitools.api"); + configAssert.assertValue(JavaJerseyServerCodegen.SERVER_PORT, "8082"); } @Test @@ -78,14 +76,12 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { codegen.setDateLibrary("java8"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, true); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, "xx.yyyyyyyy.invoker"); Assert.assertEquals(codegen.getDateLibrary(), "java8"); } @@ -102,14 +98,11 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { openAPI.addServersItem(new Server().url("https://api.abcde.xy:8082/v2")); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.iiii.invoker"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, true); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.iiii.invoker"); Assert.assertEquals(codegen.additionalProperties().get(JavaJerseyServerCodegen.SERVER_PORT), "8088"); } @@ -250,53 +243,53 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest { JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") - .hasParameter("headerNumber").withType("BigDecimal") + .assertParameter("headerNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("headerString").withType("String") + .assertParameter("headerString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringWrapped").withType("String") + .assertParameter("headerStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotes").withType("String") + .assertParameter("headerStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotesWrapped").withType("String") + .assertParameter("headerStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerBoolean").withType("Boolean") + .assertParameter("headerBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\"")); JavaFileAssert.assertThat(files.get("TestQueryParamsApi.java")) .assertMethod("queryParamsTest") - .hasParameter("queryNumber").withType("BigDecimal") + .assertParameter("queryNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("queryString").withType("String") + .assertParameter("queryString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringWrapped").withType("String") + .assertParameter("queryStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotes").withType("String") + .assertParameter("queryStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotesWrapped").withType("String") + .assertParameter("queryStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryBoolean").withType("Boolean") + .assertParameter("queryBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\"")); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautClientCodegenTest.java similarity index 61% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautClientCodegenTest.java index 2c449e9bfee..23e808675f7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautClientCodegenTest.java @@ -5,14 +5,24 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.JavaMicronautClientCodegen; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; import org.testng.annotations.Test; + +import java.io.File; +import java.util.List; +import java.util.Map; + import static java.util.stream.Collectors.groupingBy; -import static org.testng.Assert.*; +import static org.openapitools.codegen.TestUtils.newTempFolder; +import static org.testng.Assert.assertEquals; -public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest { +public class JavaMicronautClientCodegenTest extends AbstractMicronautCodegenTest { @Test public void clientOptsUnicity() { JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); @@ -31,15 +41,11 @@ public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest { openAPI.addServersItem(new Server().url("https://one.com/v2")); openAPI.setInfo(new Info()); codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools"); } @Test @@ -310,4 +316,145 @@ public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest { // Micronaut declarative http client should use the provided path separator assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client(\"${openapi-micronaut-client.base-path}\")"); } + + /** + * General XML annotations test (both JAXB and Jackson) + *
    + * Includes regression tests for: + * - Correct Jackson annotation when `wrapped: false` + */ + @Test public void shouldGenerateCorrectXmlAnnotations() { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, null) + .addGlobalProperty(CodegenConstants.MODEL_TESTS, null) + .setGeneratorName(JavaMicronautClientCodegen.NAME) + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertProperty("tags").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\"")) + .toProperty().toType() + .assertMethod("getTags") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Tag\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("friends").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\"")) + .toProperty().toType() + .assertMethod("getFriends") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"friend-pet\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertProperty("status").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\"")) + .toProperty().toType() + .assertMethod("getStatus") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"PetStatus\"")) + .toFileAssert() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("photoUrls").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\"")) + .toProperty().toType() + .assertMethod("getPhotoUrls") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"photoUrls\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertProperty("name").assertPropertyAnnotations() + .doesNotContainWithName("XmlElement") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\"")) + .toProperty().toType() + .assertMethod("getName") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\"")) + .toFileAssert() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertProperty("id").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toProperty().toType() + .assertMethod("getId") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toFileAssert() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("foods").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\"")) + .toProperty().toType() + .assertMethod("getFoods") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\"")) + .toFileAssert() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("colors").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\"")) + .toProperty().toType() + .assertMethod("getColors") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"color\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"colors\"")) + .toFileAssert() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("categories").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\"")) + .toProperty().toType() + .assertMethod("getCategories") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Category\"")) + // ↓ specific regression test for #2417: (useWrapping=false) needs to be present + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("activities").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\"")) + .toProperty().toType() + .assertMethod("getActivities") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"item\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\"")); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautServerCodegenTest.java similarity index 64% rename from modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java rename to modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautServerCodegenTest.java index 4b1ad1db749..ceb6aee4b85 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/JavaMicronautServerCodegenTest.java @@ -5,15 +5,24 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; import org.openapitools.codegen.CliOption; 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.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.JavaMicronautServerCodegen; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; import org.testng.annotations.Test; +import java.io.File; +import java.util.List; +import java.util.Map; + import static java.util.stream.Collectors.groupingBy; +import static org.openapitools.codegen.TestUtils.newTempFolder; import static org.testng.Assert.assertEquals; -public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest { +public class JavaMicronautServerCodegenTest extends AbstractMicronautCodegenTest { protected static String ROLES_EXTENSION_TEST_PATH = "src/test/resources/3_0/micronaut/roles-extension-test.yaml"; protected static String MULTI_TAGS_TEST_PATH = "src/test/resources/3_0/micronaut/multi-tags-test.yaml"; @@ -35,16 +44,12 @@ public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest { openAPI.addServersItem(new Server().url("https://one.com/v2")); openAPI.setInfo(new Info()); codegen.preprocessOpenAPI(openAPI); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); - Assert.assertEquals(codegen.apiPackage(), "org.openapitools.controller"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.controller"); - Assert.assertEquals(codegen.additionalProperties().get(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE), "org.openapitools.controller"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.controller"); + configAssert.assertValue(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE, "org.openapitools.controller"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools"); } @Test @@ -341,4 +346,145 @@ public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest { assertFileContains(controllerPath + "SearchController.java", "authorSearchGet", "bookSearchGet"); } + + /** + * General XML annotations test (both JAXB and Jackson) + *
    + * Includes regression tests for: + * - Correct Jackson annotation when `wrapped: false` + */ + @Test public void shouldGenerateCorrectXmlAnnotations() { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, null) + .addGlobalProperty(CodegenConstants.MODEL_TESTS, null) + .setGeneratorName(JavaMicronautServerCodegen.NAME) + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertProperty("tags").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\"")) + .toProperty().toType() + .assertMethod("getTags") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Tag\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("friends").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\"")) + .toProperty().toType() + .assertMethod("getFriends") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"friend-pet\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertProperty("status").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\"")) + .toProperty().toType() + .assertMethod("getStatus") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"PetStatus\"")) + .toFileAssert() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("photoUrls").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\"")) + .toProperty().toType() + .assertMethod("getPhotoUrls") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"photoUrls\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertProperty("name").assertPropertyAnnotations() + .doesNotContainWithName("XmlElement") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\"")) + .toProperty().toType() + .assertMethod("getName") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\"")) + .toFileAssert() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertProperty("id").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toProperty().toType() + .assertMethod("getId") + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toFileAssert() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("foods").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\"")) + .toProperty().toType() + .assertMethod("getFoods") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\"")) + .toFileAssert() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("colors").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\"")) + .toProperty().toType() + .assertMethod("getColors") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"color\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"colors\"")) + .toFileAssert() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("categories").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .doesNotContainWithName("XmlElementWrapper") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\"")) + .toProperty().toType() + .assertMethod("getCategories") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Category\"")) + // ↓ specific regression test for #2417: (useWrapping=false) needs to be present + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("activities").assertPropertyAnnotations() + .doesNotContainWithName("XmlAttribute") + .containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\"")) + .containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\"")) + .toProperty().toType() + .assertMethod("getActivities") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"item\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\"")); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/play/JavaPlayFrameworkCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/play/JavaPlayFrameworkCodegenTest.java index 06d602f8f77..8a7c81c91db 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/play/JavaPlayFrameworkCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/play/JavaPlayFrameworkCodegenTest.java @@ -26,6 +26,7 @@ import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.JavaPlayFrameworkCodegen; +import org.openapitools.codegen.testutils.ConfigAssert; import org.testng.Assert; import org.testng.annotations.Test; @@ -39,18 +40,13 @@ public class JavaPlayFrameworkCodegenTest { final JavaPlayFrameworkCodegen codegen = new JavaPlayFrameworkCodegen(); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); - Assert.assertEquals(codegen.modelPackage(), "apimodels"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "apimodels"); - Assert.assertEquals(codegen.apiPackage(), "controllers"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "controllers"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.BASE_PACKAGE), "org.openapitools"); - Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, false); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "apimodels"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "controllers"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); + configAssert.assertValue(JavaPlayFrameworkCodegen.BASE_PACKAGE, codegen::getBasePackage, "org.openapitools"); + configAssert.assertValue(JavaPlayFrameworkCodegen.CONFIG_PACKAGE, codegen::getConfigPackage, "org.openapitools.configuration"); } @Test @@ -63,19 +59,13 @@ public class JavaPlayFrameworkCodegenTest { codegen.setBasePackage("xx.yyyyyyyy.base"); codegen.setConfigPackage("xx.yyyyyyyy.config"); codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.getBasePackage(), "xx.yyyyyyyy.base"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.BASE_PACKAGE), "xx.yyyyyyyy.base"); - Assert.assertEquals(codegen.getConfigPackage(), "xx.yyyyyyyy.config"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.CONFIG_PACKAGE), "xx.yyyyyyyy.config"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xx.yyyyyyyy.invoker"); + configAssert.assertValue(JavaPlayFrameworkCodegen.BASE_PACKAGE, codegen::getBasePackage, "xx.yyyyyyyy.base"); + configAssert.assertValue(JavaPlayFrameworkCodegen.CONFIG_PACKAGE, "xx.yyyyyyyy.config"); } @Test @@ -89,19 +79,13 @@ public class JavaPlayFrameworkCodegenTest { codegen.additionalProperties().put(JavaPlayFrameworkCodegen.CONFIG_PACKAGE,"xyz.yyyyy.cccc.config"); codegen.additionalProperties().put("serverPort","8088"); codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); - 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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.getBasePackage(), "xyz.yyyyy.bbbb.base"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.BASE_PACKAGE), "xyz.yyyyy.bbbb.base"); - Assert.assertEquals(codegen.getConfigPackage(), "xyz.yyyyy.cccc.config"); - Assert.assertEquals(codegen.additionalProperties().get(JavaPlayFrameworkCodegen.CONFIG_PACKAGE), "xyz.yyyyy.cccc.config"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.iiii.invoker"); + configAssert.assertValue(JavaPlayFrameworkCodegen.BASE_PACKAGE, codegen::getBasePackage, "xyz.yyyyy.bbbb.base"); + configAssert.assertValue(JavaPlayFrameworkCodegen.CONFIG_PACKAGE, codegen::getConfigPackage, "xyz.yyyyy.cccc.config"); } @Test 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 48fef733c94..1a4c07ef12e 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 @@ -17,35 +17,31 @@ package org.openapitools.codegen.java.spring; -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; -import static org.openapitools.codegen.languages.SpringCodegen.IMPLICIT_HEADERS; -import static org.openapitools.codegen.languages.SpringCodegen.INTERFACE_ONLY; -import static org.openapitools.codegen.languages.SpringCodegen.OPENAPI_NULLABLE; -import static org.openapitools.codegen.languages.SpringCodegen.REACTIVE; -import static org.openapitools.codegen.languages.SpringCodegen.REQUEST_MAPPING_OPTION; -import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; -import static org.openapitools.codegen.languages.SpringCodegen.RETURN_SUCCESS_CODE; -import static org.openapitools.codegen.languages.SpringCodegen.SKIP_DEFAULT_INTERFACE; -import static org.openapitools.codegen.languages.SpringCodegen.SPRING_BOOT; -import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CLOUD_LIBRARY; -import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CONTROLLER; -import static org.openapitools.codegen.languages.SpringCodegen.SSE; -import static org.openapitools.codegen.languages.SpringCodegen.USE_ENUM_CASE_INSENSITIVE; -import static org.openapitools.codegen.languages.SpringCodegen.USE_RESPONSE_ENTITY; -import static org.openapitools.codegen.languages.SpringCodegen.USE_SPRING_BOOT3; -import static org.openapitools.codegen.languages.SpringCodegen.USE_TAGS; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import com.google.common.collect.ImmutableMap; +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.apache.commons.lang3.StringUtils; +import org.assertj.core.api.MapAssert; +import org.openapitools.codegen.*; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.config.GlobalSettings; +import org.openapitools.codegen.java.assertions.JavaFileAssert; +import org.openapitools.codegen.languages.AbstractJavaCodegen; +import org.openapitools.codegen.languages.JavaClientCodegen; +import org.openapitools.codegen.languages.SpringCodegen; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.languages.features.CXFServerFeatures; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; +import org.openapitools.codegen.testutils.ConfigAssert; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; import java.io.File; import java.io.IOException; @@ -59,41 +55,17 @@ import java.util.Map; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; -import org.apache.commons.lang3.StringUtils; -import org.assertj.core.api.MapAssert; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.java.assertions.JavaFileAssert; -import org.openapitools.codegen.languages.AbstractJavaCodegen; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.openapitools.codegen.languages.SpringCodegen; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.languages.features.CXFServerFeatures; -import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; -import org.testng.Assert; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; -import com.google.common.collect.ImmutableMap; - -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.parser.core.models.ParseOptions; +import static java.util.stream.Collectors.groupingBy; +import static org.assertj.core.api.Assertions.assertThat; +import static org.openapitools.codegen.TestUtils.*; +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.*; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; public class SpringCodegenTest { @@ -154,26 +126,26 @@ public class SpringCodegenTest { "value", "\"/zebras\"" )) .toMethod() - .hasParameter("limit").withType("BigDecimal") + .assertParameter("limit").hasType("BigDecimal") .assertParameterAnnotations() .containsWithName("Valid") .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"limit\"")) .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("required", "false", "value", "\"limit\"")) .toParameter() .toMethod() - .hasParameter("animalParams").withType("AnimalParams") + .assertParameter("animalParams").hasType("AnimalParams") .toMethod() .commentContainsLines("GET /zebras", "@param limit (optional)") .bodyContainsLines("return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/AnimalParams.java")) .hasImports("org.springframework.format.annotation.DateTimeFormat") - .hasProperty("born").withType("LocalDate") + .assertProperty("born").withType("LocalDate") .assertPropertyAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE")) .toProperty() .toType() - .hasProperty("lastSeen").withType("OffsetDateTime") + .assertProperty("lastSeen").withType("OffsetDateTime") .assertPropertyAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE_TIME")) .toProperty().toType() @@ -232,26 +204,26 @@ public class SpringCodegenTest { "value", "\"/zebras\"" )) .toMethod() - .hasParameter("limit").withType("Optional") + .assertParameter("limit").hasType("Optional") .assertParameterAnnotations() .containsWithName("Valid") .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"limit\"")) .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("required", "false", "value", "\"limit\"")) .toParameter() .toMethod() - .hasParameter("animalParams").withType("Optional") + .assertParameter("animalParams").hasType("Optional") .toMethod() .commentContainsLines("GET /zebras", "@param limit (optional)") .bodyContainsLines("return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/AnimalParams.java")) .hasImports("org.springframework.format.annotation.DateTimeFormat") - .hasProperty("born").withType("Optional") + .assertProperty("born").withType("Optional") .assertPropertyAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE")) .toProperty() .toType() - .hasProperty("lastSeen").withType("Optional") + .assertProperty("lastSeen").withType("Optional") .assertPropertyAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE_TIME")) .toProperty().toType() @@ -287,13 +259,13 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java")) .assertMethod("getElephants", "String", "BigDecimal") - .hasParameter("userToken") + .assertParameter("userToken") .assertParameterAnnotations() .containsWithNameAndAttributes("CookieValue", ImmutableMap.of("name", "\"userToken\"")); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) .assertMethod("getZebras", "String") - .hasParameter("userToken") + .assertParameter("userToken") .assertParameterAnnotations() .containsWithNameAndAttributes("CookieValue", ImmutableMap.of("name", "\"userToken\"")); @@ -395,14 +367,14 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java")) .hasImports("org.springframework.format.annotation.DateTimeFormat") .assertMethod("getElephants", "LocalDate") - .hasParameter("startDate") + .assertParameter("startDate") .assertParameterAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE")); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) .hasImports("org.springframework.format.annotation.DateTimeFormat") .assertMethod("getZebras", "OffsetDateTime") - .hasParameter("startDateTime") + .assertParameter("startDateTime") .assertParameterAnnotations() .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE_TIME")); } @@ -453,11 +425,11 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java")) .assertMethod("exampleApiGet", "String", "Format") - .hasParameter("query") + .assertParameter("query") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"query\"")) .toParameter().toMethod() - .hasParameter("format") + .assertParameter("format") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"format\"")); } @@ -490,7 +462,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java")) .assertMethod("exampleApiGet", "OffsetDateTime") - .hasParameter("start") + .assertParameter("start") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"start\"")) .containsWithNameAndAttributes("DateTimeFormat", ImmutableMap.of("iso", "DateTimeFormat.ISO.DATE_TIME")); @@ -580,20 +552,15 @@ public class SpringCodegenTest { openAPI.getInfo().setTitle("Some test API"); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.iiii.invoker"); - Assert.assertEquals(codegen.getBasePackage(), "xyz.yyyyy.bbbb.base"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "xyz.yyyyy.bbbb.base"); - Assert.assertEquals(codegen.getConfigPackage(), "xyz.yyyyy.cccc.config"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "xyz.yyyyy.cccc.config"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.TITLE), "someTest"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8088"); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xyz.yyyyy.mmmmm.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xyz.yyyyy.aaaaa.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xyz.yyyyy.iiii.invoker"); + configAssert.assertValue(SpringCodegen.BASE_PACKAGE, "xyz.yyyyy.bbbb.base"); + configAssert.assertValue(SpringCodegen.CONFIG_PACKAGE, "xyz.yyyyy.cccc.config"); + configAssert.assertValue(SpringCodegen.TITLE, "someTest"); + configAssert.assertValue(SpringCodegen.SERVER_PORT, "8088"); } @Test @@ -665,7 +632,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java")) .fileContains("@RequestBody(required = false") .assertMethod("exampleApiPost", "ExampleApiPostRequest") - .hasParameter("exampleApiPostRequest") + .assertParameter("exampleApiPostRequest") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestBody", ImmutableMap.of("required", "false")); } @@ -680,21 +647,31 @@ public class SpringCodegenTest { openAPI.setInfo(new Info()); codegen.preprocessOpenAPI(openAPI); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); - Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); - Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); +// Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); +// configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); +// Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); +// Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); +// Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); +// Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); + configAssert.assertValue(SpringCodegen.BASE_PACKAGE, "org.openapitools"); +// Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); + configAssert.assertValue(SpringCodegen.CONFIG_PACKAGE, "org.openapitools.configuration"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); + configAssert.assertValue(SpringCodegen.SERVER_PORT, "8082"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); + configAssert.assertValue(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING, false); + configAssert.assertValue(SpringCodegen.USE_RESPONSE_ENTITY, true); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); } @Test @@ -709,12 +686,12 @@ public class SpringCodegenTest { // Check that the delegate handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApiDelegate.java")) .assertMethod("multipartArray", "List") - .hasParameter("files").withType("List"); + .assertParameter("files").hasType("List"); // Check that the api handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApi.java")) .assertMethod("multipartArray", "List") - .hasParameter("files").withType("List") + .assertParameter("files").hasType("List") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); @@ -729,7 +706,7 @@ public class SpringCodegenTest { // Check that the api handles the single file JavaFileAssert.assertThat(files.get("MultipartSingleApi.java")) .assertMethod("multipartSingle", "MultipartFile") - .hasParameter("file").withType("MultipartFile") + .assertParameter("file").hasType("MultipartFile") .assertParameterAnnotations() .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); @@ -737,21 +714,21 @@ public class SpringCodegenTest { // Check that api validates mixed multipart request JavaFileAssert.assertThat(files.get("MultipartMixedApi.java")) .assertMethod("multipartMixed", "MultipartMixedStatus", "MultipartFile", "MultipartMixedRequestMarker", "List") - .hasParameter("status").withType("MultipartMixedStatus") + .assertParameter("status").hasType("MultipartMixedStatus") .assertParameterAnnotations() .containsWithName("Valid") .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"status\"", "required", "true")) .toParameter().toMethod() - .hasParameter("file").withType("MultipartFile") + .assertParameter("file").hasType("MultipartFile") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) .toParameter().toMethod() - .hasParameter("marker").withType("MultipartMixedRequestMarker") + .assertParameter("marker").hasType("MultipartMixedRequestMarker") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) .toParameter().toMethod() - .hasParameter("statusArray").withType("List") + .assertParameter("statusArray").hasType("List") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); } @@ -763,21 +740,21 @@ public class SpringCodegenTest { final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml"); JavaFileAssert.assertThat(files.get("AdditionalPropertiesAnyType.java")) - .hasProperty("additionalProperties").withType("Map") + .assertProperty("additionalProperties").withType("Map") .toType() .assertMethod("putAdditionalProperty", "String", "Object") .toFileAssert() .assertMethod("getAdditionalProperty", "String").hasReturnType("Object"); JavaFileAssert.assertThat(files.get("AdditionalPropertiesArray.java")) - .hasProperty("additionalProperties").withType("Map") + .assertProperty("additionalProperties").withType("Map") .toType() .assertMethod("putAdditionalProperty", "String", "List") .toFileAssert() .assertMethod("getAdditionalProperty", "String").hasReturnType("List"); JavaFileAssert.assertThat(files.get("AdditionalPropertiesInteger.java")) - .hasProperty("additionalProperties").withType("Map") + .assertProperty("additionalProperties").withType("Map") .toType() .assertMethod("putAdditionalProperty", "String", "Integer") .toFileAssert() @@ -949,34 +926,34 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("ResponseTest.java")) .isNormalClass() .hasImports("javax.validation.Valid") - .hasProperty("details") + .assertProperty("details") .withType( "Map" ) .toType() - .hasProperty("response") + .assertProperty("response") .withType( "JsonNullable>" ) .toType() - .hasProperty("nullableDtos") + .assertProperty("nullableDtos") .withType( "JsonNullable>" ) .toType() - .hasProperty("dtos") + .assertProperty("dtos") .withType( "Set<@Valid ResponseTest2>" ) .toType() - .hasProperty("listNullableDtos") + .assertProperty("listNullableDtos") .withType( "JsonNullable>" ) .toType() - .hasProperty("listDtos") + .assertProperty("listDtos") .withType( "List<@Valid ResponseTest2>" ) .toType() - .hasProperty("nullableStrings") + .assertProperty("nullableStrings") .withType( "JsonNullable>" ) .toType() - .hasProperty("strings") + .assertProperty("strings") .withType( "Set" ) .toType() - .hasProperty("nullableInts") + .assertProperty("nullableInts") .withType( "JsonNullable>" ) .toType() - .hasProperty("ints") + .assertProperty("ints") .withType( "Set" ); } @@ -1010,65 +987,65 @@ public class SpringCodegenTest { .isNormalClass() .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType( "Set<@Pattern(regexp = \"[a-z]\") String>" ) .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType( "Set<@Size(min = 1, max = 10) String>" ) .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType( "List<@Size(min = 1) String>" ) .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType( "Set<@Size(max = 1) String>" ) .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType( "List<@Min(1) @Max(10) Integer>" ) .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType( "List<@Min(1) Integer>" ) .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType( "List<@Max(10) Integer>" ) .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType( "List<@DecimalMin(value = \"1\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true) BigDecimal>" ) .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType( "List<@DecimalMin(value = \"1\", inclusive = true) BigDecimal>" ) .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType( "List<@DecimalMax(value = \"10\", inclusive = true) BigDecimal>" ) .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType( "JsonNullable>" ) .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType( "JsonNullable>" ) .toType() ; @@ -1180,20 +1157,14 @@ public class SpringCodegenTest { codegen.setUnhandledException(true); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.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"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xx.yyyyyyyy.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xx.yyyyyyyy.invoker"); - Assert.assertEquals(codegen.getBasePackage(), "xx.yyyyyyyy.base"); - 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.assertTrue(codegen.isUnhandledException()); - Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), true); + ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); + configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.TRUE); + configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "xx.yyyyyyyy.model"); + configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "xx.yyyyyyyy.api"); + configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "xx.yyyyyyyy.invoker"); + configAssert.assertValue(SpringCodegen.BASE_PACKAGE, codegen::getBasePackage, "xx.yyyyyyyy.base"); + configAssert.assertValue(SpringCodegen.CONFIG_PACKAGE, codegen::getConfigPackage, "xx.yyyyyyyy.config"); + configAssert.assertValue(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING, codegen::isUnhandledException, true); } @Test @@ -1300,7 +1271,7 @@ public class SpringCodegenTest { if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java")) .fileContains(contains) - .fileDoesNotContains(notContains); + .fileDoesNotContain(notContains); } @Test @@ -1331,10 +1302,10 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApi.java")) .fileContains("Mono>") - .fileDoesNotContains("Mono"); + .fileDoesNotContain("Mono"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java")) .fileContains("Mono>") - .fileDoesNotContains("Mono"); + .fileDoesNotContain("Mono"); } @Test @@ -1666,7 +1637,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")) .fileContains( "status") - .fileDoesNotContains("@NotNull"); + .fileDoesNotContain("@NotNull"); } @Test @@ -1687,7 +1658,7 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - codegen.setHateoas(true); + // codegen.setHateoas(true); generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); @@ -1739,7 +1710,7 @@ public class SpringCodegenTest { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/FooRefOrValue.java"), "public interface FooRefOrValue"); // previous bugs JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/BarRef.java")) - .fileDoesNotContains( "atTypesuper.hashCode", "private String atBaseType"); + .fileDoesNotContain("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"); } @@ -2052,53 +2023,53 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") - .hasParameter("headerNumber").withType("BigDecimal") + .assertParameter("headerNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("headerString").withType("String") + .assertParameter("headerString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringWrapped").withType("String") + .assertParameter("headerStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotes").withType("String") + .assertParameter("headerStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerStringQuotesWrapped").withType("String") + .assertParameter("headerStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("headerBoolean").withType("Boolean") + .assertParameter("headerBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestHeader", ImmutableMap.of("defaultValue", "\"true\"")); JavaFileAssert.assertThat(files.get("TestQueryParamsApi.java")) .assertMethod("queryParamsTest") - .hasParameter("queryNumber").withType("BigDecimal") + .assertParameter("queryNumber").hasType("BigDecimal") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"11.2\"")) .toParameter().toMethod() - .hasParameter("queryString").withType("String") + .assertParameter("queryString").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringWrapped").withType("String") + .assertParameter("queryStringWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"qwerty\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotes").withType("String") + .assertParameter("queryStringQuotes").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryStringQuotesWrapped").withType("String") + .assertParameter("queryStringQuotesWrapped").hasType("String") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"qwerty\\\"with quotes\\\" test\"")) .toParameter().toMethod() - .hasParameter("queryBoolean").withType("Boolean") + .assertParameter("queryBoolean").hasType("Boolean") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"true\"")); } @@ -2253,7 +2224,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("PetApi.java")) .hasImports("org.springdoc.api.annotations.ParameterObject") .assertMethod("findPetsByStatus") - .hasParameter("pageable").withType("Pageable") + .assertParameter("pageable").hasType("Pageable") .assertParameterAnnotations() .containsWithName("ParameterObject"); @@ -2265,7 +2236,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("PetApi.java")) .hasImports("org.springdoc.core.annotations.ParameterObject", "org.springframework.data.domain.Pageable") .assertMethod("findPetsByStatus") - .hasParameter("pageable").withType("Pageable") + .assertParameter("pageable").hasType("Pageable") .assertParameterAnnotations() .containsWithName("ParameterObject"); } @@ -2285,7 +2256,7 @@ public class SpringCodegenTest { .hasImports("org.openapitools.model.Pageable") .hasNoImports("org.springframework.data.domain.Pageable", "org.springdoc.core.annotations.ParameterObject") .assertMethod("findPageable") - .hasParameter("pageable").withType("Pageable"); + .assertParameter("pageable").hasType("Pageable"); } @Test @@ -2302,22 +2273,22 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("SearchApi.java")) .assertMethod("defaultList") - .hasParameter("orderBy") + .assertParameter("orderBy") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"updatedAt:DESC,createdAt:DESC\"")) .toParameter().toMethod().toFileAssert() .assertMethod("defaultSet") - .hasParameter("orderBy") + .assertParameter("orderBy") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"updatedAt:DESC,createdAt:DESC\"")) .toParameter().toMethod().toFileAssert() .assertMethod("emptyDefaultList") - .hasParameter("orderBy") + .assertParameter("orderBy") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"\"")) .toParameter().toMethod().toFileAssert() .assertMethod("emptyDefaultSet") - .hasParameter("orderBy") + .assertParameter("orderBy") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"\"")); } @@ -2395,7 +2366,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("SomeMethodApi.java")) .assertMethod("methodWithValidation") - .hasParameter("headerOne") + .assertParameter("headerOne") .assertParameterAnnotations() .containsWithName("RequestHeader") .containsWithName("NotNull") @@ -2406,7 +2377,7 @@ public class SpringCodegenTest { .containsWithNameAndAttributes("Pattern", ImmutableMap.of("regexp", "\"\\\\d+\"")) .toParameter() .toMethod() - .hasParameter("headerTwo") + .assertParameter("headerTwo") .assertParameterAnnotations() .containsWithName("RequestHeader") .containsWithName("NotNull") @@ -2633,7 +2604,7 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("AddApi.java")) .assertMethod("addPost") - .hasParameter("body") + .assertParameter("body") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of("value", "2")); } @@ -2681,7 +2652,7 @@ public class SpringCodegenTest { } @Test - public void contractWithoutEnumDoesNotContainsEnumConverter() throws IOException { + public void contractWithoutEnumDoesNotContainEnumConverter() throws IOException { Map output = generateFromContract("src/test/resources/3_0/generic.yaml", SPRING_BOOT); assertThat(output).doesNotContainKey("EnumConverterConfiguration.java"); @@ -2739,7 +2710,7 @@ public class SpringCodegenTest { Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "false") ); - JavaFileAssert.assertThat(output.get("ObjectWithNoRequiredParameter.java")).assertNoConstructor("String"); + JavaFileAssert.assertThat(output.get("ObjectWithNoRequiredParameter.java")).hasNoConstructor("String"); JavaFileAssert.assertThat(output.get("ObjectWithRequiredParameter.java")).assertConstructor(); JavaFileAssert.assertThat(output.get("ObjectWithRequiredParameter.java")).assertConstructor("String", "String") @@ -2850,25 +2821,25 @@ public class SpringCodegenTest { .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("ResponseObjectWithDifferentFieldNames.java")) - .hasProperty("normalPropertyName") + .assertProperty("normalPropertyName") .assertPropertyAnnotations() - .doesNotContainsWithName("JsonProperty") - .doesNotContainsWithName("JacksonXmlProperty") + .doesNotContainWithName("JsonProperty") + .doesNotContainWithName("JacksonXmlProperty") .toProperty().toType() - .hasProperty("UPPER_CASE_PROPERTY_SNAKE") + .assertProperty("UPPER_CASE_PROPERTY_SNAKE") .assertPropertyAnnotations() - .doesNotContainsWithName("JsonProperty") - .doesNotContainsWithName("JacksonXmlProperty") + .doesNotContainWithName("JsonProperty") + .doesNotContainWithName("JacksonXmlProperty") .toProperty().toType() - .hasProperty("lowerCasePropertyDashes") + .assertProperty("lowerCasePropertyDashes") .assertPropertyAnnotations() - .doesNotContainsWithName("JsonProperty") - .doesNotContainsWithName("JacksonXmlProperty") + .doesNotContainWithName("JsonProperty") + .doesNotContainWithName("JacksonXmlProperty") .toProperty().toType() - .hasProperty("propertyNameWithSpaces") + .assertProperty("propertyNameWithSpaces") .assertPropertyAnnotations() - .doesNotContainsWithName("JsonProperty") - .doesNotContainsWithName("JacksonXmlProperty") + .doesNotContainWithName("JsonProperty") + .doesNotContainWithName("JacksonXmlProperty") .toProperty().toType() .assertMethod("getNormalPropertyName") .assertMethodAnnotations() @@ -3094,7 +3065,7 @@ public class SpringCodegenTest { .hasNoImports("org.springframework.stereotype.Controller") .assertTypeAnnotations() .containsWithName("RestController") - .doesNotContainsWithName("Controller"); + .doesNotContainWithName("Controller"); } @Test @@ -3132,7 +3103,7 @@ public class SpringCodegenTest { .hasNoImports("org.springframework.web.bind.annotation.RestController") .assertTypeAnnotations() .containsWithName("Controller") - .doesNotContainsWithName("RestController"); + .doesNotContainWithName("RestController"); } @Test @@ -3177,6 +3148,61 @@ public class SpringCodegenTest { )); } + @Test + public void testXPatternMessage_issue18959() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_18959.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.DATE_LIBRARY, "java8-localdatetime"); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); + codegen.additionalProperties().put(USE_RESPONSE_ENTITY, "false"); + codegen.additionalProperties().put(DELEGATE_PATTERN, "true"); + codegen.additionalProperties().put(USE_BEANVALIDATION, "true"); + codegen.additionalProperties().put(PERFORM_BEANVALIDATION, "true"); + codegen.additionalProperties().put(REQUEST_MAPPING_OPTION, "api_interface"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("TestApi.java")); + javaFileAssert + .assertMethod("_postToTest") + .assertParameter("groupObj") + .assertParameterAnnotations() + .containsWithNameAndAttributes("Pattern", ImmutableMap.of( + "regexp", "\"[a-zA-Z]\"", + "message", "\"Only letters\"" + )) + .toParameter() + .toMethod() + .assertParameter("token") + .assertParameterAnnotations() + .containsWithNameAndAttributes("Pattern", ImmutableMap.of( + "regexp", "\"[0-9a-fA-F]\"", + "message", "\"Only numbers and letters a-f\"" + )) + .toParameter() + .toMethod() + .assertParameter("clientId") + .assertParameterAnnotations() + .containsWithNameAndAttributes("Pattern", ImmutableMap.of( + "regexp", "\"\\\\d\"", + "message", "\"Only numbers\"" + )); + } + @Test public void testEnumCaseInsensitive_issue8084() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -3243,6 +3269,52 @@ public class SpringCodegenTest { .bodyContainsLines("if (b.value.equals(value)) {"); } + @Test + public void testHasOperationParameterExtraAnnotation_issue18224() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_18224.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.DATE_LIBRARY, "java8-localdatetime"); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); + codegen.additionalProperties().put(USE_RESPONSE_ENTITY, "false"); + codegen.additionalProperties().put(DELEGATE_PATTERN, "true"); + codegen.additionalProperties().put(REQUEST_MAPPING_OPTION, "api_interface"); + codegen.additionalProperties().put(SPRING_CONTROLLER, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + 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())); + + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("TestApi.java")); + javaFileAssert + .assertMethod("_postToTest") + .assertParameter("groupObj") + .assertParameterAnnotations() + .containsWithName("com.test.MyAnnotationInPath") + .toParameter() + .toMethod() + .assertParameter("token") + .assertParameterAnnotations() + .containsWithName("com.test.MyAnnotationInQuery") + .toParameter() + .toMethod() + .assertParameter("clientId") + .assertParameterAnnotations() + .containsWithName("com.test.MyAnnotationInHeader"); + } + @Test public void testHasOperationExtraAnnotation_issue15822() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -3384,29 +3456,29 @@ public class SpringCodegenTest { .assertMethod("alias") .hasReturnType("Animal") .bodyContainsLines("this.alias = JsonNullable.of(alias);", "return this;") - .hasParameter("alias") - .withType("String") + .assertParameter("alias") + .hasType("String") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setAlias") .hasReturnType("void") - .hasParameter("alias") - .withType("JsonNullable"); + .assertParameter("alias") + .hasType("JsonNullable"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Zebra.java")) // Fluent method assertions .assertMethod("alias") .hasReturnType("Zebra") .bodyContainsLines("super.alias(alias);", "return this;") - .hasParameter("alias") - .withType("String") + .assertParameter("alias") + .hasType("String") .toMethod() .toFileAssert() // No overridden setter on child object - .assertNoMethod("setAlias"); + .hasNoMethod("setAlias"); } @Test @@ -3440,96 +3512,96 @@ public class SpringCodegenTest { .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") - .hasProperty("name") + .assertProperty("name") .withType( "String" ) .toType() - .hasProperty("age") + .assertProperty("age") .withType( "JsonNullable" ) .toType() - .hasProperty("alias") + .assertProperty("alias") .withType( "JsonNullable" ) .toType() - .hasProperty("color") + .assertProperty("color") .withType( "String" ) .toType() - .hasProperty("names") + .assertProperty("names") .withType( "List" ) .toType() - .hasProperty("colors") + .assertProperty("colors") .withType( "JsonNullable>" ) .toType() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType( "String" ) .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType( "String" ) .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType( "String" ) .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType( "String" ) .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType( "String" ) .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType( "Integer" ) .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType( "Integer" ) .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType( "Integer" ) .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType( "BigDecimal" ) .toType() - .hasProperty("stringDefault") + .assertProperty("stringDefault") .withType( "String" ) .toType() .fileContains("stringDefault = \"ABC\"") - .hasProperty("zebra") + .assertProperty("zebra") .withType( "Zebra" ) .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType( "JsonNullable<@Pattern(regexp = \"[a-z]\") String>" ) .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType( "JsonNullable<@Size(min = 1, max = 10) String>" ) .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType( "JsonNullable<@Size(min = 1) String>" ) .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType( "JsonNullable<@Size(max = 1) String>" ) .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType( "JsonNullable<@Min(1) @Max(10) Integer>" ) .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType( "JsonNullable<@Min(1) Integer>" ) .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType( "JsonNullable<@Max(10) Integer>" ) .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType( "JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType( "JsonNullable<@DecimalMin(\"1\") BigDecimal>" ) .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType( "JsonNullable<@DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("stringDefaultNullable") + .assertProperty("stringDefaultNullable") .withType( "JsonNullable<@Size(max = 1) String>" ) .toType() .fileContains("stringDefaultNullable = JsonNullable.undefined();") @@ -3537,15 +3609,15 @@ public class SpringCodegenTest { .assertMethod("name") .hasReturnType("Animal") .bodyContainsLines("this.name = name;", "return this;") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setName") .hasReturnType("void") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Getter method assertions @@ -3557,15 +3629,15 @@ public class SpringCodegenTest { .assertMethod("colors") .hasReturnType("Animal") .bodyContainsLines("this.colors = JsonNullable.of(colors);", "return this;") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setColors") .hasReturnType("void") - .hasParameter("colors") - .withType("JsonNullable>") + .assertParameter("colors") + .hasType("JsonNullable>") .toMethod() .toFileAssert() // Getter method assertions @@ -3577,15 +3649,15 @@ public class SpringCodegenTest { .assertMethod("names") .hasReturnType("Animal") .bodyContainsLines("this.names = names;", "return this;") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setNames") .hasReturnType("void") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -3656,96 +3728,96 @@ public class SpringCodegenTest { .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") - .hasProperty("name") + .assertProperty("name") .withType( "String" ) .toType() - .hasProperty("age") + .assertProperty("age") .withType( "JsonNullable" ) .toType() - .hasProperty("alias") + .assertProperty("alias") .withType( "JsonNullable" ) .toType() - .hasProperty("color") + .assertProperty("color") .withType( "Optional" ) .toType() - .hasProperty("names") + .assertProperty("names") .withType( "List" ) .toType() - .hasProperty("colors") + .assertProperty("colors") .withType( "JsonNullable>" ) .toType() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType( "Optional<@Pattern(regexp = \"[a-z]\") String>" ) .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType( "Optional<@Size(min = 1, max = 10) String>" ) .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType( "Optional<@Size(min = 1) String>" ) .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType( "Optional<@Size(max = 1) String>" ) .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType( "Optional<@jakarta.validation.constraints.Email String>" ) .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType( "Optional<@Min(1) @Max(10) Integer>" ) .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType( "Optional<@Min(1) Integer>" ) .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType( "Optional<@Max(10) Integer>" ) .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType( "Optional<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType( "Optional<@DecimalMin(\"1\") BigDecimal>" ) .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType( "Optional<@DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("stringDefault") + .assertProperty("stringDefault") .withType( "Optional<@Size(max = 1) String>" ) .toType() .fileContains("stringDefault = Optional.of(\"ABC\")") - .hasProperty("zebra") + .assertProperty("zebra") .withType( "Optional" ) .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType( "JsonNullable<@Pattern(regexp = \"[a-z]\") String>" ) .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType( "JsonNullable<@Size(min = 1, max = 10) String>" ) .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType( "JsonNullable<@Size(min = 1) String>" ) .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType( "JsonNullable<@Size(max = 1) String>" ) .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType( "JsonNullable<@Min(1) @Max(10) Integer>" ) .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType( "JsonNullable<@Min(1) Integer>" ) .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType( "JsonNullable<@Max(10) Integer>" ) .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType( "JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType( "JsonNullable<@DecimalMin(\"1\") BigDecimal>" ) .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType( "JsonNullable<@DecimalMax(\"10\") BigDecimal>" ) .toType() - .hasProperty("stringDefaultNullable") + .assertProperty("stringDefaultNullable") .withType( "JsonNullable<@Size(max = 1) String>" ) .toType() .fileContains("stringDefaultNullable = JsonNullable.undefined();") @@ -3753,15 +3825,15 @@ public class SpringCodegenTest { .assertMethod("name") .hasReturnType("Animal") .bodyContainsLines("this.name = name;", "return this;") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setName") .hasReturnType("void") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Getter method assertions @@ -3773,15 +3845,15 @@ public class SpringCodegenTest { .assertMethod("colors") .hasReturnType("Animal") .bodyContainsLines("this.colors = JsonNullable.of(colors);", "return this;") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setColors") .hasReturnType("void") - .hasParameter("colors") - .withType("JsonNullable>") + .assertParameter("colors") + .hasType("JsonNullable>") .toMethod() .toFileAssert() // Getter method assertions @@ -3793,15 +3865,15 @@ public class SpringCodegenTest { .assertMethod("names") .hasReturnType("Animal") .bodyContainsLines("this.names = names;", "return this;") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setNames") .hasReturnType("void") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -3872,96 +3944,96 @@ public class SpringCodegenTest { .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") - .hasProperty("name") + .assertProperty("name") .withType( "String" ) .toType() - .hasProperty("age") + .assertProperty("age") .withType( "Integer" ) .toType() - .hasProperty("alias") + .assertProperty("alias") .withType( "String" ) .toType() - .hasProperty("color") + .assertProperty("color") .withType( "String" ) .toType() - .hasProperty("names") + .assertProperty("names") .withType( "List" ) .toType() - .hasProperty("colors") + .assertProperty("colors") .withType( "List" ) .toType() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType( "String" ) .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType( "String" ) .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType( "String" ) .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType( "String" ) .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType( "String" ) .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType( "Integer" ) .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType( "Integer" ) .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType( "Integer" ) .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType( "BigDecimal" ) .toType() - .hasProperty("stringDefault") + .assertProperty("stringDefault") .withType( "String" ) .toType() .fileContains("stringDefault = \"ABC\"") - .hasProperty("zebra") + .assertProperty("zebra") .withType( "Zebra" ) .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType( "String" ) .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType( "String" ) .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType( "String" ) .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType( "String" ) .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType( "Integer" ) .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType( "Integer" ) .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType( "Integer" ) .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("stringDefaultNullable") + .assertProperty("stringDefaultNullable") .withType( "String" ) .toType() .fileContains("stringDefaultNullable = null;") @@ -3969,15 +4041,15 @@ public class SpringCodegenTest { .assertMethod("name") .hasReturnType("Animal") .bodyContainsLines("this.name = name;", "return this;") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setName") .hasReturnType("void") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Getter method assertions @@ -3989,15 +4061,15 @@ public class SpringCodegenTest { .assertMethod("age") .hasReturnType("Animal") .bodyContainsLines("this.age = age;", "return this;") - .hasParameter("age") - .withType("Integer") + .assertParameter("age") + .hasType("Integer") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setAge") .hasReturnType("void") - .hasParameter("age") - .withType("Integer") + .assertParameter("age") + .hasType("Integer") .toMethod() .toFileAssert() // Getter method assertions @@ -4009,15 +4081,15 @@ public class SpringCodegenTest { .assertMethod("colors") .hasReturnType("Animal") .bodyContainsLines("this.colors = colors;", "return this;") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setColors") .hasReturnType("void") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -4029,15 +4101,15 @@ public class SpringCodegenTest { .assertMethod("names") .hasReturnType("Animal") .bodyContainsLines("this.names = names;", "return this;") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setNames") .hasReturnType("void") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -4107,96 +4179,96 @@ public class SpringCodegenTest { .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") - .hasProperty("name") + .assertProperty("name") .withType( "String" ) .toType() - .hasProperty("age") + .assertProperty("age") .withType( "Integer" ) .toType() - .hasProperty("alias") + .assertProperty("alias") .withType( "String" ) .toType() - .hasProperty("color") + .assertProperty("color") .withType( "String" ) .toType() - .hasProperty("names") + .assertProperty("names") .withType( "List" ) .toType() - .hasProperty("colors") + .assertProperty("colors") .withType( "List" ) .toType() - .hasProperty("stringPattern") + .assertProperty("stringPattern") .withType( "String" ) .toType() - .hasProperty("stringMaxMinLength") + .assertProperty("stringMaxMinLength") .withType( "String" ) .toType() - .hasProperty("stringMinLength") + .assertProperty("stringMinLength") .withType( "String" ) .toType() - .hasProperty("stringMaxLength") + .assertProperty("stringMaxLength") .withType( "String" ) .toType() - .hasProperty("stringEmail") + .assertProperty("stringEmail") .withType( "String" ) .toType() - .hasProperty("intMinMax") + .assertProperty("intMinMax") .withType( "Integer" ) .toType() - .hasProperty("intMin") + .assertProperty("intMin") .withType( "Integer" ) .toType() - .hasProperty("intMax") + .assertProperty("intMax") .withType( "Integer" ) .toType() - .hasProperty("numberMinMax") + .assertProperty("numberMinMax") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMin") + .assertProperty("numberMin") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMax") + .assertProperty("numberMax") .withType( "BigDecimal" ) .toType() - .hasProperty("stringDefault") + .assertProperty("stringDefault") .withType( "String" ) .toType() .fileContains("stringDefault = \"ABC\"") - .hasProperty("zebra") + .assertProperty("zebra") .withType( "Zebra" ) .toType() - .hasProperty("stringPatternNullable") + .assertProperty("stringPatternNullable") .withType( "String" ) .toType() - .hasProperty("stringMaxMinLengthNullable") + .assertProperty("stringMaxMinLengthNullable") .withType( "String" ) .toType() - .hasProperty("stringMinLengthNullable") + .assertProperty("stringMinLengthNullable") .withType( "String" ) .toType() - .hasProperty("stringMaxLengthNullable") + .assertProperty("stringMaxLengthNullable") .withType( "String" ) .toType() - .hasProperty("intMinMaxNullable") + .assertProperty("intMinMaxNullable") .withType( "Integer" ) .toType() - .hasProperty("intMinNullable") + .assertProperty("intMinNullable") .withType( "Integer" ) .toType() - .hasProperty("intMaxNullable") + .assertProperty("intMaxNullable") .withType( "Integer" ) .toType() - .hasProperty("numberMinMaxNullable") + .assertProperty("numberMinMaxNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMinNullable") + .assertProperty("numberMinNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("numberMaxNullable") + .assertProperty("numberMaxNullable") .withType( "BigDecimal" ) .toType() - .hasProperty("stringDefaultNullable") + .assertProperty("stringDefaultNullable") .withType( "String" ) .toType() .fileContains("stringDefaultNullable = null;") @@ -4204,15 +4276,15 @@ public class SpringCodegenTest { .assertMethod("name") .hasReturnType("Animal") .bodyContainsLines("this.name = name;", "return this;") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setName") .hasReturnType("void") - .hasParameter("name") - .withType("String") + .assertParameter("name") + .hasType("String") .toMethod() .toFileAssert() // Getter method assertions @@ -4224,15 +4296,15 @@ public class SpringCodegenTest { .assertMethod("age") .hasReturnType("Animal") .bodyContainsLines("this.age = age;", "return this;") - .hasParameter("age") - .withType("Integer") + .assertParameter("age") + .hasType("Integer") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setAge") .hasReturnType("void") - .hasParameter("age") - .withType("Integer") + .assertParameter("age") + .hasType("Integer") .toMethod() .toFileAssert() // Getter method assertions @@ -4244,15 +4316,15 @@ public class SpringCodegenTest { .assertMethod("colors") .hasReturnType("Animal") .bodyContainsLines("this.colors = colors;", "return this;") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setColors") .hasReturnType("void") - .hasParameter("colors") - .withType("List") + .assertParameter("colors") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -4264,15 +4336,15 @@ public class SpringCodegenTest { .assertMethod("names") .hasReturnType("Animal") .bodyContainsLines("this.names = names;", "return this;") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Setter method assertions .assertMethod("setNames") .hasReturnType("void") - .hasParameter("names") - .withType("List") + .assertParameter("names") + .hasType("List") .toMethod() .toFileAssert() // Getter method assertions @@ -4332,15 +4404,15 @@ public class SpringCodegenTest { javaFileAssert.assertMethod(expectedName) .hasReturnType("Animal") .bodyContainsLines("this."+expectedName+" = "+wrapperType+".of("+expectedName+");", "return this;") - .hasParameter(expectedName) - .withType(type) + .assertParameter(expectedName) + .hasType(type) .toMethod() .toFileAssert() // Setter method assertions .assertMethod("set"+methodName) .hasReturnType("void") - .hasParameter(expectedName) - .withType(wrapperType+"<"+type+">") + .assertParameter(expectedName) + .hasType(wrapperType+"<"+type+">") .toMethod() .toFileAssert() // Getter method assertions @@ -4355,15 +4427,15 @@ public class SpringCodegenTest { javaFileAssert.assertMethod(expectedName) .hasReturnType("Animal") .bodyContainsLines("this."+expectedName+" = "+ expectedName + ";", "return this;") - .hasParameter(expectedName) - .withType(type) + .assertParameter(expectedName) + .hasType(type) .toMethod() .toFileAssert() // Setter method assertions .assertMethod("set"+methodName) .hasReturnType("void") - .hasParameter(expectedName) - .withType(type) + .assertParameter(expectedName) + .hasType(type) .toMethod() .toFileAssert() // Getter method assertions @@ -4666,20 +4738,20 @@ public class SpringCodegenTest { 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() - .assertNoMethod("toString") - .assertNoMethod("hashCode") - .assertNoMethod("equals") - .assertNoMethod("getId") - .assertNoMethod("setId") - .assertNoMethod("getName") - .assertNoMethod("setName") + .hasNoConstructor() + .hasNoMethod("toString") + .hasNoMethod("hashCode") + .hasNoMethod("equals") + .hasNoMethod("getId") + .hasNoMethod("setId") + .hasNoMethod("getName") + .hasNoMethod("setName") ; additionalProperties.put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@lombok.ToString"); output = generateFromContract("src/test/resources/3_0/petstore.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(output.get("Pet.java")) .assertConstructor().toFileAssert() - .assertNoMethod("toString") + .hasNoMethod("toString") .assertMethod("hashCode") .toFileAssert() .assertMethod("equals") @@ -4730,7 +4802,7 @@ public class SpringCodegenTest { .fileContains("public SimpleObject.Builder additionalProperties(Map additionalProperties) {", "SimpleObject.Builder nullableObject(String nullableObject) {", "SimpleObject.Builder nb(BigDecimal nb) {") - .fileDoesNotContains("SimpleObject.Builder nullableObject(JsonNullable nullableObject) {"); + .fileDoesNotContain("SimpleObject.Builder nullableObject(JsonNullable nullableObject) {"); } @Test @@ -4835,10 +4907,10 @@ public class SpringCodegenTest { .fileContains("Set stringSet") .fileContains("private Set stringDefaultSet = new LinkedHashSet<>(Arrays.asList(\"A\", \"B\"));") .fileContains("private Set stringEmptyDefaultSet = new LinkedHashSet<>();") - .fileDoesNotContains("private List<@Valid TagDto> tags = new ArrayList<>()") - .fileDoesNotContains("private Set<@Valid TagDto> tagsUnique = new LinkedHashSet<>()") - .fileDoesNotContains("private List stringList = new ArrayList<>()") - .fileDoesNotContains("private Set stringSet = new LinkedHashSet<>()"); + .fileDoesNotContain("private List<@Valid TagDto> tags = new ArrayList<>()") + .fileDoesNotContain("private Set<@Valid TagDto> tagsUnique = new LinkedHashSet<>()") + .fileDoesNotContain("private List stringList = new ArrayList<>()") + .fileDoesNotContain("private Set stringSet = new LinkedHashSet<>()"); } @Test @@ -4854,15 +4926,181 @@ public class SpringCodegenTest { Map files = generateFromContract("src/test/resources/bugs/issue_17768.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("TestApiDelegate.java")) .assertMethod("updatePost") - .hasParameter("updateRequest") - .withType("Optional") + .assertParameter("updateRequest") + .hasType("Optional") .toMethod() .toFileAssert(); JavaFileAssert.assertThat(files.get("TestApi.java")) .assertMethod("updatePost") - .hasParameter("updateRequest") - .withType("Optional") + .assertParameter("updateRequest") + .hasType("Optional") .toMethod() .toFileAssert(); } + + @Test + public void testEnumUnknownDefaultCaseDeserializationTrue_issue13241() throws IOException { + + SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary(SPRING_BOOT); + codegen.additionalProperties().put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, "true"); + + Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13241.yaml"); + + JavaFileAssert.assertThat(files.get("Color.java")) + .assertMethod("fromValue").bodyContainsLines("return UNKNOWN_DEFAULT_OPEN_API"); + } + + @Test + public void testEnumUnknownDefaultCaseDeserializationNotSet_issue13241() throws IOException { + + SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary(SPRING_BOOT); + Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13241.yaml"); + + JavaFileAssert.assertThat(files.get("Color.java")) + .assertMethod("fromValue").bodyContainsLines("throw new IllegalArgumentException(\"Unexpected value '\" + value + \"'\");"); + } + + /** + * General XML annotations test (both JAXB and Jackson) + *
    + * Includes regression tests for: + * - Correct Jackson annotation when `wrapped: false` + */ + @Test void shouldGenerateCorrectXmlAnnotations() { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .setGeneratorName("spring") + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setLibrary(SPRING_BOOT) + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertMethod("getTags") + .doesNotHaveAnnotation("XmlAttribute") + .hasAnnotation("XmlElement", Map.of("name", "\"Tag\"")) + .hasAnnotation("XmlElementWrapper", Map.of("name", "\"TagList\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Tag\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertMethod("getFriends") + .doesNotHaveAnnotation("XmlAttribute") + .doesNotHaveAnnotation("XmlElementWrapper") + .hasAnnotation("XmlElement", Map.of("name", "\"friend-pet\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"friend-pet\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertMethod("getStatus") + .doesNotHaveAnnotation("XmlAttribute") + .doesNotHaveAnnotation("XmlElementWrapper") + .hasAnnotation("XmlElement", Map.of("name", "\"PetStatus\"")) + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"PetStatus\"")) + .toFileAssert() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertMethod("getPhotoUrls") + .doesNotHaveAnnotation("XmlAttribute") + .hasAnnotation("XmlElement", Map.of("name", "\"photoUrls\"")) + .hasAnnotation("XmlElementWrapper", Map.of("name", "\"photoUrls\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"photoUrls\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true")) + .toFileAssert() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertMethod("getName") + .doesNotHaveAnnotation("XmlElement") + .doesNotHaveAnnotation("XmlElementWrapper") + .hasAnnotation("XmlAttribute", Map.of("name", "\"name\"")) + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\"")) + .toFileAssert() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertMethod("getId") + .doesNotHaveAnnotation("XmlAttribute") + .doesNotHaveAnnotation("XmlElementWrapper") + .hasAnnotation("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .doesNotHaveAnnotation("JacksonXmlElementWrapper") + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toFileAssert() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertMethod("getFoods") + .doesNotHaveAnnotation("XmlAttribute") + .hasAnnotation("XmlElement", Map.of("name", "\"yummy-yummy\"")) + .hasAnnotation("XmlElementWrapper", Map.of("name", "\"yummy-yummy\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\"")) + .toFileAssert() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertMethod("getColors") + .doesNotHaveAnnotation("XmlAttribute") + .hasAnnotation("XmlElement", Map.of("name", "\"color\"")) + .hasAnnotation("XmlElementWrapper", Map.of("name", "\"colors\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"color\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"colors\"")) + .toFileAssert() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertMethod("getCategories") + .doesNotHaveAnnotation("XmlAttribute") + .doesNotHaveAnnotation("XmlElementWrapper") + .hasAnnotation("XmlElement", Map.of("name", "\"Category\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"Category\"")) + // ↓ specific regression test for #2417: (useWrapping=false) needs to be present + .hasAnnotation("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toFileAssert() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertMethod("getActivities") + .doesNotHaveAnnotation("XmlAttribute") + .hasAnnotation("XmlElement", Map.of("name", "\"item\"")) + .hasAnnotation("XmlElementWrapper", Map.of("name", "\"activities-array\"")) + .hasAnnotation("JacksonXmlProperty", Map.of("localName", "\"item\"")) + .hasAnnotation("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\"")); + } + + /** + * Regression test for #12804 + */ + @Test public void shouldGenerateSingleDeprecatedAnnotation() { + final var tempDir = TestUtils.newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .addAdditionalProperty(GENERATE_BUILDERS, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setGeneratorName("spring") + .setOutputDir(tempDir.toString()); + + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(tempDir.resolve("src/main/java/org/openapitools/model/Pet.java")) + .assertInnerClass("Builder") + .assertMethod("status").hasAnnotation("Deprecated") + .toInnerClassAssert() + .assertMethod("build") + .doesNotHaveAnnotation("Deprecated"); + } } 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 dd283de1bee..54fae7f36c2 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.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.JetbrainsHttpClientClientCodegen; @@ -16,7 +16,6 @@ import java.util.List; import static org.openapitools.codegen.TestUtils.assertFileExists; public class JetbrainsHttpClientClientCodegenTest { - @Test public void testBasicGenerationYaml() throws IOException { @@ -403,7 +402,7 @@ public class JetbrainsHttpClientClientCodegenTest { } @Test - @Disabled // For some reason this test fails during Docker image generation. Investigate one day. + @Ignore // 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(); @@ -481,4 +480,300 @@ public class JetbrainsHttpClientClientCodegenTest { " \"channel\" : \"Android\"\n" + "}"); } + + @Test + public void testBasicGenerationQueryParams() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/SampleProjectWithAuthQuery.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis/DefaultApi.http"); + assertFileExists(path); + + // Checking with extra params + TestUtils.assertFileContains(path, "### Get User Info by Query Param\n" + + "## Get User Info by Query Param\n" + + "GET http://localhost:5000/v1/users/?page={{page}}&pUserId={{pUserId}}&api_key={{queryKey}}\n" + + "Accept: application/json\n" + + "Custom-Header: {{customHeader}}\n" + + "Another-Custom-Header: {{anotherCustomHeader}}"); + + // Checking without extra params + TestUtils.assertFileContains(path, "### Get User Info by User ID\n" + + "## Get User Info by User ID\n" + + "GET http://localhost:5000/v1/users/{{userId}}?api_key={{queryKey}}\n" + + "Accept: application/json\n" + + "strCode: {{strCode}}\n" + + "strCode2: {{strCode2}}"); + + // Checking with only auth + TestUtils.assertFileContains(path, "### Get User Info by User ID\n" + + "## Get User Info by User ID\n" + + "GET http://localhost:5000/v1/users/{{userId}}?api_key={{queryKey}}\n" + + "Accept: application/json\n" + + "strCode: {{strCode}}\n" + + "strCode2: {{strCode2}}"); + + // Checking with only param + TestUtils.assertFileContains(path, "### Update User Information\n" + + "## Update User Information\n" + + "PATCH http://localhost:5000/v1/users/{{userId}}?page={{page}}\n" + + "Content-Type: application/json\n" + + "Accept: application/json\n" + + "strCode: {{strCode}}\n" + + "strCode2: {{strCode2}}\n" + + "\n" + + "{\n" + + " \"firstName\" : \"Rebecca\"\n" + + "}"); + + // Checking when there is nothing + TestUtils.assertFileContains(path, "### Create New User\n" + + "## Example request for Get User\n" + + "POST http://localhost:5000/v1/user\n" + + "Content-Type: application/json\n" + + "Accept: application/json\n" + + "\n" + + "{\n" + + " \"id\": 777,\n" + + " \"firstName\": \"Alotta\",\n" + + " \"lastName\": \"Rotta\",\n" + + " \"email\": \"alotta.rotta@gmail.com\",\n" + + " \"dateOfBirth\": \"1997-10-31\",\n" + + " \"emailVerified\": true,\n" + + " \"createDate\": \"2019-08-24\"\n" + + "}"); + } + + @Test + public void testBasicGenerationHeaderParams() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/SampleProjectWithHeaderParams.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis/DefaultApi.http"); + assertFileExists(path); + + // Checking with extra headers and header security + TestUtils.assertFileContains(path, "### Get User Info by Query Param\n" + + "## Get User Info by Query Param\n" + + "GET http://localhost:5000/v1/users/?page={{page}}&pUserId={{pUserId}}\n" + + "Accept: application/json\n" + + "Custom-Header: {{customHeader}}\n" + + "Another-Custom-Header: {{anotherCustomHeader}}\n" + + "X-API-Key: {{apiKey}}"); + + // Checking with only header security + TestUtils.assertFileContains(path, "### Update User Information\n" + + "## Update User Information\n" + + "PATCH http://localhost:5000/v1/users/{{userId}}?page={{page}}\n" + + "Content-Type: application/json\n" + + "Accept: application/json\n" + + "strCode: {{strCode}}\n" + + "strCode2: {{strCode2}}\n" + + "X-API-Key: {{apiKey}}"); + + // Checking with only extra headers + TestUtils.assertFileContains(path, "### Get group by ID\n" + + "## Get group by ID\n" + + "GET http://localhost:5000/v1/groups/{{groupId}}\n" + + "Accept: application/json\n" + + "Custom-Header: {{customHeader}}\n" + + "Another-Custom-Header: {{anotherCustomHeader}}\n"); + + TestUtils.assertFileContains(path, "### Create New User\n" + + "## Example request for Get User\n" + + "POST http://localhost:5000/v1/user\n" + + "Content-Type: application/json\n" + + "Accept: application/json"); + } + + @Test + public void testTemplateEnvironmentFileGenerationEmpty() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/Simple.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " }\n" + + "}"); + } + + @Test + public void testTemplateEnvironmentFileGenerationPath() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/Path.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " \"resource\" : \"\"\n" + + " }\n" + + "}"); + } + + @Test + public void testTemplateEnvironmentFileGenerationQueryParam() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/QueryParam.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " \"laneRole\" : \"\",\n" + + " \"heroId\" : \"\"\n" + + " }\n" + + "}"); + } + + @Test + public void testTemplateEnvironmentFileGenerationHeader() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/Header.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " \"Custom-Header\" : \"\",\n" + + " \"Another-Custom-Header\" : \"\"\n" + + " }\n" + + "}"); + } + + @Test + public void testTemplateEnvironmentFileGenerationCustomVariable() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/CustomVariable.yaml") + .addAdditionalProperty(JetbrainsHttpClientClientCodegen.BODY_VARIABLES, "MY_VAR_NAME-MY_VAR_LAST_NAME") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " \"MY_VAR_LAST_NAME\" : \"\",\n" + + " \"MY_VAR_NAME\" : \"\"\n" + + " }\n" + + "}"); + } + + @Test + public void testTemplateEnvironmentFileGenerationCustomHeaders() throws IOException { + // Checking that each request example is present in the output file + File output = Files.createTempDirectory("jetbrainstest_").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("jetbrains-http-client") + .setInputSpec("src/test/resources/3_0/jetbrains/environmentgeneration/CustomHeaders.yaml") + .addAdditionalProperty(JetbrainsHttpClientClientCodegen.CUSTOM_HEADERS, "Cookie:X-API-KEY={{cookieKey}}&Accept-Encoding=gzip") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + files.forEach(File::deleteOnExit); + + Path path = Paths.get(output + "/Apis//http-client.template.env.json"); + assertFileExists(path); + + TestUtils.assertFileContains(path, "{\n" + + " \"dev\": {\n" + + " \"cookieKey\" : \"\"\n" + + " }\n" + + "}"); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java index b820edc3384..6ab3fd69878 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/AbstractKotlinCodegenTest.java @@ -5,31 +5,42 @@ import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import org.mockito.Answers; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.AbstractKotlinCodegen; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.io.File; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; import static org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.*; import static org.openapitools.codegen.TestUtils.createCodegenModelWrapper; import static org.testng.Assert.*; public class AbstractKotlinCodegenTest { - private final AbstractKotlinCodegen codegen = new P_AbstractKotlinCodegen(); + private AbstractKotlinCodegen 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 = mock( + AbstractKotlinCodegen.class, withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } @Test public void camlCaseEnumConverter() { @@ -82,23 +93,6 @@ public class AbstractKotlinCodegenTest { assertEquals(codegen.toEnumValue("data/*", "Something"), "\"data/*\""); } - private static class P_AbstractKotlinCodegen extends AbstractKotlinCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - } - @Test public void isDataTypeString() { assertFalse(codegen.isDataTypeString("kotlin.Int")); @@ -241,7 +235,6 @@ public class AbstractKotlinCodegenTest { openAPI.getComponents().addSchemas(parent.getName(), parent); openAPI.getComponents().addSchemas(child.getName(), child); - final DefaultCodegen codegen = new P_AbstractKotlinCodegen(); codegen.setOpenAPI(openAPI); final CodegenModel pm = codegen @@ -267,7 +260,6 @@ public class AbstractKotlinCodegenTest { @Test(description = "Issue #10591") public void testEnumPropertyWithDefaultValue() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/issue10591-enum-defaultValue.yaml"); - final AbstractKotlinCodegen codegen = new P_AbstractKotlinCodegen(); codegen.setOpenAPI(openAPI); Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); @@ -289,7 +281,6 @@ public class AbstractKotlinCodegenTest { @Test(description = "Issue #3804") public void testEnumPropertyWithCapitalization() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/issue3804-enum-enum-capitalization.yaml"); - final AbstractKotlinCodegen codegen = new P_AbstractKotlinCodegen(); Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); CodegenModel cm1 = codegen.fromModel("ModelWithEnumPropertyHavingDefault", test1); @@ -312,7 +303,6 @@ public class AbstractKotlinCodegenTest { @Test(description = "Issue #3804") public void testEnumPropertyDefaultWithCapitalization() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/issue3804-enum-enum-capitalization.yaml"); - final AbstractKotlinCodegen codegen = new P_AbstractKotlinCodegen(); Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); CodegenModel cm1 = codegen.fromModel("ModelWithEnumPropertyHavingDefault", test1); @@ -332,7 +322,6 @@ public class AbstractKotlinCodegenTest { @Test(description = "Issue #3804") public void testEnumPropertyWithKeyword() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/issue3804-enum-enum-capitalization.yaml"); - final AbstractKotlinCodegen codegen = new P_AbstractKotlinCodegen(); Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); CodegenModel cm1 = codegen.fromModel("ModelWithEnumPropertyHavingDefault", test1); @@ -373,7 +362,6 @@ public class AbstractKotlinCodegenTest { openAPI.getComponents().addSchemas(child.getName(), child); openAPI.getComponents().addSchemas(mapSchema.getName(), mapSchema); - final DefaultCodegen codegen = new P_AbstractKotlinCodegen(); codegen.setOpenAPI(openAPI); final CodegenModel pm = codegen diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java index 1eda19d8d77..9b2f7d97a8b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java @@ -8,6 +8,7 @@ import org.openapitools.codegen.*; import org.openapitools.codegen.languages.KotlinClientCodegen; import org.openapitools.codegen.languages.KotlinSpringServerCodegen; import org.openapitools.codegen.utils.StringUtils; +import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -22,7 +23,11 @@ import static org.testng.Assert.assertEquals; @SuppressWarnings("rawtypes") public class KotlinReservedWordsTest { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/reserved_words.yaml"); + OpenAPI openAPI; + + @BeforeTest void loadOpenApi() { + openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/reserved_words.yaml"); + } @DataProvider(name = "reservedWords") static Object[][] reservedWords() { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinServerCodegenTest.java index 42f4777d7dc..939d840118e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinServerCodegenTest.java @@ -23,6 +23,38 @@ import static org.openapitools.codegen.languages.features.BeanValidationFeatures public class KotlinServerCodegenTest { + + @Test + public void enumDescription() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + KotlinServerCodegen codegen = new KotlinServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(LIBRARY, JAXRS_SPEC); + + new DefaultGenerator().opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/enum-description.yaml")) + .config(codegen)) + .generate(); + + String outputPath = output.getAbsolutePath() + "/src/main/kotlin/org/openapitools/server"; + Path petApi = Paths.get(outputPath + "/models/Type.kt"); + assertFileNotContains( + petApi, + "import jakarta.ws.rs.*", + "import jakarta.ws.rs.core.Response", + "@jakarta.annotation.Generated(value = arrayOf(\"org.openapitools.codegen.languages.KotlinServerCodegen\")" + ); + // assert, that all enum values have a description comment + assertFileContains( + petApi, + "Pegasi b is a gas giant exoplanet that orbits a G-type star", + "Mercury is the first planet from the Sun and the smallest in the Solar System", + "The planet we all live on" + ); + } + @Test public void javaxImports() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java index 324775d1df2..85286a729d6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinTestUtils.java @@ -20,6 +20,7 @@ import java.io.*; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.*; @@ -51,12 +52,7 @@ public class KotlinTestUtils { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.put(CommonConfigurationKeys.MODULE_NAME, moduleName); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = null; - try { - ps = new PrintStream(baos, true, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + PrintStream ps = new PrintStream(baos, true, StandardCharsets.UTF_8); configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, new PrintingMessageCollector(ps, MessageRenderer.PLAIN_FULL_PATHS, true)); configuration.put(JVMConfigurationKeys.OUTPUT_DIRECTORY, saveClassesDir); // configuration.put(JVMConfigurationKeys.RETAIN_OUTPUT_IN_MEMORY, true) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index ffe9ccfc007..dc2a699c2b1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -1,12 +1,13 @@ package org.openapitools.codegen.kotlin.spring; -import com.google.common.collect.testing.Helpers; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; import org.apache.commons.io.FileUtils; +import org.assertj.core.api.Assertions; +import org.jetbrains.annotations.NotNull; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.DefaultGenerator; @@ -82,7 +83,7 @@ public class KotlinSpringServerCodegenTest { } @Test - public void testNoRequestMappingAnnotation() throws IOException { + public void testNoRequestMappingAnnotation_spring_cloud_default() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); @@ -102,6 +103,74 @@ public class KotlinSpringServerCodegenTest { ); } + @Test + public void testNoRequestMappingAnnotationNone() throws IOException { + File output = generatePetstoreWithRequestMappingMode(KotlinSpringServerCodegen.RequestMappingMode.none); + + // Check that the @RequestMapping annotation is not generated in the Api file + assertFileNotContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApi.kt"), + "@RequestMapping(\"\\${" + ); + // Check that the @RequestMapping annotation is not generated in the ApiController file + assertFileNotContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"), + "@RequestMapping(\"\\${" + ); + } + + @Test + public void testNoRequestMappingAnnotationController() throws IOException { + File output = generatePetstoreWithRequestMappingMode(KotlinSpringServerCodegen.RequestMappingMode.controller); + + // Check that the @RequestMapping annotation is not generated in the Api file + assertFileNotContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApi.kt"), + "@RequestMapping(\"\\${" + ); + // Check that the @RequestMapping annotation is generated in the ApiController file + assertFileContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"), + "@RequestMapping(\"\\${" + ); + } + + @Test + public void testNoRequestMappingAnnotationApiInterface() throws IOException { + File output = generatePetstoreWithRequestMappingMode(KotlinSpringServerCodegen.RequestMappingMode.api_interface); + + // Check that the @RequestMapping annotation is generated in the Api file + assertFileContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApi.kt"), + "@RequestMapping(\"\\${" + ); + // Check that the @RequestMapping annotation is not generated in the ApiController file + assertFileNotContains( + Paths.get(output + "/src/main/kotlin/org/openapitools/api/PetApiController.kt"), + "@RequestMapping(\"\\${" + ); + } + + private static @NotNull File generatePetstoreWithRequestMappingMode(KotlinSpringServerCodegen.RequestMappingMode requestMappingMode) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(KotlinSpringServerCodegen.DELEGATE_PATTERN, true); + codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true); + codegen.additionalProperties().put(KotlinSpringServerCodegen.REQUEST_MAPPING_OPTION, requestMappingMode); + + new DefaultGenerator() + .opts( + new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore.yaml")) + .config(codegen) + ) + .generate(); + return output; + } + @Test public void testSettersForConfigValues() throws Exception { final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); @@ -115,6 +184,7 @@ public class KotlinSpringServerCodegenTest { codegen.setServiceImplementation(true); codegen.setUseBeanValidation(false); codegen.setReactive(false); + codegen.setSerializableModel(true); codegen.processOpts(); Assert.assertEquals(codegen.modelPackage(), "xx.yyyyyyyy.model"); @@ -137,6 +207,8 @@ public class KotlinSpringServerCodegenTest { Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.USE_BEANVALIDATION), false); Assert.assertFalse(codegen.isReactive()); Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.REACTIVE), false); + Assert.assertTrue(codegen.isSerializableModel()); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.SERIALIZABLE_MODEL), true); } @Test @@ -225,7 +297,7 @@ public class KotlinSpringServerCodegenTest { ) .generate(); - Helpers.assertContainsAllOf(files, + Assertions.assertThat(files).contains( new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"), @@ -250,7 +322,7 @@ public class KotlinSpringServerCodegenTest { ) .generate(); - Helpers.assertContainsAllOf(files, + Assertions.assertThat(files).contains( new File(output, "src/main/kotlin/org/openapitools/api/TestV1Api.kt"), new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"), new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"), @@ -290,6 +362,37 @@ public class KotlinSpringServerCodegenTest { "ApiUtil"); } + @Test + public void arrayItemsCanBeNullable() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/array-nullable-items.yaml", null, new ParseOptions()).getOpenAPI(); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + 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.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/ArrayWithNullableItemsModel.kt"), "List"); + } + + @Test public void doNotGenerateRequestParamForObjectQueryParam() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -678,4 +781,35 @@ public class KotlinSpringServerCodegenTest { "@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.core.io.Resource?"); } -} \ No newline at end of file + + @Test + public void generateSerializableModel() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + + ClientOptInput input = new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore.yaml")) + .config(codegen); + 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, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + assertFileContains( + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Pet.kt"), + "import java.io.Serializable", + ") : Serializable{", + "private const val serialVersionUID: kotlin.Long = 1" + ); + } +} 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 index 46c489b29a9..09f1dabd862 100644 --- 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 @@ -16,37 +16,26 @@ */ package org.openapitools.codegen.languages; +import org.testng.annotations.Test; + import java.util.List; -import org.junit.Assert; -import org.testng.annotations.Test; +import static org.assertj.core.api.Assertions.assertThat; // 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 { +public 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"))); + JavaHelidonCommonCodegen.VersionUtil test = JavaHelidonCommonCodegen.VersionUtil.instance(); + + @Test void checkMajorVersionMatch() { + assertThat(test.chooseVersion("1", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0"))) + .isEqualTo("1.2.3"); } - @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"))); + @Test void checkExactMatch() { + assertThat(test.chooseVersion("1.2.2", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0"))) + .isEqualTo("1.2.2"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegenTest.java new file mode 100644 index 00000000000..e4db32d175f --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegenTest.java @@ -0,0 +1,107 @@ +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.java.assertions.JavaFileAssert; +import org.testng.annotations.Test; + +import java.io.File; +import java.util.List; +import java.util.Map; + +import static org.openapitools.codegen.TestUtils.newTempFolder; + +public class JavaPKMSTServerCodegenTest { + + /** + * General XML annotations test (both JAXB and Jackson) + *
    + * Includes regression tests for: + * - Correct Jackson annotation when `wrapped: false` + */ + @Test public void shouldGenerateCorrectXmlAnnotations() { + // Arrange + final CodegenConfigurator config = new CodegenConfigurator() + .addAdditionalProperty(CodegenConstants.WITH_XML, true) + .addGlobalProperty(CodegenConstants.MODELS, "Pet") + .addGlobalProperty(CodegenConstants.MODEL_DOCS, null) + .addGlobalProperty(CodegenConstants.MODEL_TESTS, null) + .setGeneratorName("java-pkmst") + .setInputSpec("src/test/resources/3_0/java/xml-annotations-test.yaml") + .setOutputDir(newTempFolder().toString()); + + // Act + final List files = new DefaultGenerator().opts(config.toClientOptInput()).generate(); + + // Assert + JavaFileAssert.assertThat(files.get(0)) + .assertTypeAnnotations() + .containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\"")) + .containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD")) + .toType() + + // ↓ test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + .assertProperty("tags").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true")) + .toProperty().toType() + + // ↓ custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("friends").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toProperty().toType() + + // ↓ test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + .assertProperty("status").assertPropertyAnnotations() + .doesNotContainWithName("JacksonXmlElementWrapper") + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\"")) + .toProperty().toType() + + // ↓ test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays) + // maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("photoUrls").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true")) + .toProperty().toType() + + // ↓ test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute) + .assertProperty("name").assertPropertyAnnotations() + .doesNotContainWithName("JacksonXmlElementWrapper") + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\"")) + .toProperty().toType() + + // ↓ test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces) + .assertProperty("id").assertPropertyAnnotations() + .doesNotContainWithName("JacksonXmlElementWrapper") + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\"")) + .toProperty().toType() + + // ↓ external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("foods").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\"")) + .toProperty().toType() + + // ↓ internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("colors").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\"")) + .toProperty().toType() + + // ↓ ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + .assertProperty("categories").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\"")) + // ↓ specific regression test for #2417: (useWrapping=false) needs to be present + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false")) + .toProperty().toType() + + // ↓ test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names) + // maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays + .assertProperty("activities").assertPropertyAnnotations() + .containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\"")) + .containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\"")); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JetbrainsHttpClientClientCodegenOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JetbrainsHttpClientClientCodegenOptionsProvider.java index bcc397589cb..f5d7706402a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JetbrainsHttpClientClientCodegenOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/JetbrainsHttpClientClientCodegenOptionsProvider.java @@ -1,6 +1,5 @@ package org.openapitools.codegen.options; -import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.languages.JetbrainsHttpClientClientCodegen; import com.google.common.collect.ImmutableMap; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index 33e4d608b65..c9a5c4b2ae4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.languages.Swift5ClientCodegen; -import java.io.File; import java.util.Map; public class Swift5OptionsProvider implements OptionsProvider { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 2e034f0695f..2ffc324fc83 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -94,6 +94,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptAngularClientCodegen.QUERY_PARAM_OBJECT_FORMAT, QUERY_PARAM_OBJECT_FORMAT_VALUE) .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) + .put(TypeScriptAngularClientCodegen.USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, Boolean.FALSE.toString()) .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 b2f8f1e447b..2ac10fa6f32 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 @@ -85,6 +85,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .put(TypeScriptFetchClientCodegen.STRING_ENUMS, STRING_ENUMS) + .put(TypeScriptFetchClientCodegen.USE_SQUARE_BRACKETS_IN_ARRAY_NAMES, Boolean.FALSE.toString()) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/XojoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/XojoClientOptionsProvider.java index 05a6f60a434..a7f9a869765 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/XojoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/XojoClientOptionsProvider.java @@ -19,9 +19,7 @@ package org.openapitools.codegen.options; import com.google.common.collect.ImmutableMap; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.XojoClientCodegen; -import java.io.File; import java.util.Map; public class XojoClientOptionsProvider implements OptionsProvider { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java index f89f5f95ea1..a73cb73a76a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/AbstractPhpCodegenTest.java @@ -20,25 +20,40 @@ package org.openapitools.codegen.php; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; +import org.mockito.Answers; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractPhpCodegen; import org.openapitools.codegen.TestUtils; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.util.Arrays; import java.util.HashMap; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.withSettings; + public class AbstractPhpCodegenTest { + private AbstractPhpCodegen 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 = mock( + AbstractPhpCodegen.class, withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } + @Test public void testInitialConfigValues() throws Exception { - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -53,7 +68,6 @@ public class AbstractPhpCodegenTest { @Test public void testSettersForConfigValues() throws Exception { - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.setHideGenerationTimestamp(false); codegen.setModelPackage("My\\Client\\Model"); codegen.setApiPackage("My\\Client\\Api"); @@ -72,7 +86,6 @@ public class AbstractPhpCodegenTest { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "PHPmodel"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "PHPapi"); @@ -100,7 +113,6 @@ public class AbstractPhpCodegenTest { codegenOperation.hasProduces = true; codegenOperation.produces = Arrays.asList(all, applicationJson); - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.escapeMediaType(Arrays.asList(codegenOperation)); Assert.assertEquals(codegenOperation.produces.get(0).get("mediaType"), "*_/_*"); @@ -109,7 +121,6 @@ public class AbstractPhpCodegenTest { @Test(dataProvider = "composerNames", description = "Issue #9998") public void testGetComposerPackageName(String gitUserId, String gitRepoId, String result) { - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.processOpts(); codegen.setGitUserId(gitUserId); @@ -131,7 +142,6 @@ public class AbstractPhpCodegenTest { @Test(description = "Issue #8945") public void testArrayOfArrays() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_8945.yaml"); - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.setOpenAPI(openAPI); Schema test1 = openAPI.getComponents().getSchemas().get("MyResponse"); @@ -150,7 +160,6 @@ public class AbstractPhpCodegenTest { @Test(description = "Issue #10244") public void testEnumPropertyWithDefaultValue() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/php/issue_10244.yaml"); - final AbstractPhpCodegen codegen = new P_AbstractPhpCodegen(); codegen.setOpenAPI(openAPI); Schema test1 = openAPI.getComponents().getSchemas().get("ModelWithEnumPropertyHavingDefault"); @@ -167,21 +176,4 @@ public class AbstractPhpCodegenTest { CodegenProperty cp1 = cm1.vars.get(0); Assert.assertEquals(cp1.getDefaultValue(), "'VALUE'"); } - - private static class P_AbstractPhpCodegen extends AbstractPhpCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java index c90459e87c5..359bae82cfc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpLaravelServerCodegenTest.java @@ -24,33 +24,29 @@ import org.testng.annotations.Test; public class PhpLaravelServerCodegenTest { - @Test - public void testInitialConfigValues() throws Exception { + @Test public void testInitialConfigValues() throws Exception { final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + Assert.assertTrue(codegen.isHideGenerationTimestamp()); } - @Test - public void testSettersForConfigValues() throws Exception { + @Test public void testSettersForConfigValues() throws Exception { final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); codegen.setHideGenerationTimestamp(false); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); } - @Test - public void testAdditionalPropertiesPutForConfigValues() throws Exception { + @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { final PhpLaravelServerCodegen codegen = new PhpLaravelServerCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); } - } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/plantuml/PlantumlDocumentationCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/plantuml/PlantumlDocumentationCodegenTest.java index 6e96ae888d1..358948df3b7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/plantuml/PlantumlDocumentationCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/plantuml/PlantumlDocumentationCodegenTest.java @@ -7,7 +7,6 @@ import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.PlantumlDocumentationCodegen; import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java new file mode 100644 index 00000000000..458c9415ebe --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonFastapiCodegenTest.java @@ -0,0 +1,56 @@ +package org.openapitools.codegen.python; + +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.Test; +import org.openapitools.codegen.CodegenConstants; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +public class PythonFastapiCodegenTest { + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final String IMPL_PKG = "impl_package"; + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python-fastapi") + .setPackageName("nodesc") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")) + .setInputSpec("src/test/resources/3_1/nodesc.yaml") + .addAdditionalProperty(CodegenConstants.FASTAPI_IMPLEMENTATION_PACKAGE, IMPL_PKG); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output.getAbsolutePath(), "/src", IMPL_PKG, "__init__.py")); + } + + @Test + public void testEndpointSpecsWithoutDescription() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("python-fastapi") + .setPackageName("nodesc") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")) + .setInputSpec("src/test/resources/3_1/nodesc.yaml"); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileContains(Paths.get(output + "/src/nodesc/apis/nodesc_api.py"), + "return await BaseNodescApi.subclasses[0]().nodesc()\n"); + TestUtils.assertFileContains(Paths.get(output + "/src/nodesc/apis/desc_api.py"), + "return await BaseDescApi.subclasses[0]().desc()\n"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPydanticV1ClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPydanticV1ClientCodegenTest.java index 837c7ad3f7d..109112b9d99 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPydanticV1ClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPydanticV1ClientCodegenTest.java @@ -29,7 +29,7 @@ import org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen; 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.testng.Assert; import org.testng.annotations.Test; import java.io.File; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java index 2d54a75582a..07362649ff6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.ruby; -import com.google.common.collect.ImmutableMap; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java index 52e07fa5f17..bd4c1eda369 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java @@ -19,9 +19,6 @@ package org.openapitools.codegen.swift5; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.Swift5ClientCodegen; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/ConfigAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/ConfigAssert.java new file mode 100644 index 00000000000..f692876aa54 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/ConfigAssert.java @@ -0,0 +1,63 @@ +package org.openapitools.codegen.testutils; + +import com.samskivert.mustache.MustacheEvaluator; +import org.junit.jupiter.api.Assertions; + + +import java.util.Map; +import java.util.function.Supplier; + +/** + * Utility class to assert variable values in mustache. + * + * @See {@link org.openapitools.codegen.DefaultCodegen#useCodegenAsMustacheParentContext() useCodegenAsMustacheParentContext} + * + * The values come from additionalProperties or from codegen if useCodegenAsMustacheParentContext is called + */ +public class ConfigAssert { + + private final MustacheEvaluator evaluator; + + public ConfigAssert(Map additionalProperties) { + this.evaluator = MustacheEvaluator.create(additionalProperties); + } + + /** + * Evaluate a mustache variable. + * + * @param name mustache variable + * @return the value as seen by mustache as {{{name}}} + */ + public Object getValue(String name) { + return evaluator.getValue(name); + } + + /** + * Validate that property is correctly initialized for mustache. + * + * @param name mustache variable + * @param expectedValue value to match. + * + * @throws AssertionError in case of mismatch + */ + public void assertValue(String name, Object expectedValue) { + Object actual = getValue(name); + Assertions.assertEquals(expectedValue, actual, name + "not matching in mustache context"); + } + + /** + * Validate that property is correctly initialized for mustache and in java. + * + * @param name mustache variable + * @param getter value provider in java code (typically in DefaultCodegen or children of DefaultCodegen) + * @param expectedValue value to match. + * + * @throws AssertionError in case of mismatch + */ + public void assertValue(String name, Supplier getter, Object expectedValue) { + Object actual = getValue(name); + Object codeGenExpectedValue = getter.get(); + Assertions.assertEquals(codeGenExpectedValue, actual, "valueNotFound in codegen"); + Assertions.assertEquals(expectedValue, actual, name + "not matching in mustache context"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java index fdfd30230cb..404d36e086e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/testutils/IntegrationTestPathsConfig.java @@ -17,10 +17,12 @@ package org.openapitools.codegen.testutils; +import lombok.Getter; + import java.nio.file.Path; import java.nio.file.Paths; -public class IntegrationTestPathsConfig { +@Getter public class IntegrationTestPathsConfig { private static final Path INTEGRATION_TEST_PATH = Paths.get("target/test-classes/integrationtests").toAbsolutePath(); private final Path outputPath; private final Path specPath; @@ -38,19 +40,4 @@ public class IntegrationTestPathsConfig { ignoreFilePath = INTEGRATION_TEST_PATH.resolve(ignoreFileLocation); } - public Path getOutputPath() { - return outputPath; - } - - public Path getSpecPath() { - return specPath; - } - - public Path getExpectedPath() { - return expectedPath; - } - - public Path getIgnoreFilePath() { - return ignoreFilePath; - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java index 3b2169950de..26feb5589d0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/SharedTypeScriptTest.java @@ -7,11 +7,14 @@ import org.openapitools.codegen.Generator; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.TypeScriptAxiosClientCodegen; import org.testng.Assert; +import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.HashMap; @@ -21,27 +24,33 @@ import static org.openapitools.codegen.typescript.TypeScriptGroups.*; @Test(groups = {TYPESCRIPT}) public class SharedTypeScriptTest { + @Test public void typesInImportsAreSplitTest() throws IOException { + Path output = Files.createTempDirectory("test"); + output.toFile().deleteOnExit(); + CodegenConfigurator config = new CodegenConfigurator() .setInputSpec("src/test/resources/split-import.json") .setModelPackage("model") .setApiPackage("api") - .setOutputDir("src/test/resources/typesInImportsAreSplittedTest") + .setOutputDir(output.toString()) .addAdditionalProperty( TypeScriptAxiosClientCodegen.SEPARATE_MODELS_AND_API, true); config.setGeneratorName("typescript-axios"); - checkAPIFile(getGenerator(config).generate(), "default-api.ts"); + getGenerator(config).generate(); + final String apiFileContent = Files.readString(output.resolve("api/default-api.ts"), StandardCharsets.UTF_8); + Assert.assertFalse(apiFileContent.contains("import { GetCustomer200Response | PersonWrapper }")); + Assert.assertEquals(StringUtils.countMatches(apiFileContent,"import type { PersonWrapper }"),1); + Assert.assertEquals(StringUtils.countMatches(apiFileContent,"import type { GetCustomer200Response }"),1); config.setGeneratorName("typescript-node"); checkAPIFile(getGenerator(config).generate(), "defaultApi.ts"); config.setGeneratorName("typescript-angular"); checkAPIFile(getGenerator(config).generate(), "default.service.ts"); - - FileUtils.deleteDirectory(new File("src/test/resources/typesInImportsAreSplittedTest")); } private Generator getGenerator(CodegenConfigurator config) { @@ -51,19 +60,22 @@ public class SharedTypeScriptTest { private void checkAPIFile(List files, String apiFileName) throws IOException { File apiFile = files.stream().filter(file->file.getName().contains(apiFileName)).findFirst().get(); String apiFileContent = FileUtils.readFileToString(apiFile, StandardCharsets.UTF_8); - Assert.assertTrue(!apiFileContent.contains("import { GetCustomer200Response | PersonWrapper }")); + Assert.assertFalse(apiFileContent.contains("import { GetCustomer200Response | PersonWrapper }")); Assert.assertEquals(StringUtils.countMatches(apiFileContent,"import { PersonWrapper }"),1); Assert.assertEquals(StringUtils.countMatches(apiFileContent,"import { GetCustomer200Response }"),1); } @Test public void oldImportsStillPresentTest() throws IOException { + Path output = Files.createTempDirectory("test"); + output.toFile().deleteOnExit(); + CodegenConfigurator config = new CodegenConfigurator() .setInputSpec("petstore.json") .setModelPackage("model") .setApiPackage("api") - .setOutputDir("src/test/resources/oldImportsStillPresentTest/") + .setOutputDir(output.toString()) .addAdditionalProperty( TypeScriptAxiosClientCodegen.SEPARATE_MODELS_AND_API, true); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java index 319e2db9bf4..0c1cd296d18 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java @@ -15,7 +15,6 @@ import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; -import java.io.File; import java.util.Collections; import java.util.List; import java.util.Map; @@ -158,4 +157,15 @@ public class TypeScriptClientCodegenTest { Assert.fail("Exception was thrown."); } } + + @Test + public void arrayItemsCanBeNullable() throws Exception { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/array-nullable-items.yaml"); + final DefaultCodegen codegen = new TypeScriptClientCodegen(); + codegen.setOpenAPI(openAPI); + final ArraySchema schema = (ArraySchema) openAPI.getComponents().getSchemas().get("ArrayWithNullableItemsModel") + .getProperties() + .get("foo"); + Assert.assertEquals(codegen.getTypeDeclaration(schema), "Array"); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java index 8a229bf14ff..6e513a73b9e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java @@ -111,4 +111,23 @@ public class TypeScriptAxiosClientCodegenTest { assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); assertThat(codegen.supportingFiles()).doesNotContain(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json")); } + + @Test + public void testAppliesDefaultAxiosVersion() { + TypeScriptAxiosClientCodegen codegen = new TypeScriptAxiosClientCodegen(); + + codegen.processOpts(); + + assertEquals(codegen.additionalProperties().get("axiosVersion"), TypeScriptAxiosClientCodegen.DEFAULT_AXIOS_VERSION); + } + + @Test + public void testAppliesCustomAxiosVersion() { + TypeScriptAxiosClientCodegen codegen = new TypeScriptAxiosClientCodegen(); + codegen.additionalProperties().put("axiosVersion", "^1.2.3"); + + codegen.processOpts(); + + assertEquals(codegen.additionalProperties().get("axiosVersion"), "^1.2.3"); + } } 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 32e5e42e325..411d35827e3 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 @@ -9,12 +9,6 @@ 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; import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.openapitools.codegen.typescript.TypeScriptGroups; 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 0c2ad39f41f..a7a3e644f0b 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,7 +21,6 @@ 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; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java index 7101d441b2a..29d7b419f2e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/JsonCacheTest.java @@ -32,7 +32,6 @@ import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.BigInteger; import java.nio.charset.StandardCharsets; @@ -205,7 +204,7 @@ public class JsonCacheTest { private JsonCache.Root root; private JsonCache cache; - private void reload() throws CacheException, UnsupportedEncodingException { + private void reload() throws CacheException { root.unload(); root.load(new ByteArrayInputStream(JSON.getBytes(StandardCharsets.UTF_8))); } 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 187e22f55cc..067bd3b1dcd 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 @@ -399,26 +399,28 @@ public class ModelUtilsTest { .name("test-schema") .minimum(new BigDecimal(100)); - Schema deepCopy = ModelUtils.cloneSchema(schema); + Schema deepCopy = ModelUtils.cloneSchema(schema, false); - Assert.assertEquals(schema, deepCopy); + Assert.assertEquals(deepCopy, schema); + Assert.assertNotSame(deepCopy, schema); } @Test public void testCloneCustomSchema() { - Schema schema = new Schema().type("money"); + Schema schema = new ObjectSchema().type("money"); - Schema deepCopy = ModelUtils.cloneSchema(schema); + Schema deepCopy = ModelUtils.cloneSchema(schema, false); - Assert.assertEquals(schema, deepCopy); + Assert.assertEquals(deepCopy, schema); + Assert.assertNotSame(deepCopy, schema); } @Test public void testCloneComposedSchema() { - Schema base1 = new Schema() + Schema base1 = new ObjectSchema() .name("Base1") .addProperty("foo", new StringSchema()); - Schema base2 = new Schema() + Schema base2 = new ObjectSchema() .name("Base2") .addProperty("bar", new StringSchema()); Schema composedSchema = new ComposedSchema() @@ -426,24 +428,37 @@ public class ModelUtilsTest { .allOf(List.of(base1, base2)) .addProperty("baz", new StringSchema()); - var deepCopy = ModelUtils.cloneSchema(composedSchema); + Schema deepCopy = ModelUtils.cloneSchema(composedSchema, false); - Assert.assertEquals(composedSchema, deepCopy); + Assert.assertEquals(deepCopy, composedSchema); + Assert.assertNotSame(deepCopy, composedSchema); } @Test public void testCloneArrayOfEnumsSchema() { - Schema arraySchema = new Schema() + Schema schema = new ArraySchema() .name("ArrayType") .type("array") - .items(new Schema() + .items(new StringSchema() .type("string") ._enum(List.of("SUCCESS", "FAILURE", "SKIPPED")) ) ._default(List.of("SUCCESS", "FAILURE")); - var deepCopy = ModelUtils.cloneSchema(arraySchema); + Schema deepCopy = ModelUtils.cloneSchema(schema, false); - Assert.assertEquals(arraySchema, deepCopy); + Assert.assertEquals(deepCopy, schema); + Assert.assertNotSame(deepCopy, schema); + } + + @Test + public void testCloneDateTimeSchemaWithExample() { + Schema schema = new DateTimeSchema() + .example("2020-02-02T20:20:20.000222Z"); + + Schema deepCopy = ModelUtils.cloneSchema(schema, false); + + Assert.assertEquals(deepCopy, schema); + Assert.assertNotSame(deepCopy, schema); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java index 5e2c3729a6d..40920f1fd54 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OnceLoggerTest.java @@ -20,6 +20,8 @@ import static org.testng.Assert.*; @SuppressWarnings({"SameParameterValue", "UnstableApiUsage"}) public class OnceLoggerTest { private Logger mockLogger = Mockito.mock(Logger.class); + + // TODO if we find a replacement for FakeTicker, we can drop the guava-testlib dependency altogether private FakeTicker ticker = new FakeTicker(); @BeforeTest diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/ModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/ModelTest.java index 18c8cff0791..32f1a317d68 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/ModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/ModelTest.java @@ -5,7 +5,6 @@ import org.openapitools.codegen.languages.XojoClientCodegen; import io.swagger.models.*; import io.swagger.models.properties.*; -import org.testng.Assert; import org.testng.annotations.Test; @SuppressWarnings("static-method") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/OptionsTest.java index 3cd79d3ba60..e620e9ff616 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/xojo/client/OptionsTest.java @@ -3,7 +3,6 @@ package org.openapitools.codegen.xojo.client; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.XojoClientCodegen; -import org.openapitools.codegen.options.OptionsProvider; import org.openapitools.codegen.options.XojoClientOptionsProvider; import static org.mockito.Mockito.mock; diff --git a/modules/openapi-generator/src/test/resources/2_0/java/issue-6496.yaml b/modules/openapi-generator/src/test/resources/2_0/java/issue-6496.yaml new file mode 100644 index 00000000000..17ddfae0456 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/java/issue-6496.yaml @@ -0,0 +1,88 @@ +swagger: '2.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' +basePath: /v2 +schemes: + - http +paths: + /: + get: + operationId: addPet + responses: + '200': + description: successful operation +definitions: + FormatTest: + 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 + 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 + BigDecimal: + type: string + format: number + enumContainer: + type: array + uniqueItems: true + items: + enum: + - placed + - approved + - delivered diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache index c0e71ee8d00..03d6b0f6b6f 100644 --- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/build.gradle.mustache @@ -109,8 +109,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.1" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache index f8d3b607e7e..b8bcc813552 100644 --- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache @@ -373,8 +373,8 @@ UTF-8 1.6.1 2.30.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.1 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/test/resources/3_0/array-nullable-items.yaml b/modules/openapi-generator/src/test/resources/3_0/array-nullable-items.yaml new file mode 100644 index 00000000000..13c307292ca --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/array-nullable-items.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: 'Array nullable items' + version: latest +paths: + '/': + get: + operationId: operation + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayWithNullableItemsModel' +components: + schemas: + ArrayWithNullableItemsModel: + required: + - foo + properties: + foo: + type: array + items: + type: string + nullable: true diff --git a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml index 20e8b70c421..065598b9f74 100644 --- a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml @@ -594,6 +594,20 @@ paths: responses: default: description: successful operation + /fake/nullable_example_test: + get: + tags: + - fake + summary: Fake endpoint to test nullable example (object) + description: '' + operationId: fake_nullable_example_test + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/TestNullable' externalDocs: description: Find out more about Swagger url: 'http://swagger.io' @@ -637,6 +651,14 @@ components: enum: - A - B + TestNullable: + type: object + properties: + name: + type: string + nullableName: + type: string + nullable: true Order: title: Pet Order description: An order for a pets from the pet store 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 index 64ca7deaaf8..28dc856f83e 100644 --- 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 @@ -569,6 +569,27 @@ paths: description: User not found security: - api_key: [] + /user_or_pet: + post: + tags: + - user_or_pet + summary: Create user or pet + description: This can only be done by the logged in user or pet. + operationId: createUserOrPet + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + description: Created user or pet object + required: true externalDocs: description: Find out more about Swagger url: 'http://swagger.io' 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 21570bfa9ac..6809791b5e4 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 @@ -1250,6 +1250,32 @@ paths: application/json: schema: $ref: '#/components/schemas/ArrayOfEnums' + /fake/mixed/anyOf: + get: + tags: + - fake + summary: Test mixed type anyOf deserialization + operationId: getMixedAnyOf + responses: + 200: + description: Got mixed anyOf + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + /fake/mixed/oneOf: + get: + tags: + - fake + summary: Test mixed type oneOf deserialization + operationId: getMixedOneOf + responses: + 200: + description: Got mixed oneOf + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' /country: post: operationId: getCountry @@ -2753,6 +2779,41 @@ components: type: array items: $ref: '#/components/schemas/Custom-Variableobject-Response' + MixedOneOf: + properties: + content: + oneOf: + - type: string + - type: boolean + # JsonReader will give back C# System.Int64 regardless of format. + - type: integer + format: uint8 + # JsonReader will give back C# System.Double regardless of format. + - type: number + format: float32 + - type: object + $ref: '#/components/schemas/MixedSubId' + description: Mixed oneOf types for testing + MixedAnyOf: + properties: + content: + anyOf: + - type: string + - type: boolean + # JsonReader will give back C# System.Int64 regardless of format. + - type: integer + format: uint8 + # JsonReader will give back C# System.Double regardless of format. + - type: number + format: float32 + - type: object + $ref: '#/components/schemas/MixedSubId' + + description: Mixed anyOf types for testing + MixedSubId: + properties: + id: + type: string # this class ensures that the CodegenProperties are sorted correctly # https://github.com/OpenAPITools/openapi-generator/issues/18607 MixLog: diff --git a/modules/openapi-generator/src/test/resources/3_0/enum-description.yaml b/modules/openapi-generator/src/test/resources/3_0/enum-description.yaml new file mode 100644 index 00000000000..8f69c9898c1 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/enum-description.yaml @@ -0,0 +1,36 @@ +openapi: 3.0.0 +info: + title: Sample API + description: API description in Markdown. + version: 1.0.0 +paths: + /ponies: + get: + summary: Returns all animals. + description: Optional extended description in Markdown. + responses: + 200: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pony' +components: + schemas: + Pony: + type: object + properties: + type: + $ref: '#/components/schemas/Type' + Type: + type: string + enum: + - Earth + - Pegasi + - Mercury + x-enum-descriptions: + - The planet we all live on + - Pegasi b is a gas giant exoplanet that orbits a G-type star + - Mercury is the first planet from the Sun and the smallest in the Solar System diff --git a/modules/openapi-generator/src/test/resources/3_0/go/oneof-with-pattern-discriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/go/oneof-with-pattern-discriminator.yaml new file mode 100644 index 00000000000..64c8c0b2938 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go/oneof-with-pattern-discriminator.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.0 +info: + title: Test + version: 1.0.0 +paths: {} +components: + schemas: + rtmp_source: + required: + - url + properties: + url: + type: string + pattern: "^rtmp://.+$" + hls_source: + required: + - url + properties: + url: + type: string + description: this pattern is more complicated and requires escaping + pattern: "^hls://.+$|^http.*\\.m3u8$" + source: + oneOf: + - $ref: '#/components/schemas/rtmp_source' + - $ref: '#/components/schemas/hls_source' diff --git a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 9ed104ab283..3f1e3e9c67a 100644 --- a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1268,6 +1268,29 @@ paths: responses: 200: description: OK + /fake/wrapped-integer-ref: + post: + operationId: someOpsRequiringRefInt + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - ids + properties: + MyIDs: + type: array + items: + $ref: '#/components/schemas/IDsWrapper/properties/id' + responses: + '200': + description: success + content: + application/json: + schema: + type: object servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -2125,6 +2148,12 @@ components: type: array items: type: string + AnyOfPrimitiveType: + anyOf: + - $ref: '#/components/schemas/OneOfPrimitiveTypeChild' + - type: integer + format: int32 + - $ref: '#/components/schemas/OneOfArrayOfString' # `dup-prop` is defined in both parent and child models # but not identical: optional vs required DuplicatedPropChild: @@ -2185,3 +2214,8 @@ components: type: object - type: object - type: "null" + IDsWrapper: + type: object + properties: + id: + type: integer diff --git a/modules/openapi-generator/src/test/resources/3_0/issue18345.yaml b/modules/openapi-generator/src/test/resources/3_0/issue18345.yaml new file mode 100644 index 00000000000..d74ca5f3b0d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue18345.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.3 +info: + title: Issue 18345 + description: '' + version: 1.0.0 +paths: + /dummy: + post: + description: '' + operationId: uploadFile + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: successful operation diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_15077.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_15077.yaml new file mode 100644 index 00000000000..2c227604eca --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_15077.yaml @@ -0,0 +1,53 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Property refs using allOf +paths: + /limits: + get: + operationId: getLimits + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Limits' +components: + schemas: + NumberRange: + type: object + properties: + min: + type: number + max: + type: number + required: + - min + - max + Limits: + type: object + properties: + allOfRef: + allOf: + - $ref: '#/components/schemas/NumberRange' + allOfRefWithDescription: + description: | + Description for this property + allOf: + - $ref: '#/components/schemas/NumberRange' + allOfRefWithReadonly: + readOnly: true + allOf: + - $ref: '#/components/schemas/NumberRange' + allOfRefWithDescriptionAndReadonly: + description: | + Description for this readonly property + readOnly: true + allOf: + - $ref: '#/components/schemas/NumberRange' + required: + - allOfRef + - allOfRefWithDescription + - allOfRefWithReadonly + - allOfRefWithDescriptionAndReadonly \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml new file mode 100644 index 00000000000..5a95b543718 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml @@ -0,0 +1,45 @@ +openapi: '3.0.1' +info: + version: 1.0.0 + title: MultipartFile test +paths: + /multipart-mixed: + post: + tags: + - multipart + description: Mixed MultipartFile test + operationId: multipartMixed + requestBody: + content: + multipart/form-data: + schema: + type: object + required: + - status + - file + properties: + status: + $ref: '#/components/schemas/MultipartMixedStatus' + marker: + description: "additional object" + type: object + properties: + name: + type: string + file: + description: "a file" + type: string + format: binary + responses: + '204': + description: Successful operation +components: + schemas: + MultipartMixedStatus: + description: "additional field as Enum" + type: string + enum: + - ALLOWED + - IN_PROGRESS + - REJECTED + example: REJECTED \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_18224.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_18224.yaml new file mode 100644 index 00000000000..9dd78620e0b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_18224.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.3 +info: + title: sample spec + version: 1.0.0 +paths: + /test/{groupObj}: + post: + summary: Post to test + description: '' + operationId: postToTest + parameters: + - $ref: '#/components/parameters/groupObj' + - $ref: '#/components/parameters/token' + - $ref: '#/components/parameters/clientId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjTest' + responses: + 201: + description: success +components: + parameters: + groupObj: + in: path + name: groupObj + required: true + schema: + type: string + pattern: "[a-zA-Z]" + x-pattern-message: "Only letters" + x-field-extra-annotation: '@com.test.MyAnnotationInPath' + token: + in: query + name: token + required: true + schema: + type: string + pattern: "[0-9a-fA-F]" + x-pattern-message: "Only numbers and letters a-f" + x-field-extra-annotation: '@com.test.MyAnnotationInQuery' + clientId: + in: header + name: clientId + required: true + schema: + type: string + pattern: "\\d" + x-pattern-message: "Only numbers" + x-field-extra-annotation: '@com.test.MyAnnotationInHeader' + schemas: + ObjTest: + description: A model to return + type: object + properties: + field1: + type: integer + format: int64 + field2: + type: string + pattern: "\\w" + x-pattern-message: "Only letters, numbers and underscore" + field3: + type: string + pattern: "\\w" diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_18959.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_18959.yaml new file mode 100644 index 00000000000..97905a4bbdd --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_18959.yaml @@ -0,0 +1,63 @@ +openapi: 3.0.3 +info: + title: sample spec + version: 1.0.0 +paths: + /test/{groupObj}: + post: + summary: Post to test + description: '' + operationId: postToTest + parameters: + - $ref: '#/components/parameters/groupObj' + - $ref: '#/components/parameters/token' + - $ref: '#/components/parameters/clientId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ObjTest' + responses: + 201: + description: success +components: + parameters: + groupObj: + in: path + name: groupObj + required: true + schema: + type: string + pattern: "[a-zA-Z]" + x-pattern-message: "Only letters" + token: + in: query + name: token + required: true + schema: + type: string + pattern: "[0-9a-fA-F]" + x-pattern-message: "Only numbers and letters a-f" + clientId: + in: header + name: clientId + required: true + schema: + type: string + pattern: "\\d" + x-pattern-message: "Only numbers" + schemas: + ObjTest: + description: A model to return + type: object + properties: + field1: + type: integer + format: int64 + field2: + type: string + pattern: "\\w" + x-pattern-message: "Only letters, numbers and underscore" + field3: + type: string + pattern: "\\w" diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_6726.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_6726.yaml new file mode 100644 index 00000000000..68304012d53 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_6726.yaml @@ -0,0 +1,10555 @@ +openapi: 3.0.0 +info: + title: PeerTube + version: 6.1.0 + contact: + name: PeerTube Community + url: https://joinpeertube.org + license: + name: AGPLv3.0 + url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE + x-logo: + url: https://joinpeertube.org/img/brand.png + altText: PeerTube Project Homepage + description: | + The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite + HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with + [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) + which generates a client SDK in the language of your choice - we generate some client SDKs automatically: + + - [Python](https://framagit.org/framasoft/peertube/clients/python) + - [Go](https://framagit.org/framasoft/peertube/clients/go) + - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) + + See the [REST API quick start](https://docs.joinpeertube.org/api/rest-getting-started) for a few + examples of using the PeerTube API. + + # Authentication + + When you sign up for an account on a PeerTube instance, you are given the possibility + to generate sessions on it, and authenticate there using an access token. Only __one + access token can currently be used at a time__. + + ## Roles + + Accounts are given permissions based on their role. There are three roles on + PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin/managing-users#roles) for a detail of their permissions. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body. + + ``` + HTTP 1.1 404 Not Found + Content-Type: application/problem+json; charset=utf-8 + + { + "detail": "Video not found", + "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", + "status": 404, + "title": "Not Found", + "type": "about:blank" + } + ``` + + We provide error `type` values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/packages/models/src/server/core-error-code.enum.ts), + but it is still optional. Types are used to disambiguate errors that bear the same status code + and are non-obvious: + + ``` + HTTP 1.1 403 Forbidden + Content-Type: application/problem+json; charset=utf-8 + + { + "detail": "Cannot get this video regarding follow constraints", + "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", + "status": 403, + "title": "Forbidden", + "type": "https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints" + } + ``` + + Here a 403 error could otherwise mean that the video is private or blocklisted. + + ### Validation errors + + Each parameter is evaluated on its own against a set of rules before the route validator + proceeds with potential testing involving parameter combinations. Errors coming from validation + errors appear earlier and benefit from a more detailed error description: + + ``` + HTTP 1.1 400 Bad Request + Content-Type: application/problem+json; charset=utf-8 + + { + "detail": "Incorrect request parameters: id", + "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo", + "instance": "/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180", + "invalid-params": { + "id": { + "location": "params", + "msg": "Invalid value", + "param": "id", + "value": "9c9de5e8-0a1e-484a-b099-e80766180" + } + }, + "status": 400, + "title": "Bad Request", + "type": "about:blank" + } + ``` + + Where `id` is the name of the field concerned by the error, within the route definition. + `invalid-params..location` can be either 'params', 'body', 'header', 'query' or 'cookies', and + `invalid-params..value` reports the value that didn't pass validation whose `invalid-params..msg` + is about. + + ### Deprecated error fields + + Some fields could be included with previous versions. They are still included but their use is deprecated: + - `error`: superseded by `detail` + - `code`: superseded by `type` (which is now an URI) + + # Rate limits + + We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators: + + | Endpoint (prefix: `/api/v1`) | Calls | Time frame | + |------------------------------|---------------|--------------| + | `/*` | 50 | 10 seconds | + | `POST /users/token` | 15 | 5 minutes | + | `POST /users/register` | 2* | 5 minutes | + | `POST /users/ask-send-verify-email` | 3 | 5 minutes | + + Depending on the endpoint, *failed requests are not taken into account. A service + limit is announced by a `429 Too Many Requests` status code. + + You can get details about the current state of your rate limit by reading the + following headers: + + | Header | Description | + |-------------------------|------------------------------------------------------------| + | `X-RateLimit-Limit` | Number of max requests allowed in the current time period | + | `X-RateLimit-Remaining` | Number of remaining requests in the current time period | + | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp | + | `Retry-After` | Seconds to delay after the first `429` is received | + + # CORS + + This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/), + allowing cross-domain communication from the browser for some routes: + + | Endpoint | + |------------------------- ---| + | `/api/*` | + | `/download/*` | + | `/lazy-static/*` | + | `/.well-known/webfinger` | + + In addition, all routes serving ActivityPub are CORS-enabled for all origins. +externalDocs: + url: https://docs.joinpeertube.org/api-rest-reference.html +tags: + - name: Register + description: | + As a visitor, you can use this API to open an account (if registrations are open on + that PeerTube instance). As an admin, you should use the dedicated [User creation + API](#operation/addUser) instead. + - name: Session + x-displayName: Login/Logout + description: | + Sessions deal with access tokens over time. Only __one session token can currently be used at a time__. + - name: Accounts + description: > + Accounts encompass remote accounts discovered across the federation, + and correspond to the main Actor, along with video channels a user can create, which + are also Actors. + + When a comment is posted, it is done with your Account's Actor. + - name: Users + description: > + Using some features of PeerTube require authentication, for which User + provide different levels of permission as well as associated user + information. Each user has a corresponding local Account for federation. + - name: User Exports + description: > + To create an archive of user data. + - name: User Imports + description: > + To import an archive of user data. + - name: My User + description: > + Operations related to your own User, when logged-in. + - name: My Subscriptions + description: > + Operations related to your subscriptions to video channels, their + new videos, and how to keep up to date with their latest publications! + - name: My History + description: > + Operations related to your watch history. + - name: My Notifications + description: > + Notifications following new videos, follows or reports. They allow you + to keep track of the interactions and overall important information that + concerns you. You MAY set per-notification type delivery preference, to + receive the info either by mail, by in-browser notification or both. + - name: Config + description: > + Each server exposes public information regarding supported videos and + options. + - name: Job + description: > + Jobs are long-running tasks enqueued and processed by the instance + itself. No additional worker registration is currently available. + - name: Instance Follows + description: > + Managing servers which the instance interacts with is crucial to the + concept of federation in PeerTube and external video indexation. The PeerTube + server then deals with inter-server ActivityPub operations and propagates + information across its social graph by posting activities to actors' inbox + endpoints. + externalDocs: + url: https://docs.joinpeertube.org/admin/following-instances#instances-follows + - name: Instance Redundancy + description: > + Redundancy is part of the inter-server solidarity that PeerTube fosters. + Manage the list of instances you wish to help by seeding their videos according + to the policy of video selection of your choice. Note that you have a similar functionality + to mirror individual videos, see [video mirroring](#tag/Video-Mirroring). + externalDocs: + url: https://docs.joinpeertube.org/admin/following-instances#instances-redundancy + - name: Plugins + description: > + Managing plugins installed from a local path or from NPM, or search for new ones. + externalDocs: + url: https://docs.joinpeertube.org/api/plugins + - name: Abuses + description: | + Abuses deal with reports of local or remote videos/comments/accounts alike. + - name: Video + description: | + Operations dealing with listing, uploading, fetching or modifying videos. + - name: Video Upload + description: | + Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes. + + ### Upload + + - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request + - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks + + You can upload videos more reliably by using the resumable variant. Its protocol lets + you resume an upload operation after a network interruption or other transmission failure, + saving time and bandwidth in the event of network failures. + + Favor using resumable uploads in any of the following cases: + - You are transferring large files + - The likelihood of a network interruption is high + - Uploads are originating from a device with a low-bandwidth or unstable Internet connection, + such as a mobile device + + ### Import + + - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/) + - _magnet_-based: where the URI resolves to a BitTorrent resource containing a single supported video file + - _torrent_-based: where the metainfo file resolves to a BitTorrent resource containing a single supported video file + + The import function is practical when the desired video/audio is available online. It makes PeerTube + download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have. + - name: Video Imports + description: Operations dealing with listing, adding and removing video imports. + - name: Channels Sync + description: Operations dealing with synchronizing PeerTube user's channel with channels of other platforms + - name: Video Captions + description: Operations dealing with listing, adding and removing closed captions of a video. + - name: Video Chapters + description: Operations dealing with managing chapters of a video. + - name: Video Channels + description: Operations dealing with the creation, modification and listing of videos within a channel. + - name: Video Comments + description: > + Operations dealing with comments to a video. Comments are organized in threads: adding a + comment in response to the video starts a thread, adding a reply to a comment adds it to + its root comment thread. + - name: Video Blocks + description: Operations dealing with blocking videos (removing them from view and preventing interactions). + - name: Video Rates + description: Like/dislike a video. + - name: Video Playlists + description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels. + - name: Video Files + description: Operations on video files + - name: Video Transcoding + description: Video transcoding related operations + - name: Video Stats + description: Video statistics + - name: Video Feeds + description: Server syndication feeds of videos + - name: Search + description: | + The search helps to find _videos_ or _channels_ from within the instance and beyond. + Videos from other instances federated by the instance (that is, instances + followed by the instance) can be found via keywords and other criteria of + the advanced search. + + Administrators can also enable the use of a remote search system, indexing + videos and channels not could be not federated by the instance. + - name: Homepage + description: Get and update the custom homepage + - name: Video Mirroring + description: | + PeerTube instances can mirror videos from one another, and help distribute some videos. + + For importing videos as your own, refer to [video imports](#operation/importVideo). + - name: Stats + description: | + Statistics + - name: Runner Registration Token + description: | + Manage runner registration token + - name: Video Passwords + description: Operation on video passwords + +x-tagGroups: + - name: Static endpoints + tags: + - Static Video Files + - name: Feeds + tags: + - Video Feeds + - name: Auth + tags: + - Register + - Session + - name: Accounts + tags: + - Accounts + - Users + - User Exports + - User Imports + - My User + - My Subscriptions + - My Notifications + - My History + - name: Videos + tags: + - Video + - Video Upload + - Video Imports + - Video Captions + - Video Chapters + - Video Channels + - Video Comments + - Video Rates + - Video Playlists + - Video Stats + - Video Ownership Change + - Video Mirroring + - Video Files + - Video Transcoding + - Live Videos + - Channels Sync + - Video Passwords + - name: Search + tags: + - Search + - name: Moderation + tags: + - Abuses + - Video Blocks + - Account Blocks + - Server Blocks + - name: Instance + tags: + - Config + - Homepage + - Instance Follows + - Instance Redundancy + - Plugins + - Stats + - Logs + - Job + - name: Remote Jobs + tags: + - Runner Registration Token + - Runner Jobs + - Runners + +paths: + '/static/web-videos/{filename}': + get: + tags: + - Static Video Files + summary: Get public Web Video file + description: "**PeerTube >= 6.0**" + parameters: + - $ref: '#/components/parameters/staticFilename' + responses: + '200': + description: successful operation + '404': + description: not found + '/static/web-videos/private/{filename}': + get: + tags: + - Static Video Files + summary: Get private Web Video file + description: "**PeerTube >= 6.0**" + parameters: + - $ref: '#/components/parameters/staticFilename' + - $ref: '#/components/parameters/videoFileToken' + security: + - OAuth2: [] + responses: + '200': + description: successful operation + '403': + description: invalid auth + '404': + description: not found + + '/static/streaming-playlists/hls/{filename}': + get: + tags: + - Static Video Files + summary: Get public HLS video file + parameters: + - $ref: '#/components/parameters/staticFilename' + security: + - OAuth2: [] + responses: + '200': + description: successful operation + '403': + description: invalid auth + '404': + description: not found + '/static/streaming-playlists/hls/private/{filename}': + get: + tags: + - Static Video Files + summary: Get private HLS video file + parameters: + - $ref: '#/components/parameters/staticFilename' + - $ref: '#/components/parameters/videoFileToken' + - $ref: '#/components/parameters/reinjectVideoFileToken' + security: + - OAuth2: [] + responses: + '200': + description: successful operation + '403': + description: invalid auth + '404': + description: not found + + + '/feeds/video-comments.{format}': + get: + tags: + - Video Feeds + summary: Comments on videos feeds + operationId: getSyndicatedComments + parameters: + - name: format + in: path + required: true + description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' + schema: + type: string + enum: + - xml + - rss + - rss2 + - atom + - atom1 + - json + - json1 + - name: videoId + in: query + description: 'limit listing to a specific video' + schema: + type: string + - name: accountId + in: query + description: 'limit listing to a specific account' + schema: + type: string + - name: accountName + in: query + description: 'limit listing to a specific account' + schema: + type: string + - name: videoChannelId + in: query + description: 'limit listing to a specific video channel' + schema: + type: string + - name: videoChannelName + in: query + description: 'limit listing to a specific video channel' + schema: + type: string + responses: + '200': + description: successful operation + headers: + Cache-Control: + schema: + type: string + default: 'max-age=900' # 15 min cache + content: + application/xml: + schema: + $ref: '#/components/schemas/VideoCommentsForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local + application/rss+xml: + schema: + $ref: '#/components/schemas/VideoCommentsForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local + text/xml: + schema: + $ref: '#/components/schemas/VideoCommentsForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local + application/atom+xml: + schema: + $ref: '#/components/schemas/VideoCommentsForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local + application/json: + schema: + type: object + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local + '400': + x-summary: field inconsistencies + description: > + Arises when: + - videoId filter is mixed with a channel filter + '404': + description: video, video channel or account not found + '406': + description: accept header unsupported + + '/feeds/videos.{format}': + get: + tags: + - Video Feeds + summary: Common videos feeds + operationId: getSyndicatedVideos + parameters: + - name: format + in: path + required: true + description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' + schema: + type: string + enum: + - xml + - rss + - rss2 + - atom + - atom1 + - json + - json1 + - name: accountId + in: query + description: 'limit listing to a specific account' + schema: + type: string + - name: accountName + in: query + description: 'limit listing to a specific account' + schema: + type: string + - name: videoChannelId + in: query + description: 'limit listing to a specific video channel' + schema: + type: string + - name: videoChannelName + in: query + description: 'limit listing to a specific video channel' + schema: + type: string + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + responses: + '200': + description: successful operation + headers: + Cache-Control: + schema: + type: string + default: 'max-age=900' # 15 min cache + content: + application/xml: + schema: + $ref: '#/components/schemas/VideosForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local + application/rss+xml: + schema: + $ref: '#/components/schemas/VideosForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local + text/xml: + schema: + $ref: '#/components/schemas/VideosForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local + application/atom+xml: + schema: + $ref: '#/components/schemas/VideosForXML' + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local + application/json: + schema: + type: object + examples: + nightly: + externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local + '404': + description: video channel or account not found + '406': + description: accept header unsupported + + '/feeds/subscriptions.{format}': + get: + tags: + - Video Feeds + summary: Videos of subscriptions feeds + operationId: getSyndicatedSubscriptionVideos + parameters: + - name: format + in: path + required: true + description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' + schema: + type: string + enum: + - xml + - rss + - rss2 + - atom + - atom1 + - json + - json1 + - name: accountId + in: query + description: limit listing to a specific account + schema: + type: string + required: true + - name: token + in: query + description: private token allowing access + schema: + type: string + required: true + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + responses: + '200': + description: successful operation + headers: + Cache-Control: + schema: + type: string + default: 'max-age=900' # 15 min cache + content: + application/xml: + schema: + $ref: '#/components/schemas/VideosForXML' + application/rss+xml: + schema: + $ref: '#/components/schemas/VideosForXML' + text/xml: + schema: + $ref: '#/components/schemas/VideosForXML' + application/atom+xml: + schema: + $ref: '#/components/schemas/VideosForXML' + application/json: + schema: + type: object + '406': + description: accept header unsupported + + '/feeds/podcast/videos.xml': + get: + tags: + - Video Feeds + summary: Videos podcast feed + operationId: getVideosPodcastFeed + parameters: + - name: videoChannelId + in: query + description: 'Limit listing to a specific video channel' + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Cache-Control: + schema: + type: string + default: 'max-age=900' # 15 min cache + '404': + description: video channel not found + + '/api/v1/accounts/{name}': + get: + tags: + - Accounts + summary: Get an account + operationId: getAccount + parameters: + - $ref: '#/components/parameters/name' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + '404': + description: account not found + + '/api/v1/accounts/{name}/videos': + get: + tags: + - Accounts + - Video + summary: 'List videos of an account' + operationId: getAccountVideos + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/categoryOneOf' + - $ref: '#/components/parameters/isLive' + - $ref: '#/components/parameters/tagsOneOf' + - $ref: '#/components/parameters/tagsAllOf' + - $ref: '#/components/parameters/licenceOneOf' + - $ref: '#/components/parameters/languageOneOf' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + - $ref: '#/components/parameters/skipCount' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + x-codeSamples: + - lang: JavaScript + source: | + fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') + .then(function(response) { + return response.json() + }).then(function(data) { + console.log(data) + }) + - lang: Shell + source: | + ## DEPENDENCIES: jq + curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq + - lang: Ruby + source: | + require 'net/http' + require 'json' + + uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos") + + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = true + + response = http.get(uri.request_uri) + + puts JSON.parse(response.read_body) + - lang: Python + source: | + import requests + + r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos") + json = r.json() + + print(json) + + '/api/v1/accounts/{name}/followers': + get: + tags: + - Accounts + summary: 'List followers of an account' + security: + - OAuth2: [] + operationId: getAccountFollowers + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/followersSort' + - $ref: '#/components/parameters/search' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Follow' + + /api/v1/accounts: + get: + tags: + - Accounts + summary: List accounts + operationId: getAccounts + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + 'application/json': + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Account' + + /api/v1/config: + get: + tags: + - Config + summary: Get instance public configuration + operationId: getConfig + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ServerConfig' + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/config + + /api/v1/config/about: + get: + summary: Get instance "About" information + operationId: getAbout + tags: + - Config + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ServerConfigAbout' + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/config/about + + /api/v1/config/custom: + get: + summary: Get instance runtime configuration + operationId: getCustomConfig + tags: + - Config + security: + - OAuth2: + - admin + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ServerConfigCustom' + put: + summary: Set instance runtime configuration + operationId: putCustomConfig + tags: + - Config + security: + - OAuth2: + - admin + responses: + '200': + description: successful operation + '400': + x-summary: field inconsistencies + description: > + Arises when: + - the emailer is disabled and the instance is open to registrations + - web videos and hls are disabled with transcoding enabled - you need at least one enabled + delete: + summary: Delete instance runtime configuration + operationId: delCustomConfig + tags: + - Config + security: + - OAuth2: + - admin + responses: + '200': + description: successful operation + + /api/v1/config/instance-banner/pick: + post: + summary: Update instance banner + security: + - OAuth2: + - admin + tags: + - Config + responses: + '204': + description: successful operation + '413': + description: image file too large + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the banner + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + bannerfile: + description: The file to upload. + type: string + format: binary + encoding: + bannerfile: + contentType: image/png, image/jpeg + + '/api/v1/config/instance-banner': + delete: + summary: Delete instance banner + security: + - OAuth2: + - admin + tags: + - Config + responses: + '204': + description: successful operation + + /api/v1/config/instance-avatar/pick: + post: + summary: Update instance avatar + security: + - OAuth2: + - admin + tags: + - Config + responses: + '204': + description: successful operation + '413': + description: image file too large + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the avatar + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + avatarfile: + description: The file to upload. + type: string + format: binary + encoding: + avatarfile: + contentType: image/png, image/jpeg + + '/api/v1/config/instance-avatar': + delete: + summary: Delete instance avatar + security: + - OAuth2: + - admin + tags: + - Config + responses: + '204': + description: successful operation + + /api/v1/custom-pages/homepage/instance: + get: + summary: Get instance custom homepage + tags: + - Homepage + responses: + '404': + description: No homepage set + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/CustomHomepage' + put: + summary: Set instance custom homepage + tags: + - Homepage + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + type: object + properties: + content: + type: string + description: content of the homepage, that will be injected in the client + responses: + '204': + description: successful operation + + /api/v1/jobs/pause: + post: + summary: Pause job queue + security: + - OAuth2: + - admin + tags: + - Job + responses: + '204': + description: successful operation + + /api/v1/jobs/resume: + post: + summary: Resume job queue + security: + - OAuth2: + - admin + tags: + - Job + responses: + '204': + description: successful operation + + /api/v1/jobs/{state}: + get: + summary: List instance jobs + operationId: getJobs + security: + - OAuth2: + - admin + tags: + - Job + parameters: + - name: state + in: path + required: true + description: The state of the job ('' for for no filter) + schema: + type: string + enum: + - '' + - active + - completed + - failed + - waiting + - delayed + - $ref: '#/components/parameters/jobType' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Job' + + /api/v1/server/followers: + get: + tags: + - Instance Follows + summary: List instances following the server + parameters: + - $ref: '#/components/parameters/followState' + - $ref: '#/components/parameters/actorType' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Follow' + + '/api/v1/server/followers/{nameWithHost}': + delete: + summary: Remove or reject a follower to your server + security: + - OAuth2: + - admin + tags: + - Instance Follows + parameters: + - name: nameWithHost + in: path + required: true + description: The remote actor handle to remove from your followers + schema: + type: string + format: email + responses: + '204': + description: successful operation + '404': + description: follower not found + + '/api/v1/server/followers/{nameWithHost}/reject': + post: + summary: Reject a pending follower to your server + security: + - OAuth2: + - admin + tags: + - Instance Follows + parameters: + - name: nameWithHost + in: path + required: true + description: The remote actor handle to remove from your followers + schema: + type: string + format: email + responses: + '204': + description: successful operation + '404': + description: follower not found + + '/api/v1/server/followers/{nameWithHost}/accept': + post: + summary: Accept a pending follower to your server + security: + - OAuth2: + - admin + tags: + - Instance Follows + parameters: + - name: nameWithHost + in: path + required: true + description: The remote actor handle to remove from your followers + schema: + type: string + format: email + responses: + '204': + description: successful operation + '404': + description: follower not found + + /api/v1/server/following: + get: + tags: + - Instance Follows + summary: List instances followed by the server + parameters: + - $ref: '#/components/parameters/followState' + - $ref: '#/components/parameters/actorType' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Follow' + post: + security: + - OAuth2: + - admin + tags: + - Instance Follows + summary: Follow a list of actors (PeerTube instance, channel or account) + responses: + '204': + description: successful operation + '500': + description: cannot follow a non-HTTPS server + requestBody: + content: + application/json: + schema: + type: object + properties: + hosts: + type: array + items: + type: string + format: hostname + uniqueItems: true + handles: + type: array + items: + type: string + uniqueItems: true + + '/api/v1/server/following/{hostOrHandle}': + delete: + summary: Unfollow an actor (PeerTube instance, channel or account) + security: + - OAuth2: + - admin + tags: + - Instance Follows + parameters: + - name: hostOrHandle + in: path + required: true + description: The hostOrHandle to unfollow + schema: + type: string + responses: + '204': + description: successful operation + '404': + description: host or handle not found + + /api/v1/users: + post: + summary: Create a user + operationId: addUser + security: + - OAuth2: + - admin + tags: + - Users + responses: + '200': + description: user created + content: + application/json: + schema: + $ref: '#/components/schemas/AddUserResponse' + links: + # GET /users/{id} + GetUser: + operationId: getUser + parameters: + id: '$response.body#/user/id' + # PUT /users/{id} + PutUser: + operationId: putUser + parameters: + id: '$response.body#/user/id' + # DELETE /users/{id} + DelUser: + operationId: delUser + parameters: + id: '$response.body#/user/id' + '403': + description: insufficient authority to create an admin or moderator + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddUser' + description: | + If the smtp server is configured, you can leave the password empty and an email will be sent + asking the user to set it first. + required: true + get: + summary: List users + operationId: getUsers + security: + - OAuth2: + - admin + tags: + - Users + parameters: + - $ref: '#/components/parameters/usersSearch' + - $ref: '#/components/parameters/usersBlocked' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/usersSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + + '/api/v1/users/{id}': + parameters: + - $ref: '#/components/parameters/id' + delete: + summary: Delete a user + security: + - OAuth2: + - admin + tags: + - Users + operationId: delUser + responses: + '204': + description: successful operation + get: + summary: Get a user + security: + - OAuth2: [] + tags: + - Users + operationId: getUser + parameters: + - name: withStats + in: query + description: include statistics about the user (only available as a moderator/admin) + schema: + type: boolean + responses: + '200': + x-summary: successful operation + description: | + As an admin/moderator, you can request a response augmented with statistics about the user's + moderation relations and videos usage, by using the `withStats` parameter. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/UserWithStats' + put: + summary: Update a user + security: + - OAuth2: [] + tags: + - Users + operationId: putUser + responses: + '204': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUser' + required: true + + /api/v1/oauth-clients/local: + get: + summary: Login prerequisite + description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken). + operationId: getOAuthClient + tags: + - Session + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClient' + links: + UseOAuthClientToLogin: + operationId: getOAuthToken + parameters: + client_id: '$response.body#/client_id' + client_secret: '$response.body#/client_secret' + x-codeSamples: + - lang: Shell + source: | + API="https://peertube2.cpy.re/api/v1" + + ## AUTH + curl -s "$API/oauth-clients/local" + + /api/v1/users/token: + post: + summary: Login + operationId: getOAuthToken + description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens. + tags: + - Session + requestBody: + content: + application/x-www-form-urlencoded: + schema: + oneOf: + - $ref: '#/components/schemas/OAuthToken-password' + - $ref: '#/components/schemas/OAuthToken-refresh_token' + discriminator: + propertyName: grant_type + mapping: + password: '#/components/schemas/OAuthToken-password' + refresh_token: '#/components/schemas/OAuthToken-refresh_token' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + token_type: + type: string + example: Bearer + access_token: + type: string + example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0 + description: valid for 1 day + refresh_token: + type: string + example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 + description: valid for 2 weeks + expires_in: + type: integer + minimum: 0 + example: 14399 + refresh_token_expires_in: + type: integer + minimum: 0 + example: 1209600 + '400': + x-summary: client or credentials are invalid + description: | + Disambiguate via `type`: + - `invalid_client` for an unmatched `client_id` + - `invalid_grant` for unmatched credentials + '401': + x-summary: token expired + description: | + Disambiguate via `type`: + - default value for a regular authentication failure + - `invalid_token` for an expired token + x-codeSamples: + - lang: Shell + source: | + ## DEPENDENCIES: jq + API="https://peertube2.cpy.re/api/v1" + USERNAME="" + PASSWORD="" + + ## AUTH + client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") + client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") + curl -s "$API/users/token" \ + --data client_id="$client_id" \ + --data client_secret="$client_secret" \ + --data grant_type=password \ + --data username="$USERNAME" \ + --data password="$PASSWORD" \ + | jq -r ".access_token" + + /api/v1/users/revoke-token: + post: + summary: Logout + description: Revokes your access token and its associated refresh token, destroying your current session. + operationId: revokeOAuthToken + tags: + - Session + security: + - OAuth2: [] + responses: + '200': + description: successful operation + + /api/v1/users/ask-send-verify-email: + post: + summary: Resend user verification link + operationId: resendEmailToVerifyUser + tags: + - Users + - Register + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + description: User email + required: + - email + responses: + '204': + description: successful operation + + /api/v1/users/registrations/ask-send-verify-email: + post: + summary: Resend verification link to registration email + operationId: resendEmailToVerifyRegistration + tags: + - Register + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + description: Registration email + required: + - email + responses: + '204': + description: successful operation + + /api/v1/users/{id}/verify-email: + post: + summary: Verify a user + operationId: verifyUser + description: | + Following a user registration, the new user will receive an email asking to click a link + containing a secret. + This endpoint can also be used to verify a new email set in the user account. + tags: + - Users + - Register + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/json: + schema: + type: object + properties: + verificationString: + type: string + format: url + isPendingEmail: + type: boolean + required: + - verificationString + responses: + '204': + description: successful operation + '403': + description: invalid verification string + '404': + description: user not found + + /api/v1/users/registrations/{registrationId}/verify-email: + post: + summary: Verify a registration email + operationId: verifyRegistrationEmail + description: | + Following a user registration request, the user will receive an email asking to click a link + containing a secret. + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + type: object + properties: + verificationString: + type: string + format: url + required: + - verificationString + responses: + '204': + description: successful operation + '403': + description: invalid verification string + '404': + description: registration not found + + /api/v1/users/{id}/two-factor/request: + post: + summary: Request two factor auth + operationId: requestTwoFactor + description: Request two factor authentication for a user + security: + - OAuth2: [] + tags: + - Users + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/json: + schema: + type: object + properties: + currentPassword: + type: string + description: Password of the currently authenticated user + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RequestTwoFactorResponse' + '403': + description: invalid password + '404': + description: user not found + + /api/v1/users/{id}/two-factor/confirm-request: + post: + summary: Confirm two factor auth + operationId: confirmTwoFactorRequest + description: Confirm a two factor authentication request + security: + - OAuth2: [] + tags: + - Users + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/json: + schema: + type: object + properties: + requestToken: + type: string + description: Token to identify the two factor request + otpToken: + type: string + description: OTP token generated by the app + required: + - requestToken + - otpToken + responses: + '204': + description: successful operation + '403': + description: invalid request token or OTP token + '404': + description: user not found + + /api/v1/users/{id}/two-factor/disable: + post: + summary: Disable two factor auth + operationId: disableTwoFactor + description: Disable two factor authentication of a user + security: + - OAuth2: [] + tags: + - Users + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/json: + schema: + type: object + properties: + currentPassword: + type: string + description: Password of the currently authenticated user + responses: + '204': + description: successful operation + '403': + description: invalid password + '404': + description: user not found + + /api/v1/users/{userId}/imports/import-resumable: + post: + summary: Initialize the resumable user import + description: "**PeerTube >= 6.1** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the import of the archive" + operationId: userImportResumableInit + security: + - OAuth2: [] + tags: + - User Imports + parameters: + - $ref: '#/components/parameters/resumableUploadInitContentLengthHeader' + - $ref: '#/components/parameters/resumableUploadInitContentTypeHeader' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserImportResumable' + responses: + '201': + description: created + headers: + Location: + schema: + type: string + format: url + Content-Length: + schema: + type: number + example: 0 + put: + summary: Send chunk for the resumable user import + description: "**PeerTube >= 6.1** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the import of the archive" + operationId: userImportResumable + security: + - OAuth2: [] + tags: + - User Imports + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - $ref: '#/components/parameters/resumableUploadChunkContentRangeHeader' + - $ref: '#/components/parameters/resumableUploadChunkContentLengthHeader' + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '204': + description: 'last chunk received: successful operation' + '308': + description: resume incomplete + headers: + Range: + schema: + type: string + example: bytes=0-262143 + Content-Length: + schema: + type: number + example: 0 + delete: + summary: Cancel the resumable user import + description: "**PeerTube >= 6.1** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the resumable user import" + operationId: userImportResumableCancel + security: + - OAuth2: [] + tags: + - User Imports + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - name: Content-Length + in: header + required: true + schema: + type: number + example: 0 + responses: + '204': + description: import cancelled + headers: + Content-Length: + schema: + type: number + example: 0 + + /api/v1/users/{userId}/imports/latest: + get: + summary: Get latest user import + description: "**PeerTube >= 6.1**" + operationId: getLatestUserImport + security: + - OAuth2: [] + tags: + - User Imports + parameters: + - $ref: '#/components/parameters/userId' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + state: + type: object + properties: + id: + $ref: '#/components/schemas/UserImportState' + label: + type: string + createdAt: + type: string + format: date-time + + /api/v1/users/{userId}/exports/request: + post: + summary: Request user export + operationId: requestUserExport + description: Request an archive of user data. An email is sent when the archive is ready. + security: + - OAuth2: [] + tags: + - User Exports + parameters: + - $ref: '#/components/parameters/userId' + requestBody: + content: + application/json: + schema: + type: object + properties: + withVideoFiles: + type: boolean + description: Whether to include video files in the archive + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + export: + type: object + properties: + id: + type: integer + + /api/v1/users/{userId}/exports: + get: + summary: List user exports + description: "**PeerTube >= 6.1**" + operationId: listUserExports + security: + - OAuth2: [] + tags: + - User Exports + parameters: + - $ref: '#/components/parameters/userId' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + state: + type: object + properties: + id: + $ref: '#/components/schemas/UserExportState' + label: + type: string + size: + type: integer + description: Size of the archive file in bytes + privateDownloadUrl: + type: string + description: This URL already contains the JWT token, so no additional authentication credentials are required + createdAt: + type: string + format: date-time + expiresOn: + type: string + format: date-time + /api/v1/users/{userId}/exports/{id}: + delete: + summary: Delete a user export + description: "**PeerTube >= 6.1**" + operationId: deleteUserExport + security: + - OAuth2: [] + tags: + - User Exports + parameters: + - $ref: '#/components/parameters/userId' + - $ref: '#/components/parameters/id' + responses: + '204': + description: successful operation + + /api/v1/users/me: + get: + summary: Get my user information + operationId: getUserInfo + security: + - OAuth2: + - user + tags: + - My User + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + put: + summary: Update my user information + operationId: putUserInfo + security: + - OAuth2: + - user + tags: + - My User + responses: + '204': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMe' + required: true + + /api/v1/users/me/videos/imports: + get: + summary: Get video imports of my user + security: + - OAuth2: + - user + tags: + - Videos + - My User + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - + name: targetUrl + in: query + required: false + description: Filter on import target URL + schema: + type: string + - + name: videoChannelSyncId + in: query + required: false + description: Filter on imports created by a specific channel synchronization + schema: + type: number + - + name: search + in: query + required: false + description: Search in video names + schema: + type: string + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoImportsList' + + /api/v1/users/me/video-quota-used: + get: + summary: Get my user used quota + security: + - OAuth2: + - user + tags: + - My User + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoQuotaUsed: + type: number + description: The user video quota used so far in bytes + example: 16810141515 + videoQuotaUsedDaily: + type: number + description: The user video quota used today in bytes + example: 1681014151 + + '/api/v1/users/me/videos/{videoId}/rating': + get: + summary: Get rate of my user for a video + security: + - OAuth2: [] + tags: + - My User + - Video Rates + parameters: + - name: videoId + in: path + required: true + description: The video id + schema: + $ref: '#/components/schemas/Video/properties/id' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/GetMeVideoRating' + + /api/v1/users/me/videos: + get: + summary: List videos of my user + security: + - OAuth2: + - user + tags: + - My User + - Videos + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + + /api/v1/users/me/subscriptions: + get: + summary: Get my user subscriptions + security: + - OAuth2: + - user + tags: + - My Subscriptions + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelList' + post: + tags: + - My Subscriptions + summary: Add subscription to my user + security: + - OAuth2: + - user + requestBody: + content: + application/json: + schema: + type: object + properties: + uri: + type: string + format: uri + description: uri of the video channels to subscribe to + required: + - uri + examples: + default: + value: + uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr + responses: + '200': + description: successful operation + + /api/v1/users/me/subscriptions/exist: + get: + summary: Get if subscriptions exist for my user + security: + - OAuth2: + - user + tags: + - My Subscriptions + parameters: + - $ref: '#/components/parameters/subscriptionsUris' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + + /api/v1/users/me/subscriptions/videos: + get: + summary: List videos of subscriptions of my user + security: + - OAuth2: + - user + tags: + - My Subscriptions + - Videos + parameters: + - $ref: '#/components/parameters/categoryOneOf' + - $ref: '#/components/parameters/isLive' + - $ref: '#/components/parameters/tagsOneOf' + - $ref: '#/components/parameters/tagsAllOf' + - $ref: '#/components/parameters/licenceOneOf' + - $ref: '#/components/parameters/languageOneOf' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + - $ref: '#/components/parameters/skipCount' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + + '/api/v1/users/me/subscriptions/{subscriptionHandle}': + get: + summary: Get subscription of my user + security: + - OAuth2: + - user + tags: + - My Subscriptions + parameters: + - $ref: '#/components/parameters/subscriptionHandle' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannel' + delete: + summary: Delete subscription of my user + security: + - OAuth2: + - user + tags: + - My Subscriptions + parameters: + - $ref: '#/components/parameters/subscriptionHandle' + responses: + '200': + description: successful operation + + /api/v1/users/me/notifications: + get: + summary: List my notifications + security: + - OAuth2: [] + tags: + - My Notifications + parameters: + - name: unread + in: query + description: only list unread notifications + schema: + type: boolean + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationListResponse' + + /api/v1/users/me/notifications/read: + post: + summary: Mark notifications as read by their id + security: + - OAuth2: [] + tags: + - My Notifications + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + description: ids of the notifications to mark as read + items: + type: integer + required: + - ids + responses: + '204': + description: successful operation + + /api/v1/users/me/notifications/read-all: + post: + summary: Mark all my notification as read + security: + - OAuth2: [] + tags: + - My Notifications + responses: + '204': + description: successful operation + + /api/v1/users/me/notification-settings: + put: + summary: Update my notification settings + security: + - OAuth2: [] + tags: + - My Notifications + requestBody: + content: + application/json: + schema: + type: object + properties: + newVideoFromSubscription: + $ref: '#/components/schemas/NotificationSettingValue' + newCommentOnMyVideo: + $ref: '#/components/schemas/NotificationSettingValue' + abuseAsModerator: + $ref: '#/components/schemas/NotificationSettingValue' + videoAutoBlacklistAsModerator: + $ref: '#/components/schemas/NotificationSettingValue' + blacklistOnMyVideo: + $ref: '#/components/schemas/NotificationSettingValue' + myVideoPublished: + $ref: '#/components/schemas/NotificationSettingValue' + myVideoImportFinished: + $ref: '#/components/schemas/NotificationSettingValue' + newFollow: + $ref: '#/components/schemas/NotificationSettingValue' + newUserRegistration: + $ref: '#/components/schemas/NotificationSettingValue' + commentMention: + $ref: '#/components/schemas/NotificationSettingValue' + newInstanceFollower: + $ref: '#/components/schemas/NotificationSettingValue' + autoInstanceFollowing: + $ref: '#/components/schemas/NotificationSettingValue' + responses: + '204': + description: successful operation + + /api/v1/users/me/history/videos: + get: + summary: List watched videos history + security: + - OAuth2: [] + tags: + - My History + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/search' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + + /api/v1/users/me/history/videos/{videoId}: + delete: + summary: Delete history element + security: + - OAuth2: [] + tags: + - My History + parameters: + - name: videoId + in: path + required: true + schema: + $ref: '#/components/schemas/Video/properties/id' + responses: + '204': + description: successful operation + + /api/v1/users/me/history/videos/remove: + post: + summary: Clear video history + security: + - OAuth2: [] + tags: + - My History + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + beforeDate: + description: history before this date will be deleted + type: string + format: date-time + responses: + '204': + description: successful operation + + /api/v1/users/me/avatar/pick: + post: + summary: Update my user avatar + security: + - OAuth2: [] + tags: + - My User + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + '413': + description: image file too large + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the avatar + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + avatarfile: + description: The file to upload + type: string + format: binary + encoding: + avatarfile: + contentType: image/png, image/jpeg + + /api/v1/users/me/avatar: + delete: + summary: Delete my avatar + security: + - OAuth2: [] + tags: + - My User + responses: + '204': + description: successful operation + + /api/v1/users/register: + post: + summary: Register a user + operationId: registerUser + description: Signup has to be enabled and signup approval is not required + tags: + - Register + responses: + '204': + description: successful operation + '400': + description: request error + '403': + description: user registration is not enabled, user limit is reached, registration is not allowed for the ip, requires approval or blocked by a plugin + '409': + description: 'a user with this username, channel name or email already exists' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUser' + required: true + + /api/v1/users/registrations/request: + post: + summary: Request registration + description: Signup has to be enabled and require approval on the instance + operationId: requestRegistration + tags: + - Register + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistration' + '400': + description: request error or signup approval is not enabled on the instance + '403': + description: user registration is not enabled, user limit is reached, registration is not allowed for the ip or blocked by a plugin + '409': + description: 'a user or registration with this username, channel name or email already exists' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationRequest' + + /api/v1/users/registrations/{registrationId}/accept: + post: + security: + - OAuth2: + - admin + - moderator + summary: Accept registration + operationId: acceptRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationAcceptOrReject' + responses: + '204': + description: successful operation + + /api/v1/users/registrations/{registrationId}/reject: + post: + security: + - OAuth2: + - admin + - moderator + summary: Reject registration + operationId: rejectRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationAcceptOrReject' + responses: + '204': + description: successful operation + + /api/v1/users/registrations/{registrationId}: + delete: + security: + - OAuth2: + - admin + - moderator + summary: Delete registration + description: 'Delete the registration entry. It will not remove the user associated with this registration (if any)' + operationId: deleteRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + responses: + '204': + description: successful operation + + /api/v1/users/registrations: + get: + security: + - OAuth2: + - admin + - moderator + summary: List registrations + operationId: listRegistrations + tags: + - Register + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - name: search + in: query + required: false + schema: + type: string + - name: sort + in: query + required: false + schema: + type: string + enum: + - -createdAt + - createdAt + - state + - -state + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/UserRegistration' + + /api/v1/videos/ownership: + get: + summary: List video ownership changes + tags: + - Video Ownership Change + security: + - OAuth2: [] + responses: + '200': + description: successful operation + + '/api/v1/videos/ownership/{id}/accept': + post: + summary: Accept ownership change request + tags: + - Video Ownership Change + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '403': + description: cannot terminate an ownership change of another user + '404': + description: video ownership change not found + + '/api/v1/videos/ownership/{id}/refuse': + post: + summary: Refuse ownership change request + tags: + - Video Ownership Change + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '403': + description: cannot terminate an ownership change of another user + '404': + description: video ownership change not found + + '/api/v1/videos/{id}/give-ownership': + post: + summary: Request ownership change + tags: + - Video Ownership Change + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + username: + type: string + required: + - username + responses: + '204': + description: successful operation + '400': + description: changing video ownership to a remote account is not supported yet + '404': + description: video not found + + '/api/v1/videos/{id}/token': + post: + summary: Request video token + operationId: requestVideoToken + description: Request special tokens that expire quickly to use them in some context (like accessing private static files) + tags: + - Video + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoTokenResponse' + '400': + description: incorrect parameters + '404': + description: video not found + + /api/v1/videos/{id}/studio/edit: + post: + summary: Create a studio task + tags: + - Video Transcoding + - Video + description: Create a task to edit a video (cut, add intro/outro etc) + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/VideoStudioCreateTask' + responses: + '204': + description: successful operation + '400': + description: incorrect parameters + '404': + description: video not found + + /api/v1/videos: + get: + summary: List videos + operationId: getVideos + tags: + - Video + parameters: + - $ref: '#/components/parameters/categoryOneOf' + - $ref: '#/components/parameters/isLive' + - $ref: '#/components/parameters/tagsOneOf' + - $ref: '#/components/parameters/tagsAllOf' + - $ref: '#/components/parameters/licenceOneOf' + - $ref: '#/components/parameters/languageOneOf' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + - $ref: '#/components/parameters/skipCount' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + + /api/v1/videos/categories: + get: + summary: List available video categories + operationId: getCategories + tags: + - Video + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/videos/categories + + /api/v1/videos/licences: + get: + summary: List available video licences + operationId: getLicences + tags: + - Video + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/videos/licences + + /api/v1/videos/languages: + get: + summary: List available video languages + operationId: getLanguages + tags: + - Video + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/videos/languages + + /api/v1/videos/privacies: + get: + summary: List available video privacy policies + operationId: getVideoPrivacyPolicies + tags: + - Video + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/videos/privacies + + '/api/v1/videos/{id}': + put: + summary: Update a video + operationId: putVideo + security: + - OAuth2: [] + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + thumbnailfile: + description: Video thumbnail file + type: string + format: binary + previewfile: + description: Video preview file + type: string + format: binary + category: + $ref: '#/components/schemas/VideoCategorySet' + licence: + $ref: '#/components/schemas/VideoLicenceSet' + language: + $ref: '#/components/schemas/VideoLanguageSet' + privacy: + $ref: '#/components/schemas/VideoPrivacySet' + description: + description: Video description + type: string + waitTranscoding: + description: Whether or not we wait transcoding before publish the video + type: string + support: + description: A text tell the audience how to support the video creator + example: Please support our work on https://soutenir.framasoft.org/en/ <3 + type: string + nsfw: + description: Whether or not this video contains sensitive content + type: boolean + name: + description: Video name + type: string + minLength: 3 + maxLength: 120 + tags: + description: Video tags (maximum 5 tags each between 2 and 30 characters) + type: array + minItems: 1 + maxItems: 5 + items: + type: string + minLength: 2 + maxLength: 30 + commentsEnabled: + description: Enable or disable comments for this video + type: boolean + downloadEnabled: + description: Enable or disable downloading for this video + type: boolean + originallyPublishedAt: + description: Date when the content was originally published + type: string + format: date-time + scheduleUpdate: + $ref: '#/components/schemas/VideoScheduledUpdate' + videoPasswords: + $ref: '#/components/schemas/AddVideoPasswords' + encoding: + thumbnailfile: + contentType: image/jpeg + previewfile: + contentType: image/jpeg + get: + summary: Get a video + operationId: getVideo + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoDetails' + '403': + description: provide a correct password to access this password protected video + delete: + summary: Delete a video + operationId: delVideo + security: + - OAuth2: [] + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + + '/api/v1/videos/{id}/description': + get: + summary: Get complete video description + operationId: getVideoDesc + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + nullable: true + type: string + minLength: 3 + maxLength: 10000 + example: | + **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)** + + '/api/v1/videos/{id}/views': + post: + summary: Notify user is watching a video + description: Call this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time. + operationId: addView + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserViewingVideo' + required: true + responses: + '204': + description: successful operation + + '/api/v1/videos/{id}/watching': + put: + summary: Set watching progress of a video + deprecated: true + description: This endpoint has been deprecated. Use `/videos/{id}/views` instead + tags: + - Video + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserViewingVideo' + required: true + responses: + '204': + description: successful operation + + '/api/v1/videos/{id}/stats/overall': + get: + summary: Get overall stats of a video + tags: + - Video Stats + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + - name: startDate + in: query + description: Filter stats by start date + schema: + type: string + format: date-time + - name: endDate + in: query + description: Filter stats by end date + schema: + type: string + format: date-time + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoStatsOverall' + + '/api/v1/videos/{id}/stats/retention': + get: + summary: Get retention stats of a video + tags: + - Video Stats + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoStatsRetention' + + '/api/v1/videos/{id}/stats/timeseries/{metric}': + get: + summary: Get timeserie stats of a video + tags: + - Video Stats + security: + - OAuth2: [] + parameters: + - $ref: '#/components/parameters/idOrUUID' + - + name: metric + in: path + required: true + description: The metric to get + schema: + type: string + enum: + - 'viewers' + - 'aggregateWatchTime' + - name: startDate + in: query + description: Filter stats by start date + schema: + type: string + format: date-time + - name: endDate + in: query + description: Filter stats by end date + schema: + type: string + format: date-time + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoStatsTimeserie' + + /api/v1/videos/upload: + post: + summary: Upload a video + description: Uses a single request to upload a video. + operationId: uploadLegacy + security: + - OAuth2: [] + tags: + - Video + - Video Upload + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoUploadResponse' + '403': + description: video didn't pass upload filter + '408': + description: upload has timed out + '413': + x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy + description: | + If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`: + - `quota_reached` for quota limits whether daily or global + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the video + '415': + description: video type unsupported + '422': + description: video unreadable + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/VideoUploadRequestLegacy' + encoding: + videofile: + contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream + thumbnailfile: + contentType: image/jpeg + previewfile: + contentType: image/jpeg + x-codeSamples: + - lang: Shell + source: | + ## DEPENDENCIES: jq + USERNAME="" + PASSWORD="" + FILE_PATH="" + CHANNEL_ID="" + NAME="" + API="https://peertube2.cpy.re/api/v1" + + ## AUTH + client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") + client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") + token=$(curl -s "$API/users/token" \ + --data client_id="$client_id" \ + --data client_secret="$client_secret" \ + --data grant_type=password \ + --data username="$USERNAME" \ + --data password="$PASSWORD" \ + | jq -r ".access_token") + + ## VIDEO UPLOAD + curl -s "$API/videos/upload" \ + -H "Authorization: Bearer $token" \ + --max-time 600 \ + --form videofile=@"$FILE_PATH" \ + --form channelId=$CHANNEL_ID \ + --form name="$NAME" + + /api/v1/videos/upload-resumable: + post: + summary: Initialize the resumable upload of a video + description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video + operationId: uploadResumableInit + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadInitContentLengthHeader' + - $ref: '#/components/parameters/resumableUploadInitContentTypeHeader' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VideoUploadRequestResumable' + responses: + '200': + description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead + '201': + description: created + headers: + Location: + schema: + type: string + format: url + example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51 + Content-Length: + schema: + type: number + example: 0 + '413': + x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit + description: | + Disambiguate via `type`: + - `max_file_size_reached` for the absolute file size limit + - `quota_reached` for quota limits whether daily or global + '415': + description: video type unsupported + put: + summary: Send chunk for the resumable upload of a video + description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video + operationId: uploadResumable + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - $ref: '#/components/parameters/resumableUploadChunkContentRangeHeader' + - $ref: '#/components/parameters/resumableUploadChunkContentLengthHeader' + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: last chunk received + headers: + Content-Length: + schema: + type: number + content: + application/json: + schema: + $ref: '#/components/schemas/VideoUploadResponse' + '308': + description: resume incomplete + headers: + Range: + schema: + type: string + example: bytes=0-262143 + Content-Length: + schema: + type: number + example: 0 + '403': + description: video didn't pass upload filter + '404': + description: upload not found + '409': + description: chunk doesn't match range + '422': + description: video unreadable + '429': + description: too many concurrent requests + '503': + description: upload is already being processed + headers: + 'Retry-After': + schema: + type: number + example: 300 + delete: + summary: Cancel the resumable upload of a video, deleting any data uploaded so far + description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video + operationId: uploadResumableCancel + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - name: Content-Length + in: header + required: true + schema: + type: number + example: 0 + responses: + '204': + description: upload cancelled + headers: + Content-Length: + schema: + type: number + example: 0 + '404': + description: upload not found + + /api/v1/videos/imports: + post: + summary: Import a video + description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) + operationId: importVideo + security: + - OAuth2: [] + tags: + - Video Imports + - Video Upload + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/VideoCreateImport' + encoding: + torrentfile: + contentType: application/x-bittorrent + thumbnailfile: + contentType: image/jpeg + previewfile: + contentType: image/jpeg + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoUploadResponse' + '400': + description: '`magnetUri` or `targetUrl` or a torrent file missing' + '403': + description: video didn't pass pre-import filter + '409': + description: HTTP or Torrent/magnetURI import not enabled + + /api/v1/videos/imports/{id}/cancel: + post: + summary: Cancel video import + description: Cancel a pending video import + security: + - OAuth2: [] + tags: + - Video Imports + parameters: + - $ref: '#/components/parameters/id' + responses: + '204': + description: successful operation + + /api/v1/videos/imports/{id}: + delete: + summary: Delete video import + description: Delete ended video import + security: + - OAuth2: [] + tags: + - Video Imports + parameters: + - $ref: '#/components/parameters/id' + responses: + '204': + description: successful operation + + /api/v1/videos/live: + post: + summary: Create a live + operationId: addLive + security: + - OAuth2: [] + tags: + - Live Videos + - Video + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoUploadResponse' + '400': + x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set + description: | + Disambiguate via `type`: + - default type for a validation error + - `live_conflicting_permanent_and_save_replay` for conflicting parameters set + '403': + x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded + description: | + Disambiguate via `type`: + - `live_not_enabled` for a disabled live feature + - `live_not_allowing_replay` for a disabled replay feature + - `max_instance_lives_limit_reached` for the absolute concurrent live limit + - `max_user_lives_limit_reached` for the user concurrent live limit + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + channelId: + description: Channel id that will contain this live video + type: integer + saveReplay: + type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' + permanentLive: + description: User can stream multiple times in a permanent live + type: boolean + latencyMode: + $ref: '#/components/schemas/LiveVideoLatencyMode' + thumbnailfile: + description: Live video/replay thumbnail file + type: string + format: binary + previewfile: + description: Live video/replay preview file + type: string + format: binary + privacy: + $ref: '#/components/schemas/VideoPrivacySet' + category: + $ref: '#/components/schemas/VideoCategorySet' + licence: + $ref: '#/components/schemas/VideoLicenceSet' + language: + $ref: '#/components/schemas/VideoLanguageSet' + description: + description: Live video/replay description + type: string + support: + description: A text tell the audience how to support the creator + example: Please support our work on https://soutenir.framasoft.org/en/ <3 + type: string + nsfw: + description: Whether or not this live video/replay contains sensitive content + type: boolean + name: + description: Live video/replay name + type: string + minLength: 3 + maxLength: 120 + tags: + description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters) + type: array + minItems: 1 + maxItems: 5 + items: + type: string + minLength: 2 + maxLength: 30 + commentsEnabled: + description: Enable or disable comments for this live video/replay + type: boolean + downloadEnabled: + description: Enable or disable downloading for the replay of this live video + type: boolean + required: + - channelId + - name + encoding: + thumbnailfile: + contentType: image/jpeg + previewfile: + contentType: image/jpeg + + /api/v1/videos/live/{id}: + get: + summary: Get information about a live + operationId: getLiveId + security: + - OAuth2: [] + tags: + - Live Videos + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/LiveVideoResponse' + put: + summary: Update information about a live + operationId: updateLiveId + security: + - OAuth2: [] + tags: + - Live Videos + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LiveVideoUpdate' + responses: + '204': + description: successful operation + '400': + description: bad parameters or trying to update a live that has already started + '403': + description: trying to save replay of the live but saving replay is not enabled on the instance + /api/v1/videos/live/{id}/sessions: + get: + summary: List live sessions + description: List all sessions created in a particular live + security: + - OAuth2: [] + tags: + - Live Videos + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/LiveVideoSessionResponse' + /api/v1/videos/{id}/live-session: + get: + summary: Get live session of a replay + description: If the video is a replay of a live, you can find the associated live session using this endpoint + security: + - OAuth2: [] + tags: + - Live Videos + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/LiveVideoSessionResponse' + + '/api/v1/videos/{id}/source': + get: + summary: Get video source file metadata + operationId: getVideoSource + security: + - OAuth2: [] + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoSource' + + '/api/v1/videos/{id}/source/file': + delete: + summary: Delete video source file + operationId: deleteVideoSourceFile + tags: + - Video + security: + - OAuth2: + - admin + - moderator + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '404': + description: video source not found + + '/api/v1/videos/{id}/source/replace-resumable': + post: + summary: Initialize the resumable replacement of a video + description: "**PeerTube >= 6.0** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the replacement of a video" + operationId: replaceVideoSourceResumableInit + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadInitContentLengthHeader' + - $ref: '#/components/parameters/resumableUploadInitContentTypeHeader' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VideoReplaceSourceRequestResumable' + responses: + '200': + description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead + '201': + description: created + headers: + Location: + schema: + type: string + format: url + Content-Length: + schema: + type: number + example: 0 + '413': + x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit + description: | + Disambiguate via `type`: + - `max_file_size_reached` for the absolute file size limit + - `quota_reached` for quota limits whether daily or global + '415': + description: video type unsupported + put: + summary: Send chunk for the resumable replacement of a video + description: "**PeerTube >= 6.0** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the replacement of a video" + operationId: replaceVideoSourceResumable + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - $ref: '#/components/parameters/resumableUploadChunkContentRangeHeader' + - $ref: '#/components/parameters/resumableUploadChunkContentLengthHeader' + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '204': + description: 'last chunk received: successful operation' + '308': + description: resume incomplete + headers: + Range: + schema: + type: string + example: bytes=0-262143 + Content-Length: + schema: + type: number + example: 0 + '403': + description: video didn't pass file replacement filter + '404': + description: replace upload not found + '409': + description: chunk doesn't match range + '422': + description: video unreadable + '429': + description: too many concurrent requests + '503': + description: upload is already being processed + headers: + 'Retry-After': + schema: + type: number + example: 300 + delete: + summary: Cancel the resumable replacement of a video + description: "**PeerTube >= 6.0** Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the replacement of a video" + operationId: replaceVideoSourceResumableCancel + security: + - OAuth2: [] + tags: + - Video + - Video Upload + parameters: + - $ref: '#/components/parameters/resumableUploadId' + - name: Content-Length + in: header + required: true + schema: + type: number + example: 0 + responses: + '204': + description: source file replacement cancelled + headers: + Content-Length: + schema: + type: number + example: 0 + '404': + description: source file replacement not found + + /api/v1/users/me/abuses: + get: + summary: List my abuses + operationId: getMyAbuses + security: + - OAuth2: [] + tags: + - Abuses + - My User + parameters: + - name: id + in: query + description: only list the report with this id + schema: + type: integer + - name: state + in: query + schema: + $ref: '#/components/schemas/AbuseStateSet' + - $ref: '#/components/parameters/abusesSort' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Abuse' + + /api/v1/abuses: + get: + summary: List abuses + operationId: getAbuses + security: + - OAuth2: + - admin + - moderator + tags: + - Abuses + parameters: + - name: id + in: query + description: only list the report with this id + schema: + type: integer + - name: predefinedReason + in: query + description: predefined reason the listed reports should contain + schema: + $ref: '#/components/schemas/PredefinedAbuseReasons' + - name: search + in: query + description: plain search that will match with video titles, reporter names and more + schema: + type: string + - name: state + in: query + schema: + $ref: '#/components/schemas/AbuseStateSet' + - name: searchReporter + in: query + description: only list reports of a specific reporter + schema: + type: string + - name: searchReportee + description: only list reports of a specific reportee + in: query + schema: + type: string + - name: searchVideo + in: query + description: only list reports of a specific video + schema: + type: string + - name: searchVideoChannel + in: query + description: only list reports of a specific video channel + schema: + type: string + - name: videoIs + in: query + description: only list deleted or blocklisted videos + schema: + type: string + enum: + - 'deleted' + - 'blacklisted' + - name: filter + in: query + description: only list account, comment or video reports + schema: + type: string + enum: + - 'video' + - 'comment' + - 'account' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/abusesSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Abuse' + post: + summary: Report an abuse + security: + - OAuth2: [] + tags: + - Abuses + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + reason: + description: Reason why the user reports this video + type: string + minLength: 2 + maxLength: 3000 + predefinedReasons: + $ref: '#/components/schemas/PredefinedAbuseReasons' + video: + type: object + properties: + id: + description: Video id to report + allOf: + - $ref: '#/components/schemas/Video/properties/id' + startAt: + type: integer + format: seconds + description: Timestamp in the video that marks the beginning of the report + minimum: 0 + endAt: + type: integer + format: seconds + description: Timestamp in the video that marks the ending of the report + minimum: 0 + comment: + type: object + properties: + id: + description: Comment id to report + allOf: + - $ref: '#/components/schemas/VideoComment/properties/id' + account: + type: object + properties: + id: + description: Account id to report + type: integer + required: + - reason + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + abuse: + type: object + properties: + id: + $ref: '#/components/schemas/id' + '400': + description: incorrect request parameters + + '/api/v1/abuses/{abuseId}': + put: + summary: Update an abuse + security: + - OAuth2: + - admin + - moderator + tags: + - Abuses + parameters: + - $ref: '#/components/parameters/abuseId' + requestBody: + content: + application/json: + schema: + type: object + properties: + state: + $ref: '#/components/schemas/AbuseStateSet' + moderationComment: + type: string + description: Update the report comment visible only to the moderation team + minLength: 2 + maxLength: 3000 + responses: + '204': + description: successful operation + '404': + description: abuse not found + delete: + tags: + - Abuses + summary: Delete an abuse + security: + - OAuth2: + - admin + - moderator + parameters: + - $ref: '#/components/parameters/abuseId' + responses: + '204': + description: successful operation + '404': + description: block not found + + '/api/v1/abuses/{abuseId}/messages': + get: + summary: List messages of an abuse + security: + - OAuth2: [] + tags: + - Abuses + parameters: + - $ref: '#/components/parameters/abuseId' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/AbuseMessage' + post: + summary: Add message to an abuse + security: + - OAuth2: [] + tags: + - Abuses + parameters: + - $ref: '#/components/parameters/abuseId' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + message: + description: Message to send + type: string + minLength: 2 + maxLength: 3000 + required: + - message + responses: + '200': + description: successful operation + '400': + description: incorrect request parameters + + '/api/v1/abuses/{abuseId}/messages/{abuseMessageId}': + delete: + summary: Delete an abuse message + security: + - OAuth2: [] + tags: + - Abuses + parameters: + - $ref: '#/components/parameters/abuseId' + - $ref: '#/components/parameters/abuseMessageId' + responses: + '204': + description: successful operation + + '/api/v1/videos/{id}/blacklist': + post: + summary: Block a video + operationId: addVideoBlock + security: + - OAuth2: + - admin + - moderator + tags: + - Video Blocks + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + delete: + summary: Unblock a video by its id + operationId: delVideoBlock + security: + - OAuth2: + - admin + - moderator + tags: + - Video Blocks + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '404': + description: block not found + + /api/v1/videos/blacklist: + get: + tags: + - Video Blocks + summary: List video blocks + operationId: getVideoBlocks + security: + - OAuth2: + - admin + - moderator + parameters: + - name: type + in: query + description: > + list only blocks that match this type: + + - `1`: manual block + + - `2`: automatic block that needs review + schema: + type: integer + enum: + - 1 + - 2 + - name: search + in: query + description: plain search that will match with video titles, and more + schema: + type: string + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/blacklistsSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoBlacklist' + + /api/v1/videos/{id}/storyboards: + get: + summary: List storyboards of a video + description: "**PeerTube** >= 6.0" + operationId: listVideoStoryboards + tags: + - Video + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + storyboards: + type: array + items: + $ref: '#/components/schemas/Storyboard' + + /api/v1/videos/{id}/captions: + get: + summary: List captions of a video + operationId: getVideoCaptions + tags: + - Video Captions + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoCaption' + + /api/v1/videos/{id}/captions/{captionLanguage}: + put: + summary: Add or replace a video caption + operationId: addVideoCaption + security: + - OAuth2: + - user + tags: + - Video Captions + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/captionLanguage' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + captionfile: + description: The file to upload. + type: string + format: binary + encoding: + captionfile: + contentType: text/vtt, application/x-subrip, text/plain + responses: + '204': + description: successful operation + '404': + description: video or language not found + delete: + summary: Delete a video caption + operationId: delVideoCaption + security: + - OAuth2: + - user + tags: + - Video Captions + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/captionLanguage' + responses: + '204': + description: successful operation + '404': + description: video or language or caption for that language not found + + /api/v1/videos/{id}/chapters: + get: + summary: Get chapters of a video + description: "**PeerTube** >= 6.0" + operationId: getVideoChapters + tags: + - Video Chapters + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChapters' + put: + summary: Replace video chapters + description: "**PeerTube** >= 6.0" + operationId: replaceVideoChapters + security: + - OAuth2: + - user + tags: + - Video Chapters + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + chapters: + type: array + items: + type: object + properties: + title: + type: string + timecode: + type: integer + responses: + '204': + description: successful operation + '404': + description: video not found + + /api/v1/videos/{id}/passwords: + get: + summary: List video passwords + description: "**PeerTube** >= 6.0" + security: + - OAuth2: + - user + tags: + - Video Passwords + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '204': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoPasswordList' + '400': + description: video is not password protected + put: + summary: Update video passwords + description: "**PeerTube** >= 6.0" + security: + - OAuth2: + - user + tags: + - Video Passwords + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + passwords: + $ref: '#/components/schemas/AddVideoPasswords' + responses: + '204': + description: successful operation + '400': + description: video is not password protected + + /api/v1/videos/{id}/passwords/{videoPasswordId}: + delete: + summary: Delete a video password + description: "**PeerTube** >= 6.0" + security: + - OAuth2: + - user + tags: + - Video Passwords + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordId' + responses: + '204': + description: successful operation + '403': + description: cannot delete the last password of the protected video + '400': + description: video is not password protected + + /api/v1/video-channels: + get: + summary: List video channels + operationId: getVideoChannels + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelList' + post: + summary: Create a video channel + operationId: addVideoChannel + security: + - OAuth2: [] + tags: + - Video Channels + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoChannel: + type: object + properties: + id: + $ref: '#/components/schemas/id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelCreate' + + '/api/v1/video-channels/{channelHandle}': + get: + summary: Get a video channel + operationId: getVideoChannel + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannel' + put: + summary: Update a video channel + operationId: putVideoChannel + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '204': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelUpdate' + delete: + summary: Delete a video channel + operationId: delVideoChannel + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '204': + description: successful operation + + '/api/v1/video-channels/{channelHandle}/videos': + get: + summary: List videos of a video channel + operationId: getVideoChannelVideos + tags: + - Video + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + - $ref: '#/components/parameters/categoryOneOf' + - $ref: '#/components/parameters/isLive' + - $ref: '#/components/parameters/tagsOneOf' + - $ref: '#/components/parameters/tagsAllOf' + - $ref: '#/components/parameters/licenceOneOf' + - $ref: '#/components/parameters/languageOneOf' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + - $ref: '#/components/parameters/skipCount' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + + '/api/v1/video-channels/{channelHandle}/video-playlists': + get: + summary: List playlists of a channel + tags: + - Video Playlists + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/videoPlaylistType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' + + '/api/v1/video-channels/{channelHandle}/followers': + get: + tags: + - Video Channels + summary: 'List followers of a video channel' + security: + - OAuth2: [] + operationId: getVideoChannelFollowers + parameters: + - $ref: '#/components/parameters/channelHandle' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/followersSort' + - $ref: '#/components/parameters/search' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Follow' + + '/api/v1/video-channels/{channelHandle}/avatar/pick': + post: + summary: Update channel avatar + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + '413': + description: image file too large + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the avatar + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + avatarfile: + description: The file to upload. + type: string + format: binary + encoding: + avatarfile: + contentType: image/png, image/jpeg + + '/api/v1/video-channels/{channelHandle}/avatar': + delete: + summary: Delete channel avatar + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '204': + description: successful operation + + '/api/v1/video-channels/{channelHandle}/banner/pick': + post: + summary: Update channel banner + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + banners: + type: array + items: + $ref: '#/components/schemas/ActorImage' + '413': + description: image file too large + headers: + X-File-Maximum-Size: + schema: + type: string + format: Nginx size + description: Maximum file size for the banner + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + bannerfile: + description: The file to upload. + type: string + format: binary + encoding: + bannerfile: + contentType: image/png, image/jpeg + + '/api/v1/video-channels/{channelHandle}/banner': + delete: + summary: Delete channel banner + security: + - OAuth2: [] + tags: + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + responses: + '204': + description: successful operation + + '/api/v1/video-channels/{channelHandle}/import-videos': + post: + summary: Import videos in channel + description: Import a remote channel/playlist videos into a channel + security: + - OAuth2: [] + tags: + - Video Channels + - Channels Sync + parameters: + - $ref: '#/components/parameters/channelHandle' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImportVideosInChannelCreate' + responses: + '204': + description: successful operation + + '/api/v1/video-channel-syncs': + post: + summary: Create a synchronization for a video channel + operationId: addVideoChannelSync + security: + - OAuth2: [] + tags: + - Channels Sync + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelSyncCreate' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoChannelSync: + $ref: "#/components/schemas/VideoChannelSync" + + '/api/v1/video-channel-syncs/{channelSyncId}': + delete: + summary: Delete a video channel synchronization + operationId: delVideoChannelSync + security: + - OAuth2: [] + tags: + - Channels Sync + parameters: + - $ref: '#/components/parameters/channelSyncId' + responses: + '204': + description: successful operation + + '/api/v1/video-channel-syncs/{channelSyncId}/sync': + post: + summary: Triggers the channel synchronization job, fetching all the videos from the remote channel + operationId: triggerVideoChannelSync + security: + - OAuth2: [] + tags: + - Channels Sync + parameters: + - $ref: '#/components/parameters/channelSyncId' + responses: + '204': + description: successful operation + + + /api/v1/video-playlists/privacies: + get: + summary: List available playlist privacy policies + operationId: getPlaylistPrivacyPolicies + tags: + - Video Playlists + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + examples: + nightly: + externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies + + /api/v1/video-playlists: + get: + summary: List video playlists + operationId: getPlaylists + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/videoPlaylistType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' + post: + summary: Create a video playlist + description: If the video playlist is set as public, `videoChannelId` is mandatory. + operationId: addPlaylist + security: + - OAuth2: [] + tags: + - Video Playlists + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoPlaylist: + type: object + properties: + id: + $ref: '#/components/schemas/VideoPlaylist/properties/id' + uuid: + $ref: '#/components/schemas/VideoPlaylist/properties/uuid' + shortUUID: + $ref: '#/components/schemas/VideoPlaylist/properties/shortUUID' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + displayName: + description: Video playlist display name + type: string + minLength: 1 + maxLength: 120 + thumbnailfile: + description: Video playlist thumbnail file + type: string + format: binary + privacy: + $ref: '#/components/schemas/VideoPlaylistPrivacySet' + description: + description: Video playlist description + type: string + minLength: 3 + maxLength: 1000 + videoChannelId: + allOf: + - $ref: '#/components/schemas/id' + description: Video channel in which the playlist will be published + required: + - displayName + encoding: + thumbnailfile: + contentType: image/jpeg + + /api/v1/video-playlists/{playlistId}: + get: + summary: Get a video playlist + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoPlaylist' + put: + summary: Update a video playlist + description: 'If the video playlist is set as public, the playlist must have a assigned channel.' + security: + - OAuth2: [] + tags: + - Video Playlists + responses: + '204': + description: successful operation + parameters: + - $ref: '#/components/parameters/playlistId' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + displayName: + description: Video playlist display name + type: string + minLength: 1 + maxLength: 120 + thumbnailfile: + description: Video playlist thumbnail file + type: string + format: binary + privacy: + $ref: '#/components/schemas/VideoPlaylistPrivacySet' + description: + description: Video playlist description + type: string + videoChannelId: + allOf: + - $ref: '#/components/schemas/id' + description: Video channel in which the playlist will be published + encoding: + thumbnailfile: + contentType: image/jpeg + delete: + summary: Delete a video playlist + security: + - OAuth2: [] + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + responses: + '204': + description: successful operation + + /api/v1/video-playlists/{playlistId}/videos: + get: + summary: 'List videos of a playlist' + operationId: getVideoPlaylistVideos + tags: + - Videos + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + post: + summary: Add a video in a playlist + operationId: addVideoPlaylistVideo + security: + - OAuth2: [] + tags: + - Videos + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoPlaylistElement: + type: object + properties: + id: + type: integer + example: 2 + requestBody: + content: + application/json: + schema: + type: object + properties: + videoId: + oneOf: + - $ref: '#/components/schemas/Video/properties/uuid' + - $ref: '#/components/schemas/Video/properties/id' + description: Video to add in the playlist + startTimestamp: + type: integer + format: seconds + description: Start the video at this specific timestamp + stopTimestamp: + type: integer + format: seconds + description: Stop the video at this specific timestamp + required: + - videoId + + /api/v1/video-playlists/{playlistId}/videos/reorder: + post: + summary: 'Reorder a playlist' + operationId: reorderVideoPlaylist + security: + - OAuth2: [] + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + responses: + '204': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + startPosition: + type: integer + description: 'Start position of the element to reorder' + minimum: 1 + insertAfterPosition: + type: integer + description: 'New position for the block to reorder, to add the block before the first element' + minimum: 0 + reorderLength: + type: integer + description: 'How many element from `startPosition` to reorder' + minimum: 1 + required: + - startPosition + - insertAfterPosition + + /api/v1/video-playlists/{playlistId}/videos/{playlistElementId}: + put: + summary: Update a playlist element + operationId: putVideoPlaylistVideo + security: + - OAuth2: [] + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + - $ref: '#/components/parameters/playlistElementId' + responses: + '204': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + startTimestamp: + type: integer + format: seconds + description: Start the video at this specific timestamp + stopTimestamp: + type: integer + format: seconds + description: Stop the video at this specific timestamp + delete: + summary: Delete an element from a playlist + operationId: delVideoPlaylistVideo + security: + - OAuth2: [] + tags: + - Video Playlists + parameters: + - $ref: '#/components/parameters/playlistId' + - $ref: '#/components/parameters/playlistElementId' + responses: + '204': + description: successful operation + + '/api/v1/users/me/video-playlists/videos-exist': + get: + summary: Check video exists in my playlists + security: + - OAuth2: [] + tags: + - Video Playlists + parameters: + - name: videoIds + in: query + required: true + description: The video ids to check + schema: + type: array + items: + $ref: '#/components/schemas/Video/properties/id' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + videoId: + type: array + items: + type: object + properties: + playlistElementId: + type: integer + playlistId: + type: integer + startTimestamp: + type: integer + format: seconds + stopTimestamp: + type: integer + + '/api/v1/accounts/{name}/video-playlists': + get: + summary: List playlists of an account + tags: + - Video Playlists + - Accounts + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/videoPlaylistType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' + + '/api/v1/accounts/{name}/video-channels': + get: + summary: List video channels of an account + tags: + - Video Channels + - Accounts + parameters: + - $ref: '#/components/parameters/name' + - name: withStats + in: query + description: include daily view statistics for the last 30 days and total views (only if authentified as the account user) + schema: + type: boolean + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelList' + + '/api/v1/accounts/{name}/video-channel-syncs': + get: + summary: List the synchronizations of video channels of an account + tags: + - Video Channels + - Channels Sync + - Accounts + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelSyncList' + + '/api/v1/accounts/{name}/ratings': + get: + summary: List ratings of an account + security: + - OAuth2: [] + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - name: rating + in: query + required: false + description: Optionally filter which ratings to retrieve + schema: + type: string + enum: + - like + - dislike + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoRating' + + '/api/v1/videos/{id}/comment-threads': + get: + summary: List threads of a video + tags: + - Video Comments + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/commentsSort' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/CommentThreadResponse' + post: + summary: Create a thread + security: + - OAuth2: [] + tags: + - Video Comments + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/CommentThreadPostResponse' + '404': + description: video does not exist + requestBody: + content: + application/json: + schema: + type: object + properties: + text: + allOf: + - $ref: '#/components/schemas/VideoComment/properties/text' + format: markdown + maxLength: 10000 + required: + - text + + '/api/v1/videos/{id}/comment-threads/{threadId}': + get: + summary: Get a thread + tags: + - Video Comments + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/threadId' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoCommentThreadTree' + + '/api/v1/videos/{id}/comments/{commentId}': + post: + summary: Reply to a thread of a video + security: + - OAuth2: [] + tags: + - Video Comments + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/commentId' + - $ref: '#/components/parameters/videoPasswordHeader' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/CommentThreadPostResponse' + '404': + description: thread or video does not exist + requestBody: + content: + application/json: + schema: + type: object + properties: + text: + allOf: + - $ref: '#/components/schemas/VideoComment/properties/text' + format: markdown + maxLength: 10000 + required: + - text + delete: + summary: Delete a comment or a reply + security: + - OAuth2: [] + tags: + - Video Comments + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/commentId' + responses: + '204': + description: successful operation + '403': + description: cannot remove comment of another user + '404': + description: comment or video does not exist + '409': + description: comment is already deleted + + '/api/v1/videos/{id}/rate': + put: + summary: Like/dislike a video + security: + - OAuth2: [] + tags: + - Video Rates + parameters: + - $ref: '#/components/parameters/idOrUUID' + - $ref: '#/components/parameters/videoPasswordHeader' + requestBody: + content: + application/json: + schema: + type: object + properties: + rating: + type: string + enum: + - like + - dislike + required: + - rating + responses: + '204': + description: successful operation + '404': + description: video does not exist + + '/api/v1/videos/{id}/hls': + delete: + summary: Delete video HLS files + security: + - OAuth2: + - admin + tags: + - Video Files + operationId: delVideoHLS + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '404': + description: video does not exist + '/api/v1/videos/{id}/web-videos': + delete: + summary: Delete video Web Video files + description: "**PeerTube >= 6.0**" + security: + - OAuth2: + - admin + tags: + - Video Files + operationId: delVideoWebVideos + parameters: + - $ref: '#/components/parameters/idOrUUID' + responses: + '204': + description: successful operation + '404': + description: video does not exist + + '/api/v1/videos/{id}/transcoding': + post: + summary: Create a transcoding job + security: + - OAuth2: + - admin + tags: + - Video Transcoding + operationId: createVideoTranscoding + parameters: + - $ref: '#/components/parameters/idOrUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + transcodingType: + type: string + enum: + - hls + - web-video + forceTranscoding: + type: boolean + default: false + description: If the video is stuck in transcoding state, do it anyway + required: + - transcodingType + responses: + '204': + description: successful operation + '404': + description: video does not exist + + /api/v1/search/videos: + get: + tags: + - Search + summary: Search videos + operationId: searchVideos + parameters: + - name: search + in: query + required: true + allowEmptyValue: false + description: > + String to search. If the user can make a remote URI search, and the string is an URI then the + PeerTube instance will fetch the remote object and add it to its database. Then, + you can use the REST API to fetch the complete video information and interact with it. + schema: + type: string + - $ref: '#/components/parameters/categoryOneOf' + - $ref: '#/components/parameters/isLive' + - $ref: '#/components/parameters/tagsOneOf' + - $ref: '#/components/parameters/tagsAllOf' + - $ref: '#/components/parameters/licenceOneOf' + - $ref: '#/components/parameters/languageOneOf' + - $ref: '#/components/parameters/nsfw' + - $ref: '#/components/parameters/isLocal' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/uuids' + - $ref: '#/components/parameters/hasHLSFiles' + - $ref: '#/components/parameters/hasWebVideoFiles' + - $ref: '#/components/parameters/skipCount' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/searchTarget' + - $ref: '#/components/parameters/videosSearchSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' + - name: startDate + in: query + description: Get videos that are published after this date + schema: + type: string + format: date-time + - name: endDate + in: query + description: Get videos that are published before this date + schema: + type: string + format: date-time + - name: originallyPublishedStartDate + in: query + description: Get videos that are originally published after this date + schema: + type: string + format: date-time + - name: originallyPublishedEndDate + in: query + description: Get videos that are originally published before this date + schema: + type: string + format: date-time + - name: durationMin + in: query + description: Get videos that have this minimum duration + schema: + type: integer + - name: durationMax + in: query + description: Get videos that have this maximum duration + schema: + type: integer + callbacks: + 'searchTarget === search-index': + $ref: '#/components/callbacks/searchIndex' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' + '500': + description: search index unavailable + + /api/v1/search/video-channels: + get: + tags: + - Search + summary: Search channels + operationId: searchChannels + parameters: + - name: search + in: query + required: true + description: > + String to search. If the user can make a remote URI search, and the string is an URI then the + PeerTube instance will fetch the remote object and add it to its database. Then, + you can use the REST API to fetch the complete channel information and interact with it. + schema: + type: string + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/searchTarget' + - $ref: '#/components/parameters/sort' + callbacks: + 'searchTarget === search-index': + $ref: '#/components/callbacks/searchIndex' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannelList' + '500': + description: search index unavailable + + /api/v1/search/video-playlists: + get: + tags: + - Search + summary: Search playlists + operationId: searchPlaylists + parameters: + - name: search + in: query + required: true + description: > + String to search. If the user can make a remote URI search, and the string is an URI then the + PeerTube instance will fetch the remote object and add it to its database. Then, + you can use the REST API to fetch the complete playlist information and interact with it. + schema: + type: string + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/searchTarget' + - $ref: '#/components/parameters/sort' + callbacks: + 'searchTarget === search-index': + $ref: '#/components/callbacks/searchIndex' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' + '500': + description: search index unavailable + + /api/v1/blocklist/status: + get: + tags: + - Account Blocks + - Server Blocks + summary: Get block status of accounts/hosts + parameters: + - + name: 'accounts' + in: query + description: 'Check if these accounts are blocked' + example: [ 'goofy@example.com', 'donald@example.com' ] + schema: + type: array + items: + type: string + - + name: 'hosts' + in: query + description: 'Check if these hosts are blocked' + example: [ 'example.com' ] + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + 'application/json': + schema: + $ref: '#/components/schemas/BlockStatus' + + /api/v1/server/blocklist/accounts: + get: + tags: + - Account Blocks + summary: List account blocks + security: + - OAuth2: + - admin + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + post: + tags: + - Account Blocks + summary: Block an account + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + type: object + properties: + accountName: + type: string + example: chocobozzz@example.org + description: account to block, in the form `username@domain` + required: + - accountName + responses: + '200': + description: successful operation + '409': + description: self-blocking forbidden + + '/api/v1/server/blocklist/accounts/{accountName}': + delete: + tags: + - Account Blocks + summary: Unblock an account by its handle + security: + - OAuth2: + - admin + parameters: + - name: accountName + in: path + required: true + description: account to unblock, in the form `username@domain` + schema: + type: string + responses: + '201': + description: successful operation + '404': + description: account or account block does not exist + + /api/v1/server/blocklist/servers: + get: + tags: + - Server Blocks + summary: List server blocks + security: + - OAuth2: + - admin + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + post: + tags: + - Server Blocks + summary: Block a server + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + type: object + properties: + host: + type: string + format: hostname + description: server domain to block + required: + - host + responses: + '204': + description: successful operation + '409': + description: self-blocking forbidden + + '/api/v1/server/blocklist/servers/{host}': + delete: + tags: + - Server Blocks + summary: Unblock a server by its domain + security: + - OAuth2: + - admin + parameters: + - name: host + in: path + required: true + description: server domain to unblock + schema: + type: string + format: hostname + responses: + '204': + description: successful operation + '404': + description: account block does not exist + + /api/v1/server/redundancy/{host}: + put: + tags: + - Instance Redundancy + summary: Update a server redundancy policy + security: + - OAuth2: + - admin + parameters: + - name: host + in: path + required: true + description: server domain to mirror + schema: + type: string + format: hostname + requestBody: + content: + application/json: + schema: + type: object + properties: + redundancyAllowed: + type: boolean + description: allow mirroring of the host's local videos + required: + - redundancyAllowed + responses: + '204': + description: successful operation + '404': + description: server is not already known + + /api/v1/server/redundancy/videos: + get: + tags: + - Video Mirroring + summary: List videos being mirrored + operationId: getMirroredVideos + security: + - OAuth2: + - admin + parameters: + - name: target + in: query + required: true + description: direction of the mirror + schema: + type: string + enum: + - my-videos + - remote-videos + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/videoRedundanciesSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoRedundancy' + post: + tags: + - Video Mirroring + summary: Mirror a video + operationId: putMirroredVideo + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + type: object + properties: + videoId: + $ref: '#/components/schemas/Video/properties/id' + required: + - videoId + responses: + '204': + description: successful operation + '400': + description: cannot mirror a local video + '404': + description: video does not exist + '409': + description: video is already mirrored + + /api/v1/server/redundancy/videos/{redundancyId}: + delete: + tags: + - Video Mirroring + summary: Delete a mirror done on a video + operationId: delMirroredVideo + security: + - OAuth2: + - admin + parameters: + - name: redundancyId + in: path + required: true + description: id of an existing redundancy on a video + schema: + type: string + responses: + '204': + description: successful operation + '404': + description: video redundancy not found + + /api/v1/server/stats: + get: + tags: + - Stats + summary: Get instance stats + description: Get instance public statistics. This endpoint is cached. + operationId: getInstanceStats + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ServerStats' + + /api/v1/server/logs/client: + post: + tags: + - Logs + summary: Send client log + operationId: sendClientLog + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SendClientLog' + responses: + '204': + description: successful operation + + /api/v1/server/logs: + get: + tags: + - Logs + summary: Get instance logs + operationId: getInstanceLogs + security: + - OAuth2: + - admin + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + + /api/v1/server/audit-logs: + get: + tags: + - Logs + summary: Get instance audit logs + operationId: getInstanceAuditLogs + security: + - OAuth2: + - admin + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + + /api/v1/plugins: + get: + tags: + - Plugins + summary: List plugins + operationId: getPlugins + security: + - OAuth2: + - admin + parameters: + - name: pluginType + in: query + schema: + type: integer + - name: uninstalled + in: query + schema: + type: boolean + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/PluginResponse' + + /api/v1/plugins/available: + get: + tags: + - Plugins + summary: List available plugins + operationId: getAvailablePlugins + security: + - OAuth2: + - admin + parameters: + - name: search + in: query + schema: + type: string + - name: pluginType + in: query + schema: + type: integer + - name: currentPeerTubeEngine + in: query + schema: + type: string + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/PluginResponse' + '503': + description: plugin index unavailable + + /api/v1/plugins/install: + post: + tags: + - Plugins + summary: Install a plugin + operationId: addPlugin + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + oneOf: + - type: object + properties: + npmName: + type: string + example: peertube-plugin-auth-ldap + required: + - npmName + additionalProperties: false + - type: object + properties: + path: + type: string + required: + - path + additionalProperties: false + responses: + '204': + description: successful operation + '400': + description: should have either `npmName` or `path` set + + /api/v1/plugins/update: + post: + tags: + - Plugins + summary: Update a plugin + operationId: updatePlugin + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + oneOf: + - type: object + properties: + npmName: + type: string + example: peertube-plugin-auth-ldap + required: + - npmName + additionalProperties: false + - type: object + properties: + path: + type: string + required: + - path + additionalProperties: false + responses: + '204': + description: successful operation + '400': + description: should have either `npmName` or `path` set + '404': + description: existing plugin not found + + /api/v1/plugins/uninstall: + post: + tags: + - Plugins + summary: Uninstall a plugin + operationId: uninstallPlugin + security: + - OAuth2: + - admin + requestBody: + content: + application/json: + schema: + type: object + properties: + npmName: + type: string + description: name of the plugin/theme in its package.json + example: peertube-plugin-auth-ldap + required: + - npmName + responses: + '204': + description: successful operation + '404': + description: existing plugin not found + + /api/v1/plugins/{npmName}: + get: + tags: + - Plugins + summary: Get a plugin + operationId: getPlugin + security: + - OAuth2: + - admin + parameters: + - $ref: '#/components/parameters/npmName' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + '404': + description: plugin not found + + /api/v1/plugins/{npmName}/settings: + put: + tags: + - Plugins + summary: Set a plugin's settings + security: + - OAuth2: + - admin + parameters: + - $ref: '#/components/parameters/npmName' + requestBody: + content: + application/json: + schema: + type: object + properties: + settings: + type: object + additionalProperties: true + responses: + '204': + description: successful operation + '404': + description: plugin not found + + /api/v1/plugins/{npmName}/public-settings: + get: + tags: + - Plugins + summary: Get a plugin's public settings + parameters: + - $ref: '#/components/parameters/npmName' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: true + '404': + description: plugin not found + + /api/v1/plugins/{npmName}/registered-settings: + get: + tags: + - Plugins + summary: Get a plugin's registered settings + security: + - OAuth2: + - admin + parameters: + - $ref: '#/components/parameters/npmName' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: true + '404': + description: plugin not found + + /api/v1/metrics/playback: + post: + summary: Create playback metrics + description: These metrics are exposed by OpenTelemetry metrics exporter if enabled. + tags: + - Stats + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PlaybackMetricCreate' + responses: + '204': + description: successful operation + + /api/v1/runners/registration-tokens/generate: + post: + summary: Generate registration token + description: Generate a new runner registration token + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + responses: + '204': + description: successful operation + + /api/v1/runners/registration-tokens/{registrationTokenId}: + delete: + summary: Remove registration token + description: Remove a registration token. Runners that used this token for their registration are automatically removed. + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + parameters: + - $ref: '#/components/parameters/registrationTokenId' + responses: + '204': + description: successful operation + + /api/v1/runners/registration-tokens: + get: + summary: List registration tokens + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/registrationTokenSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/RunnerRegistrationToken' + + /api/v1/runners/register: + post: + summary: Register a new runner + description: API used by PeerTube runners + tags: + - Runners + requestBody: + content: + application/json: + schema: + type: object + properties: + registrationToken: + type: string + name: + type: string + description: + type: string + required: + - registrationToken + - name + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: Runner id + runnerToken: + type: string + + /api/v1/runners/unregister: + post: + summary: Unregister a runner + description: API used by PeerTube runners + tags: + - Runners + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '204': + description: successful operation + + /api/v1/runners/{runnerId}: + delete: + summary: Delete a runner + security: + - OAuth2: + - admin + tags: + - Runners + parameters: + - $ref: '#/components/parameters/runnerId' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '204': + description: successful operation + + /api/v1/runners: + get: + summary: List runners + security: + - OAuth2: + - admin + tags: + - Runners + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/runnerSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Runner' + + + /api/v1/runners/jobs/request: + post: + summary: Request a new job + description: API used by PeerTube runners + tags: + - Runner Jobs + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + availableJobs: + type: array + items: + type: object + properties: + uuid: + $ref: '#/components/schemas/UUIDv4' + type: + $ref: '#/components/schemas/RunnerJobType' + payload: + $ref: '#/components/schemas/RunnerJobPayload' + + /api/v1/runners/jobs/{jobUUID}/accept: + post: + summary: Accept job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + job: + allOf: + - $ref: '#/components/schemas/RunnerJob' + - type: object + properties: + jobToken: + type: string + + /api/v1/runners/jobs/{jobUUID}/abort: + post: + summary: Abort job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + reason: + type: string + description: Why the runner aborts this job + required: + - runnerToken + - jobToken + - reason + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/update: + post: + summary: Update job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + progress: + type: integer + description: Update job progression percentage (optional) + payload: + anyOf: + - type: object + description: Provide live transcoding chunks update + properties: + type: + type: string + enum: + - 'add-chunk' + - 'remove-chunk' + masterPlaylistFile: + type: string + format: binary + resolutionPlaylistFile: + type: string + format: binary + resolutionPlaylistFilename: + type: string + videoChunkFile: + type: string + format: binary + videoChunkFilename: + type: string + required: + - runnerToken + - jobToken + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/error: + post: + summary: Post job error + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + message: + type: string + description: Why the runner failed to process this job + required: + - runnerToken + - jobToken + - message + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/success: + post: + summary: Post job success + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + payload: + anyOf: + - type: object + title: VOD web video transcoding + properties: + videoFile: + type: string + format: binary + - type: object + title: VOD HLS transcoding + properties: + videoFile: + type: string + format: binary + resolutionPlaylistFile: + type: string + format: binary + - type: object + title: VOD audio merge transcoding + properties: + videoFile: + type: string + format: binary + - type: object + title: Live RTMP to HLS transcoding + required: + - runnerToken + - jobToken + - payload + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/cancel: + get: + summary: Cancel a job + security: + - OAuth2: + - admin + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}: + delete: + summary: Delete a job + description: The endpoint will first cancel the job if needed, and then remove it from the database. Children jobs will also be removed + security: + - OAuth2: + - admin + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + responses: + '204': + description: successful operation + + /api/v1/runners/jobs: + get: + summary: List jobs + security: + - OAuth2: + - admin + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/runnerJobSort' + - $ref: '#/components/parameters/search' + - name: stateOneOf + in: query + required: false + schema: + type: array + items: + $ref: '#/components/schemas/RunnerJobState' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/RunnerJobAdmin' + +servers: + - url: 'https://peertube2.cpy.re' + description: Live Test Server (live data - latest nightly version) + - url: 'https://peertube3.cpy.re' + description: Live Test Server (live data - latest RC version) + - url: 'https://peertube.cpy.re' + description: Live Test Server (live data - stable version) +components: + parameters: + start: + name: start + in: query + required: false + description: Offset used to paginate results + schema: + type: integer + minimum: 0 + count: + name: count + in: query + required: false + description: "Number of items to return" + schema: + type: integer + default: 15 + maximum: 100 + minimum: 1 + sort: + name: sort + in: query + required: false + description: Sort column + schema: + type: string + example: -createdAt + search: + name: search + in: query + required: false + description: Plain text search, applied to various parts of the model depending on endpoint + schema: + type: string + searchTarget: + name: searchTarget + in: query + required: false + description: > + If the administrator enabled search index support, you can override the default search target. + + + **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. + It means the instance may not yet know the objects you fetched. If you want to load video/channel information: + * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), + then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. + After that, you can use the classic REST API endpoints to fetch the complete object or interact with it + * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch + the data from the origin instance API + schema: + type: string + enum: + - 'local' + - 'search-index' + videosSort: + name: sort + in: query + required: false + schema: + type: string + enum: + - name + - -duration + - -createdAt + - -publishedAt + - -views + - -likes + - -trending + - -hot + - -best + description: > + Sort videos by criteria (prefixing with `-` means `DESC` order): + * `hot` - Adaptation of Reddit "hot" algorithm taking into account video views, likes, dislikes and comments and publication date + * `best` - Same than `hot`, but also takes into account user video history + * `trending` - Sort videos by recent views ("recent" is defined by the admin) + * `views` - Sort videos using their `views` counter + * `publishedAt` - Sort by video publication date (when it became publicly available) + videosSearchSort: + name: sort + in: query + required: false + description: > + Sort videos by criteria (prefixing with `-` means `DESC` order): + schema: + type: string + enum: + - name + - -duration + - -createdAt + - -publishedAt + - -views + - -likes + - -match + commentsSort: + name: sort + in: query + required: false + description: Sort comments by criteria + schema: + type: string + enum: + - -createdAt + - -totalReplies + blacklistsSort: + name: sort + in: query + required: false + description: Sort blocklists by criteria + schema: + type: string + enum: + - -id + - name + - -duration + - -views + - -likes + - -dislikes + - -uuid + - -createdAt + usersSearch: + name: search + in: query + required: false + description: Plain text search that will match with user usernames or emails + schema: + type: string + usersBlocked: + name: blocked + in: query + required: false + description: Filter results down to (un)banned users + schema: + type: boolean + usersSort: + name: sort + in: query + required: false + description: Sort users by criteria + schema: + type: string + enum: + - -id + - -username + - -createdAt + abusesSort: + name: sort + in: query + required: false + description: Sort abuses by criteria + schema: + type: string + enum: + - -id + - -createdAt + - -state + videoRedundanciesSort: + name: sort + in: query + required: false + description: Sort abuses by criteria + schema: + type: string + enum: + - name + followersSort: + name: sort + in: query + required: false + description: Sort followers by criteria + schema: + type: string + enum: + - createdAt + registrationTokenSort: + name: sort + in: query + required: false + description: Sort registration tokens by criteria + schema: + type: string + enum: + - createdAt + runnerSort: + name: sort + in: query + required: false + description: Sort runners by criteria + schema: + type: string + enum: + - createdAt + runnerJobSort: + name: sort + in: query + required: false + description: Sort runner jobs by criteria + schema: + type: string + enum: + - updatedAt + - createdAt + - priority + - state + - progress + + name: + name: name + in: path + required: true + description: The username or handle of the account + schema: + type: string + example: chocobozzz | chocobozzz@example.org + id: + name: id + in: path + required: true + description: Entity id + schema: + $ref: '#/components/schemas/id' + userId: + name: userId + in: path + required: true + description: User id + schema: + $ref: '#/components/schemas/id' + registrationId: + name: registrationId + in: path + required: true + description: Registration ID + schema: + $ref: '#/components/schemas/id' + idOrUUID: + name: id + in: path + required: true + description: The object id, uuid or short uuid + schema: + oneOf: + - $ref: '#/components/schemas/id' + - $ref: '#/components/schemas/UUIDv4' + - $ref: '#/components/schemas/shortUUID' + playlistId: + name: playlistId + in: path + required: true + description: Playlist id + schema: + $ref: '#/components/schemas/VideoPlaylist/properties/id' + playlistElementId: + name: playlistElementId + in: path + required: true + description: Playlist element id + schema: + $ref: '#/components/schemas/id' + abuseId: + name: abuseId + in: path + required: true + description: Abuse id + schema: + $ref: '#/components/schemas/Abuse/properties/id' + abuseMessageId: + name: abuseMessageId + in: path + required: true + description: Abuse message id + schema: + $ref: '#/components/schemas/AbuseMessage/properties/id' + captionLanguage: + name: captionLanguage + in: path + required: true + description: The caption language + schema: + $ref: '#/components/schemas/VideoLanguageSet' + channelHandle: + name: channelHandle + in: path + required: true + description: The video channel handle + schema: + type: string + example: my_username | my_username@example.com + channelSyncId: + name: channelSyncId + in: path + required: true + description: Channel Sync id + schema: + $ref: '#/components/schemas/Abuse/properties/id' + subscriptionHandle: + name: subscriptionHandle + in: path + required: true + description: The subscription handle + schema: + type: string + example: my_username | my_username@example.com + threadId: + name: threadId + in: path + required: true + description: The thread id (root comment id) + schema: + type: integer + commentId: + name: commentId + in: path + required: true + description: The comment id + schema: + $ref: '#/components/schemas/VideoComment/properties/id' + isLive: + name: isLive + in: query + required: false + description: whether or not the video is a live + schema: + type: boolean + categoryOneOf: + name: categoryOneOf + in: query + required: false + description: category id of the video (see [/videos/categories](#operation/getCategories)) + schema: + oneOf: + - $ref: '#/components/schemas/VideoCategorySet' + - type: array + items: + $ref: '#/components/schemas/VideoCategorySet' + style: form + explode: false + tagsOneOf: + name: tagsOneOf + in: query + required: false + description: tag(s) of the video + schema: + oneOf: + - type: string + - type: array + maxItems: 5 + items: + type: string + style: form + explode: false + tagsAllOf: + name: tagsAllOf + in: query + required: false + description: tag(s) of the video, where all should be present in the video + schema: + oneOf: + - type: string + - type: array + items: + type: string + style: form + explode: false + languageOneOf: + name: languageOneOf + in: query + required: false + description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language + schema: + oneOf: + - $ref: '#/components/schemas/VideoLanguageSet' + - type: array + items: + $ref: '#/components/schemas/VideoLanguageSet' + style: form + explode: false + licenceOneOf: + name: licenceOneOf + in: query + required: false + description: licence id of the video (see [/videos/licences](#operation/getLicences)) + schema: + oneOf: + - $ref: '#/components/schemas/VideoLicenceSet' + - type: array + items: + $ref: '#/components/schemas/VideoLicenceSet' + style: form + explode: false + skipCount: + name: skipCount + in: query + required: false + description: if you don't need the `total` in the response + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + nsfw: + name: nsfw + in: query + required: false + description: whether to include nsfw videos, if any + schema: + type: string + enum: + - 'true' + - 'false' + isLocal: + name: isLocal + in: query + required: false + schema: + type: boolean + description: '**PeerTube >= 4.0** Display only local or remote videos' + hasHLSFiles: + name: hasHLSFiles + in: query + required: false + schema: + type: boolean + description: '**PeerTube >= 4.0** Display only videos that have HLS files' + hasWebVideoFiles: + name: hasWebVideoFiles + in: query + required: false + schema: + type: boolean + description: '**PeerTube >= 6.0** Display only videos that have Web Video files' + privacyOneOf: + name: privacyOneOf + in: query + required: false + schema: + $ref: '#/components/schemas/VideoPrivacySet' + description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies' + excludeAlreadyWatched: + name: excludeAlreadyWatched + in: query + description: Whether or not to exclude videos that are in the user's video history + schema: + type: boolean + uuids: + name: uuids + in: query + required: false + schema: + items: + type: string + description: 'Find videos with specific UUIDs' + include: + name: include + in: query + required: false + schema: + type: integer + enum: + - 0 + - 1 + - 2 + - 4 + - 8 + - 16 + - 32 + description: > + **PeerTube >= 4.0** Include additional videos in results (can be combined using bitwise or operator) + + - `0` NONE + + - `1` NOT_PUBLISHED_STATE + + - `2` BLACKLISTED + + - `4` BLOCKED_OWNER + + - `8` FILES + + - `16` CAPTIONS + + - `32` VIDEO SOURCE + subscriptionsUris: + name: uris + in: query + required: true + description: list of uris to check if each is part of the user subscriptions + schema: + type: array + items: + type: string + format: uri + npmName: + name: npmName + in: path + required: true + description: name of the plugin/theme on npmjs.com or in its package.json + schema: + type: string + example: peertube-plugin-auth-ldap + jobType: + name: jobType + in: query + required: false + description: job type + schema: + type: string + enum: + - activitypub-follow + - activitypub-http-broadcast + - activitypub-http-fetcher + - activitypub-http-unicast + - email + - video-transcoding + - video-file-import + - video-import + - videos-views-stats + - activitypub-refresher + - video-redundancy + - video-live-ending + - video-channel-import + followState: + name: state + in: query + schema: + type: string + enum: + - pending + - accepted + actorType: + name: actorType + in: query + schema: + type: string + enum: + - Person + - Application + - Group + - Service + - Organization + staticFilename: + name: filename + in: path + required: true + description: Filename + schema: + type: string + videoFileToken: + name: videoFileToken + in: query + required: false + description: Video file token [generated](#operation/requestVideoToken) by PeerTube so you don't need to provide an OAuth token in the request header. + schema: + type: string + reinjectVideoFileToken: + name: reinjectVideoFileToken + in: query + required: false + description: Ask the server to reinject videoFileToken in URLs in m3u8 playlist + schema: + type: boolean + videoPlaylistType: + name: playlistType + in: query + required: false + schema: + $ref: '#/components/schemas/VideoPlaylistTypeSet' + registrationTokenId: + name: registrationTokenId + in: path + required: true + schema: + type: integer + runnerId: + name: runnerId + in: path + required: true + schema: + type: integer + jobUUID: + name: jobUUID + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv4' + videoPasswordId: + name: videoPasswordId + in: path + required: true + description: The video password id + schema: + $ref: '#/components/schemas/id' + videoPasswordHeader: + name: x-peertube-video-password + description: Required on password protected video + in: header + required: false + schema: + type: string + resumableUploadInitContentLengthHeader: + name: X-Upload-Content-Length + in: header + schema: + type: number + example: 2469036 + required: true + description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading. + resumableUploadInitContentTypeHeader: + name: X-Upload-Content-Type + in: header + schema: + type: string + format: mimetype + example: video/mp4 + required: true + description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary. + resumableUploadChunkContentRangeHeader: + name: Content-Range + in: header + schema: + type: string + example: bytes 0-262143/2469036 + required: true + description: | + Specifies the bytes in the file that the request is uploading. + + For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first + 262144 bytes (256 x 1024) in a 2,469,036 byte file. + resumableUploadChunkContentLengthHeader: + name: Content-Length + in: header + schema: + type: number + example: 262144 + required: true + description: | + Size of the chunk that the request is sending. + + Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from + 1048576 bytes (~1MB) and increases or reduces size depending on connection health. + resumableUploadId: + name: upload_id + in: query + required: true + description: | + Created session id to proceed with. If you didn't send chunks in the last hour, it is + not valid anymore and you need to initialize a new upload. + schema: + type: string + + + securitySchemes: + OAuth2: + description: | + Authenticating via OAuth requires the following steps: + - Have an activated account + - [Generate] an access token for that account at `/api/v1/users/token`. + - Make requests with the *Authorization: Bearer * header + - Profit, depending on the role assigned to the account + + Note that the __access token is valid for 1 day__ and is given + along with a __refresh token valid for 2 weeks__. + + [Generate]: https://docs.joinpeertube.org/api/rest-getting-started + type: oauth2 + flows: + password: + tokenUrl: /api/v1/users/token + scopes: + admin: Admin scope + moderator: Moderator scope + user: User scope + schemas: + # Reusable core properties + id: + type: integer + minimum: 1 + example: 42 + UUIDv4: + type: string + format: uuid + example: 9c9de5e8-0a1e-484a-b099-e80766180a6d + pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' + minLength: 36 + maxLength: 36 + shortUUID: + type: string + description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid + example: 2y84q2MQUMWPbiEcxNXMgC + username: + type: string + description: immutable name of the user, used to find or mention its actor + example: chocobozzz + pattern: '/^[a-z0-9._]+$/' + minLength: 1 + maxLength: 50 + usernameChannel: + type: string + description: immutable name of the channel, used to interact with its actor + example: framasoft_videos + pattern: '/^[a-zA-Z0-9\\-_.:]+$/' + minLength: 1 + maxLength: 50 + password: + type: string + format: password + minLength: 6 + maxLength: 255 + + VideoCategorySet: + type: integer + description: category id of the video (see [/videos/categories](#operation/getCategories)) + example: 15 + VideoConstantNumber-Category: + properties: + id: + $ref: '#/components/schemas/VideoCategorySet' + label: + type: string + example: Science & Technology + + VideoLicenceSet: + type: integer + description: licence id of the video (see [/videos/licences](#operation/getLicences)) + example: 2 + VideoConstantNumber-Licence: + properties: + id: + $ref: '#/components/schemas/VideoLicenceSet' + label: + type: string + example: Attribution - Share Alike + + VideoLanguageSet: + type: string + description: language id of the video (see [/videos/languages](#operation/getLanguages)) + example: en + VideoConstantString-Language: + properties: + id: + $ref: '#/components/schemas/VideoLanguageSet' + label: + type: string + example: English + + VideoPlaylistPrivacySet: + type: integer + enum: + - 1 + - 2 + - 3 + description: Video playlist privacy policy (see [/video-playlists/privacies](#operation/getPlaylistPrivacyPolicies)) + VideoPlaylistPrivacyConstant: + properties: + id: + $ref: '#/components/schemas/VideoPlaylistPrivacySet' + label: + type: string + + VideoPlaylistTypeSet: + type: integer + enum: + - 1 + - 2 + description: The video playlist type (Regular = `1`, Watch Later = `2`) + VideoPlaylistTypeConstant: + properties: + id: + $ref: '#/components/schemas/VideoPlaylistTypeSet' + label: + type: string + + VideoPrivacySet: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + description: privacy id of the video (see [/videos/privacies](#operation/getVideoPrivacyPolicies)) + VideoPrivacyConstant: + properties: + id: + $ref: '#/components/schemas/VideoPrivacySet' + label: + type: string + + BlockStatus: + properties: + accounts: + type: object + additionalProperties: + x-additionalPropertiesName: account + type: object + properties: + blockedByServer: + type: boolean + blockedByUser: + type: boolean + hosts: + type: object + additionalProperties: + x-additionalPropertiesName: host + type: object + properties: + blockedByServer: + type: boolean + blockedByUser: + type: boolean + + NSFWPolicy: + type: string + enum: + - display + - blur + - do_not_list + + UserRole: + type: integer + enum: + - 0 + - 1 + - 2 + description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)' + example: 2 + UserAdminFlags: + type: integer + enum: + - 0 + - 1 + description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)' + example: 1 + + LiveVideoLatencyMode: + type: integer + enum: + - 1 + - 2 + - 3 + description: 'The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`)' + + LiveVideoReplaySettings: + type: object + properties: + privacy: + # description: Video playlist privacy policy (see [../video-playlists/privacies]) + $ref: '#/components/schemas/VideoPrivacySet' + + + VideoStateConstant: + properties: + id: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + description: | + The video state: + - `1`: Published + - `2`: To transcode + - `3`: To import + - `4`: Waiting for live stream + - `5`: Live ended + - `6`: To move to an external storage (object storage...) + - `7`: Transcoding failed + - `8`: Moving to an external storage failed + - `9`: To edit using studio edition feature + label: + type: string + + UserExportState: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + description: | + The user export state: + - `1`: Pending + - `2`: Processing + - `3`: Completed + - `4`: Errored + + UserImportState: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + description: | + The user import state: + - `1`: Pending + - `2`: Processing + - `3`: Completed + - `4`: Errored + + AbuseStateSet: + type: integer + enum: + - 1 + - 2 + - 3 + description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)' + AbuseStateConstant: + properties: + id: + $ref: '#/components/schemas/AbuseStateSet' + label: + type: string + AbusePredefinedReasons: + type: array + items: + type: string + enum: + - violentOrAbusive + - hatefulOrAbusive + - spamOrMisleading + - privacy + - rights + - serverRules + - thumbnails + - captions + example: [spamOrMisleading] + + VideoResolutionSet: + type: integer + description: | + Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) + + `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. + example: 240 + VideoResolutionConstant: + description: resolutions and their labels for the video + properties: + id: + $ref: '#/components/schemas/VideoResolutionSet' + label: + type: string + example: 240p + VideoScheduledUpdate: + properties: + privacy: + $ref: '#/components/schemas/VideoPrivacySet' + updateAt: + type: string + format: date-time + description: When to update the video + required: + - updateAt + AccountSummary: + properties: + id: + type: integer + name: + type: string + displayName: + type: string + url: + type: string + format: url + host: + type: string + format: hostname + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + VideoChannelSummary: + properties: + id: + $ref: '#/components/schemas/id' + name: + type: string + displayName: + type: string + url: + type: string + format: url + host: + type: string + format: hostname + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + PlaylistElement: + properties: + position: + type: integer + startTimestamp: + type: integer + format: seconds + stopTimestamp: + type: integer + format: seconds + video: + nullable: true + allOf: + - $ref: '#/components/schemas/Video' + VideoFile: + readOnly: true + properties: + id: + $ref: '#/components/schemas/id' + magnetUri: + type: string + format: uri + description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file + pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i + resolution: + $ref: '#/components/schemas/VideoResolutionConstant' + size: + type: integer + description: Video file size in bytes + torrentUrl: + type: string + description: Direct URL of the torrent file + format: url + torrentDownloadUrl: + type: string + description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) + format: url + fileUrl: + type: string + description: Direct URL of the video + format: url + fileDownloadUrl: + type: string + description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) + format: url + fps: + type: number + description: Frames per second of the video file + width: + type: number + description: "**PeerTube >= 6.1** Video stream width" + height: + type: number + description: "**PeerTube >= 6.1** Video stream height" + metadataUrl: + type: string + format: url + description: URL dereferencing the output of ffprobe on the file + VideoStreamingPlaylists: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/id' + type: + type: integer + enum: + - 1 + description: | + Playlist type: + - `1`: HLS + - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS' + VideoStreamingPlaylists-HLS: + properties: + playlistUrl: + type: string + format: url + segmentsSha256Url: + type: string + format: url + files: + type: array + description: | + Video files associated to this playlist. + + The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.) + items: + $ref: '#/components/schemas/VideoFile' + redundancies: + type: array + items: + type: object + properties: + baseUrl: + type: string + format: url + VideoInfo: + properties: + id: + $ref: '#/components/schemas/Video/properties/id' + uuid: + $ref: '#/components/schemas/Video/properties/uuid' + name: + $ref: '#/components/schemas/Video/properties/name' + Video: + properties: + id: + description: object id for the video + allOf: + - $ref: '#/components/schemas/id' + uuid: + description: universal identifier for the video, that can be used across instances + allOf: + - $ref: '#/components/schemas/UUIDv4' + shortUUID: + allOf: + - $ref: '#/components/schemas/shortUUID' + isLive: + type: boolean + createdAt: + type: string + format: date-time + example: 2017-10-01T10:52:46.396Z + description: time at which the video object was first drafted + publishedAt: + type: string + format: date-time + example: 2018-10-01T10:52:46.396Z + description: time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution. + updatedAt: + type: string + format: date-time + example: 2021-05-04T08:01:01.502Z + description: last time the video's metadata was modified + originallyPublishedAt: + type: string + format: date-time + example: 2010-10-01T10:52:46.396Z + description: used to represent a date of first publication, prior to the practical publication date of `publishedAt` + category: + allOf: + - $ref: '#/components/schemas/VideoConstantNumber-Category' + description: category in which the video is classified + licence: + allOf: + - $ref: '#/components/schemas/VideoConstantNumber-Licence' + description: licence under which the video is distributed + language: + allOf: + - $ref: '#/components/schemas/VideoConstantString-Language' + description: main language used in the video + privacy: + allOf: + - $ref: '#/components/schemas/VideoPrivacyConstant' + description: privacy policy used to distribute the video + description: + type: string + example: | + **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n + **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr... + minLength: 3 + maxLength: 250 + description: | + truncated description of the video, written in Markdown. + Resolve `descriptionPath` to get the full description of maximum `10000` characters. + duration: + type: integer + example: 1419 + format: seconds + description: duration of the video in seconds + aspectRatio: + type: number + format: float + example: 1.778 + description: "**PeerTube >= 6.1** Aspect ratio of the video stream" + isLocal: + type: boolean + name: + type: string + description: title of the video + example: What is PeerTube? + minLength: 3 + maxLength: 120 + thumbnailPath: + type: string + example: /lazy-static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg + previewPath: + type: string + example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg + embedPath: + type: string + example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee + views: + type: integer + example: 1337 + likes: + type: integer + example: 42 + dislikes: + type: integer + example: 7 + nsfw: + type: boolean + waitTranscoding: + type: boolean + nullable: true + state: + allOf: + - $ref: '#/components/schemas/VideoStateConstant' + description: represents the internal state of the video processing within the PeerTube instance + scheduledUpdate: + nullable: true + allOf: + - $ref: '#/components/schemas/VideoScheduledUpdate' + blacklisted: + nullable: true + type: boolean + blacklistedReason: + nullable: true + type: string + account: + $ref: '#/components/schemas/AccountSummary' + channel: + $ref: '#/components/schemas/VideoChannelSummary' + userHistory: + nullable: true + type: object + properties: + currentTime: + type: integer + VideoDetails: + allOf: + - $ref: '#/components/schemas/Video' + - type: object + properties: + viewers: + type: integer + description: If the video is a live, you have the amount of current viewers + descriptionPath: + type: string + example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description + description: path at which to get the full description of maximum `10000` characters + support: + type: string + description: A text tell the audience how to support the video creator + example: Please support our work on https://soutenir.framasoft.org/en/ <3 + minLength: 3 + maxLength: 1000 + channel: + $ref: '#/components/schemas/VideoChannel' + account: + $ref: '#/components/schemas/Account' + tags: + example: [flowers, gardening] + type: array + minItems: 1 + maxItems: 5 + items: + type: string + minLength: 2 + maxLength: 30 + commentsEnabled: + type: boolean + downloadEnabled: + type: boolean + inputFileUpdatedAt: + type: string + format: date-time + nullable: true + description: Latest input file update. Null if the file has never been replaced since the original upload + trackerUrls: + type: array + items: + type: string + format: url + example: + - https://peertube2.cpy.re/tracker/announce + - wss://peertube2.cpy.re/tracker/socket + files: + type: array + items: + $ref: '#/components/schemas/VideoFile' + description: | + Web compatible video files. If Web Video is disabled on the server: + + - field will be empty + - video files will be found in `streamingPlaylists[].files` field + streamingPlaylists: + type: array + items: + $ref: '#/components/schemas/VideoStreamingPlaylists' + description: | + HLS playlists/manifest files. If HLS is disabled on the server: + + - field will be empty + - video files will be found in `files` field + FileRedundancyInformation: + properties: + id: + $ref: '#/components/schemas/id' + fileUrl: + type: string + format: url + strategy: + type: string + enum: + - manual + - most-views + - trending + - recently-added + size: + type: integer + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + expiresOn: + type: string + format: date-time + VideoRedundancy: + properties: + id: + $ref: '#/components/schemas/id' + name: + type: string + url: + type: string + format: url + uuid: + $ref: '#/components/schemas/UUIDv4' + redundancies: + type: object + properties: + files: + type: array + items: + $ref: '#/components/schemas/FileRedundancyInformation' + streamingPlaylists: + type: array + items: + $ref: '#/components/schemas/FileRedundancyInformation' + VideoImportStateConstant: + properties: + id: + type: integer + enum: + - 1 + - 2 + - 3 + description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)' + label: + type: string + example: Pending + VideoCreateImport: + allOf: + - type: object + additionalProperties: false + oneOf: + - properties: + targetUrl: + $ref: '#/components/schemas/VideoImport/properties/targetUrl' + required: [targetUrl] + - properties: + magnetUri: + $ref: '#/components/schemas/VideoImport/properties/magnetUri' + required: [magnetUri] + - properties: + torrentfile: + $ref: '#/components/schemas/VideoImport/properties/torrentfile' + required: [torrentfile] + - $ref: '#/components/schemas/VideoUploadRequestCommon' + required: + - channelId + - name + VideoImport: + properties: + id: + readOnly: true + allOf: + - $ref: '#/components/schemas/id' + targetUrl: + type: string + format: url + description: remote URL where to find the import's source video + example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d + magnetUri: + type: string + format: uri + description: magnet URI allowing to resolve the import's source video + pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i + torrentfile: + writeOnly: true + type: string + format: binary + description: Torrent file containing only the video file + torrentName: + readOnly: true + type: string + state: + readOnly: true + allOf: + - $ref: '#/components/schemas/VideoImportStateConstant' + error: + readOnly: true + type: string + createdAt: + readOnly: true + type: string + format: date-time + updatedAt: + readOnly: true + type: string + format: date-time + video: + readOnly: true + nullable: true + allOf: + - $ref: '#/components/schemas/Video' + VideoImportsList: + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/VideoImport' + Abuse: + properties: + id: + $ref: '#/components/schemas/id' + reason: + type: string + example: The video is a spam + minLength: 2 + maxLength: 3000 + predefinedReasons: + $ref: '#/components/schemas/AbusePredefinedReasons' + reporterAccount: + $ref: '#/components/schemas/Account' + state: + $ref: '#/components/schemas/AbuseStateConstant' + moderationComment: + type: string + example: Decided to ban the server since it spams us regularly + minLength: 2 + maxLength: 3000 + video: + $ref: '#/components/schemas/VideoInfo' + createdAt: + type: string + format: date-time + AbuseMessage: + properties: + id: + $ref: '#/components/schemas/id' + message: + type: string + minLength: 2 + maxLength: 3000 + byModerator: + type: boolean + createdAt: + type: string + format: date-time + account: + $ref: '#/components/schemas/AccountSummary' + VideoBlacklist: + properties: + id: + $ref: '#/components/schemas/id' + videoId: + $ref: '#/components/schemas/Video/properties/id' + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + name: + type: string + minLength: 3 + maxLength: 120 + uuid: + $ref: '#/components/schemas/UUIDv4' + description: + type: string + minLength: 3 + maxLength: 10000 + duration: + type: integer + views: + type: integer + likes: + type: integer + dislikes: + type: integer + nsfw: + type: boolean + VideoPlaylist: + properties: + id: + $ref: '#/components/schemas/id' + uuid: + $ref: '#/components/schemas/UUIDv4' + shortUUID: + allOf: + - $ref: '#/components/schemas/shortUUID' + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + description: + type: string + minLength: 3 + maxLength: 1000 + displayName: + type: string + minLength: 1 + maxLength: 120 + isLocal: + type: boolean + videoLength: + type: integer + minimum: 0 + thumbnailPath: + type: string + privacy: + $ref: '#/components/schemas/VideoPlaylistPrivacyConstant' + type: + $ref: '#/components/schemas/VideoPlaylistTypeConstant' + ownerAccount: + $ref: '#/components/schemas/AccountSummary' + videoChannel: + $ref: '#/components/schemas/VideoChannelSummary' + VideoComment: + properties: + id: + $ref: '#/components/schemas/id' + url: + type: string + format: url + text: + type: string + format: html + description: Text of the comment + minLength: 1 + example: This video is wonderful! + threadId: + $ref: '#/components/schemas/id' + inReplyToCommentId: + nullable: true + allOf: + - $ref: '#/components/schemas/id' + videoId: + $ref: '#/components/schemas/Video/properties/id' + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + deletedAt: + nullable: true + type: string + format: date-time + default: null + isDeleted: + type: boolean + default: false + totalRepliesFromVideoAuthor: + type: integer + minimum: 0 + totalReplies: + type: integer + minimum: 0 + account: + $ref: '#/components/schemas/Account' + VideoCommentThreadTree: + properties: + comment: + $ref: '#/components/schemas/VideoComment' + children: + type: array + items: + $ref: '#/components/schemas/VideoCommentThreadTree' + Storyboard: + properties: + storyboardPath: + type: string + totalHeight: + type: integer + totalWidth: + type: integer + spriteHeight: + type: integer + spriteWidth: + type: integer + spriteDuration: + type: integer + VideoCaption: + properties: + language: + $ref: '#/components/schemas/VideoConstantString-Language' + captionPath: + type: string + VideoChapters: + properties: + chapters: + type: object + properties: + title: + type: string + timecode: + type: integer + VideoSource: + properties: + filename: + type: string + deprecated: true + description: 'Deprecated in 6.1, use inputFilename instead' + inputFilename: + type: string + description: 'Uploaded/imported filename' + fileDownloadUrl: + type: string + description: "**PeerTube >= 6.1** If enabled by the admin, the video source file is kept on the server and can be downloaded by the owner" + resolution: + $ref: '#/components/schemas/VideoResolutionConstant' + size: + type: integer + description: "**PeerTube >= 6.1** Video file size in bytes" + fps: + type: number + description: "**PeerTube >= 6.1** Frames per second of the video file" + width: + type: number + description: "**PeerTube >= 6.1** Video stream width" + height: + type: number + description: "**PeerTube >= 6.1** Video stream height" + createdAt: + type: string + format: date-time + ActorImage: + properties: + path: + type: string + width: + type: integer + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + ActorInfo: + properties: + id: + $ref: '#/components/schemas/id' + name: + type: string + displayName: + type: string + host: + type: string + format: hostname + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + Actor: + properties: + id: + $ref: '#/components/schemas/id' + url: + type: string + format: url + name: + description: immutable name of the actor, used to find or mention it + allOf: + - $ref: '#/components/schemas/username' + host: + type: string + format: hostname + description: server on which the actor is resident + hostRedundancyAllowed: + type: boolean + description: whether this actor's host allows redundancy of its videos + followingCount: + type: integer + minimum: 0 + description: number of actors subscribed to by this actor, as seen by this instance + followersCount: + type: integer + minimum: 0 + description: number of followers of this actor, as seen by this instance + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + Account: + allOf: + - $ref: '#/components/schemas/Actor' + - properties: + userId: + description: object id for the user tied to this account + allOf: + - $ref: '#/components/schemas/User/properties/id' + displayName: + type: string + description: editable name of the account, displayed in its representations + minLength: 3 + maxLength: 120 + description: + type: string + description: text or bio displayed on the account's profile + UserViewingVideo: + required: + - currentTime + properties: + currentTime: + type: integer + format: seconds + description: timestamp within the video, in seconds + example: 5 + viewEvent: + type: string + enum: + - seek + description: > + Event since last viewing call: + * `seek` - If the user seeked the video + sessionId: + type: string + description: > + Optional param to represent the current viewer session. + Used by the backend to properly count one view per session per video. + PeerTube admin can configure the server to not trust this `sessionId` parameter but use the request IP address instead to identify a viewer. + + + VideoStatsOverall: + properties: + averageWatchTime: + type: number + totalWatchTime: + type: number + viewersPeak: + type: number + viewersPeakDate: + type: string + format: date-time + countries: + type: array + items: + type: object + properties: + isoCode: + type: string + viewers: + type: number + + VideoStatsRetention: + properties: + data: + type: array + items: + type: object + properties: + second: + type: number + retentionPercent: + type: number + + VideoStatsTimeserie: + properties: + data: + type: array + items: + type: object + properties: + date: + type: string + value: + type: number + + ServerConfig: + properties: + instance: + type: object + properties: + name: + type: string + shortDescription: + type: string + defaultClientRoute: + type: string + isNSFW: + type: boolean + defaultNSFWPolicy: + type: string + customizations: + type: object + properties: + javascript: + type: string + css: + type: string + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + banners: + type: array + items: + $ref: '#/components/schemas/ActorImage' + search: + type: object + properties: + remoteUri: + type: object + properties: + users: + type: boolean + anonymous: + type: boolean + plugin: + type: object + properties: + registered: + type: array + items: + type: string + theme: + type: object + properties: + registered: + type: array + items: + type: string + email: + type: object + properties: + enabled: + type: boolean + contactForm: + type: object + properties: + enabled: + type: boolean + serverVersion: + type: string + serverCommit: + type: string + signup: + type: object + properties: + allowed: + type: boolean + allowedForCurrentIP: + type: boolean + requiresEmailVerification: + type: boolean + transcoding: + type: object + properties: + hls: + type: object + properties: + enabled: + type: boolean + web_videos: + type: object + properties: + enabled: + type: boolean + enabledResolutions: + type: array + items: + $ref: '#/components/schemas/VideoResolutionSet' + import: + type: object + properties: + videos: + type: object + properties: + http: + type: object + properties: + enabled: + type: boolean + torrent: + type: object + properties: + enabled: + type: boolean + videoChannelSynchronization: + type: object + properties: + enabled: + type: boolean + users: + type: object + properties: + enabled: + type: boolean + export: + type: object + properties: + users: + type: object + properties: + enabled: + type: boolean + exportExpiration: + type: number + description: In milliseconds + maxUserVideoQuota: + type: number + description: In bytes + autoBlacklist: + type: object + properties: + videos: + type: object + properties: + ofUsers: + type: object + properties: + enabled: + type: boolean + avatar: + type: object + properties: + file: + type: object + properties: + size: + type: object + properties: + max: + type: integer + extensions: + type: array + items: + type: string + video: + type: object + properties: + image: + type: object + properties: + extensions: + type: array + items: + type: string + size: + type: object + properties: + max: + type: integer + file: + type: object + properties: + extensions: + type: array + items: + type: string + videoCaption: + type: object + properties: + file: + type: object + properties: + size: + type: object + properties: + max: + type: integer + extensions: + type: array + items: + type: string + user: + type: object + properties: + videoQuota: + type: integer + description: In bytes + example: 16810141515 + videoQuotaDaily: + type: integer + description: In bytes + example: 1681014151 + trending: + type: object + properties: + videos: + type: object + properties: + intervalDays: + type: integer + tracker: + type: object + properties: + enabled: + type: boolean + followings: + type: object + properties: + instance: + type: object + properties: + autoFollowIndex: + type: object + properties: + indexUrl: + type: string + format: url + homepage: + type: object + properties: + enabled: + type: boolean + + openTelemetry: + type: object + description: 'PeerTube >= 6.1' + properties: + metrics: + type: object + properties: + enabled: + type: boolean + playbackStatsInterval: + type: number + description: 'Milliseconds' + + views: + type: object + description: 'PeerTube >= 6.1' + properties: + views: + type: object + properties: + watchingInterval: + type: object + properties: + anonymous: + type: number + description: 'Milliseconds' + users: + type: number + description: 'Milliseconds' + + SendClientLog: + properties: + message: + type: string + url: + type: string + description: URL of the current user page + level: + enum: + - error + - warn + stackTrace: + type: string + description: Stack trace of the error if there is one + userAgent: + type: string + description: User agent of the web browser that sends the message + meta: + type: string + description: Additional information regarding this log + required: + - message + - url + - level + + ServerStats: + properties: + totalUsers: + type: number + totalDailyActiveUsers: + type: number + totalWeeklyActiveUsers: + type: number + totalMonthlyActiveUsers: + type: number + totalModerators: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled total moderators stats" + totalAdmins: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled total admins stats" + totalLocalVideos: + type: number + totalLocalVideoViews: + type: number + description: Total video views made on the instance + totalLocalVideoComments: + type: number + description: Total comments made by local users + totalLocalVideoFilesSize: + type: number + totalVideos: + type: number + totalVideoComments: + type: number + totalLocalVideoChannels: + type: number + totalLocalDailyActiveVideoChannels: + type: number + totalLocalWeeklyActiveVideoChannels: + type: number + totalLocalMonthlyActiveVideoChannels: + type: number + totalLocalPlaylists: + type: number + totalInstanceFollowers: + type: number + totalInstanceFollowing: + type: number + videosRedundancy: + type: array + items: + type: object + properties: + strategy: + type: string + totalSize: + type: number + totalUsed: + type: number + totalVideoFiles: + type: number + totalVideos: + type: number + totalActivityPubMessagesProcessed: + type: number + totalActivityPubMessagesSuccesses: + type: number + totalActivityPubMessagesErrors: + type: number + + activityPubMessagesProcessedPerSecond: + type: number + totalActivityPubMessagesWaiting: + type: number + + averageRegistrationRequestResponseTimeMs: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled registration requests stats" + totalRegistrationRequestsProcessed: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled registration requests stats" + totalRegistrationRequests: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled registration requests stats" + + averageAbuseResponseTimeMs: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled abuses stats" + totalAbusesProcessed: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled abuses stats" + totalAbuses: + type: number + description: "**PeerTube >= 6.1** Value is null if the admin disabled abuses stats" + + ServerConfigAbout: + properties: + instance: + type: object + properties: + name: + type: string + shortDescription: + type: string + description: + type: string + terms: + type: string + codeOfConduct: + type: string + hardwareInformation: + type: string + creationReason: + type: string + moderationInformation: + type: string + administrator: + type: string + maintenanceLifetime: + type: string + businessModel: + type: string + languages: + type: array + items: + type: string + categories: + type: array + items: + type: integer + avatars: + type: array + items: + $ref: '#/components/schemas/ActorImage' + banners: + type: array + items: + $ref: '#/components/schemas/ActorImage' + ServerConfigCustom: + properties: + instance: + type: object + properties: + name: + type: string + shortDescription: + type: string + description: + type: string + terms: + type: string + defaultClientRoute: + type: string + isNSFW: + type: boolean + defaultNSFWPolicy: + type: string + customizations: + type: object + properties: + javascript: + type: string + css: + type: string + theme: + type: object + properties: + default: + type: string + services: + type: object + properties: + twitter: + type: object + properties: + username: + type: string + cache: + type: object + properties: + previews: + type: object + properties: + size: + type: integer + captions: + type: object + properties: + size: + type: integer + signup: + type: object + properties: + enabled: + type: boolean + limit: + type: integer + requiresEmailVerification: + type: boolean + admin: + type: object + properties: + email: + type: string + format: email + contactForm: + type: object + properties: + enabled: + type: boolean + user: + type: object + description: Settings that apply to new users, if registration is enabled + properties: + videoQuota: + type: integer + example: 16810141515 + videoQuotaDaily: + type: integer + example: 1681014151 + transcoding: + type: object + description: Settings pertaining to transcoding jobs + properties: + enabled: + type: boolean + originalFile: + type: object + properties: + keep: + type: boolean + allowAdditionalExtensions: + type: boolean + description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos + allowAudioFiles: + type: boolean + description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file + threads: + type: integer + description: Amount of threads used by ffmpeg for 1 transcoding job + concurrency: + type: number + description: Amount of transcoding jobs to execute in parallel + profile: + type: string + enum: + - default + description: | + New profiles can be added by plugins ; available in core PeerTube: 'default'. + resolutions: + type: object + description: Resolutions to transcode _new videos_ to + properties: + 0p: + type: boolean + 144p: + type: boolean + 240p: + type: boolean + 360p: + type: boolean + 480p: + type: boolean + 720p: + type: boolean + 1080p: + type: boolean + 1440p: + type: boolean + 2160p: + type: boolean + web_videos: + type: object + description: Web Video specific settings + properties: + enabled: + type: boolean + hls: + type: object + description: HLS specific settings + properties: + enabled: + type: boolean + import: + type: object + properties: + videos: + type: object + properties: + http: + type: object + properties: + enabled: + type: boolean + torrent: + type: object + properties: + enabled: + type: boolean + video_channel_synchronization: + type: object + properties: + enabled: + type: boolean + autoBlacklist: + type: object + properties: + videos: + type: object + properties: + ofUsers: + type: object + properties: + enabled: + type: boolean + followers: + type: object + properties: + instance: + type: object + properties: + enabled: + type: boolean + manualApproval: + type: boolean + + CustomHomepage: + properties: + content: + type: string + + Follow: + properties: + id: + $ref: '#/components/schemas/id' + follower: + $ref: '#/components/schemas/Actor' + following: + $ref: '#/components/schemas/Actor' + score: + type: number + description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. + state: + type: string + enum: + - pending + - accepted + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + + PredefinedAbuseReasons: + description: Reason categories that help triage reports + type: array + maxItems: 8 + items: + type: string + enum: + - violentOrAbusive + - hatefulOrAbusive + - spamOrMisleading + - privacy + - rights + - serverRules + - thumbnails + - captions + + Job: + properties: + id: + $ref: '#/components/schemas/id' + state: + type: string + enum: + - active + - completed + - failed + - waiting + - delayed + type: + type: string + enum: + - activitypub-http-unicast + - activitypub-http-broadcast + - activitypub-http-fetcher + - activitypub-follow + - video-file-import + - video-transcoding + - email + - video-import + - videos-views-stats + - activitypub-refresher + - video-redundancy + - video-channel-import + data: + type: object + additionalProperties: true + error: + type: object + additionalProperties: true + createdAt: + type: string + format: date-time + finishedOn: + type: string + format: date-time + processedOn: + type: string + format: date-time + AddUserResponse: + properties: + user: + type: object + properties: + id: + $ref: '#/components/schemas/id' + account: + type: object + properties: + id: + $ref: '#/components/schemas/id' + VideoUploadRequestCommon: + properties: + name: + description: Video name + type: string + example: What is PeerTube? + minLength: 3 + maxLength: 120 + channelId: + description: Channel id that will contain this video + type: integer + example: 3 + minimum: 1 + privacy: + $ref: '#/components/schemas/VideoPrivacySet' + category: + $ref: '#/components/schemas/VideoCategorySet' + licence: + $ref: '#/components/schemas/VideoLicenceSet' + language: + $ref: '#/components/schemas/VideoLanguageSet' + description: + description: Video description + type: string + example: | + **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)** + waitTranscoding: + description: Whether or not we wait transcoding before publish the video + type: boolean + support: + description: A text tell the audience how to support the video creator + example: Please support our work on https://soutenir.framasoft.org/en/ <3 + type: string + nsfw: + description: Whether or not this video contains sensitive content + type: boolean + tags: + description: Video tags (maximum 5 tags each between 2 and 30 characters) + type: array + minItems: 1 + maxItems: 5 + uniqueItems: true + example: + - framasoft + - peertube + items: + type: string + minLength: 2 + maxLength: 30 + commentsEnabled: + description: Enable or disable comments for this video + type: boolean + downloadEnabled: + description: Enable or disable downloading for this video + type: boolean + originallyPublishedAt: + description: Date when the content was originally published + type: string + format: date-time + scheduleUpdate: + $ref: '#/components/schemas/VideoScheduledUpdate' + thumbnailfile: + description: Video thumbnail file + type: string + format: binary + previewfile: + description: Video preview file + type: string + format: binary + videoPasswords: + $ref: '#/components/schemas/AddVideoPasswords' + required: + - channelId + - name + VideoUploadRequestLegacy: + allOf: + - $ref: '#/components/schemas/VideoUploadRequestCommon' + - type: object + required: + - videofile + properties: + videofile: + description: Video file + type: string + format: binary + VideoUploadRequestResumable: + allOf: + - $ref: '#/components/schemas/VideoUploadRequestCommon' + - type: object + required: + - filename + properties: + filename: + description: Video filename including extension + type: string + format: filename + example: what_is_peertube.mp4 + thumbnailfile: + description: Video thumbnail file + type: string + format: binary + previewfile: + description: Video preview file + type: string + format: binary + VideoUploadResponse: + properties: + video: + type: object + properties: + id: + $ref: '#/components/schemas/Video/properties/id' + uuid: + $ref: '#/components/schemas/Video/properties/uuid' + shortUUID: + $ref: '#/components/schemas/Video/properties/shortUUID' + VideoReplaceSourceRequestResumable: + properties: + filename: + description: Video filename including extension + type: string + format: filename + example: what_is_peertube.mp4 + UserImportResumable: + properties: + filename: + description: Archive filename including extension + type: string + format: filename + example: "user-export-6-2024-02-09T10_12_11.682Z" + CommentThreadResponse: + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/VideoComment' + CommentThreadPostResponse: + properties: + comment: + $ref: '#/components/schemas/VideoComment' + VideoTokenResponse: + properties: + files: + type: object + properties: + token: + type: string + expires: + type: string + format: date-time + VideoListResponse: + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Video' + User: + properties: + account: + $ref: '#/components/schemas/Account' + autoPlayNextVideo: + type: boolean + description: Automatically start playing the upcoming video after the currently playing video + autoPlayNextVideoPlaylist: + type: boolean + description: Automatically start playing the video on the playlist after the currently playing video + autoPlayVideo: + type: boolean + description: Automatically start playing the video on the watch page + blocked: + type: boolean + blockedReason: + type: string + createdAt: + type: string + email: + type: string + format: email + description: The user email + emailVerified: + type: boolean + description: Has the user confirmed their email address? + id: + allOf: + - $ref: '#/components/schemas/id' + readOnly: true + pluginAuth: + type: string + description: Auth plugin to use to authenticate the user + lastLoginDate: + type: string + format: date-time + noInstanceConfigWarningModal: + type: boolean + noAccountSetupWarningModal: + type: boolean + noWelcomeModal: + type: boolean + nsfwPolicy: + $ref: '#/components/schemas/NSFWPolicy' + role: + type: object + properties: + id: + $ref: '#/components/schemas/UserRole' + label: + type: string + enum: + - User + - Moderator + - Administrator + theme: + type: string + description: Theme enabled by this user + username: + $ref: '#/components/schemas/username' + videoChannels: + type: array + items: + $ref: '#/components/schemas/VideoChannel' + videoQuota: + type: integer + description: The user video quota in bytes + example: -1 + videoQuotaDaily: + type: integer + description: The user daily video quota in bytes + example: -1 + p2pEnabled: + type: boolean + description: Enable P2P in the player + UserWithStats: + allOf: + - $ref: '#/components/schemas/User' + - properties: + # optionally present fields: they require WITH_STATS scope + videosCount: + type: integer + description: Count of videos published + abusesCount: + type: integer + description: Count of reports/abuses of which the user is a target + abusesAcceptedCount: + type: integer + description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team + abusesCreatedCount: + type: integer + description: Count of reports/abuses created by the user + videoCommentsCount: + type: integer + description: Count of comments published + AddUser: + properties: + username: + $ref: '#/components/schemas/username' + password: + $ref: '#/components/schemas/password' + email: + type: string + format: email + description: The user email + videoQuota: + type: integer + description: The user video quota in bytes + example: -1 + videoQuotaDaily: + type: integer + description: The user daily video quota in bytes + example: -1 + channelName: + $ref: '#/components/schemas/usernameChannel' + role: + $ref: '#/components/schemas/UserRole' + adminFlags: + $ref: '#/components/schemas/UserAdminFlags' + required: + - username + - password + - email + - role + UpdateUser: + properties: + email: + description: The updated email of the user + allOf: + - $ref: '#/components/schemas/User/properties/email' + emailVerified: + type: boolean + description: Set the email as verified + videoQuota: + type: integer + description: The updated video quota of the user in bytes + videoQuotaDaily: + type: integer + description: The updated daily video quota of the user in bytes + pluginAuth: + type: string + nullable: true + description: The auth plugin to use to authenticate the user + example: 'peertube-plugin-auth-saml2' + role: + $ref: '#/components/schemas/UserRole' + adminFlags: + $ref: '#/components/schemas/UserAdminFlags' + password: + $ref: '#/components/schemas/password' + UpdateMe: + properties: + password: + $ref: '#/components/schemas/password' + currentPassword: + $ref: '#/components/schemas/password' + email: + description: new email used for login and service communications + allOf: + - $ref: '#/components/schemas/User/properties/email' + displayName: + type: string + description: new name of the user in its representations + minLength: 3 + maxLength: 120 + displayNSFW: + type: string + description: new NSFW display policy + enum: + - 'true' + - 'false' + - both + p2pEnabled: + type: boolean + description: whether to enable P2P in the player or not + autoPlayVideo: + type: boolean + description: new preference regarding playing videos automatically + autoPlayNextVideo: + type: boolean + description: new preference regarding playing following videos automatically + autoPlayNextVideoPlaylist: + type: boolean + description: new preference regarding playing following playlist videos automatically + videosHistoryEnabled: + type: boolean + description: whether to keep track of watched history or not + videoLanguages: + type: array + items: + type: string + description: list of languages to filter videos down to + theme: + type: string + noInstanceConfigWarningModal: + type: boolean + noAccountSetupWarningModal: + type: boolean + noWelcomeModal: + type: boolean + GetMeVideoRating: + properties: + id: + $ref: '#/components/schemas/id' + rating: + type: string + enum: + - like + - dislike + - none + description: Rating of the video + required: + - id + - rating + VideoRating: + properties: + video: + $ref: '#/components/schemas/Video' + rating: + type: string + enum: + - like + - dislike + - none + description: Rating of the video + required: + - video + - rating + + RegisterUser: + properties: + username: + description: immutable name of the user, used to find or mention its actor + allOf: + - $ref: '#/components/schemas/username' + password: + $ref: '#/components/schemas/password' + email: + type: string + format: email + description: email of the user, used for login or service communications + displayName: + type: string + description: editable name of the user, displayed in its representations + minLength: 1 + maxLength: 120 + channel: + type: object + description: channel base information used to create the first channel of the user + properties: + name: + $ref: '#/components/schemas/usernameChannel' + displayName: + type: string + required: + - username + - password + - email + + UserRegistrationRequest: + allOf: + - $ref: '#/components/schemas/RegisterUser' + - type: object + properties: + registrationReason: + type: string + description: reason for the user to register on the instance + required: + - registrationReason + + UserRegistrationAcceptOrReject: + type: object + properties: + moderationResponse: + type: string + description: Moderation response to send to the user + preventEmailDelivery: + type: boolean + description: Set it to true if you don't want PeerTube to send an email to the user + required: + - moderationResponse + + UserRegistration: + properties: + id: + $ref: '#/components/schemas/id' + state: + type: object + properties: + id: + type: integer + enum: + - 1 + - 2 + - 3 + description: 'The registration state (Pending = `1`, Rejected = `2`, Accepted = `3`)' + label: + type: string + registrationReason: + type: string + moderationResponse: + type: string + nullable: true + username: + type: string + email: + type: string + format: email + emailVerified: + type: boolean + accountDisplayName: + type: string + channelHandle: + type: string + channelDisplayName: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + user: + type: object + nullable: true + description: If the registration has been accepted, this is a partial user object created by the registration + properties: + id: + $ref: '#/components/schemas/id' + + OAuthClient: + properties: + client_id: + type: string + pattern: /^[a-z0-9]$/ + maxLength: 32 + minLength: 32 + example: v1ikx5hnfop4mdpnci8nsqh93c45rldf + client_secret: + type: string + pattern: /^[a-zA-Z0-9]$/ + maxLength: 32 + minLength: 32 + example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt + OAuthToken-password: + allOf: + - $ref: '#/components/schemas/OAuthClient' + - type: object + properties: + grant_type: + type: string + enum: + - password + - refresh_token + default: password + username: + $ref: '#/components/schemas/User/properties/username' + password: + $ref: '#/components/schemas/password' + required: + - client_id + - client_secret + - grant_type + - username + - password + OAuthToken-refresh_token: + allOf: + - $ref: '#/components/schemas/OAuthClient' + - type: object + properties: + grant_type: + type: string + enum: + - password + - refresh_token + default: password + refresh_token: + type: string + example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 + required: + - client_id + - client_secret + - grant_type + - refresh_token + + VideoChannel: + allOf: + - $ref: '#/components/schemas/Actor' + - type: object + properties: + displayName: + type: string + description: editable name of the channel, displayed in its representations + example: Videos of Framasoft + minLength: 1 + maxLength: 120 + description: + type: string + example: Videos made with <3 by Framasoft + minLength: 3 + maxLength: 1000 + support: + type: string + description: text shown by default on all videos of this channel, to tell the audience how to support it + example: Please support our work on https://soutenir.framasoft.org/en/ <3 + minLength: 3 + maxLength: 1000 + isLocal: + readOnly: true + type: boolean + updatedAt: + readOnly: true + type: string + format: date-time + banners: + type: array + items: + $ref: '#/components/schemas/ActorImage' + ownerAccount: + readOnly: true + nullable: true + type: object + properties: + id: + type: integer + uuid: + $ref: '#/components/schemas/UUIDv4' + + VideoChannelEdit: + properties: + displayName: + description: Channel display name + description: + description: Channel description + support: + description: How to support/fund the channel + + VideoChannelCreate: + allOf: + - $ref: '#/components/schemas/VideoChannelEdit' + - properties: + name: + description: username of the channel to create + allOf: + - $ref: '#/components/schemas/usernameChannel' + required: + - name + - displayName + VideoChannelUpdate: + allOf: + - $ref: '#/components/schemas/VideoChannelEdit' + - properties: + bulkVideosSupportUpdate: + type: boolean + description: Update the support field for all videos of this channel + + VideoChannelList: + properties: + total: + type: integer + example: 1 + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/VideoChannel' + - $ref: '#/components/schemas/Actor' + + ImportVideosInChannelCreate: + type: object + properties: + externalChannelUrl: + type: string + example: https://youtube.com/c/UC_myfancychannel + videoChannelSyncId: + type: integer + description: If part of a channel sync process, specify its id to assign video imports to this channel synchronization + required: + - 'externalChannelUrl' + + VideoChannelSync: + type: object + properties: + id: + $ref: '#/components/schemas/id' + state: + type: object + properties: + id: + type: integer + example: 2 + label: + type: string + example: PROCESSING + externalChannelUrl: + type: string + example: 'https://youtube.com/c/UC_myfancychannel' + createdAt: + type: string + format: date-time + lastSyncAt: + type: string + format: date-time + nullable: true + channel: + $ref: '#/components/schemas/VideoChannel' + VideoChannelSyncList: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/VideoChannelSync' + VideoChannelSyncCreate: + type: object + properties: + externalChannelUrl: + type: string + example: https://youtube.com/c/UC_myfancychannel + videoChannelId: + $ref: '#/components/schemas/id' + MRSSPeerLink: + type: object + xml: + name: 'media:peerLink' + properties: + href: + type: string + xml: + attribute: true + type: + type: string + enum: + - application/x-bittorrent + xml: + attribute: true + MRSSGroupContent: + type: object + xml: + name: 'media:content' + properties: + url: + type: string + format: url + xml: + attribute: true + fileSize: + type: integer + xml: + attribute: true + type: + type: string + xml: + attribute: true + framerate: + type: integer + xml: + attribute: true + duration: + type: integer + xml: + attribute: true + height: + type: integer + xml: + attribute: true + lang: + type: string + xml: + attribute: true + VideoCommentsForXML: + type: array + xml: + wrapped: true + name: 'channel' + items: + type: object + xml: + name: 'item' + properties: + link: + type: string + format: url + guid: + type: string + pubDate: + type: string + format: date-time + 'content:encoded': + type: string + 'dc:creator': + type: string + VideosForXML: + type: array + xml: + wrapped: true + name: 'channel' + items: + type: object + xml: + name: 'item' + properties: + link: + type: string + format: url + description: video watch page URL + guid: + type: string + description: video canonical URL + pubDate: + type: string + format: date-time + description: video publication date + description: + type: string + description: video description + 'content:encoded': + type: string + description: video description + 'dc:creator': + type: string + description: publisher user name + 'media:category': + type: integer + description: video category (MRSS) + 'media:community': + type: object + description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS) + properties: + 'media:statistics': + type: object + properties: + views: + type: integer + xml: + attribute: true + 'media:embed': + type: object + properties: + url: + type: string + format: url + description: video embed path, relative to the canonical URL domain (MRSS) + xml: + attribute: true + 'media:player': + type: object + properties: + url: + type: string + format: url + description: video watch path, relative to the canonical URL domain (MRSS) + xml: + attribute: true + 'media:thumbnail': + type: object + properties: + url: + type: string + format: url + xml: + attribute: true + height: + type: integer + xml: + attribute: true + width: + type: integer + xml: + attribute: true + 'media:title': + type: string + description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles. + 'media:description': + type: string + 'media:rating': + type: string + enum: + - nonadult + - adult + description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS) + 'enclosure': + type: object + description: main streamable file for the video + properties: + url: + type: string + format: url + xml: + attribute: true + type: + type: string + enum: + - application/x-bittorrent + xml: + attribute: true + length: + type: integer + xml: + attribute: true + 'media:group': + type: array + description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS) + items: + anyOf: + - $ref: '#/components/schemas/MRSSPeerLink' + - $ref: '#/components/schemas/MRSSGroupContent' + NotificationSettingValue: + type: integer + description: > + Notification type. One of the following values, or a sum of multiple values: + + - `0` NONE + + - `1` WEB + + - `2` EMAIL + Notification: + properties: + id: + $ref: '#/components/schemas/id' + type: + type: integer + description: > + Notification type, following the `UserNotificationType` enum: + + - `1` NEW_VIDEO_FROM_SUBSCRIPTION + + - `2` NEW_COMMENT_ON_MY_VIDEO + + - `3` NEW_ABUSE_FOR_MODERATORS + + - `4` BLACKLIST_ON_MY_VIDEO + + - `5` UNBLACKLIST_ON_MY_VIDEO + + - `6` MY_VIDEO_PUBLISHED + + - `7` MY_VIDEO_IMPORT_SUCCESS + + - `8` MY_VIDEO_IMPORT_ERROR + + - `9` NEW_USER_REGISTRATION + + - `10` NEW_FOLLOW + + - `11` COMMENT_MENTION + + - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS + + - `13` NEW_INSTANCE_FOLLOWER + + - `14` AUTO_INSTANCE_FOLLOWING + + - `15` ABUSE_STATE_CHANGE + + - `16` ABUSE_NEW_MESSAGE + + - `17` NEW_PLUGIN_VERSION + + - `18` NEW_PEERTUBE_VERSION + read: + type: boolean + video: + nullable: true + allOf: + - $ref: '#/components/schemas/VideoInfo' + - type: object + properties: + channel: + $ref: '#/components/schemas/ActorInfo' + videoImport: + nullable: true + type: object + properties: + id: + $ref: '#/components/schemas/id' + video: + $ref: '#/components/schemas/VideoInfo' + torrentName: + type: string + nullable: true + magnetUri: + $ref: '#/components/schemas/VideoImport/properties/magnetUri' + targetUri: + type: string + format: uri + nullable: true + comment: + nullable: true + type: object + properties: + id: + $ref: '#/components/schemas/id' + threadId: + type: integer + video: + $ref: '#/components/schemas/VideoInfo' + account: + $ref: '#/components/schemas/ActorInfo' + videoAbuse: + nullable: true + type: object + properties: + id: + $ref: '#/components/schemas/id' + video: + allOf: + - $ref: '#/components/schemas/VideoInfo' + videoBlacklist: + nullable: true + type: object + properties: + id: + $ref: '#/components/schemas/id' + video: + allOf: + - $ref: '#/components/schemas/VideoInfo' + account: + nullable: true + allOf: + - $ref: '#/components/schemas/ActorInfo' + actorFollow: + type: object + nullable: true + properties: + id: + $ref: '#/components/schemas/id' + follower: + $ref: '#/components/schemas/ActorInfo' + state: + type: string + enum: + - pending + - accepted + following: + type: object + properties: + type: + type: string + enum: + - account + - channel + - instance + name: + type: string + displayName: + type: string + host: + type: string + format: hostname + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + NotificationListResponse: + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Notification' + Plugin: + properties: + name: + type: string + example: peertube-plugin-auth-ldap + type: + type: integer + description: > + - `1`: PLUGIN + + - `2`: THEME + enum: + - 1 + - 2 + latestVersion: + type: string + example: 0.0.3 + version: + type: string + example: 0.0.1 + enabled: + type: boolean + uninstalled: + type: boolean + peertubeEngine: + type: string + example: 2.2.0 + description: + type: string + homepage: + type: string + format: url + example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap + settings: + type: object + additionalProperties: true + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + PluginResponse: + properties: + total: + type: integer + example: 1 + data: + type: array + maxItems: 100 + items: + $ref: '#/components/schemas/Plugin' + + LiveVideoUpdate: + properties: + saveReplay: + type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' + permanentLive: + description: User can stream multiple times in a permanent live + type: boolean + latencyMode: + $ref: '#/components/schemas/LiveVideoLatencyMode' + + LiveVideoResponse: + properties: + rtmpUrl: + type: string + description: Included in the response if an appropriate token is provided + rtmpsUrl: + type: string + description: Included in the response if an appropriate token is provided + streamKey: + type: string + description: RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided + saveReplay: + type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' + permanentLive: + description: User can stream multiple times in a permanent live + type: boolean + latencyMode: + $ref: '#/components/schemas/LiveVideoLatencyMode' + + RequestTwoFactorResponse: + properties: + otpRequest: + type: object + properties: + requestToken: + type: string + description: The token to send to confirm this request + secret: + type: string + description: The OTP secret + uri: + type: string + description: The OTP URI + + VideoStudioCreateTask: + type: array + items: + anyOf: + - + title: cut + type: object + properties: + name: + type: string + enum: + - 'cut' + options: + type: object + properties: + start: + type: integer + end: + type: integer + - + title: add-intro + type: object + properties: + name: + type: string + enum: + - 'add-intro' + options: + type: object + properties: + file: + type: string + format: binary + - + title: add-outro + type: object + properties: + name: + type: string + enum: + - 'add-outro' + options: + type: object + properties: + file: + type: string + format: binary + - + title: add-watermark + type: object + properties: + name: + type: string + enum: + - 'add-watermark' + options: + type: object + properties: + file: + type: string + format: binary + + LiveVideoSessionResponse: + properties: + id: + type: integer + startDate: + type: string + format: date-time + description: Start date of the live session + endDate: + type: string + format: date-time + nullable: true + description: End date of the live session + error: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + nullable: true + description: > + Error type if an error occurred during the live session: + - `1`: Bad socket health (transcoding is too slow) + - `2`: Max duration exceeded + - `3`: Quota exceeded + - `4`: Quota FFmpeg error + - `5`: Video has been blacklisted during the live + replayVideo: + type: object + description: Video replay information + properties: + id: + type: number + uuid: + $ref: '#/components/schemas/UUIDv4' + shortUUID: + $ref: '#/components/schemas/shortUUID' + + PlaybackMetricCreate: + properties: + playerMode: + type: string + enum: + - 'p2p-media-loader' + - 'web-video' + resolution: + type: number + description: Current player video resolution + fps: + type: number + description: Current player video fps + p2pEnabled: + type: boolean + p2pPeers: + type: number + description: P2P peers connected (doesn't include WebSeed peers) + resolutionChanges: + type: number + description: How many resolution changes occurred since the last metric creation + errors: + type: number + description: How many errors occurred since the last metric creation + downloadedBytesP2P: + type: number + description: How many bytes were downloaded with P2P since the last metric creation + downloadedBytesHTTP: + type: number + description: How many bytes were downloaded with HTTP since the last metric creation + uploadedBytesP2P: + type: number + description: How many bytes were uploaded with P2P since the last metric creation + videoId: + oneOf: + - $ref: '#/components/schemas/id' + - $ref: '#/components/schemas/UUIDv4' + - $ref: '#/components/schemas/shortUUID' + required: + - playerMode + - resolutionChanges + - errors + - downloadedBytesP2P + - downloadedBytesHTTP + - uploadedBytesP2P + - p2pEnabled + - videoId + + RunnerRegistrationToken: + properties: + id: + type: integer + registrationToken: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + registeredRunnersCount: + type: integer + + Runner: + properties: + id: + type: integer + name: + type: string + description: + type: string + ip: + type: string + updatedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + lastContact: + type: string + format: date-time + + RunnerJobType: + type: string + enum: + - vod-web-video-transcoding + - vod-hls-transcoding + - vod-audio-merge-transcoding + - live-rtmp-hls-transcoding + + RunnerJobState: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + description: > + The runner job state: + - `1` Pending + - `2` Processing + - `3` Completed + - `4` Errored + - `5` Waiting for a parent job + - `6` Cancelled + - `7` Parent had an error + - `8` Parent has been cancelled + + RunnerJobStateConstant: + type: object + properties: + id: + $ref: '#/components/schemas/RunnerJobState' + label: + type: string + example: 'Processing' + + RunnerJobPayload: + anyOf: + - type: object + title: VOD web video transcoding + properties: + input: + type: object + properties: + videoFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + - type: object + title: VOD HLS transcoding + properties: + input: + type: object + properties: + videoFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + - type: object + title: VOD audio merge transcoding + properties: + input: + type: object + properties: + audioFileUrl: + type: string + previewFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + + RunnerJob: + properties: + uuid: + $ref: '#/components/schemas/UUIDv4' + type: + $ref: '#/components/schemas/RunnerJobType' + state: + $ref: '#/components/schemas/RunnerJobStateConstant' + payload: + $ref: '#/components/schemas/RunnerJobPayload' + failures: + type: integer + description: Number of times a remote runner failed to process this job. After too many failures, the job in "error" state + error: + nullable: true + type: string + description: Error message if the job is errored + progress: + type: integer + description: Percentage progress + priority: + type: integer + description: Job priority (less has more priority) + updatedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + startedAt: + type: string + format: date-time + finishedAt: + type: string + format: date-time + parent: + nullable: true + description: If job has a parent job + type: object + properties: + type: + $ref: '#/components/schemas/RunnerJobType' + state: + $ref: '#/components/schemas/RunnerJobStateConstant' + uuid: + $ref: '#/components/schemas/UUIDv4' + runner: + nullable: true + description: If job is associated to a runner + properties: + id: + type: number + name: + type: string + description: + type: string + + RunnerJobAdmin: + allOf: + - $ref: '#/components/schemas/RunnerJob' + - type: object + properties: + privatePayload: + type: object + + VideoPassword: + properties: + id: + $ref: '#/components/schemas/id' + password: + type: string + minLength: 2 + videoId: + $ref: '#/components/schemas/id' + VideoPasswordList: + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPassword' + AddVideoPasswords: + type: array + items: + $ref: "#/components/schemas/VideoPassword/properties/password" + uniqueItems: true + callbacks: + searchIndex: + 'https://search.example.org/api/v1/search/videos': + post: + summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget` + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoListResponse' diff --git a/modules/openapi-generator/src/test/resources/3_0/java/oauth.yaml b/modules/openapi-generator/src/test/resources/3_0/java/oauth.yaml new file mode 100644 index 00000000000..af7e5c6e2d3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/oauth.yaml @@ -0,0 +1,28 @@ +openapi: 3.0.3 + +info: + title: Test OAuth code generation + description: Tests OAuth code generation + version: 1.0.0 + +servers: + - url: http://localhost:8080 + +paths: + /api/something: + get: + responses: + 204: + description: Success! + +components: + securitySchemes: + oAuth: + type: oauth2 + flows: + implicit: + authorizationUrl: '' + scopes: {} + +security: + - oAuth: [] \ No newline at end of file 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 c2d678c532b..a0d815dd355 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 @@ -1217,7 +1217,7 @@ paths: operationId: getParameterNameMapping parameters: - name: _type - in: header + in: header description: _type required: true schema: @@ -1230,7 +1230,7 @@ paths: schema: type: string - name: type_ - in: header + in: header description: type_ required: true schema: @@ -1246,7 +1246,7 @@ paths: operationId: getParameterStringNumber parameters: - name: string_number - in: header + in: header description: string number required: true schema: @@ -2202,6 +2202,13 @@ components: - $ref: '#/components/schemas/Pig' discriminator: propertyName: className + mammal_anyof: + anyOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className whale: type: object properties: @@ -2600,6 +2607,17 @@ components: category_allOf_ref: allOf: - $ref: '#/components/schemas/Category' + category_allOf_ref_description: + description: | + Adding description to property using allOf + allOf: + - $ref: '#/components/schemas/Category' + category_allOf_ref_description_readonly: + description: | + Adding description to readonly property using allOf + readOnly: true + allOf: + - $ref: '#/components/schemas/Category' name: type: string example: doggie diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index c9a21cf8f27..40cb91d8c70 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1981,6 +1981,13 @@ components: - $ref: '#/components/schemas/Pig' discriminator: propertyName: className + mammal_anyof: + anyOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className whale: type: object properties: diff --git a/modules/openapi-generator/src/test/resources/3_0/java/xml-annotations-test.yaml b/modules/openapi-generator/src/test/resources/3_0/java/xml-annotations-test.yaml new file mode 100644 index 00000000000..2b585377f5c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/xml-annotations-test.yaml @@ -0,0 +1,142 @@ +openapi: 3.0.0 +info: + description: | + This spec is mainly for testing JAXB & Jackson XML annotation being generated correctly. + Some guidance: + - Jackson annotations: https://www.baeldung.com/jackson-xml-serialization-and-deserialization + - JAXB annotations: https://howtodoinjava.com/jaxb/xmlelementwrapper-annotation + version: 1.0.0 + title: OpenAPI Petstore +servers: + - url: 'https://localhost' +paths: + /foo: + get: + operationId: foo + responses: + '200': + description: response + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' +components: + requestBodies: + 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: + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + 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 + xml: + prefix: 'smp' + namespace: 'http://example.com/schema' + friends: # non-wrapped with custom xml item element name (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + type: array + items: + type: string + xml: + name: friend-pet + categories: + type: array + items: + $ref: '#/components/schemas/Category' + xml: + wrapped: false # This is the default value as per OAI spec anyway, just being explicit here for the test + # as per https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=For%20arrays: + # »For arrays, the `xml/name` property works only if `xml/wrapped` is set to true. + name: NotUsedAsNotWrapped # ← so this will not be used (see also 2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + name: + type: string + example: doggie + xml: + attribute: true + photoUrls: # wrapped with no defined xml name (3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + type: array + xml: + wrapped: true + items: + type: string + colors: # wrapped with only internal xml name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + type: array + xml: + wrapped: true + items: + type: string + xml: + name: color + activities: # wrapped with both internal and external xml name (5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays) + type: array + xml: + wrapped: true + name: activities-array + items: + type: string + xml: + name: item + foods: + type: array + items: + type: string + xml: + name: yummy-yummy # test case for changing external name, but not internal (last example at https://spec.openapis.org/oas/v3.0.0#xml-arrays) + wrapped: true + tags: + type: array + xml: + name: TagList + wrapped: true + items: + $ref: '#/components/schemas/Tag' + xml: + name: Ignored # because sibling elements of `$ref`s are ignored (https://swagger.io/docs/specification/using-ref/) + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: PetStatus # custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names) + xml: + name: Pet + namespace: 'urn:jacksonxml' diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProject.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProject.yaml index 69a79b7eb14..1c5b66f2e5e 100644 --- a/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProject.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProject.yaml @@ -44,6 +44,13 @@ paths: tags: - basic parameters: + - description: Page length + name: page + in: query + required: false + schema: + type: string + example: 50 - description: Query Id. name: pUserId in: query diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithAuthQuery.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithAuthQuery.yaml new file mode 100644 index 00000000000..42ab3a7350c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithAuthQuery.yaml @@ -0,0 +1,378 @@ +openapi: 3.1.0 +info: + title: Sample project + version: '1.0' + contact: + name: Julien Lengrand-Lambert + email: fake@email.com + url: 'https://github.com/jlengrand' + description: 'Sample API Check "API Key" ' + license: + name: Apache 2.0 + url: 'https://github.com/gcatanese' +servers: + - url: 'http://localhost:{port}/{version}' + description: dev server + variables: + port: + description: Port number + enum: + - '5000' + - '8080' + default: '5000' + version: + default: v1 + description: API version + - url: 'http://localhost:{port}/{version}' + description: test server + variables: + port: + description: Port number + enum: + - '5000' + - '8080' + default: '5000' + version: + default: v1 + description: API version +paths: + '/users/': + get: + summary: Get User Info by Query Param + operationId: get-users-query-id + description: Retrieve the information of the user with the matching user ID. + security: + - ApiKeyAuthQuery: [ ] + parameters: + - description: Page length + name: page + in: query + required: false + schema: + type: string + example: 50 + - description: Query Id. + name: pUserId + in: query + required: true + schema: + type: string + example: 888 + - description: Custom HTTP header + name: Custom-Header + in: header + schema: + type: string + - description: Custom HTTP header with default + name: Another-Custom-Header + in: header + schema: + type: string + default: abc + responses: + '200': + description: User Found + content: + application/json: + schema: + $ref: '#/components/schemas/User' + example: + id: schema-example + firstName: Alice + lastName: Smith333 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + examples: + Get User Alice Smith: + value: + id: 142 + firstName: Alice + lastName: Smith + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + Get User Phil Smith: + value: + id: 143 + firstName: Phil + lastName: Smith + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + '404': + description: User Not Found + '/users/{userId}': + parameters: + - schema: + type: integer + examples: + a: + value: 1 + summary: a summary + b: + value: 2 + summary: b summary + name: userId + in: path + required: true + description: Id of an existing user. + - schema: + type: string + default: code_one + name: strCode + in: header + description: Code as header + - schema: + type: string + name: strCode2 + in: header + description: Code as header2 + get: + summary: Get User Info by User ID + security: + - ApiKeyAuthQuery: [ ] + responses: + '200': + description: User Found + content: + application/json: + schema: + $ref: '#/components/schemas/User' + example: + id: 9998 + firstName: Alice9998 resp example + lastName: Smith9998 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' + '404': + description: User Not Found + operationId: get-users-userId + description: Retrieve the information of the user with the matching user ID. + patch: + summary: Update User Information + deprecated: true + operationId: patch-users-userId + parameters: + - description: Page length + name: page + in: query + required: false + schema: + type: string + example: 50 + responses: + '200': + description: User Updated + content: + application/json: + schema: + $ref: '#/components/schemas/User' + examples: + Updated User Rebecca Baker: + value: + id: 13 + firstName: Rebecca + lastName: Baker + email: rebecca@gmail.com + dateOfBirth: '1985-10-02' + emailVerified: false + createDate: '2019-08-24' + '404': + description: User Not Found + '409': + description: Email Already Taken + description: Update the information of an existing user. + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + lastName: + type: string + email: + type: string + description: >- + If a new email is given, the user's email verified property + will be set to false. + dateOfBirth: + type: string + examples: + Update First Name: + value: + firstName: Rebecca + Update Email: + value: + email: rebecca@gmail.com + Update Last Name & Date of Birth: + value: + lastName: Baker + dateOfBirth: '1985-10-02' + description: Patch user properties to update. + /user: + post: + summary: Create New User + operationId: post-user + responses: + '200': + description: User Created + content: + application/json: + schema: + $ref: '#/components/schemas/User' + examples: + basic: + $ref: '#/components/examples/get-user-basic' + '400': + description: Missing Required Information + '409': + description: Email Already Taken + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + lastName: + type: string + email: + type: string + dateOfBirth: + type: string + format: date + required: + - firstName + - lastName + - email + - dateOfBirth + examples: + basic: + $ref: '#/components/examples/get-user-basic' + description: Post the necessary fields for the API to create a new user. + description: Create a new user. + '/groups/{groupId}': + get: + summary: Get group by ID + parameters: + - description: group Id + name: groupId + in: path + required: true + schema: + type: integer + default: 1 + responses: + '200': + description: Group Found + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + '404': + description: Group Not Found + operationId: get-groups-groupId + description: Get group of users + +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + name: X-API-Key + in: header + ApiKeyAuthQuery: + in: query + name: api_key + type: apiKey + schemas: + User: + title: User + type: object + description: '' + example: + id: 999 + firstName: Alice9 schema example + lastName: Smith9 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' + properties: + id: + type: integer + description: Unique identifier for the given user. + example: 0 + firstName: + type: string + example: Alix + lastName: + type: string + example: Smith + email: + type: string + format: email + example: alix.smith@gmail.com + dateOfBirth: + type: string + format: date + example: '1997-10-31' + emailVerified: + type: boolean + description: Set to true if the user's email has been verified. + example: true + createDate: + type: string + format: date + description: The date that the user was created. + example: '2019-08-24' + required: + - id + - firstName + - lastName + - email + - emailVerified + Group: + title: Group + type: object + description: '' + properties: + id: + type: integer + description: Unique identifier for the given group. + name: + type: string + example: admin + required: + - id + - name + examples: + get-user-basic: + summary: Example request for Get User + value: + id: 777 + firstName: Alotta + lastName: Rotta + email: alotta.rotta@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' +tags: + - name: basic + description: Basic tag + - name: advanced + description: Advanced tag diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithHeaderParams.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithHeaderParams.yaml new file mode 100644 index 00000000000..9fea40cf430 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/SampleProjectWithHeaderParams.yaml @@ -0,0 +1,391 @@ +openapi: 3.1.0 +info: + title: Sample project + version: '1.0' + contact: + name: Julien Lengrand-Lambert + email: fake@email.com + url: 'https://github.com/jlengrand' + description: 'Sample API Check "API Key" ' + license: + name: Apache 2.0 + url: 'https://github.com/gcatanese' +servers: + - url: 'http://localhost:{port}/{version}' + description: dev server + variables: + port: + description: Port number + enum: + - '5000' + - '8080' + default: '5000' + version: + default: v1 + description: API version + - url: 'http://localhost:{port}/{version}' + description: test server + variables: + port: + description: Port number + enum: + - '5000' + - '8080' + default: '5000' + version: + default: v1 + description: API version +paths: + '/users/': + get: + summary: Get User Info by Query Param + operationId: get-users-query-id + description: Retrieve the information of the user with the matching user ID. + security: + - ApiKeyAuth: [ ] + parameters: + - description: Page length + name: page + in: query + required: false + schema: + type: string + example: 50 + - description: Query Id. + name: pUserId + in: query + required: true + schema: + type: string + example: 888 + - description: Custom HTTP header + name: Custom-Header + in: header + schema: + type: string + - description: Custom HTTP header with default + name: Another-Custom-Header + in: header + schema: + type: string + default: abc + responses: + '200': + description: User Found + content: + application/json: + schema: + $ref: '#/components/schemas/User' + example: + id: schema-example + firstName: Alice + lastName: Smith333 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + examples: + Get User Alice Smith: + value: + id: 142 + firstName: Alice + lastName: Smith + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + Get User Phil Smith: + value: + id: 143 + firstName: Phil + lastName: Smith + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + signUpDate: '2019-08-24' + '404': + description: User Not Found + '/users/{userId}': + parameters: + - schema: + type: integer + examples: + a: + value: 1 + summary: a summary + b: + value: 2 + summary: b summary + name: userId + in: path + required: true + description: Id of an existing user. + - schema: + type: string + default: code_one + name: strCode + in: header + description: Code as header + - schema: + type: string + name: strCode2 + in: header + description: Code as header2 + get: + summary: Get User Info by User ID + security: + - ApiKeyAuth: [ ] + responses: + '200': + description: User Found + content: + application/json: + schema: + $ref: '#/components/schemas/User' + example: + id: 9998 + firstName: Alice9998 resp example + lastName: Smith9998 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' + '404': + description: User Not Found + operationId: get-users-userId + description: Retrieve the information of the user with the matching user ID. + patch: + summary: Update User Information + deprecated: true + operationId: patch-users-userId + security: + - ApiKeyAuth: [ ] + parameters: + - description: Page length + name: page + in: query + required: false + schema: + type: string + example: 50 + responses: + '200': + description: User Updated + content: + application/json: + schema: + $ref: '#/components/schemas/User' + examples: + Updated User Rebecca Baker: + value: + id: 13 + firstName: Rebecca + lastName: Baker + email: rebecca@gmail.com + dateOfBirth: '1985-10-02' + emailVerified: false + createDate: '2019-08-24' + '404': + description: User Not Found + '409': + description: Email Already Taken + description: Update the information of an existing user. + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + lastName: + type: string + email: + type: string + description: >- + If a new email is given, the user's email verified property + will be set to false. + dateOfBirth: + type: string + examples: + Update First Name: + value: + firstName: Rebecca + Update Email: + value: + email: rebecca@gmail.com + Update Last Name & Date of Birth: + value: + lastName: Baker + dateOfBirth: '1985-10-02' + description: Patch user properties to update. + /user: + post: + summary: Create New User + operationId: post-user + responses: + '200': + description: User Created + content: + application/json: + schema: + $ref: '#/components/schemas/User' + examples: + basic: + $ref: '#/components/examples/get-user-basic' + '400': + description: Missing Required Information + '409': + description: Email Already Taken + requestBody: + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + lastName: + type: string + email: + type: string + dateOfBirth: + type: string + format: date + required: + - firstName + - lastName + - email + - dateOfBirth + examples: + basic: + $ref: '#/components/examples/get-user-basic' + description: Post the necessary fields for the API to create a new user. + description: Create a new user. + '/groups/{groupId}': + get: + summary: Get group by ID + parameters: + - description: group Id + name: groupId + in: path + required: true + schema: + type: integer + default: 1 + - description: Custom HTTP header + name: Custom-Header + in: header + schema: + type: string + - description: Custom HTTP header with default + name: Another-Custom-Header + in: header + schema: + type: string + default: abc + responses: + '200': + description: Group Found + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + '404': + description: Group Not Found + operationId: get-groups-groupId + description: Get group of users + +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + name: X-API-Key + in: header + ApiKeyAuthQuery: + in: query + name: api_key + type: apiKey + schemas: + User: + title: User + type: object + description: '' + example: + id: 999 + firstName: Alice9 schema example + lastName: Smith9 + email: alice.smith@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' + properties: + id: + type: integer + description: Unique identifier for the given user. + example: 0 + firstName: + type: string + example: Alix + lastName: + type: string + example: Smith + email: + type: string + format: email + example: alix.smith@gmail.com + dateOfBirth: + type: string + format: date + example: '1997-10-31' + emailVerified: + type: boolean + description: Set to true if the user's email has been verified. + example: true + createDate: + type: string + format: date + description: The date that the user was created. + example: '2019-08-24' + required: + - id + - firstName + - lastName + - email + - emailVerified + Group: + title: Group + type: object + description: '' + properties: + id: + type: integer + description: Unique identifier for the given group. + name: + type: string + example: admin + required: + - id + - name + examples: + get-user-basic: + summary: Example request for Get User + value: + id: 777 + firstName: Alotta + lastName: Rotta + email: alotta.rotta@gmail.com + dateOfBirth: '1997-10-31' + emailVerified: true + createDate: '2019-08-24' +tags: + - name: basic + description: Basic tag + - name: advanced + description: Advanced tag diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomHeaders.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomHeaders.yaml new file mode 100644 index 00000000000..f0782835b28 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomHeaders.yaml @@ -0,0 +1,2461 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /constants: + get: + summary: GET /constants + description: Gets an array of available resources. + tags: + - constants + parameters: [] + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + type: array + items: + title: ConstantsResponse + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomVariable.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomVariable.yaml new file mode 100644 index 00000000000..f0782835b28 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/CustomVariable.yaml @@ -0,0 +1,2461 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /constants: + get: + summary: GET /constants + description: Gets an array of available resources. + tags: + - constants + parameters: [] + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + type: array + items: + title: ConstantsResponse + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Header.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Header.yaml new file mode 100644 index 00000000000..2ea26dbfa4e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Header.yaml @@ -0,0 +1,2472 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /constants: + get: + summary: GET /constants + description: Gets an array of available resources. + tags: + - constants + parameters: + - description: Custom HTTP header + name: Custom-Header + in: header + schema: + type: string + - description: Custom HTTP header with default + name: Another-Custom-Header + in: header + schema: + type: string + default: abc + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + type: array + items: + title: ConstantsResponse + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Path.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Path.yaml new file mode 100644 index 00000000000..479bc3c1a62 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Path.yaml @@ -0,0 +1,2475 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /constants/{resource}: + get: + summary: GET /constants + description: Get static game data mirrored from the dotaconstants repository. + tags: + - constants + parameters: + - name: resource + in: path + description: Resource name e.g. `heroes`. [List of resources](https://github.com/odota/dotaconstants/tree/master/build) + required: true + schema: + type: string + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + nullable: true + oneOf: + - type: object + additionalProperties: + title: ConstantResourceResponse + - type: array + items: + oneOf: + - type: object + additionalProperties: + title: ConstantResourceResponse + - type: integer \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/QueryParam.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/QueryParam.yaml new file mode 100644 index 00000000000..05a4d2fa6a5 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/QueryParam.yaml @@ -0,0 +1,2467 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /scenarios/laneRoles: + get: + summary: GET /scenarios/laneRoles + description: Win rates for heroes in certain lane roles + tags: + - scenarios + parameters: + - name: lane_role + in: query + description: Filter by lane role 1-4 (Safe, Mid, Off, Jungle) + required: false + schema: + type: string + - $ref: '#/components/parameters/heroIdParam' + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + type: array + items: + $ref: '#/components/schemas/ScenarioLaneRolesResponse' \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Simple.yaml b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Simple.yaml new file mode 100644 index 00000000000..f0782835b28 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jetbrains/environmentgeneration/Simple.yaml @@ -0,0 +1,2461 @@ +openapi: 3.0.3 +info: + title: OpenDota API + description: | + # Introduction + The OpenDota API provides Dota 2 related data including advanced match data extracted from match replays. + + You can find data that can be used to convert hero and ability IDs and other information provided by the API from the [dotaconstants](https://github.com/odota/dotaconstants) repository. + + **Beginning 2018-04-22, the OpenDota API is limited to 50,000 free calls per month and 60 requests/minute** We offer a Premium Tier with unlimited API calls and higher rate limits. Check out the [API page](https://www.opendota.com/api-keys) to learn more. + version: 20.0.0 +servers: + - url: https://api.opendota.com/api +components: + securitySchemes: + api_key: + type: apiKey + name: api_key + description: |- + Use an API key to remove monthly call limits and to receive higher rate limits. [Learn more and get your API key](https://www.opendota.com/api-keys). + Usage example: https://api.opendota.com/api/matches/271145478?api_key=YOUR-API-KEY + + API key can also be sent using the authorization header "Authorization: Bearer YOUR-API-KEY" + + in: query + schemas: + MatchResponse: + title: MatchResponse + type: object + properties: + match_id: + description: The ID number of the match assigned by Valve + type: integer + barracks_status_dire: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + barracks_status_radiant: + description: Bitmask. An integer that represents a binary of which barracks are still standing. 63 would mean all barracks still stand at the end of the game. + type: integer + chat: + description: Array containing information on the chat of the game + type: array + items: + type: object + properties: + time: + description: Time in seconds at which the message was said + type: integer + unit: + description: Name of the player who sent the message + type: string + key: + description: The message the player sent + type: string + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + cluster: + description: cluster + type: integer + cosmetics: + description: cosmetics + type: object + additionalProperties: + type: integer + dire_score: + description: Final score for Dire (number of kills on Radiant) + type: integer + draft_timings: + description: draft_timings + type: array + items: + description: draft_stage + type: object + properties: + order: + description: order + type: integer + pick: + description: pick + type: boolean + active_team: + description: active_team + type: integer + hero_id: + description: The ID value of the hero played + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + extra_time: + description: extra_time + type: integer + total_time_taken: + description: total_time_taken + type: integer + duration: + description: Duration of the game in seconds + type: integer + engine: + description: engine + type: integer + first_blood_time: + description: Time in seconds at which first blood occurred + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + human_players: + description: Number of human players in the game + type: integer + leagueid: + description: leagueid + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + match_seq_num: + description: match_seq_num + type: integer + negative_votes: + description: Number of negative votes the replay received in the in-game client + type: integer + objectives: + description: objectives + type: array + items: + type: object + picks_bans: + description: Array containing information on the draft. Each item contains a boolean relating to whether the choice is a pick or a ban, the hero ID, the team the picked or banned it, and the order. + type: array + items: + type: object + properties: + is_pick: + description: Boolean indicating whether the choice is a pick or a ban + type: boolean + hero_id: + description: The hero ID + type: integer + team: + description: The team that picked or banned the hero + type: integer + order: + description: The order of the pick or ban + type: integer + positive_votes: + description: Number of positive votes the replay received in the in-game client + type: integer + radiant_gold_adv: + description: 'Array of the Radiant gold advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their gold disadvantage. ' + type: array + items: + type: number + radiant_score: + description: Final score for Radiant (number of kills on Radiant) + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + radiant_xp_adv: + description: 'Array of the Radiant experience advantage at each minute in the game. A negative number means that Radiant is behind, and thus it is their experience disadvantage. ' + type: array + items: + type: number + start_time: + description: The Unix timestamp at which the game started + type: integer + teamfights: + description: teamfights + type: array + items: + type: array + items: + type: object + tower_status_dire: + description: Bitmask. An integer that represents a binary of which Dire towers are still standing. + type: integer + tower_status_radiant: + description: Bitmask. An integer that represents a binary of which Radiant towers are still standing. + type: integer + version: + description: Parse version, used internally by OpenDota + type: integer + replay_salt: + description: replay_salt + type: integer + series_id: + description: series_id + type: integer + series_type: + description: series_type + type: integer + radiant_team: + description: radiant_team + type: object + dire_team: + description: dire_team + type: object + league: + description: league + type: object + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + players: + description: Array of information on individual players + type: array + items: + description: player + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + ability_upgrades_arr: + description: An array describing how abilities were upgraded + type: array + items: + type: integer + ability_uses: + description: Object containing information on how many times the played used their abilities + type: object + ability_targets: + description: Object containing information on who the player used their abilities on + type: object + damage_targets: + description: Object containing information on how and how much damage the player dealt to other heroes + type: object + account_id: + description: account_id + type: integer + actions: + description: Object containing information on how many and what type of actions the player issued to their hero + type: object + additional_units: + description: Object containing information on additional units the player had under their control + type: array + items: + type: object + nullable: true + assists: + description: Number of assists the player had + type: integer + backpack_0: + description: Item in backpack slot 0 + type: integer + backpack_1: + description: Item in backpack slot 1 + type: integer + backpack_2: + description: Item in backpack slot 2 + type: integer + buyback_log: + description: Array containing information about buybacks + type: array + items: + type: object + properties: + time: + description: Time in seconds the buyback occurred + type: integer + slot: + description: slot + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + camps_stacked: + description: Number of camps stacked + type: integer + connection_log: + description: Array containing information about the player's disconnections and reconnections + type: array + items: + type: object + properties: + time: + description: Game time in seconds the event ocurred + type: integer + event: + description: Event that occurred + type: string + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + creeps_stacked: + description: Number of creeps stacked + type: integer + damage: + description: Object containing information about damage dealt by the player to different units + type: object + damage_inflictor: + description: Object containing information about about the sources of this player's damage to heroes + type: object + damage_inflictor_received: + description: Object containing information about the sources of damage received by this player from heroes + type: object + damage_taken: + description: Object containing information about from whom the player took damage + type: object + deaths: + description: Number of deaths + type: integer + denies: + description: Number of denies + type: integer + dn_t: + description: Array containing number of denies at different times of the match + type: array + items: + type: integer + gold: + description: Gold at the end of the game + type: integer + gold_per_min: + description: Gold Per Minute obtained by this player + type: integer + gold_reasons: + description: Object containing information on how the player gainined gold over the course of the match + type: object + gold_spent: + description: How much gold the player spent + type: integer + gold_t: + description: Array containing total gold at different times of the match + type: array + items: + type: integer + hero_damage: + description: Hero Damage Dealt + type: integer + hero_healing: + description: Hero Healing Done + type: integer + hero_hits: + description: Object containing information on how many ticks of damages the hero inflicted with different spells and damage inflictors + type: object + hero_id: + description: The ID value of the hero played + type: integer + item_0: + description: Item in the player's first slot + type: integer + item_1: + description: Item in the player's second slot + type: integer + item_2: + description: Item in the player's third slot + type: integer + item_3: + description: Item in the player's fourth slot + type: integer + item_4: + description: Item in the player's fifth slot + type: integer + item_5: + description: Item in the player's sixth slot + type: integer + item_uses: + description: Object containing information about how many times a player used items + type: object + kill_streaks: + description: Object containing information about the player's killstreaks + type: object + killed: + description: Object containing information about what units the player killed + type: object + killed_by: + description: Object containing information about who killed the player + type: object + kills: + description: Number of kills + type: integer + kills_log: + description: Array containing information on which hero the player killed at what time + type: array + items: + type: object + properties: + time: + description: Time in seconds the player killed the hero + type: integer + key: + description: Hero killed + type: string + lane_pos: + description: Object containing information on lane position + type: object + last_hits: + description: Number of last hits + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + level: + description: Level at the end of the game + type: integer + lh_t: + description: Array describing last hits at each minute in the game + type: array + items: + type: integer + life_state: + description: life_state + type: object + max_hero_hit: + description: Object with information on the highest damage instance the player inflicted + type: object + multi_kills: + description: Object with information on the number of the number of multikills the player had + type: object + obs: + description: Object with information on where the player placed observer wards. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + obs_left_log: + description: obs_left_log + type: array + items: + type: object + obs_log: + description: Object containing information on when and where the player placed observer wards + type: array + items: + type: object + obs_placed: + description: Total number of observer wards placed + type: integer + party_id: + description: party_id + type: integer + permanent_buffs: + description: 'Array describing permanent buffs the player had at the end of the game. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/permanent_buffs.json' + type: array + items: + type: object + pings: + description: Total number of pings + type: integer + purchase: + description: Object containing information on the items the player purchased + type: object + purchase_log: + description: Object containing information on when items were purchased + type: array + items: + type: object + properties: + time: + description: Time in seconds the item was bought + type: integer + key: + description: String item ID + type: string + charges: + description: Integer amount of charges + type: integer + rune_pickups: + description: Number of runes picked up + type: integer + runes: + description: Object with information about which runes the player picked up + type: object + additionalProperties: + type: integer + runes_log: + description: Array with information on when runes were picked up + type: array + items: + type: object + properties: + time: + description: Time in seconds rune picked up + type: integer + key: + description: key + type: integer + sen: + description: Object with information on where sentries were placed. The location takes the form (outer number, inner number) and are from ~64-192. + type: object + sen_left_log: + description: Array containing information on when and where the player placed sentries + type: array + items: + type: object + sen_log: + description: Array with information on when and where sentries were placed by the player + type: array + items: + type: object + sen_placed: + description: How many sentries were placed by the player + type: integer + stuns: + description: Total stun duration of all stuns by the player + type: number + times: + description: Time in seconds corresponding to the time of entries of other arrays in the match. + type: array + items: + type: integer + tower_damage: + description: Total tower damage done by the player + type: integer + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + xp_reasons: + description: Object containing information on the sources of this player's experience + type: object + xp_t: + description: Experience at each minute of the game + type: array + items: + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + last_login: + description: Time of player's last login + type: string + format: date-time + nullable: true + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: Start time of the match in seconds since 1970 + type: integer + duration: + description: Duration of the game in seconds + type: integer + cluster: + description: cluster + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + patch: + description: Integer representing the patch the game was played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + isRadiant: + description: Boolean for whether or not the player is on Radiant + type: boolean + win: + description: Binary integer representing whether or not the player won + type: integer + lose: + description: Binary integer representing whether or not the player lost + type: integer + total_gold: + description: Total gold at the end of the game + type: integer + total_xp: + description: Total experience at the end of the game + type: integer + kills_per_min: + description: Number of kills per minute + type: number + kda: + description: kda + type: number + abandons: + description: abandons + type: integer + neutral_kills: + description: Total number of neutral creeps killed + type: integer + tower_kills: + description: Total number of tower kills the player had + type: integer + courier_kills: + description: Total number of courier kills the player had + type: integer + lane_kills: + description: Total number of lane creeps killed by the player + type: integer + hero_kills: + description: Total number of heroes killed by the player + type: integer + observer_kills: + description: Total number of observer wards killed by the player + type: integer + sentry_kills: + description: Total number of sentry wards killed by the player + type: integer + roshan_kills: + description: Total number of roshan kills (last hit on roshan) the player had + type: integer + necronomicon_kills: + description: Total number of Necronomicon creeps killed by the player + type: integer + ancient_kills: + description: Total number of Ancient creeps killed by the player + type: integer + buyback_count: + description: Total number of buyback the player used + type: integer + observer_uses: + description: Number of observer wards used + type: integer + sentry_uses: + description: Number of sentry wards used + type: integer + lane_efficiency: + description: lane_efficiency + type: number + lane_efficiency_pct: + description: lane_efficiency_pct + type: number + lane: + description: Integer referring to which lane the hero laned in + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean referring to whether or not the player roamed + type: boolean + nullable: true + purchase_time: + description: Object with information on when the player last purchased an item + type: object + first_purchase_time: + description: Object with information on when the player first puchased an item + type: object + item_win: + description: Object with information on whether or not the item won + type: object + item_usage: + description: 'Object containing binary integers the tell whether the item was purchased by the player (note: this is always 1)' + type: object + purchase_tpscroll: + description: Total number of TP scrolls purchased by the player + type: integer + actions_per_min: + description: Actions per minute + type: integer + life_state_dead: + description: life_state_dead + type: integer + rank_tier: + description: The rank tier of the player. Tens place indicates rank, ones place indicates stars. + type: integer + cosmetics: + description: cosmetics + type: array + items: + type: object + properties: + item_id: + type: integer + name: + type: string + prefab: + type: string + creation_date: + type: string + format: date-time + nullable: true + image_inventory: + type: string + nullable: true + image_path: + type: string + nullable: true + item_description: + type: string + nullable: true + item_name: + type: string + item_rarity: + type: string + nullable: true + item_type_name: + type: string + nullable: true + used_by_heroes: + type: string + nullable: true + benchmarks: + description: Object containing information on certain benchmarks like GPM, XPM, KDA, tower damage, etc + type: object + patch: + description: Information on the patch version the game is played on + type: integer + region: + description: Integer corresponding to the region the game was played on + type: integer + all_word_counts: + description: Word counts of the all chat messages in the player's games + type: object + my_word_counts: + description: Word counts of the player's all chat messages + type: object + throw: + description: Maximum gold advantage of the player's team if they lost the match + type: integer + comeback: + description: Maximum gold disadvantage of the player's team if they won the match + type: integer + loss: + description: Maximum gold disadvantage of the player's team if they lost the match + type: integer + win: + description: Maximum gold advantage of the player's team if they won the match + type: integer + replay_url: + description: replay_url + type: string + PlayersByRankResponse: + title: PlayersByRankResponse + type: array + items: + type: object + properties: + account_id: + description: account_id + type: number + rank_tier: + description: Integer indicating the rank/medal of the player + type: number + fh_unavailable: + description: Indicates if we were unable to fetch full history for this player due to privacy settings + type: boolean + nullable: true + PlayersResponse: + title: PlayerResponse + type: object + properties: + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + nullable: true + rank_tier: + description: rank_tier + type: number + nullable: true + leaderboard_rank: + description: leaderboard_rank + type: number + nullable: true + mmr_estimate: + description: mmr_estimate + type: object + properties: + estimate: + description: estimate + type: number + nullable: true + profile: + description: profile + type: object + properties: + account_id: + description: account_id + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + plus: + description: Boolean indicating status of current Dota Plus subscription + type: boolean + cheese: + description: cheese + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + is_contributor: + description: Boolean indicating if the user contributed to the development of OpenDota + type: boolean + default: false + is_subscriber: + description: Boolean indicating if the user subscribed to OpenDota + type: boolean + default: false + PlayerWinLossResponse: + title: PlayerWinLossResponse + type: object + properties: + win: + description: Number of wins + type: integer + lose: + description: Number of loses + type: integer + PlayerRecentMatchesResponse: + title: PlayerRecentMatchesResponse + description: match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Start time of the match in seconds elapsed since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the match + type: integer + deaths: + description: Total deaths the player had at the end of the match + type: integer + assists: + description: Total assists the player had at the end of the match + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High). If the skill is unknown, will return null. + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + xp_per_min: + description: Experience Per Minute obtained by the player + type: integer + gold_per_min: + description: Average gold per minute of the player + type: integer + hero_damage: + description: Total hero damage to enemy heroes + type: integer + hero_healing: + description: Total healing of ally heroes + type: integer + last_hits: + description: Total last hits the player had at the end of the match + type: integer + lane: + description: Integer corresponding to which lane the player laned in for the match + type: integer + nullable: true + lane_role: + description: lane_role + type: integer + nullable: true + is_roaming: + description: Boolean describing whether or not the player roamed + type: boolean + nullable: true + cluster: + description: cluster + type: integer + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the players party. If not in a party, will return 1. + type: integer + nullable: true + PlayerMatchesResponse: + title: PlayerMatchesResponse + description: Object containing information on the match + type: object + properties: + match_id: + description: Match ID + type: integer + player_slot: + description: Which slot the player is in. 0-127 are Radiant, 128-255 are Dire + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + duration: + description: Duration of the game in seconds + type: integer + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: integer + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: integer + hero_id: + description: The ID value of the hero played + type: integer + start_time: + description: Time the game started in seconds since 1970 + type: integer + version: + description: version + type: integer + nullable: true + kills: + description: Total kills the player had at the end of the game + type: integer + deaths: + description: Total deaths the player had at the end of the game + type: integer + assists: + description: Total assists the player had at the end of the game + type: integer + skill: + description: Skill bracket assigned by Valve (Normal, High, Very High) + type: integer + nullable: true + average_rank: + description: Average rank of players with public match data + type: integer + nullable: true + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: integer + party_size: + description: Size of the player's party + type: integer + nullable: true + PlayerHeroesResponse: + title: PlayerHeroesResponse + description: hero + type: object + properties: + hero_id: + description: The ID value of the hero played + type: string + last_played: + description: last_played + type: integer + games: + description: games + type: integer + win: + description: win + type: integer + with_games: + description: with_games + type: integer + with_win: + description: with_win + type: integer + against_games: + description: against_games + type: integer + against_win: + description: against_win + type: integer + PlayerPeersResponse: + title: PlayerPeersResponse + type: object + properties: + account_id: + description: account_id + type: integer + last_played: + description: last_played + type: integer + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + with_xpm_sum: + description: with_xpm_sum + type: integer + personaname: + description: personaname + type: string + nullable: true + name: + description: name + type: string + nullable: true + is_contributor: + description: is_contributor + type: boolean + is_subscriber: + description: is_subscriber + type: boolean + last_login: + description: last_login + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + PlayerProsResponse: + title: PlayerProsResponse + type: object + properties: + account_id: + description: account_id + type: integer + name: + description: name + type: string + country_code: + description: country_code + type: string + fantasy_role: + description: fantasy_role + type: integer + team_id: + description: team_id + type: integer + team_name: + description: team_name + type: string + nullable: true + team_tag: + description: team_tag + type: string + nullable: true + is_locked: + description: is_locked + type: boolean + is_pro: + description: is_pro + type: boolean + locked_until: + description: locked_until + type: integer + nullable: true + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + nullable: true + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + last_played: + description: last_played + type: integer + nullable: true + win: + description: win + type: integer + games: + description: games + type: integer + with_win: + description: with_win + type: integer + with_games: + description: with_games + type: integer + against_win: + description: against_win + type: integer + against_games: + description: against_games + type: integer + with_gpm_sum: + description: with_gpm_sum + type: integer + nullable: true + with_xpm_sum: + description: with_xpm_sum + type: integer + nullable: true + PlayerTotalsResponse: + title: PlayerTotalsResponse + type: object + properties: + field: + description: field + type: string + 'n': + description: number + type: integer + sum: + description: sum + type: number + PlayerCountsResponse: + title: PlayerCountsResponse + type: object + properties: + leaver_status: + description: 'Integer describing whether or not the player left the game. 0: didn''t leave. 1: left safely. 2+: Abandoned' + type: object + game_mode: + description: 'Integer corresponding to game mode played. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/game_mode.json' + type: object + lobby_type: + description: 'Integer corresponding to lobby type of match. List of constants can be found here: https://github.com/odota/dotaconstants/blob/master/json/lobby_type.json' + type: object + lane_role: + description: lane_role + type: object + region: + description: Integer corresponding to the region the game was played on + type: object + patch: + description: patch + type: object + PlayerWardMapResponse: + title: PlayerWardMapResponse + type: object + properties: + obs: + description: obs + type: object + sen: + description: sen + type: object + PlayerWordCloudResponse: + title: PlayerWordCloudResponse + type: object + properties: + my_word_counts: + description: my_word_counts + type: object + all_word_counts: + description: all_word_counts + type: object + PlayerRatingsResponse: + title: PlayerRatingsResponse + type: object + properties: + account_id: + description: account_id + type: integer + match_id: + description: match_id + type: integer + solo_competitive_rank: + description: solo_competitive_rank + type: integer + nullable: true + competitive_rank: + description: competitive_rank + type: integer + time: + description: time + type: integer + PlayerRankingsResponse: + title: PlayerRankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + score: + description: hero_score + type: number + percent_rank: + description: percent_rank + type: number + card: + description: numeric_rank + type: integer + TeamObjectResponse: + title: TeamObjectResponse + type: object + properties: + team_id: + description: Team's identifier + type: integer + rating: + description: The Elo rating of the team + type: number + wins: + description: The number of games won by this team + type: integer + losses: + description: The number of losses by this team + type: integer + last_match_time: + description: The Unix timestamp of the last match played by this team + type: integer + name: + description: Team name, eg. 'Newbee' + type: string + tag: + description: The team tag/abbreviation + type: string + MatchObjectResponse: + title: MatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + radiant_team_id: + description: The Radiant's team_id + type: integer + radiant_name: + description: The Radiant's team name + type: string + dire_team_id: + description: The Dire's team_id + type: integer + dire_name: + description: The Dire's team name + type: string + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + series_id: + description: Identifier for the series of the match + type: integer + series_type: + description: Type of series the match was + type: integer + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + TeamMatchObjectResponse: + title: TeamMatchObjectResponse + type: object + properties: + match_id: + description: Used to identify individual matches, e.g. 3703866531 + type: integer + radiant: + description: Whether the team/player/hero was on Radiant + type: boolean + radiant_win: + description: Whether or not the Radiant won the match + type: boolean + radiant_score: + description: Number of kills the Radiant team had when the match ended + type: integer + dire_score: + description: Number of kills the Dire team had when the match ended + type: integer + duration: + description: Length of the match + type: integer + start_time: + description: Unix timestamp of when the match began + type: integer + leagueid: + description: Identifier for the league the match took place in + type: integer + league_name: + description: Name of league the match took place in + type: string + cluster: + description: cluster + type: integer + opposing_team_id: + description: Opposing team identifier + type: integer + opposing_team_name: + description: Opposing team name, e.g. 'Evil Geniuses' + type: string + nullable: true + opposing_team_logo: + description: Opposing team logo url + type: string + HeroObjectResponse: + title: HeroObjectResponse + type: object + properties: + id: + description: Numeric identifier for the hero object + type: integer + name: + description: Dota hero command name, e.g. 'npc_dota_hero_antimage' + type: string + localized_name: + description: Hero name, e.g. 'Anti-Mage' + type: string + primary_attr: + description: Hero primary shorthand attribute name, e.g. 'agi' + type: string + attack_type: + description: Hero attack type, either 'Melee' or 'Ranged' + type: string + roles: + type: array + items: + description: A hero's role in the game + type: string + PlayerObjectResponse: + title: PlayerObjectResponse + type: object + properties: + account_id: + description: Player's account identifier + type: integer + steamid: + description: Player's steam identifier + type: string + avatar: + description: Steam picture URL (small picture) + type: string + avatarmedium: + description: Steam picture URL (medium picture) + type: string + avatarfull: + description: Steam picture URL (full picture) + type: string + profileurl: + description: Steam profile URL + type: string + personaname: + description: Player's Steam name + type: string + last_login: + description: Date and time of last login to OpenDota + type: string + format: date-time + full_history_time: + description: Date and time of last request to refresh player's match history + type: string + format: date-time + cheese: + description: Amount of dollars the player has donated to OpenDota + type: integer + fh_unavailable: + description: Whether the refresh of player' match history failed + type: boolean + loccountrycode: + description: Player's country identifier, e.g. US + type: string + name: + description: Verified player name, e.g. 'Miracle-' + type: string + country_code: + description: Player's country code + type: string + fantasy_role: + description: 'Player''s ingame role (core: 1 or support: 2)' + type: integer + team_id: + description: Player's team identifier + type: integer + team_name: + description: Player's team name, e.g. 'Evil Geniuses' + type: string + team_tag: + description: Player's team shorthand tag, e.g. 'EG' + type: string + is_locked: + description: Whether the roster lock is active + type: boolean + is_pro: + description: Whether the player is professional or not + type: boolean + locked_until: + description: When the roster lock will end + type: integer + LeagueObjectResponse: + title: LeagueObjectResponse + type: object + properties: + leagueid: + description: leagueid + type: integer + ticket: + description: ticket + type: string + banner: + description: banner + type: string + tier: + description: tier + type: string + name: + description: name + type: string + PublicMatchesResponse: + title: PublicMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + match_seq_num: + description: match_seq_num + type: integer + radiant_win: + description: Boolean indicating whether Radiant won the match + type: boolean + start_time: + description: start_time + type: integer + duration: + description: Duration of the game in seconds + type: integer + radiant_team: + description: radiant_team + type: string + dire_team: + description: dire_team + type: string + ParsedMatchesResponse: + title: ParsedMatchesResponse + type: object + properties: + match_id: + description: match_id + type: integer + MetadataResponse: + title: MetadataResponse + type: object + properties: + banner: + description: banner + type: object + nullable: true + DistributionsResponse: + title: DistributionsResponse + type: object + properties: + ranks: + description: ranks + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + mmr: + description: mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + bin: + description: bin + type: integer + bin_name: + description: bin_name + type: integer + count: + description: count + type: integer + cumulative_sum: + description: cumulative_sum + type: integer + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + sum: + description: sum + type: object + properties: + count: + description: count + type: integer + country_mmr: + description: country_mmr + type: object + properties: + commmand: + description: command + type: string + rowCount: + description: rowCount + type: integer + rows: + description: rows + type: array + items: + type: object + properties: + loccountrycode: + description: loccountrycode + type: string + nullable: true + count: + description: count + type: integer + avg: + description: avg + type: string + common: + description: common + type: string + fields: + description: fields + type: array + items: + type: object + properties: + name: + description: name + type: string + tableID: + description: tableID + type: integer + columnID: + description: columnID + type: integer + dataTypeID: + description: dataTypeID + type: integer + dataTypeSize: + description: dataTypeSize + type: integer + dataTypeModifier: + description: dataTypeModifier + type: integer + format: + description: format + type: string + rowAsArray: + description: rowAsArray + type: boolean + SearchResponse: + title: SearchResponse + type: object + properties: + account_id: + description: account_id + type: integer + avatarfull: + description: avatarfull + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_match_time: + description: last_match_time. May not be present or null. + type: string + similarity: + description: similarity + type: number + RankingsResponse: + title: RankingsResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + rankings: + description: rankings + type: array + items: + type: object + properties: + account_id: + description: account_id + type: integer + score: + description: score + type: number + steamid: + description: steamid + type: string + nullable: true + avatar: + description: avatar + type: string + nullable: true + avatarmedium: + description: avatarmedium + type: string + nullable: true + avatarfull: + description: avatarfull + type: string + nullable: true + profileurl: + description: profileurl + type: string + nullable: true + personaname: + description: personaname + type: string + nullable: true + last_login: + description: last_login + type: string + format: date-time + nullable: true + full_history_time: + description: full_history_time + type: string + format: date-time + cheese: + description: cheese + type: integer + nullable: true + fh_unavailable: + description: fh_unavailable + type: boolean + nullable: true + loccountrycode: + description: loccountrycode + type: string + nullable: true + rank_tier: + description: rank_tier + type: integer + nullable: true + BenchmarksResponse: + title: BenchmarksResponse + type: object + properties: + hero_id: + description: The ID value of the hero played + type: integer + result: + description: result + type: object + properties: + gold_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + xp_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + kills_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + last_hits_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_damage_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + hero_healing_per_min: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: number + tower_damage: + type: array + items: + type: object + properties: + percentile: + description: percentile + type: number + value: + description: value + type: integer + HeroStatsResponse: + title: HeroStatsResponse + type: object + properties: + id: + description: id + type: integer + name: + description: name + type: string + localized_name: + description: localized_name + type: string + img: + description: img + type: string + icon: + description: icon + type: string + pro_win: + description: pro_win + type: integer + pro_pick: + description: pro_pick + type: integer + hero_id: + description: The ID value of the hero played + type: integer + pro_ban: + description: pro_ban + type: integer + 1_pick: + description: Herald picks + type: integer + 1_win: + description: Herald wins + type: integer + 2_pick: + description: Guardian picks + type: integer + 2_win: + description: Guardian wins + type: integer + 3_pick: + description: Crusader picks + type: integer + 3_win: + description: Crusader wins + type: integer + 4_pick: + description: Archon picks + type: integer + 4_win: + description: Archon wins + type: integer + 5_pick: + description: Legend picks + type: integer + 5_win: + description: Legend wins + type: integer + 6_pick: + description: Ancient picks + type: integer + 6_win: + description: Ancient wins + type: integer + 7_pick: + description: Divine picks + type: integer + 7_win: + description: Divine wins + type: integer + 8_pick: + description: Immortal picks + type: integer + 8_win: + description: Immortal wins + type: integer + turbo_pick: + description: Picks in Turbo mode this month + type: integer + turbo_win: + description: Wins in Turbo mode this month + type: integer + HeroMatchupsResponse: + title: HeroMatchupsResponse + type: object + properties: + hero_id: + description: Numeric identifier for the hero object + type: integer + games_played: + description: Number of games played + type: integer + wins: + description: Number of games won + type: integer + HeroDurationsResponse: + title: HeroDurationsResponse + type: object + properties: + duration_bin: + description: Lower bound of number of seconds the match lasted + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + HeroItemPopularityResponse: + title: HeroItemPopularityResponse + type: object + properties: + start_game_items: + description: Items bought before game started + type: object + properties: + item: + description: Number of item bought + type: integer + early_game_items: + description: Items bought in the first 10 min of the game, with cost at least 700 + type: object + properties: + item: + description: Number of item bought + type: integer + mid_game_items: + description: Items bought between 10 and 25 min of the game, with cost at least 2000 + type: object + properties: + item: + description: Number of item bought + type: integer + late_game_items: + description: Items bought at least 25 min after game started, with cost at least 4000 + type: object + properties: + item: + description: Number of item bought + type: integer + TeamPlayersResponse: + title: TeamPlayersResponse + type: object + properties: + account_id: + description: The player account ID + type: string + name: + description: The player name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + is_current_team_member: + description: If this player is on the current roster + type: boolean + TeamHeroesResponse: + title: TeamHeroesResponse + type: object + properties: + hero_id: + description: The hero ID + type: integer + name: + description: The hero name + type: string + games_played: + description: Number of games played + type: integer + wins: + description: Number of wins + type: integer + ReplaysResponse: + title: ReplaysResponse + type: object + properties: + match_id: + description: match_id + type: integer + cluster: + description: cluster + type: integer + replay_salt: + description: replay_salt + type: integer + RecordsResponse: + title: RecordsResponse + type: object + properties: + match_id: + description: match_id + type: string + start_time: + description: start_time + type: string + hero_id: + description: The ID value of the hero played + type: string + score: + description: score + type: string + ScenarioItemTimingsResponse: + title: ScenarioItemTimingsResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + item: + description: Purchased item + type: string + time: + description: Ingame time in seconds before the item was purchased + type: integer + games: + description: The number of games where the hero bought this item before this time + type: string + wins: + description: The number of games won where the hero bought this item before this time + type: string + ScenarioLaneRolesResponse: + title: ScenarioLaneRolesResponse + type: object + properties: + hero_id: + description: Hero ID + type: integer + lane_role: + description: The hero's lane role + type: integer + time: + description: Maximum game length in seconds + type: integer + games: + description: The number of games where the hero played in this lane role + type: string + wins: + description: The number of games won where the hero played in this lane role + type: string + ScenarioMiscResponse: + title: ScenarioMiscResponse + type: object + properties: + scenario: + description: The scenario's name or description + type: string + is_radiant: + description: Boolean indicating whether Radiant executed this scenario + type: boolean + region: + description: Region the game was played in + type: integer + games: + description: The number of games where this scenario occurred + type: string + wins: + description: The number of games won where this scenario occured + type: string + SchemaResponse: + title: SchemaResponse + type: object + properties: + table_name: + description: table_name + type: string + column_name: + description: column_name + type: string + data_type: + description: data_type + type: string + parameters: + matchIdParam: + name: match_id + in: path + required: true + schema: + type: integer + accountIdParam: + name: account_id + in: path + description: Steam32 account ID + required: true + schema: + type: integer + teamIdPathParam: + name: team_id + in: path + description: Team ID + required: true + schema: + type: integer + leagueIdPathParam: + name: league_id + in: path + description: League ID + required: true + schema: + type: integer + heroIdPathParam: + name: hero_id + in: path + description: Hero ID + required: true + schema: + type: integer + fieldParam: + name: field + in: path + description: Field to aggregate on + required: true + schema: + type: string + limitParam: + name: limit + in: query + description: Number of matches to limit to + required: false + schema: + type: integer + offsetParam: + name: offset + in: query + description: Number of matches to offset start by + required: false + schema: + type: integer + projectParam: + name: project + in: query + description: Fields to project (array) + required: false + schema: + type: string + winParam: + name: win + in: query + description: Whether the player won + required: false + schema: + type: integer + patchParam: + name: patch + in: query + description: Patch ID + required: false + schema: + type: integer + gameModeParam: + name: game_mode + in: query + description: Game Mode ID + required: false + schema: + type: integer + lobbyTypeParam: + name: lobby_type + in: query + description: Lobby type ID + required: false + schema: + type: integer + regionParam: + name: region + in: query + description: Region ID + required: false + schema: + type: integer + dateParam: + name: date + in: query + description: Days previous + required: false + schema: + type: integer + laneRoleParam: + name: lane_role + in: query + description: Lane Role ID + required: false + schema: + type: integer + heroIdParam: + name: hero_id + in: query + description: Hero ID + required: false + schema: + type: integer + isRadiantParam: + name: is_radiant + in: query + description: Whether the player was radiant + required: false + schema: + type: integer + withHeroIdParam: + name: with_hero_id + in: query + description: Hero IDs on the player's team (array) + required: false + schema: + type: integer + againstHeroIdParam: + name: against_hero_id + in: query + description: Hero IDs against the player's team (array) + required: false + schema: + type: integer + withAccountIdParam: + name: with_account_id + in: query + description: Account IDs on the player's team (array) + required: false + schema: + type: integer + againstAccountIdParam: + name: against_account_id + in: query + description: Account IDs against the player's team (array) + required: false + schema: + type: integer + includedAccountIdParam: + name: included_account_id + in: query + description: Account IDs in the match (array) + required: false + schema: + type: integer + excludedAccountIdParam: + name: excluded_account_id + in: query + description: Account IDs not in the match (array) + required: false + schema: + type: integer + significantParam: + name: significant + in: query + description: Whether the match was significant for aggregation purposes. Defaults to 1 (true), set this to 0 to return data for non-standard modes/matches. + required: false + schema: + type: integer + sortParam: + name: sort + in: query + description: The field to return matches sorted by in descending order + required: false + schema: + type: string + havingParam: + name: having + in: query + description: The minimum number of games played, for filtering hero stats + required: false + schema: + type: integer + minMmrParam: + name: min_mmr + in: query + description: Minimum average MMR + required: false + schema: + type: integer + maxMmrParam: + name: max_mmr + in: query + description: Maximum average MMR + required: false + schema: + type: integer + minTimeParam: + name: min_time + in: query + description: Minimum start time (Unix time) + required: false + schema: + type: integer + maxTimeParam: + name: max_time + in: query + description: Maximum start time (Unix time) + required: false + schema: + type: integer + mmrAscendingParam: + name: mmr_ascending + in: query + description: Order by MMR ascending + required: false + schema: + type: integer + mmrDescendingParam: + name: mmr_descending + in: query + description: Order by MMR descending + required: false + schema: + type: integer + lessThanMatchIdParam: + name: less_than_match_id + in: query + description: Get matches with a match ID lower than this value + required: false + schema: + type: integer + matchOverviewParam: + name: overview + in: query + description: Only fetch data required for match overview page + required: false + schema: + type: integer + scenarioParam: + name: scenario + in: query + description: pos_chat_1min,neg_chat_1min,courier_kill,first_blood + required: false + schema: + type: string +paths: + /constants: + get: + summary: GET /constants + description: Gets an array of available resources. + tags: + - constants + parameters: [] + responses: + '200': + description: Success + content: + application/json; charset=utf-8: + schema: + type: array + items: + title: ConstantsResponse + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/k6/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/k6/petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 00000000000..bf110e9b9b2 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/k6/petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,2075 @@ +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 +security: + - global_api_key_header: [] + - global_api_key_cookie: [] +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 +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 + global_api_key_header: + type: apiKey + name: global_api_key_header + in: header + global_api_key_cookie: + type: apiKey + name: global_api_key_cookie + in: cookie + 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: + wrapped: true + items: + type: string + xml: + name: photoUrl + 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 diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml new file mode 100644 index 00000000000..bbcff074c71 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/issue19244_integer_enum.yaml @@ -0,0 +1,46 @@ +openapi: 3.0.3 +info: + description: >- + Example created + version: 1.0.0 + title: OpenAPI Stuff API created to reproduce issue + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +paths: + /healthcheck: + get: + summary: Health check endpoint. + operationId: healthcheck + responses: + 204: + description: Successful health check + default: + description: Unexpected error + content: + 'application/json': + schema: + $ref: '#/components/schemas/ApiError' + +components: + schemas: + ApiError: + required: + - errorCode + type: object + properties: + errorCode: + type: integer + enum: + - 0 + - 100 + x-enum-varnames: + - OK + - ERROR + reasonCode: + $ref: '#/components/schemas/ReasonCode' + ReasonCode: + type: integer + enum: + - 10 + - 20 diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml index edaefd90f8d..789fe3f0139 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml @@ -690,6 +690,8 @@ components: description: User Status xml: name: User + required: + - username Tag: title: Pet Tag description: A tag for a pet @@ -760,3 +762,25 @@ components: id: type: string format: uuid + UserOrPet: + oneOf: + - $ref: "#/components/schemas/User" + - $ref: "#/components/schemas/Pet" + UserOrPetOrArrayString: + oneOf: + - $ref: "#/components/schemas/User" + - $ref: "#/components/schemas/Pet" + - type: array + items: + type: string + AnyOfUserOrPet: + anyOf: + - $ref: "#/components/schemas/User" + - $ref: "#/components/schemas/Pet" + AnyOfUserOrPetOrArrayString: + anyOf: + - $ref: "#/components/schemas/User" + - $ref: "#/components/schemas/Pet" + - type: array + items: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml b/modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml new file mode 100644 index 00000000000..e0bd2f31fca --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/outerEnum.yaml @@ -0,0 +1,68 @@ +openapi: 3.0.0 +info: + title: Petstore API + description: API for managing pets in a pet store + version: 1.0.0 +paths: + /dogs: + get: + summary: List all dogs + operationId: listDogs + responses: + '200': + description: A list of dogs + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Dog' + /cats: + get: + summary: List all cats + operationId: listCats + responses: + '200': + description: A list of cats + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Cat' +components: + schemas: + Dog: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + $ref: '#/components/schemas/Status' + required: + - id + - name + - status + Cat: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + status: + $ref: '#/components/schemas/Status' + required: + - id + - name + - status + Status: + type: string + enum: + - available + - pending + - sold diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 28b35f47071..e4957b4e19d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1485,10 +1485,11 @@ components: photoUrls: type: array xml: - name: photoUrl wrapped: true items: type: string + xml: + name: photoUrl uniqueItems: true tags: type: array diff --git a/modules/openapi-generator/src/test/resources/3_0/python-flask/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/python-flask/petstore.yaml new file mode 100644 index 00000000000..49a6c04654b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/python-flask/petstore.yaml @@ -0,0 +1,802 @@ +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: [] + /fake/query_param_default: + get: + tags: + - fake + summary: test query parameter default value + description: '' + operationId: fake_query_param_default + parameters: + - name: hasDefault + in: query + description: has default value + schema: + type: string + default: Hello World + - name: noDefault + in: query + description: no default value + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found +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 + TestEnum: + type: string + enum: + - ONE + - TWO + - THREE + - foUr + TestEnumWithDefault: + type: string + enum: + - EIN + - ZWEI + - DREI + default: ZWEI + TestModel: + type: object + required: + - test_enum + properties: + test_enum: + $ref: "#/components/schemas/TestEnum" + test_string: + type: string + example: "Just some string" + test_enum_with_default: + $ref: "#/components/schemas/TestEnumWithDefault" + test_string_with_default: + type: string + example: "More string" + default: "ahoy matey" + test_inline_defined_enum_with_default: + type: string + enum: + - A + - B + - C + default: B 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 7f592594358..51eb757d374 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 @@ -2792,4 +2792,41 @@ components: - properties: _value: type: string - type: object \ No newline at end of file + type: object + TestEnum: + type: string + enum: + - ONE + - TWO + - THREE + - foUr + TestEnumWithDefault: + type: string + enum: + - EIN + - ZWEI + - DREI + default: ZWEI + TestModelWithEnumDefault: + type: object + required: + - test_enum + properties: + test_enum: + $ref: "#/components/schemas/TestEnum" + test_string: + type: string + example: "Just some string" + test_enum_with_default: + $ref: "#/components/schemas/TestEnumWithDefault" + test_string_with_default: + type: string + example: "More string" + default: "ahoy matey" + test_inline_defined_enum_with_default: + type: string + enum: + - A + - B + - C + default: B 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 917b103eb0c..2c5ad0483fb 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 @@ -959,6 +959,14 @@ components: nullable: true just_string: type: string + NumericEnumTesting: + description: testing that numeric enums are converted correctly + enum: + - 0 + - 1 + - 2 + - 3 + type: integer ref: description: using reserved word as model name type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml index f92d9a5c978..ee2e1b442a1 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1454,6 +1454,7 @@ components: uuid: type: string format: uuid + maxLength: 36 example: 72f98069-206d-4f12-9f12-3d1e525a8e84 password: type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml new file mode 100644 index 00000000000..244139a28d3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/oneOf.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: testing oneOf without discriminator +servers: + - url: http://localhost:3000 +paths: + /test: + get: + operationId: test + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' +components: + schemas: + TestResponse: + oneOf: + - $ref: "#/components/schemas/TestA" + - $ref: "#/components/schemas/TestB" + TestA: + type: object + properties: + foo: + type: string + required: + - foo + TestB: + type: object + properties: + bar: + type: string + required: + - bar diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml new file mode 100644 index 00000000000..0a2116cc581 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/self-import-issue.yaml @@ -0,0 +1,34 @@ +openapi: "3.0.1" +info: + title: Example + version: "1" +paths: {} +components: + schemas: + BranchDto: + type: object + properties: + name: + type: string + AbstractUserDto: + type: object + properties: + username: + type: string + branch: + "$ref": "#/components/schemas/BranchDto" + type: + type: string + discriminator: + propertyName: type + mapping: + internal-authenticated: "#/components/schemas/InternalAuthenticatedUserDto" + remote-authenticated: "#/components/schemas/RemoteAuthenticatedUserDto" + InternalAuthenticatedUserDto: + type: object + allOf: + - "$ref": "#/components/schemas/AbstractUserDto" + RemoteAuthenticatedUserDto: + type: object + allOf: + - "$ref": "#/components/schemas/AbstractUserDto" diff --git a/modules/openapi-generator/src/test/resources/3_0/validation.yaml b/modules/openapi-generator/src/test/resources/3_0/validation.yaml index 559a895a945..13b51951629 100644 --- a/modules/openapi-generator/src/test/resources/3_0/validation.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/validation.yaml @@ -24,3 +24,10 @@ components: maximum: 100 exclusiveMaximum: true multipleOf: 5 + ids: + type: array + items: + type: integer + minItems: 1 + maxItems: 10 + uniqueItems: false \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_1/csharp/additional_properties_oneof.yaml b/modules/openapi-generator/src/test/resources/3_1/csharp/additional_properties_oneof.yaml new file mode 100644 index 00000000000..bf87645039c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_1/csharp/additional_properties_oneof.yaml @@ -0,0 +1,60 @@ +openapi: 3.1.0 +info: + title: oneof + version: 0.0.1 +paths: + /: + get: + responses: + '200': + description: Key-value pairs with results + content: + application/json: + schema: + $ref: '#/components/schemas/Response' +components: + schemas: + + Result: + properties: + type: + type: string + checksum: + type: string + required: + - type + - checksum + discriminator: + propertyName: type + + FileResult: + allOf: + - $ref: '#/components/schemas/Result' + properties: + downloadUrl: + type: string + required: + - downloadUrl + + StringResult: + allOf: + - $ref: '#/components/schemas/Result' + properties: + data: + type: string + required: + - data + + Response: + type: object + properties: + success: + type: boolean + results: + additionalProperties: #key-value map + oneOf: + - $ref: '#/components/schemas/FileResult' + - $ref: '#/components/schemas/StringResult' + required: + - success + - results \ 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 5877e4448fa..4b20b4fa28b 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 @@ -665,6 +665,47 @@ paths: responses: '200': description: Successful Response + "/fake/inline/schema/anyof/path1": + get: + tags: + - fake + responses: + '200': + description: '' + content: + application/json: + schema: + anyOf: + - type: 'null' + - "$ref": "#/components/schemas/myObject" + "/fake/inline/schema/anyof/path2": + get: + tags: + - fake + responses: + '200': + description: '' + content: + application/json: + schema: + anyOf: + - "$ref": "#/components/schemas/myObject" + - type: 'null' + "/fake/inline/schema/anyof/path3": + get: + tags: + - fake + responses: + '200': + description: '' + content: + application/json: + schema: + anyOf: + - type: array + items: + "$ref": "#/components/schemas/myObject" + - type: 'null' externalDocs: description: Find out more about Swagger url: 'http://swagger.io' @@ -981,3 +1022,5 @@ components: AllOfSimpleModel: allOf: - $ref: '#/components/schemas/SimpleModelWithArrayProperty' + myObject: + type: object \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml b/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml new file mode 100644 index 00000000000..8aea06fd712 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_1/nodesc.yaml @@ -0,0 +1,35 @@ +openapi: 3.1.0 +info: + description: >- + Yet another example. + version: 1.0.0 + title: OpenAPI example +tags: + - name: nodesc + description: Endpoints have no description + - name: desc + description: Endpoints have description +paths: + /nodesc: + post: + tags: + - nodesc + summary: dummy operation + operationId: nodesc + responses: + '200': + description: successful operation + '405': + description: Invalid input + /desc: + post: + tags: + - desc + summary: dummy operation + description: 'Description' + operationId: desc + responses: + '200': + description: successful operation + '405': + description: Invalid input diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_13241.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_13241.yaml new file mode 100644 index 00000000000..b30b61f1918 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_13241.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 2.0.0 + title: test +paths: + /pets: + get: + summary: List all pets + operationId: listPets + responses: + '200': + description: OK +components: + schemas: + Color: + type: string + enum: [RED, BLUE, GREEN] \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_13444.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_13444.yaml new file mode 100644 index 00000000000..b30b61f1918 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_13444.yaml @@ -0,0 +1,17 @@ +openapi: "3.0.0" +info: + version: 2.0.0 + title: test +paths: + /pets: + get: + summary: List all pets + operationId: listPets + responses: + '200': + description: OK +components: + schemas: + Color: + type: string + enum: [RED, BLUE, GREEN] \ No newline at end of file diff --git a/pom.xml b/pom.xml index c769b1b6023..6ffad765b36 100644 --- a/pom.xml +++ b/pom.xml @@ -1186,10 +1186,11 @@ - org.junit.jupiter - junit-jupiter-api + org.junit + junit-bom ${junit.version} - test + pom + import org.testng @@ -1197,12 +1198,6 @@ ${testng.version} test - - org.openrewrite - rewrite-maven - ${openrewrite.version} - test - @@ -1230,8 +1225,7 @@ 32.1.3-jre 4.3.1 2.15.2 - 2.16.2 - 2.16.2 + 2.17.1 0.8.10 1.15 5.10.2 @@ -1247,9 +1241,7 @@ 4.0.0-M8 3.2.5 4.10.0 - 8.8.3 3.12.0 - 0.10.2 1.9.18 1.4 4.6.1 diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs index c569deebc53..1f3056ed28e 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs @@ -23,13 +23,14 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -70,10 +71,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -118,7 +119,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -129,7 +130,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -151,13 +152,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -204,7 +205,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -261,14 +262,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -376,7 +377,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -386,6 +387,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -430,57 +438,45 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -538,90 +534,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + Func> getResponse = (client) => { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -634,7 +620,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -649,7 +635,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -664,7 +650,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -679,7 +665,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -694,7 +680,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -709,7 +695,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -724,7 +710,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs index 3a99afa02ef..e87aec99cc6 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Bird.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs index 3ea815515b7..4c59b1d4f01 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Category.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs index 0659eda6e6a..92ba2761b5c 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DataQuery.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs index 6e0a7420fd6..3a0530813ea 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/DefaultValue.cs @@ -278,7 +278,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs index d94555402d4..ccf8e681847 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/NumberPropertiesOnly.cs @@ -144,18 +144,18 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Double (double) maximum if (this.Double > (double)50.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 50.2.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 50.2.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)0.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 0.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 0.8.", new [] { "Double" }); } yield break; diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs index 153be9a5d69..e3a45973d8b 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Pet.cs @@ -248,7 +248,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs index acb510dbeac..0ff925611a5 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Query.cs @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs index 01fbc1bf9c1..66eab762090 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/Tag.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs index dddd99a1788..d38d85da520 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestFormObjectMultipartRequestMarker.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs index 233fe2a2447..42b8e674635 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.cs @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs index 36d7bdf27a1..a6cad9859cf 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 51c96d7c8ea..422cb105a62 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 @@ -29,9 +29,7 @@ - - diff --git a/samples/client/echo_api/go-external-refs/client.go b/samples/client/echo_api/go-external-refs/client.go index 6c4adba0956..b725fb3f6d9 100644 --- a/samples/client/echo_api/go-external-refs/client.go +++ b/samples/client/echo_api/go-external-refs/client.go @@ -519,18 +519,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/client/echo_api/go-external-refs/utils.go b/samples/client/echo_api/go-external-refs/utils.go index 937ed9e7336..55defd54b94 100644 --- a/samples/client/echo_api/go-external-refs/utils.go +++ b/samples/client/echo_api/go-external-refs/utils.go @@ -12,7 +12,9 @@ Contact: team@openapitools.org package openapi import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -346,3 +348,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/client/echo_api/go/client.go b/samples/client/echo_api/go/client.go index 6c4adba0956..b725fb3f6d9 100644 --- a/samples/client/echo_api/go/client.go +++ b/samples/client/echo_api/go/client.go @@ -519,18 +519,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/client/echo_api/go/utils.go b/samples/client/echo_api/go/utils.go index 937ed9e7336..55defd54b94 100644 --- a/samples/client/echo_api/go/utils.go +++ b/samples/client/echo_api/go/utils.go @@ -12,7 +12,9 @@ Contact: team@openapitools.org package openapi import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -346,3 +348,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/client/echo_api/java/apache-httpclient/build.gradle b/samples/client/echo_api/java/apache-httpclient/build.gradle index 6f4f24adb1f..42a22e07b4a 100644 --- a/samples/client/echo_api/java/apache-httpclient/build.gradle +++ b/samples/client/echo_api/java/apache-httpclient/build.gradle @@ -114,8 +114,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.6" - jackson_version = "2.14.1" - jackson_databind_version = "2.14.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" httpclient_version = "5.1.3" diff --git a/samples/client/echo_api/java/apache-httpclient/pom.xml b/samples/client/echo_api/java/apache-httpclient/pom.xml index 45f3a1cf34d..9fae75dcad1 100644 --- a/samples/client/echo_api/java/apache-httpclient/pom.xml +++ b/samples/client/echo_api/java/apache-httpclient/pom.xml @@ -270,8 +270,8 @@ UTF-8 5.2.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 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 5cb4ce8d028..204214a1c5b 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 @@ -56,6 +56,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -103,8 +104,8 @@ public class ApiClient extends JavaTimeFormatter { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -250,16 +251,18 @@ public class ApiClient extends JavaTimeFormatter { * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -781,6 +784,7 @@ public class ApiClient extends JavaTimeFormatter { // convert input stream to string return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", response.getCode(), @@ -926,12 +930,15 @@ public class ApiClient extends JavaTimeFormatter { } protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { - statusCode = response.getCode(); + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } 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 93a9bb79d5f..ce08fa8396b 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 @@ -50,10 +50,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 36518a6ff89..a730f97ac86 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 @@ -50,10 +50,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 bc969a431ac..e35d4ee6f63 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 @@ -60,10 +60,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUFFIX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,10 +110,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 8860fb698b9..263d88c4d33 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 @@ -127,10 +127,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,10 +160,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -193,10 +193,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -259,10 +259,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -296,10 +296,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -341,10 +341,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -374,10 +374,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 29a5e596b64..580266d5918 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 @@ -55,10 +55,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +105,12 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 5e6760d0d58..644f92c37c7 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -224,10 +224,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 001c021e29c..93ce9480ece 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 @@ -90,10 +90,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,10 +123,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTCOMES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 51168440105..1ce410d3474 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 @@ -50,10 +50,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index f5fa48707c4..c2c88dd9e60 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -47,10 +47,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 edf9518a0ac..ba245c12340 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 @@ -59,10 +59,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,10 +109,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,10 +134,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 3ca75db7214..ff4ebad7beb 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -58,10 +58,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 405db1ed671..368c9ec5ea9 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 @@ -278,7 +278,7 @@ public class CustomTest { } catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) { 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])" ); + " at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); 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/feign-gson/build.gradle b/samples/client/echo_api/java/feign-gson/build.gradle index bac22350451..9c613d0b26c 100644 --- a/samples/client/echo_api/java/feign-gson/build.gradle +++ b/samples/client/echo_api/java/feign-gson/build.gradle @@ -102,8 +102,6 @@ test { ext { swagger_annotations_version = "1.6.11" - jackson_version = "2.14.3" - jackson_databind_version = "2.14.3" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" feign_version = "10.12" @@ -116,15 +114,10 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.github.openfeign:feign-core:$feign_version" - implementation "io.github.openfeign:feign-jackson:$feign_version" implementation "io.github.openfeign:feign-slf4j:$feign_version" implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_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 "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/samples/client/echo_api/java/feign-gson/build.sbt b/samples/client/echo_api/java/feign-gson/build.sbt index a305bfd0be2..a44105b5904 100644 --- a/samples/client/echo_api/java/feign-gson/build.sbt +++ b/samples/client/echo_api/java/feign-gson/build.sbt @@ -12,15 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.6.11" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "io.github.openfeign" % "feign-core" % "10.12" % "compile", - "io.github.openfeign" % "feign-jackson" % "10.12" % "compile", "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.14.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/echo_api/java/feign-gson/pom.xml b/samples/client/echo_api/java/feign-gson/pom.xml index c61a362289b..f0ea88c5bd6 100644 --- a/samples/client/echo_api/java/feign-gson/pom.xml +++ b/samples/client/echo_api/java/feign-gson/pom.xml @@ -304,7 +304,6 @@ 3.8.0 2.10.1 0.2.6 - 2.15.2 1.3.5 5.10.0 1.0.0 diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java index 6b09cec182b..ad135cef4e0 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java @@ -44,10 +44,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable public String getSize() { @@ -66,10 +66,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java index e0a317087e1..82cf74b2f63 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java @@ -44,10 +44,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -66,10 +66,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java index dd4bd5d9f31..e899ea7089d 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java @@ -54,10 +54,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable public String getSuffix() { @@ -76,10 +76,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable public String getText() { @@ -98,10 +98,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDate() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java index f7b9864a0c4..9bb873d3fa6 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -130,10 +130,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringEnumRefDefault() { @@ -160,10 +160,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringEnumDefault() { @@ -190,10 +190,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringDefault() { @@ -220,10 +220,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable public List getArrayIntegerDefault() { @@ -250,10 +250,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable public List getArrayString() { @@ -280,10 +280,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable public List getArrayStringNullable() { @@ -310,10 +310,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable public List getArrayStringExtensionNullable() { @@ -332,10 +332,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable public String getStringNullable() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index e2d9a0dd214..d1d899bf090 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -49,10 +49,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable public BigDecimal getNumber() { @@ -71,10 +71,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { @@ -93,12 +93,12 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java index 2c43ca60818..e9f9b9caf30 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -114,10 +114,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -136,10 +136,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { @@ -188,10 +188,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { @@ -218,10 +218,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { @@ -240,10 +240,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java index 97325b3f0d0..7d32532a313 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java @@ -96,10 +96,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -126,10 +126,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable public List getOutcomes() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java index b0ff86e0113..da6f8656cbc 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -44,10 +44,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -66,10 +66,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index bd870bd8bbb..18f132b04f9 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -40,10 +40,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 26deb03c46c..56e43a9fcc6 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -52,10 +52,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable public String getSize() { @@ -74,10 +74,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { @@ -96,10 +96,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -118,10 +118,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 03de447e7cf..8a89d05ea57 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -51,10 +51,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable public List getValues() { diff --git a/samples/client/echo_api/java/native/build.gradle b/samples/client/echo_api/java/native/build.gradle index 751afe8baf4..3d12e3832f7 100644 --- a/samples/client/echo_api/java/native/build.gradle +++ b/samples/client/echo_api/java/native/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson_version = "2.14.1" + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" junit_version = "5.10.2" httpmime_version = "4.5.13" diff --git a/samples/client/echo_api/java/native/pom.xml b/samples/client/echo_api/java/native/pom.xml index 5637e81399a..4a6b30f6d0e 100644 --- a/samples/client/echo_api/java/native/pom.xml +++ b/samples/client/echo_api/java/native/pom.xml @@ -253,7 +253,7 @@ UTF-8 11 11 - 2.15.2 + 2.17.1 0.2.6 1.3.5 4.5.14 diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java index c073cdf81b7..3823cd5cb72 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { private Duration readTimeout; private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Bird.java index 7d8ffa24ab2..3e37e7185c3 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Bird.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Bird */ @@ -51,14 +52,13 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSize() { return size; } @@ -76,14 +76,13 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { return color; } @@ -172,12 +171,12 @@ public class Bird { // add `size` to the URL query string if (getSize() != null) { - joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Category.java index e9dd7762220..28fdd9899e6 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Category */ @@ -51,14 +52,13 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Category { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java index beba64e4cd2..5035258825e 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java @@ -32,6 +32,7 @@ import org.openapitools.client.model.Query; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * DataQuery */ @@ -59,14 +60,13 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUFFIX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSuffix() { return suffix; } @@ -84,14 +84,13 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getText() { return text; } @@ -109,14 +108,13 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Instant getDate() { return date; } @@ -221,7 +219,7 @@ public class DataQuery extends Query { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outcomes` to the URL query string @@ -229,23 +227,23 @@ public class DataQuery extends Query { for (int i = 0; i < getOutcomes().size(); i++) { joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `suffix` to the URL query string if (getSuffix() != null) { - joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSuffix()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssuffix%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSuffix()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `text` to the URL query string if (getText() != null) { - joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stext%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `date` to the URL query string if (getDate() != null) { - joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java index 53308f7ddbf..48f2e6cabac 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -35,6 +35,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * to test the default value of properties */ @@ -127,14 +128,13 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayStringEnumRefDefault() { return arrayStringEnumRefDefault; } @@ -160,14 +160,13 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayStringEnumDefault() { return arrayStringEnumDefault; } @@ -193,14 +192,13 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayStringDefault() { return arrayStringDefault; } @@ -226,14 +224,13 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayIntegerDefault() { return arrayIntegerDefault; } @@ -259,14 +256,13 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayString() { return arrayString; } @@ -296,13 +292,12 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayStringNullable() { return arrayStringNullable.orElse(null); } @@ -341,13 +336,12 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayStringExtensionNullable() { return arrayStringExtensionNullable.orElse(null); } @@ -374,13 +368,12 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore - public String getStringNullable() { return stringNullable.orElse(null); } @@ -505,7 +498,7 @@ public class DefaultValue { if (getArrayStringEnumRefDefault().get(i) != null) { joiner.add(String.format("%sarray_string_enum_ref_default%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayStringEnumRefDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayStringEnumRefDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } @@ -515,7 +508,7 @@ public class DefaultValue { for (int i = 0; i < getArrayStringEnumDefault().size(); i++) { joiner.add(String.format("%sarray_string_enum_default%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayStringEnumDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayStringEnumDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -524,7 +517,7 @@ public class DefaultValue { for (int i = 0; i < getArrayStringDefault().size(); i++) { joiner.add(String.format("%sarray_string_default%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayStringDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayStringDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -533,7 +526,7 @@ public class DefaultValue { for (int i = 0; i < getArrayIntegerDefault().size(); i++) { joiner.add(String.format("%sarray_integer_default%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayIntegerDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayIntegerDefault().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -542,7 +535,7 @@ public class DefaultValue { for (int i = 0; i < getArrayString().size(); i++) { joiner.add(String.format("%sarray_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -551,7 +544,7 @@ public class DefaultValue { for (int i = 0; i < getArrayStringNullable().size(); i++) { joiner.add(String.format("%sarray_string_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayStringNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayStringNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -560,13 +553,13 @@ public class DefaultValue { for (int i = 0; i < getArrayStringExtensionNullable().size(); i++) { joiner.add(String.format("%sarray_string_extension_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayStringExtensionNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayStringExtensionNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `string_nullable` to the URL query string if (getStringNullable() != null) { - joiner.add(String.format("%sstring_nullable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStringNullable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstring_nullable%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStringNullable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 24bc45cb3e3..b0956c8a0e6 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * NumberPropertiesOnly */ @@ -56,14 +57,13 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getNumber() { return number; } @@ -81,14 +81,13 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { return _float; } @@ -106,16 +105,15 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { return _double; } @@ -206,17 +204,17 @@ public class NumberPropertiesOnly { // add `number` to the URL query string if (getNumber() != null) { - joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `float` to the URL query string if (getFloat() != null) { - joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `double` to the URL query string if (getDouble() != null) { - joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java index 64717d0dcfe..aff2ed12512 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -32,6 +32,7 @@ import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Pet */ @@ -108,14 +109,13 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -133,14 +133,13 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -158,14 +157,13 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { return category; } @@ -191,14 +189,13 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { return photoUrls; } @@ -224,14 +221,13 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { return tags; } @@ -249,14 +245,13 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -353,12 +348,12 @@ public class Pet { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `category` to the URL query string @@ -371,7 +366,7 @@ public class Pet { for (int i = 0; i < getPhotoUrls().size(); i++) { joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -387,7 +382,7 @@ public class Pet { // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java index d37b4922ddd..fb98790fa22 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java @@ -30,6 +30,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Query */ @@ -90,14 +91,13 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -123,14 +123,13 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTCOMES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getOutcomes() { return outcomes; } @@ -219,7 +218,7 @@ public class Query { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outcomes` to the URL query string @@ -227,7 +226,7 @@ public class Query { for (int i = 0; i < getOutcomes().size(); i++) { joiner.add(String.format("%soutcomes%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getOutcomes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Tag.java index 9c73806a1f7..a7bff60ae2b 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Tag */ @@ -51,14 +52,13 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Tag { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index 2914dae2e4e..134efc8e04f 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * TestFormObjectMultipartRequestMarker */ @@ -47,14 +48,13 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -141,7 +141,7 @@ public class TestFormObjectMultipartRequestMarker { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 393e9ed45b3..63256207cbd 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter */ @@ -59,14 +60,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSize() { return size; } @@ -84,14 +84,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { return color; } @@ -109,14 +108,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -134,14 +132,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -234,22 +231,22 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter // add `size` to the URL query string if (getSize() != null) { - joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssize%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 86f505c606a..c9c40374e45 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -30,6 +30,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter */ @@ -57,14 +58,13 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getValues() { return values; } @@ -154,7 +154,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { for (int i = 0; i < getValues().size(); i++) { joiner.add(String.format("%svalues%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getValues().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getValues().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 9aed8d9bef4..e7c6c5e6250 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 @@ -305,7 +305,7 @@ public class CustomTest { } catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) { 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])" ); + " at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); 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/okhttp-gson-user-defined-templates/build.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle index ba29ee2b2f7..676e8c999a0 100644 --- 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 @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { 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 index cef996ca186..41a2d93764c 100644 --- 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 @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/modelCopy/Category.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Category.java index 6ec7a3cf48c..540d500c096 100644 --- 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 @@ -78,12 +78,12 @@ public class Category { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 38a67fbd14e..7d00a81feb6 100644 --- 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 @@ -78,12 +78,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 70e2676c4e0..7468fca68b8 100644 --- 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 @@ -78,12 +78,12 @@ public class Order { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index f7a3ed81d8e..9692c15675c 100644 --- 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 @@ -78,12 +78,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 76c04ff9174..0e43e6a1ae3 100644 --- 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 @@ -78,12 +78,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 81bf3bd496d..44f94d64bd8 100644 --- 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 @@ -78,12 +78,12 @@ public class User { 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 - */ + /** + * 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 @@ -129,22 +129,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 6d7d759f353..c8559aa93a3 100644 --- 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 @@ -306,14 +306,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -334,14 +329,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 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 index ad2d26cbfbb..f993e935c7a 100644 --- 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 @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -338,7 +331,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -348,7 +341,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -373,7 +366,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -392,7 +385,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } 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 index f40a47ba215..199e6eb66ef 100644 --- 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 @@ -22,8 +22,6 @@ 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; 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 index 08671d8fa16..1de64b76784 100644 --- 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 @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -154,12 +154,12 @@ public class Category { 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 - */ + /** + * 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 @@ -209,22 +209,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index b7a4beed721..d728358e4e1 100644 --- 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 @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -180,12 +180,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -238,22 +238,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index e0e897a85c8..01340f00a3c 100644 --- 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 @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -313,12 +313,12 @@ public class Order { 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 - */ + /** + * 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 @@ -372,22 +372,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 1d16b4d8399..643787e056f 100644 --- 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 @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -339,12 +339,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -432,22 +432,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 57ada692df9..cead6aadb83 100644 --- 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 @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -154,12 +154,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -209,22 +209,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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 index 352227391e0..fe9eb5c674a 100644 --- 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 @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -310,12 +310,12 @@ public class User { 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 - */ + /** + * 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 @@ -380,22 +380,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/build.gradle b/samples/client/echo_api/java/okhttp-gson/build.gradle index 3d38f68764d..1f433364a3a 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson/build.gradle @@ -112,14 +112,13 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/echo_api/java/okhttp-gson/build.sbt b/samples/client/echo_api/java/okhttp-gson/build.sbt index 7ea5b0cb560..12ac2795172 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson/build.sbt @@ -14,14 +14,13 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/echo_api/java/okhttp-gson/pom.xml index 3c3aaad6fb5..b7a41cebfbb 100644 --- a/samples/client/echo_api/java/okhttp-gson/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson/pom.xml @@ -301,14 +301,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -329,14 +324,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index 1520a2c9357..247f3cf0c99 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -342,7 +335,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -352,7 +345,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -377,7 +370,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -396,7 +389,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 9e9d8df56cf..65cdf67a62d 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Bird.java index 97139b23f00..7a81a9ee785 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Bird.java @@ -67,10 +67,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable public String getSize() { return size; @@ -86,10 +86,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -154,12 +154,12 @@ public class Bird { 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 Bird - */ + /** + * 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 Bird + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Bird.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -212,22 +212,22 @@ public class Bird { } } - /** - * Create an instance of Bird given an JSON string - * - * @param jsonString JSON string - * @return An instance of Bird - * @throws IOException if the JSON string is invalid with respect to Bird - */ + /** + * Create an instance of Bird given an JSON string + * + * @param jsonString JSON string + * @return An instance of Bird + * @throws IOException if the JSON string is invalid with respect to Bird + */ public static Bird fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Bird.class); } - /** - * Convert an instance of Bird to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Bird 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/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index 41121d11144..8988d4f15af 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -154,12 +154,12 @@ public class Category { 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 - */ + /** + * 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 @@ -209,22 +209,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DataQuery.java index 85cdd64885c..fd03abb29dc 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DataQuery.java @@ -75,10 +75,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable public String getSuffix() { return suffix; @@ -94,10 +94,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable public String getText() { return text; @@ -113,10 +113,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDate() { return date; @@ -188,12 +188,12 @@ public class DataQuery extends Query { 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 DataQuery - */ + /** + * 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 DataQuery + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -246,22 +246,22 @@ public class DataQuery extends Query { } } - /** - * Create an instance of DataQuery given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataQuery - * @throws IOException if the JSON string is invalid with respect to DataQuery - */ + /** + * Create an instance of DataQuery given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataQuery + * @throws IOException if the JSON string is invalid with respect to DataQuery + */ public static DataQuery fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataQuery.class); } - /** - * Convert an instance of DataQuery to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataQuery 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/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java index a8b189c6f5e..380c4214e5b 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -157,10 +157,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringEnumRefDefault() { return arrayStringEnumRefDefault; @@ -184,10 +184,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringEnumDefault() { return arrayStringEnumDefault; @@ -211,10 +211,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable public List getArrayStringDefault() { return arrayStringDefault; @@ -238,10 +238,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable public List getArrayIntegerDefault() { return arrayIntegerDefault; @@ -265,10 +265,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable public List getArrayString() { return arrayString; @@ -292,10 +292,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable public List getArrayStringNullable() { return arrayStringNullable; @@ -319,10 +319,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable public List getArrayStringExtensionNullable() { return arrayStringExtensionNullable; @@ -338,10 +338,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable public String getStringNullable() { return stringNullable; @@ -435,12 +435,12 @@ public class DefaultValue { 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 DefaultValue - */ + /** + * 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 DefaultValue + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DefaultValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -518,22 +518,22 @@ public class DefaultValue { } } - /** - * Create an instance of DefaultValue given an JSON string - * - * @param jsonString JSON string - * @return An instance of DefaultValue - * @throws IOException if the JSON string is invalid with respect to DefaultValue - */ + /** + * Create an instance of DefaultValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultValue + * @throws IOException if the JSON string is invalid with respect to DefaultValue + */ public static DefaultValue fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DefaultValue.class); } - /** - * Convert an instance of DefaultValue to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DefaultValue 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/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 12433204f97..60b385c2a5f 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -72,10 +72,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable public BigDecimal getNumber() { return number; @@ -91,10 +91,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { return _float; @@ -110,12 +110,12 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { return _double; @@ -183,12 +183,12 @@ public class NumberPropertiesOnly { 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 NumberPropertiesOnly - */ + /** + * 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 NumberPropertiesOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NumberPropertiesOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,22 +235,22 @@ public class NumberPropertiesOnly { } } - /** - * Create an instance of NumberPropertiesOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumberPropertiesOnly - * @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly - */ + /** + * Create an instance of NumberPropertiesOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberPropertiesOnly + * @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly + */ public static NumberPropertiesOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NumberPropertiesOnly.class); } - /** - * Convert an instance of NumberPropertiesOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NumberPropertiesOnly 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/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index eecdae3113d..ca696daa15b 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -141,10 +141,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -179,10 +179,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -206,10 +206,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -252,10 +252,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -334,12 +334,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -427,22 +427,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Query.java index 769ed92bb60..760346259d9 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Query.java @@ -123,10 +123,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -150,10 +150,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable public List getOutcomes() { return outcomes; @@ -218,12 +218,12 @@ public class Query { 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 Query - */ + /** + * 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 Query + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -238,22 +238,22 @@ public class Query { } - /** - * Create an instance of Query given an JSON string - * - * @param jsonString JSON string - * @return An instance of Query - * @throws IOException if the JSON string is invalid with respect to Query - */ + /** + * Create an instance of Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of Query + * @throws IOException if the JSON string is invalid with respect to Query + */ public static Query fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Query.class); } - /** - * Convert an instance of Query to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Query 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/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index 4cab6e1fcda..2e1cdcac855 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -154,12 +154,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -209,22 +209,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index 98f9d533f8d..6d069c07113 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -63,10 +63,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -128,12 +128,12 @@ public class TestFormObjectMultipartRequestMarker { 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 TestFormObjectMultipartRequestMarker - */ + /** + * 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 TestFormObjectMultipartRequestMarker + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TestFormObjectMultipartRequestMarker.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -183,22 +183,22 @@ public class TestFormObjectMultipartRequestMarker { } } - /** - * Create an instance of TestFormObjectMultipartRequestMarker given an JSON string - * - * @param jsonString JSON string - * @return An instance of TestFormObjectMultipartRequestMarker - * @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker - */ + /** + * Create an instance of TestFormObjectMultipartRequestMarker given an JSON string + * + * @param jsonString JSON string + * @return An instance of TestFormObjectMultipartRequestMarker + * @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker + */ public static TestFormObjectMultipartRequestMarker fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TestFormObjectMultipartRequestMarker.class); } - /** - * Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TestFormObjectMultipartRequestMarker 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/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index ed497227f2e..8eb9798aa05 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -75,10 +75,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable public String getSize() { return size; @@ -94,10 +94,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -113,10 +113,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -132,10 +132,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -206,12 +206,12 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - */ + /** + * 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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -267,22 +267,22 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter } } - /** - * Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string - * - * @param jsonString JSON string - * @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - * @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter - */ + /** + * Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + * @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + */ public static TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.class); } - /** - * Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 43e20f44b73..189284c634b 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -73,10 +73,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable public List getValues() { return values; @@ -138,12 +138,12 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { 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 TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - */ + /** + * 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 TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -194,22 +194,22 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { } } - /** - * Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string - * - * @param jsonString JSON string - * @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - * @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter - */ + /** + * Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + * @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + */ public static TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.class); } - /** - * Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/echo_api/java/restclient/README.md b/samples/client/echo_api/java/restclient/README.md index 9d87421d95a..fe3136bd7df 100644 --- a/samples/client/echo_api/java/restclient/README.md +++ b/samples/client/echo_api/java/restclient/README.md @@ -89,7 +89,7 @@ import org.openapitools.client.api.AuthApi; public class AuthApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost:3000"); // Configure HTTP basic authorization: http_auth @@ -101,10 +101,10 @@ public class AuthApiExample { try { String result = apiInstance.testAuthHttpBasic(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException 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("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/echo_api/java/restclient/build.gradle b/samples/client/echo_api/java/restclient/build.gradle index dac8486322f..5e8bce82ddb 100644 --- a/samples/client/echo_api/java/restclient/build.gradle +++ b/samples/client/echo_api/java/restclient/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "6.1.6" jakarta_annotation_version = "2.1.1" diff --git a/samples/client/echo_api/java/restclient/pom.xml b/samples/client/echo_api/java/restclient/pom.xml index 828b6ef4ea2..0386d9f1470 100644 --- a/samples/client/echo_api/java/restclient/pom.xml +++ b/samples/client/echo_api/java/restclient/pom.xml @@ -281,8 +281,8 @@ UTF-8 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 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 index f11ee1eb8cb..1757e802f48 100644 --- 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 @@ -10,8 +10,8 @@ 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.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; 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 index f957b1d19ba..38a633a1acc 100644 --- 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 @@ -47,10 +47,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index cdaceb78a82..941aa693598 100644 --- 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 11342dd7f14..b9001e24d3f 100644 --- 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 @@ -57,10 +57,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUFFIX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,10 +82,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 71d6e7b290e..d05cefcdea0 100644 --- 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 @@ -124,10 +124,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,10 +223,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,10 +256,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -338,10 +338,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -371,10 +371,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @jakarta.annotation.Nullable @JsonIgnore 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 index 688551bccf9..3d5a4a0f134 100644 --- 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 @@ -52,10 +52,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,12 @@ public class NumberPropertiesOnly { 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) 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 index 8d44320cab1..1ad1cd1733c 100644 --- 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 @@ -105,10 +105,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -155,10 +155,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -221,10 +221,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,10 +246,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 6ebb85c42cf..a3d2eba7d19 100644 --- 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 @@ -87,10 +87,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -120,10 +120,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTCOMES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index b70725be92e..1525850e85d 100644 --- 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 62940d684f0..dd9c55acfb9 100644 --- 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 @@ -44,10 +44,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 4c0e64a52a2..6bd0bb437dd 100644 --- 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 @@ -56,10 +56,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +131,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 568f4dd7d5a..06a773462b4 100644 --- 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 @@ -55,10 +55,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 61840f4251b..42145cd9d3b 100644 --- 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 @@ -15,17 +15,22 @@ 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.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.GifHttpMessageConverter; import org.openapitools.client.OctetStreamHttpMessageConverter; +import org.openapitools.client.model.Category; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.Pet.StatusEnum; import org.openapitools.client.model.StringEnumRef; import org.openapitools.client.model.Tag; @@ -117,11 +122,18 @@ public class BodyApiTest { *

    Test single binary in multipart mime */ @Test - public void testBodyMultipartFormdataSingleBinaryTest() { - File myFile = null; - String response = api.testBodyMultipartFormdataSingleBinary(myFile); + public void testBodyMultipartFormdataSingleBinaryTest() throws IOException { + // given + var testFile = Files.createTempFile("test", ".txt"); + String testFileContent = "Lorem ipsum dolor sit amet"; + Files.writeString(testFile, testFileContent); - // TODO: test validations + // when + String response = api.testBodyMultipartFormdataSingleBinary(testFile.toFile()); + + // then + assertThat(response, containsString("Content-Type: multipart/form-data")); + assertThat(response, containsString(testFileContent)); } /** @@ -131,10 +143,26 @@ public class BodyApiTest { */ @Test public void testEchoBodyAllOfPetTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when Pet response = api.testEchoBodyAllOfPet(pet); - // TODO: test validations + // then + assertThat(response, is(pet)); } /** @@ -144,10 +172,22 @@ public class BodyApiTest { */ @Test public void testEchoBodyFreeFormObjectResponseStringTest() { - Object body = null; - String response = api.testEchoBodyFreeFormObjectResponseString(body); + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "51"); - // TODO: test validations + Object mapAsObject = + new HashMap<>( + Map.of( + "firstKey", "firstValue", + "secondKey", "secondValue")); + + // when + String response = api.testEchoBodyFreeFormObjectResponseString(mapAsObject); + + // then + assertThat(response, is("{\"firstKey\":\"firstValue\",\"secondKey\":\"secondValue\"}")); } /** @@ -157,10 +197,26 @@ public class BodyApiTest { */ @Test public void testEchoBodyPetTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when Pet response = api.testEchoBodyPet(pet); - // TODO: test validations + // then + assertThat(response, is(pet)); } /** @@ -170,10 +226,29 @@ public class BodyApiTest { */ @Test public void testEchoBodyPetResponseStringTest() { - Pet pet = null; + // given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "192"); + + Pet pet = + new Pet() + .id(42L) + .name("Corgi") + .category(new Category().id(1L).name("Dogs")) + .status(StatusEnum.SOLD) + .addPhotoUrlsItem( + "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg") + .addTagsItem(new Tag().id(1L).name("cute")); + + // when String response = api.testEchoBodyPetResponseString(pet); - // TODO: test validations + // then + assertThat( + response, + is( + "{\"id\":42,\"name\":\"Corgi\",\"category\":{\"id\":1,\"name\":\"Dogs\"},\"photoUrls\":[\"https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg\"],\"tags\":[{\"id\":1,\"name\":\"cute\"}],\"status\":\"sold\"}")); } /** @@ -183,10 +258,14 @@ public class BodyApiTest { */ @Test public void testEchoBodyStringEnumTest() { - String body = null; + // given + String body = "\"failure\""; + + // when StringEnumRef response = api.testEchoBodyStringEnum(body); - // TODO: test validations + // then + assertThat(response, is(StringEnumRef.FAILURE)); } /** @@ -196,9 +275,13 @@ public class BodyApiTest { */ @Test public void testEchoBodyTagResponseStringTest() { + // given Tag tag = null; + + // when String response = api.testEchoBodyTagResponseString(tag); - // TODO: test validations + // then + assertThat(response, nullValue()); } } 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 index 2db712c5dd7..140bca8e3de 100644 --- 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 @@ -10,72 +10,154 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; -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 +/** API tests for FormApi */ public class FormApiTest { - private final FormApi api = new FormApi(); + 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); + /** + * Test form parameter(s) + * + *

    Test form parameter(s) + */ + @Test + public void testFormIntegerBooleanStringTest() { + // Given + // The content length must be set to disable the Transfer-Encoding: chunked which would lead to + // unparsable response because the echo server is replying them as body. + api.getApiClient().addDefaultHeader("Content-Length", "53"); - // 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); + Integer integerForm = 42; + Boolean booleanForm = true; + String stringForm = "Test123"; - // 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); + // When + String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm); - // TODO: test validations - } - -} \ No newline at end of file + // Then + assertThat(response, containsString("integer_form=42&boolean_form=true&string_form=Test123")); + } + + /** + * Test form parameter(s) for multipart schema + * + *

    Test form parameter(s) for multipart schema + */ + @Test + public void testFormObjectMultipartTest() { + // Given + TestFormObjectMultipartRequestMarker marker = + new TestFormObjectMultipartRequestMarker().name("Test Marker"); + + // When + String response = api.testFormObjectMultipart(marker); + + // Then + assertThat(response, containsString("{\"name\":\"Test Marker\"}")); + } + + /** + * Test form parameter(s) for oneOf schema with only the first parameters filled + * + *

    Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_first() { + // Given + String form1 = "test12"; + Integer form2 = 12; + + String form3 = null; + Boolean form4 = null; + + Long id = null; + String name = null; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("form1=test12&form2=12")); + } + + /** + * Test form parameter(s) for oneOf schema with only the second parameters filled + * + *

    Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_second() { + // Given + String form1 = null; + Integer form2 = null; + + String form3 = "34test"; + Boolean form4 = false; + + Long id = null; + String name = null; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("form3=34test&form4=false")); + } + + /** + * Test form parameter(s) for oneOf schema with only the third parameters filled + * + *

    Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_third() { + // Given + String form1 = null; + Integer form2 = null; + + String form3 = null; + Boolean form4 = null; + + Long id = 21L; + String name = "Hans"; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat(response, containsString("id=21&name=Hans")); + } + + /** + * Test form parameter(s) for oneOf schema with all parameters filled + * + *

    Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest_all() { + // Given + String form1 = "test12"; + Integer form2 = 12; + + String form3 = "34test"; + Boolean form4 = false; + + Long id = 21L; + String name = "Hans"; + + // When + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // Then + assertThat( + response, containsString("form1=test12&form2=12&form3=34test&form4=false&id=21&name=Hans")); + } +} 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 index bc92762bfc8..c0230e6b003 100644 --- 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 @@ -10,43 +10,51 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.StringEnumRef; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.model.StringEnumRef; -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 +/** API tests for HeaderApi */ public class HeaderApiTest { - private final HeaderApi api = new HeaderApi(); + 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); + /** + * Test header parameter(s) + * + *

    Test header parameter(s) + */ + @Test + public void testHeaderIntegerBooleanStringEnumsTest() { + // Given + Integer integerHeader = 11; + Boolean booleanHeader = true; + String stringHeader = "simple String Header"; + String enumNonrefStringHeader = "false"; + StringEnumRef enumRefStringHeader = StringEnumRef.UNCLASSIFIED; - // TODO: test validations - } - -} \ No newline at end of file + // When + String response = + api.testHeaderIntegerBooleanStringEnums( + integerHeader, + booleanHeader, + stringHeader, + enumNonrefStringHeader, + enumRefStringHeader); + + // Then + assertThat( + response, + allOf( + containsString("integer_header: 11"), + containsString("boolean_header: true"), + containsString("string_header: simple String Header"), + containsString("enum_nonref_string_header: false"), + containsString("enum_ref_string_header: unclassified"))); + } +} 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 index dfb396727f4..d9381c9c2f3 100644 --- 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 @@ -10,42 +10,40 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.StringEnumRef; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.model.StringEnumRef; -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 +/** API tests for PathApi */ public class PathApiTest { - private final PathApi api = new PathApi(); + 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); + /** + * Test path parameter(s) + * + *

    Test path parameter(s) + */ + @Test + public void + testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() { + // Given + String pathString = "simple String Path"; + Integer pathInteger = 50; + String enumNonrefStringPath = "true"; + StringEnumRef enumRefStringPath = StringEnumRef.SUCCESS; - // TODO: test validations - } - -} \ No newline at end of file + // When + String response = + api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath( + pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); + + // Then + assertThat( + response, containsString("/path/string/simple%20String%20Path/integer/50/true/success")); + } +} 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 index 72e47f93f69..827ef91367e 100644 --- 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 @@ -10,167 +10,206 @@ * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.model.DataQuery; -import java.time.LocalDate; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + import java.time.Instant; +import java.time.LocalDate; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.openapitools.client.model.DataQuery; 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 +/** API tests for QueryApi */ public class QueryApiTest { - private final QueryApi api = new QueryApi(); + 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); + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + public void testEnumRefStringTest() { + // Given + String enumNonrefStringQuery = "false"; + StringEnumRef enumRefStringQuery = StringEnumRef.SUCCESS; - // 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); + // When + String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery); - // 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); + // Then + assertThat( + response, containsString("?enum_nonref_string_query=false&enum_ref_string_query=success")); + } - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleDeepObjectExplodeTrueObjectTest() { - Pet queryObject = null; - String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + public void testQueryDatetimeDateStringTest() { + // Given + Instant datetimeQuery = Instant.ofEpochMilli(1720361075); + LocalDate dateQuery = LocalDate.of(2024, 7, 7); + String stringQuery = "2024-07-07T16:05:59Z"; - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() { - TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null; - String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); + // When + String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery); - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeFalseArrayIntegerTest() { - List queryObject = null; - String response = api.testQueryStyleFormExplodeFalseArrayInteger(queryObject); + // Then + assertThat( + response, + containsString( + "?datetime_query=1970-01-20T21%3A52%3A41.075Z&date_query=2024-07-07&string_query=2024-07-07T16%3A05%3A59Z")); + } - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeFalseArrayStringTest() { - List queryObject = null; - String response = api.testQueryStyleFormExplodeFalseArrayString(queryObject); + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + public void testQueryIntegerBooleanStringTest() { + // Given + Integer integerQuery = 42; + Boolean booleanQuery = false; + String stringQuery = "Hello World!"; - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueArrayStringTest() { - TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = null; - String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + // When + String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueObjectTest() { - Pet queryObject = null; - String response = api.testQueryStyleFormExplodeTrueObject(queryObject); + // Then + assertThat( + response, + containsString("?integer_query=42&boolean_query=false&string_query=Hello%20World%21")); + } - // TODO: test validations - } - - /** - * Test query parameter(s) - * - * Test query parameter(s) - */ - @Test - public void testQueryStyleFormExplodeTrueObjectAllOfTest() { - DataQuery queryObject = null; - String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleDeepObjectExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); - // TODO: test validations - } - -} \ No newline at end of file + // Like Spring WebClient and RestTemplate, the deep object style is currently not + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() { + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); + + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayIntegerTest() { + // Given + List queryObject = List.of(1, 6, 2, 5, 3, 4); + + // When + String response = api.testQueryStyleFormExplodeFalseArrayInteger(queryObject); + + // Then + assertThat(response, containsString("?query_object=1%2C6%2C2%2C5%2C3%2C4")); + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayStringTest() { + // Given + List queryObject = List.of("Hello", "World"); + + // When + String response = api.testQueryStyleFormExplodeFalseArrayString(queryObject); + + // Then + assertThat(response, containsString("?query_object=Hello%2CWorld")); + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueArrayStringTest() { + // Given + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = + new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() + .addValuesItem("Hello") + .addValuesItem("Hallo") + .addValuesItem("Bonjour"); + + // When + String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + + // Then + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + assertThat( + response, containsString("?query_object=Hello&query_object=Hallo&query_object=Bonjour")); + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObject(queryObject); + + // TODO: test validations + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } + + /** + * Test query parameter(s) + * + *

    Test query parameter(s) + */ + @Test + @Disabled("The deep object style and the whole dynamic operations are currently not supported") + public void testQueryStyleFormExplodeTrueObjectAllOfTest() { + DataQuery queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); + + // TODO: test validations + // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic + // operations are currently not supported + } +} diff --git a/samples/client/echo_api/java/resteasy/build.gradle b/samples/client/echo_api/java/resteasy/build.gradle index e009dc7c480..bb27249e1ba 100644 --- a/samples/client/echo_api/java/resteasy/build.gradle +++ b/samples/client/echo_api/java/resteasy/build.gradle @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" diff --git a/samples/client/echo_api/java/resteasy/build.sbt b/samples/client/echo_api/java/resteasy/build.sbt index f68a75caf0e..57a2d1ed0a0 100644 --- a/samples/client/echo_api/java/resteasy/build.sbt +++ b/samples/client/echo_api/java/resteasy/build.sbt @@ -13,11 +13,11 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.assertj" % "assertj-core" % "3.23.1" % "test", "junit" % "junit" % "5.10.2" % "test", diff --git a/samples/client/echo_api/java/resteasy/pom.xml b/samples/client/echo_api/java/resteasy/pom.xml index d4708d3830c..db212f7f9fe 100644 --- a/samples/client/echo_api/java/resteasy/pom.xml +++ b/samples/client/echo_api/java/resteasy/pom.xml @@ -254,8 +254,8 @@ UTF-8 4.7.6.Final - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 2.9.10 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 0df0f1d3863..27e9f306c63 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 @@ -47,10 +47,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 afb07767b0f..4fffb672160 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 eee802c691b..1f047d9d057 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 @@ -57,10 +57,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUFFIX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,10 +82,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 81b9778a076..6e37dce991c 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 @@ -124,10 +124,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,10 +223,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,10 +256,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -338,10 +338,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -371,10 +371,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 2913c549de0..e5b878ca8e5 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 @@ -52,10 +52,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,12 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 2d17466ca26..ccd7a976e42 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 @@ -105,10 +105,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -155,10 +155,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -221,10 +221,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,10 +246,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 767043cacdf..5988e712c68 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 @@ -87,10 +87,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -120,10 +120,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTCOMES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a94d6f76e51..68f1a766b7e 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index bdf973ea9f7..5e2478f1191 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -44,10 +44,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 b5fb16b3f7a..11604fbdaa9 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 @@ -56,10 +56,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +131,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index a0af5c87c4a..e6e8d56dc01 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -55,10 +55,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/resttemplate/build.gradle b/samples/client/echo_api/java/resttemplate/build.gradle index 7052bf7cde0..340d7586db5 100644 --- a/samples/client/echo_api/java/resttemplate/build.gradle +++ b/samples/client/echo_api/java/resttemplate/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/echo_api/java/resttemplate/pom.xml b/samples/client/echo_api/java/resttemplate/pom.xml index e17b5a579e8..5fb4a2a5441 100644 --- a/samples/client/echo_api/java/resttemplate/pom.xml +++ b/samples/client/echo_api/java/resttemplate/pom.xml @@ -281,8 +281,8 @@ UTF-8 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 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 0df0f1d3863..27e9f306c63 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 @@ -47,10 +47,10 @@ public class Bird { return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Bird { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 afb07767b0f..4fffb672160 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 eee802c691b..1f047d9d057 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 @@ -57,10 +57,10 @@ public class DataQuery extends Query { return this; } - /** + /** * test suffix * @return suffix - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUFFIX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,10 +82,10 @@ public class DataQuery extends Query { return this; } - /** + /** * Some text containing white spaces * @return text - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class DataQuery extends Query { return this; } - /** + /** * A date * @return date - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 784ec93aea7..423e739db3b 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 @@ -124,10 +124,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumRefDefault * @return arrayStringEnumRefDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringEnumDefault * @return arrayStringEnumDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringDefault * @return arrayStringDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,10 +223,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayIntegerDefault * @return arrayIntegerDefault - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,10 +256,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayString * @return arrayString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringNullable * @return arrayStringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -338,10 +338,10 @@ public class DefaultValue { return this; } - /** + /** * Get arrayStringExtensionNullable * @return arrayStringExtensionNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -371,10 +371,10 @@ public class DefaultValue { return this; } - /** + /** * Get stringNullable * @return stringNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 2913c549de0..e5b878ca8e5 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 @@ -52,10 +52,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get number * @return number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _float * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,12 @@ public class NumberPropertiesOnly { return this; } - /** + /** * Get _double * minimum: 0.8 * maximum: 50.2 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0b551082dfb..53157b0efbc 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 @@ -105,10 +105,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -155,10 +155,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -221,10 +221,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,10 +246,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 767043cacdf..5988e712c68 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 @@ -87,10 +87,10 @@ public class Query { return this; } - /** + /** * Query * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -120,10 +120,10 @@ public class Query { return this; } - /** + /** * Get outcomes * @return outcomes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTCOMES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a94d6f76e51..68f1a766b7e 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index bdf973ea9f7..5e2478f1191 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -44,10 +44,10 @@ public class TestFormObjectMultipartRequestMarker { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 b5fb16b3f7a..11604fbdaa9 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 @@ -56,10 +56,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get size * @return size - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +131,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 11ae7f5525a..ccd45ac1ad7 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -55,10 +55,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { return this; } - /** + /** * Get values * @return values - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md index 7e9462471bf..4983f4915fe 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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* | [**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* | [**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* | [**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* | [**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) +| 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* | [**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* | [**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* | [**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* | [**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) | 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 2fc16aeeb5c..c25d660f674 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 @@ -61,8 +61,8 @@ kotlin { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/AuthApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/AuthApi.md index b7ef4f547bd..2614b18e353 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/AuthApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/AuthApi.md @@ -2,10 +2,10 @@ 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 +| 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 | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Bird.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Bird.md index 878335adf52..edef9a9f62b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Bird.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Bird.md @@ -2,10 +2,10 @@ # Bird ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertySize** | **kotlin.String** | | [optional] -**color** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertySize** | **kotlin.String** | | [optional] | +| **color** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/BodyApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/BodyApi.md index 8a02fa98c10..22c998b360b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/BodyApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/BodyApi.md @@ -2,16 +2,16 @@ 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 -[**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 -[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) +| 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 | +| [**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 | +| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | @@ -86,10 +86,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **java.io.File**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **java.io.File**| | [optional] | ### Return type @@ -133,10 +132,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **files** | **kotlin.collections.List<java.io.File>**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **files** | **kotlin.collections.List<java.io.File>**| | | ### Return type @@ -180,10 +178,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **myFile** | **java.io.File**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **myFile** | **java.io.File**| | [optional] | ### Return type @@ -227,10 +224,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **kotlin.Any**| Free form object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **kotlin.Any**| Free form object | [optional] | ### Return type @@ -274,10 +270,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -321,10 +316,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -368,10 +362,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tag** | [**Tag**](Tag.md)| Tag object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tag** | [**Tag**](Tag.md)| Tag object | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Category.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Category.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/DefaultValue.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/DefaultValue.md index de65ccf8d7c..530a960b1f8 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/DefaultValue.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/DefaultValue.md @@ -2,23 +2,23 @@ # DefaultValue ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayStringEnumRefDefault** | [**kotlin.collections.List<StringEnumRef>**](StringEnumRef.md) | | [optional] -**arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] -**arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] -**arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**stringNullable** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **arrayStringEnumRefDefault** | [**kotlin.collections.List<StringEnumRef>**](StringEnumRef.md) | | [optional] | +| **arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] | +| **arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] | +| **arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **stringNullable** | **kotlin.String** | | [optional] | ## Enum: array_string_enum_default -Name | Value ----- | ----- -arrayStringEnumDefault | success, failure, unclassified +| Name | Value | +| ---- | ----- | +| arrayStringEnumDefault | success, failure, unclassified | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md index 0b420b90654..5d229c12775 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md @@ -2,10 +2,10 @@ 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) -[**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) | +| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | @@ -39,12 +39,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerForm** | **kotlin.Int**| | [optional] - **booleanForm** | **kotlin.Boolean**| | [optional] - **stringForm** | **kotlin.String**| | [optional] +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -93,15 +92,14 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **form1** | **kotlin.String**| | [optional] - **form2** | **kotlin.Int**| | [optional] - **form3** | **kotlin.String**| | [optional] - **form4** | **kotlin.Boolean**| | [optional] - **id** | **kotlin.Long**| | [optional] - **name** | **kotlin.String**| | [optional] +| **form1** | **kotlin.String**| | [optional] | +| **form2** | **kotlin.Int**| | [optional] | +| **form3** | **kotlin.String**| | [optional] | +| **form4** | **kotlin.Boolean**| | [optional] | +| **id** | **kotlin.Long**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md index 1d38dda946f..8a1687ff990 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md @@ -2,9 +2,9 @@ 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) +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | @@ -40,14 +40,13 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerHeader** | **kotlin.Int**| | [optional] - **booleanHeader** | **kotlin.Boolean**| | [optional] - **stringHeader** | **kotlin.String**| | [optional] - **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **integerHeader** | **kotlin.Int**| | [optional] | +| **booleanHeader** | **kotlin.Boolean**| | [optional] | +| **stringHeader** | **kotlin.String**| | [optional] | +| **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/NumberPropertiesOnly.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/NumberPropertiesOnly.md index d601af65669..cf15999239e 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/NumberPropertiesOnly.md @@ -2,11 +2,11 @@ # NumberPropertiesOnly ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**float** | **kotlin.Float** | | [optional] -**double** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **float** | **kotlin.Float** | | [optional] | +| **double** | **kotlin.Double** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md index 129553d02c1..d2e44d75aba 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md @@ -2,9 +2,9 @@ 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) +| 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) | @@ -39,13 +39,12 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pathString** | **kotlin.String**| | - **pathInteger** | **kotlin.Int**| | - **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] - **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] +| **pathString** | **kotlin.String**| | | +| **pathInteger** | **kotlin.Int**| | | +| **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Pet.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Pet.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Query.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Query.md index 85d53f6f088..5f5fa6d3f47 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Query.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Query.md @@ -2,17 +2,17 @@ # Query ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | Query | [optional] -**outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | Query | [optional] | +| **outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] | ## Enum: outcomes -Name | Value ----- | ----- -outcomes | SUCCESS, FAILURE, SKIPPED +| Name | Value | +| ---- | ----- | +| outcomes | SUCCESS, FAILURE, SKIPPED | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md index 443718661d3..3ac1823f5d7 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md @@ -2,14 +2,14 @@ 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) -[**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) +| 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) | +| [**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) | @@ -42,11 +42,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -92,12 +91,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] - **dateQuery** | **java.time.LocalDate**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -143,12 +141,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerQuery** | **kotlin.Int**| | [optional] - **booleanQuery** | **kotlin.Boolean**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -192,10 +189,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**Pet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**Pet**](.md)| | [optional] | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] | ### Return type @@ -286,10 +281,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**Pet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**Pet**](.md)| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Tag.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Tag.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index 63e23617161..4c656b4700c 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -2,9 +2,9 @@ # TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] | 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt index c63c0366edf..4207d12f74b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Bird ( - @field:JsonProperty("size") + @get:JsonProperty("size") val propertySize: kotlin.String? = null, - @field:JsonProperty("color") + @get:JsonProperty("color") val color: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt index e62c174314a..9ca46c3d0fa 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt index 2ebc2632782..aa1c1f36365 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt @@ -36,28 +36,28 @@ import com.fasterxml.jackson.annotation.JsonProperty data class DefaultValue ( - @field:JsonProperty("array_string_enum_ref_default") + @get:JsonProperty("array_string_enum_ref_default") val arrayStringEnumRefDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_enum_default") + @get:JsonProperty("array_string_enum_default") val arrayStringEnumDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_default") + @get:JsonProperty("array_string_default") val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), - @field:JsonProperty("array_integer_default") + @get:JsonProperty("array_integer_default") val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), - @field:JsonProperty("array_string") + @get:JsonProperty("array_string") val arrayString: kotlin.collections.List? = null, - @field:JsonProperty("array_string_nullable") + @get:JsonProperty("array_string_nullable") val arrayStringNullable: kotlin.collections.List? = null, - @field:JsonProperty("array_string_extension_nullable") + @get:JsonProperty("array_string_extension_nullable") val arrayStringExtensionNullable: kotlin.collections.List? = null, - @field:JsonProperty("string_nullable") + @get:JsonProperty("string_nullable") val stringNullable: kotlin.String? = null ) { @@ -73,5 +73,6 @@ data class DefaultValue ( @JsonProperty(value = "unclassified") unclassified("unclassified"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt index 0f1c287e41a..5658fb2393f 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class NumberPropertiesOnly ( - @field:JsonProperty("number") + @get:JsonProperty("number") val number: java.math.BigDecimal? = null, - @field:JsonProperty("float") + @get:JsonProperty("float") val float: kotlin.Float? = null, - @field:JsonProperty("double") + @get:JsonProperty("double") val double: kotlin.Double? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index e121711bca7..adc88b27357 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { @@ -67,5 +67,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt index 81d1a6a73ce..6c346a4c093 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Query.kt @@ -30,10 +30,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Query ( /* Query */ - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("outcomes") + @get:JsonProperty("outcomes") val outcomes: kotlin.collections.List? = null ) { @@ -49,5 +49,6 @@ data class Query ( @JsonProperty(value = "SKIPPED") SKIPPED("SKIPPED"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index 36d7c43ee87..9cef5f51bd6 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt index cb6010f5d40..2c197f0ce80 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -28,8 +28,11 @@ import com.fasterxml.jackson.annotation.JsonProperty data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( - @field:JsonProperty("values") + @get:JsonProperty("values") val propertyValues: kotlin.collections.List? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md index 7e9462471bf..4983f4915fe 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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* | [**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* | [**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* | [**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* | [**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) +| 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* | [**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* | [**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* | [**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* | [**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) | 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 99192219a9d..786c00c321d 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 @@ -62,8 +62,8 @@ kotlin { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" 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/docs/AuthApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md index b7ef4f547bd..2614b18e353 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md @@ -2,10 +2,10 @@ 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 +| 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 | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md index 878335adf52..edef9a9f62b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md @@ -2,10 +2,10 @@ # Bird ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertySize** | **kotlin.String** | | [optional] -**color** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertySize** | **kotlin.String** | | [optional] | +| **color** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md index 8a02fa98c10..22c998b360b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md @@ -2,16 +2,16 @@ 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 -[**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 -[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) +| 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 | +| [**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 | +| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | @@ -86,10 +86,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **java.io.File**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **java.io.File**| | [optional] | ### Return type @@ -133,10 +132,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **files** | **kotlin.collections.List<java.io.File>**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **files** | **kotlin.collections.List<java.io.File>**| | | ### Return type @@ -180,10 +178,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **myFile** | **java.io.File**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **myFile** | **java.io.File**| | [optional] | ### Return type @@ -227,10 +224,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **kotlin.Any**| Free form object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **kotlin.Any**| Free form object | [optional] | ### Return type @@ -274,10 +270,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -321,10 +316,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -368,10 +362,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tag** | [**Tag**](Tag.md)| Tag object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tag** | [**Tag**](Tag.md)| Tag object | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md index de65ccf8d7c..530a960b1f8 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md @@ -2,23 +2,23 @@ # DefaultValue ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayStringEnumRefDefault** | [**kotlin.collections.List<StringEnumRef>**](StringEnumRef.md) | | [optional] -**arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] -**arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] -**arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**stringNullable** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **arrayStringEnumRefDefault** | [**kotlin.collections.List<StringEnumRef>**](StringEnumRef.md) | | [optional] | +| **arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] | +| **arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] | +| **arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **stringNullable** | **kotlin.String** | | [optional] | ## Enum: array_string_enum_default -Name | Value ----- | ----- -arrayStringEnumDefault | success, failure, unclassified +| Name | Value | +| ---- | ----- | +| arrayStringEnumDefault | success, failure, unclassified | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md index 0b420b90654..5d229c12775 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md @@ -2,10 +2,10 @@ 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) -[**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) | +| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | @@ -39,12 +39,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerForm** | **kotlin.Int**| | [optional] - **booleanForm** | **kotlin.Boolean**| | [optional] - **stringForm** | **kotlin.String**| | [optional] +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -93,15 +92,14 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **form1** | **kotlin.String**| | [optional] - **form2** | **kotlin.Int**| | [optional] - **form3** | **kotlin.String**| | [optional] - **form4** | **kotlin.Boolean**| | [optional] - **id** | **kotlin.Long**| | [optional] - **name** | **kotlin.String**| | [optional] +| **form1** | **kotlin.String**| | [optional] | +| **form2** | **kotlin.Int**| | [optional] | +| **form3** | **kotlin.String**| | [optional] | +| **form4** | **kotlin.Boolean**| | [optional] | +| **id** | **kotlin.Long**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md index 1d38dda946f..8a1687ff990 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md @@ -2,9 +2,9 @@ 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) +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | @@ -40,14 +40,13 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerHeader** | **kotlin.Int**| | [optional] - **booleanHeader** | **kotlin.Boolean**| | [optional] - **stringHeader** | **kotlin.String**| | [optional] - **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **integerHeader** | **kotlin.Int**| | [optional] | +| **booleanHeader** | **kotlin.Boolean**| | [optional] | +| **stringHeader** | **kotlin.String**| | [optional] | +| **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md index d601af65669..cf15999239e 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md @@ -2,11 +2,11 @@ # NumberPropertiesOnly ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**float** | **kotlin.Float** | | [optional] -**double** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **float** | **kotlin.Float** | | [optional] | +| **double** | **kotlin.Double** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md index 129553d02c1..d2e44d75aba 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md @@ -2,9 +2,9 @@ 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) +| 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) | @@ -39,13 +39,12 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pathString** | **kotlin.String**| | - **pathInteger** | **kotlin.Int**| | - **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] - **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] +| **pathString** | **kotlin.String**| | | +| **pathInteger** | **kotlin.Int**| | | +| **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md index 85d53f6f088..5f5fa6d3f47 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md @@ -2,17 +2,17 @@ # Query ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | Query | [optional] -**outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | Query | [optional] | +| **outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] | ## Enum: outcomes -Name | Value ----- | ----- -outcomes | SUCCESS, FAILURE, SKIPPED +| Name | Value | +| ---- | ----- | +| outcomes | SUCCESS, FAILURE, SKIPPED | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md index 443718661d3..3ac1823f5d7 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md @@ -2,14 +2,14 @@ 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) -[**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) +| 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) | +| [**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) | @@ -42,11 +42,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -92,12 +91,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] - **dateQuery** | **java.time.LocalDate**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -143,12 +141,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerQuery** | **kotlin.Int**| | [optional] - **booleanQuery** | **kotlin.Boolean**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -192,10 +189,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**Pet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**Pet**](.md)| | [optional] | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] | ### Return type @@ -286,10 +281,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**Pet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**Pet**](.md)| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index 63e23617161..4c656b4700c 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -2,9 +2,9 @@ # TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] | 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt index c63c0366edf..4207d12f74b 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Bird ( - @field:JsonProperty("size") + @get:JsonProperty("size") val propertySize: kotlin.String? = null, - @field:JsonProperty("color") + @get:JsonProperty("color") val color: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index e62c174314a..9ca46c3d0fa 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt index 2ebc2632782..aa1c1f36365 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt @@ -36,28 +36,28 @@ import com.fasterxml.jackson.annotation.JsonProperty data class DefaultValue ( - @field:JsonProperty("array_string_enum_ref_default") + @get:JsonProperty("array_string_enum_ref_default") val arrayStringEnumRefDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_enum_default") + @get:JsonProperty("array_string_enum_default") val arrayStringEnumDefault: kotlin.collections.List? = null, - @field:JsonProperty("array_string_default") + @get:JsonProperty("array_string_default") val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), - @field:JsonProperty("array_integer_default") + @get:JsonProperty("array_integer_default") val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), - @field:JsonProperty("array_string") + @get:JsonProperty("array_string") val arrayString: kotlin.collections.List? = null, - @field:JsonProperty("array_string_nullable") + @get:JsonProperty("array_string_nullable") val arrayStringNullable: kotlin.collections.List? = null, - @field:JsonProperty("array_string_extension_nullable") + @get:JsonProperty("array_string_extension_nullable") val arrayStringExtensionNullable: kotlin.collections.List? = null, - @field:JsonProperty("string_nullable") + @get:JsonProperty("string_nullable") val stringNullable: kotlin.String? = null ) { @@ -73,5 +73,6 @@ data class DefaultValue ( @JsonProperty(value = "unclassified") unclassified("unclassified"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt index 0f1c287e41a..5658fb2393f 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class NumberPropertiesOnly ( - @field:JsonProperty("number") + @get:JsonProperty("number") val number: java.math.BigDecimal? = null, - @field:JsonProperty("float") + @get:JsonProperty("float") val float: kotlin.Float? = null, - @field:JsonProperty("double") + @get:JsonProperty("double") val double: kotlin.Double? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index e121711bca7..adc88b27357 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { @@ -67,5 +67,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt index 81d1a6a73ce..6c346a4c093 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt @@ -30,10 +30,10 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Query ( /* Query */ - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("outcomes") + @get:JsonProperty("outcomes") val outcomes: kotlin.collections.List? = null ) { @@ -49,5 +49,6 @@ data class Query ( @JsonProperty(value = "SKIPPED") SKIPPED("SKIPPED"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index 36d7c43ee87..9cef5f51bd6 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt index cb6010f5d40..2c197f0ce80 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -28,8 +28,11 @@ import com.fasterxml.jackson.annotation.JsonProperty data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( - @field:JsonProperty("values") + @get:JsonProperty("values") val propertyValues: kotlin.collections.List? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md index 1e933999d6d..e56ac05a405 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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* | [**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* | [**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* | [**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* | [**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) +| 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* | [**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* | [**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* | [**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* | [**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) | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/AuthApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/AuthApi.md index fc2aacf4314..6db661480f1 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/AuthApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/AuthApi.md @@ -2,10 +2,10 @@ 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 +| 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 | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Bird.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Bird.md index 24ab8ec1e11..47dfa1d8cfe 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Bird.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Bird.md @@ -2,10 +2,10 @@ # ApiBird ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertySize** | **kotlin.String** | | [optional] -**color** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertySize** | **kotlin.String** | | [optional] | +| **color** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/BodyApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/BodyApi.md index ec76bd7d9c4..3a233eeccb3 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/BodyApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/BodyApi.md @@ -2,16 +2,16 @@ 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 -[**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 -[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** echo/body/Tag/response_string | Test empty json (request body) +| 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 | +| [**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 | +| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** echo/body/Tag/response_string | Test empty json (request body) | @@ -72,10 +72,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **RequestBody**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **RequestBody**| | [optional] | ### Return type @@ -112,10 +111,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **files** | **kotlin.collections.List<RequestBody>**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **files** | **kotlin.collections.List<RequestBody>**| | | ### Return type @@ -152,10 +150,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **myFile** | **RequestBody**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **myFile** | **RequestBody**| | [optional] | ### Return type @@ -192,10 +189,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **kotlin.Any**| Free form object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **kotlin.Any**| Free form object | [optional] | ### Return type @@ -232,10 +228,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -272,10 +267,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | [optional] | ### Return type @@ -312,10 +306,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiTag** | [**ApiTag**](ApiTag.md)| Tag object | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiTag** | [**ApiTag**](ApiTag.md)| Tag object | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Category.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Category.md index 4445602c2d4..6b06645c5e7 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Category.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Category.md @@ -2,10 +2,10 @@ # ApiCategory ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/DefaultValue.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/DefaultValue.md index 4775afddef8..2b8019d1a22 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/DefaultValue.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/DefaultValue.md @@ -2,23 +2,23 @@ # ApiDefaultValue ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayStringEnumRefDefault** | [**kotlin.collections.List<ApiStringEnumRef>**](ApiStringEnumRef.md) | | [optional] -**arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] -**arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] -**arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] -**stringNullable** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **arrayStringEnumRefDefault** | [**kotlin.collections.List<ApiStringEnumRef>**](ApiStringEnumRef.md) | | [optional] | +| **arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] | +| **arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] | +| **arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] | +| **stringNullable** | **kotlin.String** | | [optional] | ## Enum: array_string_enum_default -Name | Value ----- | ----- -arrayStringEnumDefault | success, failure, unclassified +| Name | Value | +| ---- | ----- | +| arrayStringEnumDefault | success, failure, unclassified | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md index 5b301ad3600..fbc8495e9d0 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md @@ -2,10 +2,10 @@ 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) -[**testFormOneof**](FormApi.md#testFormOneof) | **POST** form/oneof | Test form parameter(s) for oneOf schema +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** form/integer/boolean/string | Test form parameter(s) | +| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** form/oneof | Test form parameter(s) for oneOf schema | @@ -32,12 +32,11 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerForm** | **kotlin.Int**| | [optional] - **booleanForm** | **kotlin.Boolean**| | [optional] - **stringForm** | **kotlin.String**| | [optional] +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -79,15 +78,14 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **form1** | **kotlin.String**| | [optional] - **form2** | **kotlin.Int**| | [optional] - **form3** | **kotlin.String**| | [optional] - **form4** | **kotlin.Boolean**| | [optional] - **id** | **kotlin.Long**| | [optional] - **name** | **kotlin.String**| | [optional] +| **form1** | **kotlin.String**| | [optional] | +| **form2** | **kotlin.Int**| | [optional] | +| **form3** | **kotlin.String**| | [optional] | +| **form4** | **kotlin.Boolean**| | [optional] | +| **id** | **kotlin.Long**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md index 26fcb46bee7..bb03570a950 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md @@ -2,9 +2,9 @@ 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) +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** header/integer/boolean/string/enums | Test header parameter(s) | @@ -33,14 +33,13 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerHeader** | **kotlin.Int**| | [optional] - **booleanHeader** | **kotlin.Boolean**| | [optional] - **stringHeader** | **kotlin.String**| | [optional] - **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringHeader** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **integerHeader** | **kotlin.Int**| | [optional] | +| **booleanHeader** | **kotlin.Boolean**| | [optional] | +| **stringHeader** | **kotlin.String**| | [optional] | +| **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringHeader** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/NumberPropertiesOnly.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/NumberPropertiesOnly.md index 8741ec4ec12..a3bd77d17bb 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/NumberPropertiesOnly.md @@ -2,11 +2,11 @@ # ApiNumberPropertiesOnly ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**float** | **kotlin.Float** | | [optional] -**double** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **float** | **kotlin.Float** | | [optional] | +| **double** | **kotlin.Double** | | [optional] | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md index fc3ae5d8a52..c3ca570ecc2 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md @@ -2,9 +2,9 @@ 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) +| 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) | @@ -32,13 +32,12 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pathString** | **kotlin.String**| | - **pathInteger** | **kotlin.Int**| | - **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] - **enumRefStringPath** | [**ApiStringEnumRef**](.md)| | [enum: success, failure, unclassified] +| **pathString** | **kotlin.String**| | | +| **pathInteger** | **kotlin.Int**| | | +| **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringPath** | [**ApiStringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Pet.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Pet.md index f525df0ffd8..e7552df1e07 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Pet.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Pet.md @@ -2,21 +2,21 @@ # ApiPet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**ApiCategory**](ApiCategory.md) | | [optional] -**tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Query.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Query.md index 973bc49a7da..9020df8a350 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Query.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Query.md @@ -2,17 +2,17 @@ # ApiQuery ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | Query | [optional] -**outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | Query | [optional] | +| **outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] | ## Enum: outcomes -Name | Value ----- | ----- -outcomes | SUCCESS, FAILURE, SKIPPED +| Name | Value | +| ---- | ----- | +| outcomes | SUCCESS, FAILURE, SKIPPED | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md index f8dc4354cce..a2714d03fa8 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md @@ -2,14 +2,14 @@ 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) -[**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) +| 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) | +| [**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) | @@ -35,11 +35,10 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] - **enumRefStringQuery** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **enumRefStringQuery** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -78,12 +77,11 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] - **dateQuery** | **java.time.LocalDate**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -122,12 +120,11 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integerQuery** | **kotlin.Int**| | [optional] - **booleanQuery** | **kotlin.Boolean**| | [optional] - **stringQuery** | **kotlin.String**| | [optional] +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -164,10 +161,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**ApiPet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**ApiPet**](.md)| | [optional] | ### Return type @@ -204,10 +200,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] | ### Return type @@ -244,10 +239,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **queryObject** | [**ApiPet**](.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **queryObject** | [**ApiPet**](.md)| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Tag.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Tag.md index 91a171469a4..11567f173fc 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Tag.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/Tag.md @@ -2,10 +2,10 @@ # ApiTag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index f5b3cec9e2b..199eb808c1e 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -2,9 +2,9 @@ # ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] | 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c207277e907..2a981a94beb 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -20,7 +20,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -150,7 +150,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiBird.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiBird.kt index 12de10f20a9..ac0f2f48602 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiBird.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiBird.kt @@ -34,5 +34,8 @@ data class ApiBird ( @SerializedName("color") val color: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt index 509a736a1c0..f8ec4e1cc51 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt @@ -34,5 +34,8 @@ data class ApiCategory ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiDefaultValue.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiDefaultValue.kt index 55d13383833..ec5413f8b2c 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiDefaultValue.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiDefaultValue.kt @@ -71,5 +71,6 @@ data class ApiDefaultValue ( @SerializedName(value = "failure") FAILURE("failure"), @SerializedName(value = "unclassified") UNCLASSIFIED("unclassified"); } + } diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt index 3f411d197cc..0262f3edc40 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt @@ -38,5 +38,8 @@ data class ApiNumberPropertiesOnly ( @SerializedName("double") val double: kotlin.Double? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt index ac4940b5c7e..198ccf7f68c 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt @@ -65,5 +65,6 @@ data class ApiPet ( @SerializedName(value = "pending") PENDING("pending"), @SerializedName(value = "sold") SOLD("sold"); } + } diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiQuery.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiQuery.kt index 545b6556eed..e9f961d7441 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiQuery.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiQuery.kt @@ -47,5 +47,6 @@ data class ApiQuery ( @SerializedName(value = "FAILURE") FAILURE("FAILURE"), @SerializedName(value = "SKIPPED") SKIPPED("SKIPPED"); } + } diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt index b3a3a685a23..42e79293f18 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt @@ -34,5 +34,8 @@ data class ApiTag ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt index 7c98444fb04..f0cd66c86ef 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -30,5 +30,8 @@ data class ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( @SerializedName("values") val propertyValues: kotlin.collections.List? = null -) +) { + + +} diff --git a/samples/client/echo_api/php-nextgen/src/ApiException.php b/samples/client/echo_api/php-nextgen/src/ApiException.php index 762f5b5d6f7..bce0225bf67 100644 --- a/samples/client/echo_api/php-nextgen/src/ApiException.php +++ b/samples/client/echo_api/php-nextgen/src/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -65,10 +65,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -78,7 +78,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/StringEnumRef.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/StringEnumRef.md index 8ff54010193..c7d8715bbe1 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/StringEnumRef.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/StringEnumRef.md @@ -1,10 +1,13 @@ # StringEnumRef -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `SUCCESS` (value: `'success'`) + +* `FAILURE` (value: `'failure'`) + +* `UNCLASSIFIED` (value: `'unclassified'`) [[Back to Model list]](../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/openapi_client/api/auth_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/auth_api.py index dfd24668c5e..e9f324925ba 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/auth_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/auth_api.py @@ -250,11 +250,12 @@ class AuthApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -493,11 +494,12 @@ class AuthApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/body_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/body_api.py index 4ff665930e1..5dde71e64e9 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/body_api.py @@ -255,11 +255,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'image/gif' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/gif' + ] + ) # authentication setting @@ -517,11 +518,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -788,11 +790,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1058,11 +1061,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1328,11 +1332,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1598,11 +1603,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1868,11 +1874,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2138,11 +2145,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2408,11 +2416,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2678,11 +2687,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/form_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/form_api.py index 48f4dcf80b0..9b4c1f825e8 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/form_api.py @@ -297,11 +297,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -567,11 +568,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -912,11 +914,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/header_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/header_api.py index 9cf33bb7eb9..f1d64cfa02f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/header_api.py @@ -327,11 +327,12 @@ class HeaderApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/path_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/path_api.py index 8164e9a174c..f28f7a1b784 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/path_api.py @@ -311,11 +311,12 @@ class PathApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/query_api.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/query_api.py index 2a004b65ee8..7e9a393cb37 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/query_api.py @@ -289,11 +289,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -600,11 +601,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -893,11 +895,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1152,11 +1155,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1411,11 +1415,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1671,11 +1676,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1931,11 +1937,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2190,11 +2197,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2449,11 +2457,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2708,11 +2717,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py index 5e39f780d88..c6fa28de319 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py @@ -16,6 +16,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -67,6 +68,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -228,7 +230,7 @@ class ApiClient: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -315,10 +317,7 @@ class ApiClient: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -342,6 +341,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -367,6 +367,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -386,21 +388,35 @@ class ApiClient: for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -444,6 +460,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py index 43604555bd8..27946de1787 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py @@ -33,6 +33,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -55,6 +58,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -83,7 +87,11 @@ conf = openapi_client.Configuration( access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -98,6 +106,9 @@ conf = openapi_client.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -141,7 +152,10 @@ conf = openapi_client.Configuration( self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -184,7 +198,7 @@ conf = openapi_client.Configuration( self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py index fbb002c0f6b..02b8176438b 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py @@ -179,7 +179,7 @@ class RESTClientObject: ): request_body = None if body is not None: - request_body = json.dumps(body) + request_body = json.dumps(body, ensure_ascii=False) r = self.pool_manager.request( method, url, diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/tests/test_manual.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/tests/test_manual.py index 4fbe46dd563..1a5d0bb4d83 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/tests/test_manual.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/tests/test_manual.py @@ -113,15 +113,12 @@ class TestManual(unittest.TestCase): n = openapi_client.Pet.from_dict({"name": "testing", "photoUrls": ["http://1", "http://2"]}) api_instance = openapi_client.BodyApi() api_response = api_instance.test_echo_body_pet_response_string(n) - self.assertEqual(api_response, '{"name": "testing", "photoUrls": ["http://1", "http://2"]}') + self.assertEqual(api_response, "{'name': 'testing', 'photoUrls': ['http://1', 'http://2']}") t = openapi_client.Tag() api_response = api_instance.test_echo_body_tag_response_string(t) self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body - api_response = api_instance.test_echo_body_tag_response_string(None) - self.assertEqual(api_response, "") # assertion to ensure emtpy string is sent in the body - api_response = api_instance.test_echo_body_free_form_object_response_string({}) self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body diff --git a/samples/client/echo_api/python-pydantic-v1/docs/StringEnumRef.md b/samples/client/echo_api/python-pydantic-v1/docs/StringEnumRef.md index f59594fb861..c7d8715bbe1 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/StringEnumRef.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/StringEnumRef.md @@ -1,9 +1,13 @@ # StringEnumRef -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `SUCCESS` (value: `'success'`) + +* `FAILURE` (value: `'failure'`) + +* `UNCLASSIFIED` (value: `'unclassified'`) [[Back to Model list]](../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/StringEnumRef.md b/samples/client/echo_api/python/docs/StringEnumRef.md index 8ff54010193..c7d8715bbe1 100644 --- a/samples/client/echo_api/python/docs/StringEnumRef.md +++ b/samples/client/echo_api/python/docs/StringEnumRef.md @@ -1,10 +1,13 @@ # StringEnumRef -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `SUCCESS` (value: `'success'`) + +* `FAILURE` (value: `'failure'`) + +* `UNCLASSIFIED` (value: `'unclassified'`) [[Back to Model list]](../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/openapi_client/api/auth_api.py b/samples/client/echo_api/python/openapi_client/api/auth_api.py index dfd24668c5e..e9f324925ba 100644 --- a/samples/client/echo_api/python/openapi_client/api/auth_api.py +++ b/samples/client/echo_api/python/openapi_client/api/auth_api.py @@ -250,11 +250,12 @@ class AuthApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -493,11 +494,12 @@ class AuthApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python/openapi_client/api/body_api.py b/samples/client/echo_api/python/openapi_client/api/body_api.py index 4ff665930e1..5dde71e64e9 100644 --- a/samples/client/echo_api/python/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python/openapi_client/api/body_api.py @@ -255,11 +255,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'image/gif' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/gif' + ] + ) # authentication setting @@ -517,11 +518,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -788,11 +790,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1058,11 +1061,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1328,11 +1332,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1598,11 +1603,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1868,11 +1874,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2138,11 +2145,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2408,11 +2416,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2678,11 +2687,12 @@ class BodyApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/client/echo_api/python/openapi_client/api/form_api.py b/samples/client/echo_api/python/openapi_client/api/form_api.py index 48f4dcf80b0..9b4c1f825e8 100644 --- a/samples/client/echo_api/python/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python/openapi_client/api/form_api.py @@ -297,11 +297,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -567,11 +568,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -912,11 +914,12 @@ class FormApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/client/echo_api/python/openapi_client/api/header_api.py b/samples/client/echo_api/python/openapi_client/api/header_api.py index 9cf33bb7eb9..f1d64cfa02f 100644 --- a/samples/client/echo_api/python/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python/openapi_client/api/header_api.py @@ -327,11 +327,12 @@ class HeaderApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python/openapi_client/api/path_api.py b/samples/client/echo_api/python/openapi_client/api/path_api.py index 8164e9a174c..f28f7a1b784 100644 --- a/samples/client/echo_api/python/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python/openapi_client/api/path_api.py @@ -311,11 +311,12 @@ class PathApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python/openapi_client/api/query_api.py b/samples/client/echo_api/python/openapi_client/api/query_api.py index 2a004b65ee8..7e9a393cb37 100644 --- a/samples/client/echo_api/python/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python/openapi_client/api/query_api.py @@ -289,11 +289,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -600,11 +601,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -893,11 +895,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1152,11 +1155,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1411,11 +1415,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1671,11 +1676,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -1931,11 +1937,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2190,11 +2197,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2449,11 +2457,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -2708,11 +2717,12 @@ class QueryApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index 5e39f780d88..c6fa28de319 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -16,6 +16,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -67,6 +68,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -228,7 +230,7 @@ class ApiClient: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -315,10 +317,7 @@ class ApiClient: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -342,6 +341,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -367,6 +367,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -386,21 +388,35 @@ class ApiClient: for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -444,6 +460,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index 43604555bd8..27946de1787 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -33,6 +33,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -55,6 +58,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -83,7 +87,11 @@ conf = openapi_client.Configuration( access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -98,6 +106,9 @@ conf = openapi_client.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -141,7 +152,10 @@ conf = openapi_client.Configuration( self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -184,7 +198,7 @@ conf = openapi_client.Configuration( self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation diff --git a/samples/client/echo_api/python/poetry.lock b/samples/client/echo_api/python/poetry.lock index 7dfd40d63a7..20f493198f7 100644 --- a/samples/client/echo_api/python/poetry.lock +++ b/samples/client/echo_api/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "annotated-types" @@ -38,13 +38,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.2.0" +version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, ] [package.extras] @@ -183,13 +183,13 @@ files = [ [[package]] name = "packaging" -version = "23.2" +version = "24.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, + {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, + {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, ] [[package]] @@ -423,13 +423,13 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no [[package]] name = "python-dateutil" -version = "2.8.2" +version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, ] [package.dependencies] @@ -611,4 +611,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "e3db4fda1f09507e7001e5eccf6e0827b049b9384dba0fe21c7e1ff0a118503d" +content-hash = "131cde68a6e4a2aa7dffb9d7dc622b0b20282f3813e9d097d058c26174c83868" diff --git a/samples/client/echo_api/python/tests/test_manual.py b/samples/client/echo_api/python/tests/test_manual.py index 42ae3aafd85..8572845b9ab 100644 --- a/samples/client/echo_api/python/tests/test_manual.py +++ b/samples/client/echo_api/python/tests/test_manual.py @@ -66,7 +66,7 @@ class TestManual(unittest.TestCase): enum_nonref_string_header="success", enum_ref_string_header="failure", ) - self.assertDictContainsSubset(expected_header, e.headers) + self.assertLessEqual(expected_header.items(), e.headers.items()) def testEnumQueryParameters(self): api_instance = openapi_client.QueryApi() @@ -174,17 +174,17 @@ class TestManual(unittest.TestCase): n = openapi_client.Pet.from_dict({"name": "testing", "photoUrls": ["http://1", "http://2"]}) api_instance = openapi_client.BodyApi() api_response = api_instance.test_echo_body_pet_response_string(n) - self.assertEqual(api_response, '{"name": "testing", "photoUrls": ["http://1", "http://2"]}') + self.assertEqual(api_response, "{'name': 'testing', 'photoUrls': ['http://1', 'http://2']}") t = openapi_client.Tag() api_response = api_instance.test_echo_body_tag_response_string(t) self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body - api_response = api_instance.test_echo_body_tag_response_string(None) - self.assertEqual(api_response, "") # assertion to ensure emtpy string is sent in the body - api_response = api_instance.test_echo_body_free_form_object_response_string({}) self.assertEqual(api_response, "{}") # assertion to ensure {} is sent in the body + + api_response = api_instance.test_echo_body_tag_response_string(None) + self.assertEqual(api_response, "") # assertion to ensure emtpy string is sent in the body def testAuthHttpBasic(self): api_instance = openapi_client.AuthApi() diff --git a/samples/client/echo_api/r/R/data_query.R b/samples/client/echo_api/r/R/data_query.R index 228cd65b846..0a749f98d6e 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 50015244dc5..097f1885fe5 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/auth_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/auth_api.rb index 4a957702057..96aedc8c5f7 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/auth_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/auth_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -102,7 +102,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/body_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/body_api.rb index f181efd8c74..5be0db68279 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/body_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/body_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['image/gif']) + header_params['Accept'] = @api_client.select_header_accept(['image/gif']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -104,7 +104,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/octet-stream']) if !content_type.nil? @@ -172,7 +172,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -237,7 +237,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -302,7 +302,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -366,7 +366,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -430,7 +430,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -494,7 +494,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -558,7 +558,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -622,7 +622,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/form_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/form_api.rb index f5211a1cea0..69ddd44475e 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/form_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/form_api.rb @@ -51,7 +51,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? @@ -122,7 +122,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -197,7 +197,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/header_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/header_api.rb index 92cdc26b179..be38fa55416 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/header_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/header_api.rb @@ -59,7 +59,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] header_params['integer_header'] = opts[:'integer_header'] if !opts[:'integer_header'].nil? header_params['boolean_header'] = opts[:'boolean_header'] if !opts[:'boolean_header'].nil? header_params['string_header'] = opts[:'string_header'] if !opts[:'string_header'].nil? diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/path_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/path_api.rb index 3fe10cf23bd..b6961d67ec8 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/path_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/path_api.rb @@ -74,7 +74,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/query_api.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/query_api.rb index 7a7ab14ea9c..4be66c8e08a 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/query_api.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api/query_api.rb @@ -55,7 +55,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -121,7 +121,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -187,7 +187,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -247,7 +247,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -307,7 +307,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -367,7 +367,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -427,7 +427,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -487,7 +487,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -547,7 +547,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -607,7 +607,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} 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 e7b26c1d79a..a3c1ee84b6e 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 @@ -164,35 +164,41 @@ module OpenapiClient request.options.on_data = Proc.new do |chunk, overall_received_bytes| stream << chunk end + stream end def deserialize_file(response, stream) - body = response.body - if @config.return_binary_data == true - # return byte stream - encoding = body.encoding - stream.join.force_encoding(encoding) + body = response.body + encoding = body.encoding + + # reconstruct content + content = stream.join + content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary' + content = content.force_encoding(encoding) + + # return byte stream + return content if @config.return_binary_data == true + + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) else - # return file instead of binary data - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - tempfile.write(stream.join.force_encoding(encoding)) - tempfile.close - config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - tempfile + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(content) + tempfile.close + + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile end def connection(opts) diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/configuration.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/configuration.rb index da55dd2cb17..3af59d27d83 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/configuration.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/configuration.rb @@ -79,6 +79,14 @@ module OpenapiClient # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -170,6 +178,7 @@ module OpenapiClient @return_binary_data = false @params_encoder = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -204,6 +213,7 @@ module OpenapiClient # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/auth_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/auth_api.rb index 4a957702057..96aedc8c5f7 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/auth_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/auth_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -102,7 +102,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/body_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/body_api.rb index f181efd8c74..5be0db68279 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/body_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/body_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['image/gif']) + header_params['Accept'] = @api_client.select_header_accept(['image/gif']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -104,7 +104,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/octet-stream']) if !content_type.nil? @@ -172,7 +172,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -237,7 +237,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -302,7 +302,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -366,7 +366,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -430,7 +430,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -494,7 +494,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -558,7 +558,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -622,7 +622,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/form_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/form_api.rb index f5211a1cea0..69ddd44475e 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/form_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/form_api.rb @@ -51,7 +51,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? @@ -122,7 +122,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -197,7 +197,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/header_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/header_api.rb index 92cdc26b179..be38fa55416 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/header_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/header_api.rb @@ -59,7 +59,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] header_params['integer_header'] = opts[:'integer_header'] if !opts[:'integer_header'].nil? header_params['boolean_header'] = opts[:'boolean_header'] if !opts[:'boolean_header'].nil? header_params['string_header'] = opts[:'string_header'] if !opts[:'string_header'].nil? diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/path_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/path_api.rb index 3fe10cf23bd..b6961d67ec8 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/path_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/path_api.rb @@ -74,7 +74,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/query_api.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/query_api.rb index 7a7ab14ea9c..4be66c8e08a 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/query_api.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api/query_api.rb @@ -55,7 +55,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -121,7 +121,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -187,7 +187,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -247,7 +247,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -307,7 +307,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -367,7 +367,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -427,7 +427,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -487,7 +487,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -547,7 +547,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -607,7 +607,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/configuration.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/configuration.rb index 0b7b8f6dee1..a5902e88d47 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/configuration.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/configuration.rb @@ -79,6 +79,14 @@ module OpenapiClient # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -134,6 +142,7 @@ module OpenapiClient @timeout = 60 @configure_session_blocks = [] @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -168,6 +177,7 @@ module OpenapiClient # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/auth_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/auth_api.rb index 4a957702057..96aedc8c5f7 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/auth_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/auth_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -102,7 +102,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/body_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/body_api.rb index f181efd8c74..5be0db68279 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/body_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/body_api.rb @@ -45,7 +45,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['image/gif']) + header_params['Accept'] = @api_client.select_header_accept(['image/gif']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -104,7 +104,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/octet-stream']) if !content_type.nil? @@ -172,7 +172,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -237,7 +237,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -302,7 +302,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -366,7 +366,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -430,7 +430,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -494,7 +494,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -558,7 +558,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -622,7 +622,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/form_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/form_api.rb index f5211a1cea0..69ddd44475e 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/form_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/form_api.rb @@ -51,7 +51,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? @@ -122,7 +122,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -197,7 +197,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/header_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/header_api.rb index 92cdc26b179..be38fa55416 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/header_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/header_api.rb @@ -59,7 +59,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] header_params['integer_header'] = opts[:'integer_header'] if !opts[:'integer_header'].nil? header_params['boolean_header'] = opts[:'boolean_header'] if !opts[:'boolean_header'].nil? header_params['string_header'] = opts[:'string_header'] if !opts[:'string_header'].nil? diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/path_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/path_api.rb index 3fe10cf23bd..b6961d67ec8 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/path_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/path_api.rb @@ -74,7 +74,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/query_api.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/query_api.rb index 7a7ab14ea9c..4be66c8e08a 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/query_api.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api/query_api.rb @@ -55,7 +55,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -121,7 +121,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -187,7 +187,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -247,7 +247,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -307,7 +307,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -367,7 +367,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -427,7 +427,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -487,7 +487,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -547,7 +547,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -607,7 +607,7 @@ module OpenapiClient # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/plain']) + header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/configuration.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/configuration.rb index e5a2be23863..dfef025a84c 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/configuration.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/configuration.rb @@ -79,6 +79,14 @@ module OpenapiClient # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module OpenapiClient @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module OpenapiClient # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/echo_api/typescript-axios/build/api.ts b/samples/client/echo_api/typescript-axios/build/api.ts index f22a7e72cca..ffe05310d2d 100644 --- a/samples/client/echo_api/typescript-axios/build/api.ts +++ b/samples/client/echo_api/typescript-axios/build/api.ts @@ -473,7 +473,7 @@ export const AuthApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAuthHttpBasic(options?: any): AxiosPromise { + testAuthHttpBasic(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAuthHttpBasic(options).then((request) => request(axios, basePath)); }, /** @@ -482,7 +482,7 @@ export const AuthApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAuthHttpBearer(options?: any): AxiosPromise { + testAuthHttpBearer(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAuthHttpBearer(options).then((request) => request(axios, basePath)); }, }; @@ -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); }) } @@ -1031,7 +1031,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBinaryGif(options?: any): AxiosPromise { + testBinaryGif(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBinaryGif(options).then((request) => request(axios, basePath)); }, /** @@ -1041,7 +1041,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyApplicationOctetstreamBinary(body?: File, options?: any): AxiosPromise { + testBodyApplicationOctetstreamBinary(body?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyApplicationOctetstreamBinary(body, options).then((request) => request(axios, basePath)); }, /** @@ -1051,7 +1051,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyMultipartFormdataArrayOfBinary(files: Array, options?: any): AxiosPromise { + testBodyMultipartFormdataArrayOfBinary(files: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyMultipartFormdataArrayOfBinary(files, options).then((request) => request(axios, basePath)); }, /** @@ -1061,7 +1061,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyMultipartFormdataSingleBinary(myFile?: File, options?: any): AxiosPromise { + testBodyMultipartFormdataSingleBinary(myFile?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyMultipartFormdataSingleBinary(myFile, options).then((request) => request(axios, basePath)); }, /** @@ -1071,7 +1071,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyAllOfPet(pet?: Pet, options?: any): AxiosPromise { + testEchoBodyAllOfPet(pet?: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyAllOfPet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -1081,7 +1081,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyFreeFormObjectResponseString(body?: object, options?: any): AxiosPromise { + testEchoBodyFreeFormObjectResponseString(body?: object, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyFreeFormObjectResponseString(body, options).then((request) => request(axios, basePath)); }, /** @@ -1091,7 +1091,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyPet(pet?: Pet, options?: any): AxiosPromise { + testEchoBodyPet(pet?: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyPet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -1101,7 +1101,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyPetResponseString(pet?: Pet, options?: any): AxiosPromise { + testEchoBodyPetResponseString(pet?: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyPetResponseString(pet, options).then((request) => request(axios, basePath)); }, /** @@ -1111,7 +1111,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyStringEnum(body?: string, options?: any): AxiosPromise { + testEchoBodyStringEnum(body?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyStringEnum(body, options).then((request) => request(axios, basePath)); }, /** @@ -1121,7 +1121,7 @@ export const BodyApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEchoBodyTagResponseString(tag?: Tag, options?: any): AxiosPromise { + testEchoBodyTagResponseString(tag?: Tag, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEchoBodyTagResponseString(tag, options).then((request) => request(axios, basePath)); }, }; @@ -1491,7 +1491,7 @@ export const FormApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testFormIntegerBooleanString(integerForm?: number, booleanForm?: boolean, stringForm?: string, options?: any): AxiosPromise { + testFormIntegerBooleanString(integerForm?: number, booleanForm?: boolean, stringForm?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testFormIntegerBooleanString(integerForm, booleanForm, stringForm, options).then((request) => request(axios, basePath)); }, /** @@ -1501,7 +1501,7 @@ export const FormApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testFormObjectMultipart(marker: TestFormObjectMultipartRequestMarker, options?: any): AxiosPromise { + testFormObjectMultipart(marker: TestFormObjectMultipartRequestMarker, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testFormObjectMultipart(marker, options).then((request) => request(axios, basePath)); }, /** @@ -1516,7 +1516,7 @@ export const FormApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testFormOneof(form1?: string, form2?: number, form3?: string, form4?: boolean, id?: number, name?: string, options?: any): AxiosPromise { + testFormOneof(form1?: string, form2?: number, form3?: string, form4?: boolean, id?: number, name?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testFormOneof(form1, form2, form3, form4, id, name, options).then((request) => request(axios, basePath)); }, }; @@ -1690,7 +1690,7 @@ export const HeaderApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testHeaderIntegerBooleanStringEnums(integerHeader?: number, booleanHeader?: boolean, stringHeader?: string, enumNonrefStringHeader?: TestHeaderIntegerBooleanStringEnumsEnumNonrefStringHeaderEnum, enumRefStringHeader?: StringEnumRef, options?: any): AxiosPromise { + testHeaderIntegerBooleanStringEnums(integerHeader?: number, booleanHeader?: boolean, stringHeader?: string, enumNonrefStringHeader?: TestHeaderIntegerBooleanStringEnumsEnumNonrefStringHeaderEnum, enumRefStringHeader?: StringEnumRef, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader, options).then((request) => request(axios, basePath)); }, }; @@ -1829,7 +1829,7 @@ export const PathApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: string, pathInteger: number, enumNonrefStringPath: TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathEnumNonrefStringPathEnum, enumRefStringPath: StringEnumRef, options?: any): AxiosPromise { + testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: string, pathInteger: number, enumNonrefStringPath: TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathEnumNonrefStringPathEnum, enumRefStringPath: StringEnumRef, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath, options).then((request) => request(axios, basePath)); }, }; @@ -2427,7 +2427,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEnumRefString(enumNonrefStringQuery?: TestEnumRefStringEnumNonrefStringQueryEnum, enumRefStringQuery?: StringEnumRef, options?: any): AxiosPromise { + testEnumRefString(enumNonrefStringQuery?: TestEnumRefStringEnumNonrefStringQueryEnum, enumRefStringQuery?: StringEnumRef, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery, options).then((request) => request(axios, basePath)); }, /** @@ -2439,7 +2439,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryDatetimeDateString(datetimeQuery?: string, dateQuery?: string, stringQuery?: string, options?: any): AxiosPromise { + testQueryDatetimeDateString(datetimeQuery?: string, dateQuery?: string, stringQuery?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery, options).then((request) => request(axios, basePath)); }, /** @@ -2451,7 +2451,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryIntegerBooleanString(integerQuery?: number, booleanQuery?: boolean, stringQuery?: string, options?: any): AxiosPromise { + testQueryIntegerBooleanString(integerQuery?: number, booleanQuery?: boolean, stringQuery?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery, options).then((request) => request(axios, basePath)); }, /** @@ -2461,7 +2461,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleDeepObjectExplodeTrueObject(queryObject?: Pet, options?: any): AxiosPromise { + testQueryStyleDeepObjectExplodeTrueObject(queryObject?: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleDeepObjectExplodeTrueObject(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2471,7 +2471,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject?: TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter, options?: any): AxiosPromise { + testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject?: TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2481,7 +2481,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleFormExplodeFalseArrayInteger(queryObject?: Array, options?: any): AxiosPromise { + testQueryStyleFormExplodeFalseArrayInteger(queryObject?: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleFormExplodeFalseArrayInteger(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2491,7 +2491,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleFormExplodeFalseArrayString(queryObject?: Array, options?: any): AxiosPromise { + testQueryStyleFormExplodeFalseArrayString(queryObject?: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleFormExplodeFalseArrayString(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2501,7 +2501,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleFormExplodeTrueArrayString(queryObject?: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, options?: any): AxiosPromise { + testQueryStyleFormExplodeTrueArrayString(queryObject?: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleFormExplodeTrueArrayString(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2511,7 +2511,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleFormExplodeTrueObject(queryObject?: Pet, options?: any): AxiosPromise { + testQueryStyleFormExplodeTrueObject(queryObject?: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleFormExplodeTrueObject(queryObject, options).then((request) => request(axios, basePath)); }, /** @@ -2521,7 +2521,7 @@ export const QueryApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryStyleFormExplodeTrueObjectAllOf(queryObject?: DataQuery, options?: any): AxiosPromise { + testQueryStyleFormExplodeTrueObjectAllOf(queryObject?: DataQuery, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryStyleFormExplodeTrueObjectAllOf(queryObject, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/github/jetbrains/http/client/.openapi-generator/FILES b/samples/client/github/jetbrains/http/client/.openapi-generator/FILES index 75193ca13a5..d65c32f61fa 100644 --- a/samples/client/github/jetbrains/http/client/.openapi-generator/FILES +++ b/samples/client/github/jetbrains/http/client/.openapi-generator/FILES @@ -33,4 +33,5 @@ Apis/SecretScanningApi.http Apis/SecurityAdvisoriesApi.http Apis/TeamsApi.http Apis/UsersApi.http +Apis/http-client.template.env.json README.md diff --git a/samples/client/github/jetbrains/http/client/Apis/ActionsApi.http b/samples/client/github/jetbrains/http/client/Apis/ActionsApi.http index 7b70d83b489..995b040ead0 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ActionsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ActionsApi.http @@ -156,7 +156,7 @@ DELETE https://api.github.com/repos/{{owner}}/{{repo}}/actions/caches/{{cache_id ### Delete GitHub Actions caches for a repository (using a cache key) ## Delete GitHub Actions caches for a repository (using a cache key) -DELETE https://api.github.com/repos/{{owner}}/{{repo}}/actions/caches +DELETE https://api.github.com/repos/{{owner}}/{{repo}}/actions/caches?key={{key}}&ref={{ref}} Accept: application/json ### Delete an artifact @@ -272,7 +272,7 @@ Accept: application/json ### List GitHub Actions caches for a repository ## List GitHub Actions caches for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/caches +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/caches?perPage={{perPage}}&page={{page}}&ref={{ref}}&key={{key}}&sort={{sort}}&direction={{direction}} Accept: application/json ### Get GitHub Actions cache usage for a repository @@ -282,7 +282,7 @@ Accept: application/json ### List repositories with GitHub Actions cache usage for an organization ## List repositories with GitHub Actions cache usage for an organization -GET https://api.github.com/orgs/{{org}}/actions/cache/usage-by-repository +GET https://api.github.com/orgs/{{org}}/actions/cache/usage-by-repository?perPage={{perPage}}&page={{page}} Accept: application/json ### Get GitHub Actions cache usage for an organization @@ -413,12 +413,12 @@ Accept: application/json ### Get a workflow run ## Get a workflow run -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}?excludePullRequests={{excludePullRequests}} Accept: application/json ### Get a workflow run attempt ## Get a workflow run attempt -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/attempts/{{attempt_number}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/attempts/{{attempt_number}}?excludePullRequests={{excludePullRequests}} Accept: application/json ### Get workflow run usage @@ -433,27 +433,27 @@ Accept: application/json ### List artifacts for a repository ## List artifacts for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/artifacts +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/artifacts?perPage={{perPage}}&page={{page}}&name={{name}} Accept: application/json ### List environment secrets ## List environment secrets -GET https://api.github.com/repositories/{{repository_id}}/environments/{{environment_name}}/secrets +GET https://api.github.com/repositories/{{repository_id}}/environments/{{environment_name}}/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List environment variables ## List environment variables -GET https://api.github.com/repositories/{{repository_id}}/environments/{{environment_name}}/variables +GET https://api.github.com/repositories/{{repository_id}}/environments/{{environment_name}}/variables?perPage={{perPage}}&page={{page}} Accept: application/json ### List jobs for a workflow run ## List jobs for a workflow run -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/jobs +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/jobs?filter={{filter}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List jobs for a workflow run attempt ## List jobs for a workflow run attempt -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/attempts/{{attempt_number}}/jobs +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/attempts/{{attempt_number}}/jobs?perPage={{perPage}}&page={{page}} Accept: application/json ### List labels for a self-hosted runner for an organization @@ -468,37 +468,37 @@ Accept: application/json ### List organization secrets ## List organization secrets -GET https://api.github.com/orgs/{{org}}/actions/secrets +GET https://api.github.com/orgs/{{org}}/actions/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization variables ## List organization variables -GET https://api.github.com/orgs/{{org}}/actions/variables +GET https://api.github.com/orgs/{{org}}/actions/variables?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository organization secrets ## List repository organization secrets -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/organization-secrets +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/organization-secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository organization variables ## List repository organization variables -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/organization-variables +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/organization-variables?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository secrets ## List repository secrets -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/secrets +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository variables ## List repository variables -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/variables +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/variables?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository workflows ## List repository workflows -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows?perPage={{perPage}}&page={{page}} Accept: application/json ### List runner applications for an organization @@ -513,42 +513,42 @@ Accept: application/json ### List selected repositories for an organization secret ## List selected repositories for an organization secret -GET https://api.github.com/orgs/{{org}}/actions/secrets/{{secret_name}}/repositories +GET https://api.github.com/orgs/{{org}}/actions/secrets/{{secret_name}}/repositories?page={{page}}&perPage={{perPage}} Accept: application/json ### List selected repositories for an organization variable ## List selected repositories for an organization variable -GET https://api.github.com/orgs/{{org}}/actions/variables/{{name}}/repositories +GET https://api.github.com/orgs/{{org}}/actions/variables/{{name}}/repositories?page={{page}}&perPage={{perPage}} Accept: application/json ### List selected repositories enabled for GitHub Actions in an organization ## List selected repositories enabled for GitHub Actions in an organization -GET https://api.github.com/orgs/{{org}}/actions/permissions/repositories +GET https://api.github.com/orgs/{{org}}/actions/permissions/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List self-hosted runners for an organization ## List self-hosted runners for an organization -GET https://api.github.com/orgs/{{org}}/actions/runners +GET https://api.github.com/orgs/{{org}}/actions/runners?name={{name}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List self-hosted runners for a repository ## List self-hosted runners for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runners +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runners?name={{name}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List workflow run artifacts ## List workflow run artifacts -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/artifacts +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs/{{run_id}}/artifacts?perPage={{perPage}}&page={{page}}&name={{name}} Accept: application/json ### List workflow runs for a workflow ## List workflow runs for a workflow -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows/{{workflow_id}}/runs +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows/{{workflow_id}}/runs?actor={{actor}}&branch={{branch}}&event={{event}}&status={{status}}&perPage={{perPage}}&page={{page}}&created={{created}}&excludePullRequests={{excludePullRequests}}&checkSuiteId={{checkSuiteId}}&headSha={{headSha}} Accept: application/json ### List workflow runs for a repository ## List workflow runs for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs +GET https://api.github.com/repos/{{owner}}/{{repo}}/actions/runs?actor={{actor}}&branch={{branch}}&event={{event}}&status={{status}}&perPage={{perPage}}&page={{page}}&created={{created}}&excludePullRequests={{excludePullRequests}}&checkSuiteId={{checkSuiteId}}&headSha={{headSha}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/ActivityApi.http b/samples/client/github/jetbrains/http/client/Apis/ActivityApi.http index 6ed76c69d66..2f667e66e83 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ActivityApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ActivityApi.http @@ -36,88 +36,88 @@ Accept: application/json ### List events for the authenticated user ## List events for the authenticated user -GET https://api.github.com/users/{{username}}/events +GET https://api.github.com/users/{{username}}/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List notifications for the authenticated user ## List notifications for the authenticated user -GET https://api.github.com/notifications +GET https://api.github.com/notifications?all={{all}}&participating={{participating}}&since={{since}}&before={{before}}&page={{page}}&perPage={{perPage}} Accept: application/json ### List organization events for the authenticated user ## List organization events for the authenticated user -GET https://api.github.com/users/{{username}}/events/orgs/{{org}} +GET https://api.github.com/users/{{username}}/events/orgs/{{org}}?perPage={{perPage}}&page={{page}} Accept: application/json ### List public events ## List public events -GET https://api.github.com/events +GET https://api.github.com/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List public events for a network of repositories ## List public events for a network of repositories -GET https://api.github.com/networks/{{owner}}/{{repo}}/events +GET https://api.github.com/networks/{{owner}}/{{repo}}/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List public events for a user ## List public events for a user -GET https://api.github.com/users/{{username}}/events/public +GET https://api.github.com/users/{{username}}/events/public?perPage={{perPage}}&page={{page}} Accept: application/json ### List public organization events ## List public organization events -GET https://api.github.com/orgs/{{org}}/events +GET https://api.github.com/orgs/{{org}}/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List events received by the authenticated user ## List events received by the authenticated user -GET https://api.github.com/users/{{username}}/received_events +GET https://api.github.com/users/{{username}}/received_events?perPage={{perPage}}&page={{page}} Accept: application/json ### List public events received by a user ## List public events received by a user -GET https://api.github.com/users/{{username}}/received_events/public +GET https://api.github.com/users/{{username}}/received_events/public?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository events ## List repository events -GET https://api.github.com/repos/{{owner}}/{{repo}}/events +GET https://api.github.com/repos/{{owner}}/{{repo}}/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository notifications for the authenticated user ## List repository notifications for the authenticated user -GET https://api.github.com/repos/{{owner}}/{{repo}}/notifications +GET https://api.github.com/repos/{{owner}}/{{repo}}/notifications?all={{all}}&participating={{participating}}&since={{since}}&before={{before}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories starred by the authenticated user ## List repositories starred by the authenticated user -GET https://api.github.com/user/starred +GET https://api.github.com/user/starred?sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json Accept: application/vnd.github.v3.star+json ### List repositories starred by a user ## List repositories starred by a user -GET https://api.github.com/users/{{username}}/starred +GET https://api.github.com/users/{{username}}/starred?sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories watched by a user ## List repositories watched by a user -GET https://api.github.com/users/{{username}}/subscriptions +GET https://api.github.com/users/{{username}}/subscriptions?perPage={{perPage}}&page={{page}} Accept: application/json ### List stargazers ## List stargazers -GET https://api.github.com/repos/{{owner}}/{{repo}}/stargazers +GET https://api.github.com/repos/{{owner}}/{{repo}}/stargazers?perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories watched by the authenticated user ## List repositories watched by the authenticated user -GET https://api.github.com/user/subscriptions +GET https://api.github.com/user/subscriptions?perPage={{perPage}}&page={{page}} Accept: application/json ### List watchers ## List watchers -GET https://api.github.com/repos/{{owner}}/{{repo}}/subscribers +GET https://api.github.com/repos/{{owner}}/{{repo}}/subscribers?perPage={{perPage}}&page={{page}} Accept: application/json ### Mark notifications as read diff --git a/samples/client/github/jetbrains/http/client/Apis/AppsApi.http b/samples/client/github/jetbrains/http/client/Apis/AppsApi.http index 1bf8d496f5a..8e1de9e7937 100644 --- a/samples/client/github/jetbrains/http/client/Apis/AppsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/AppsApi.http @@ -116,62 +116,62 @@ Accept: application/scim+json ### List accounts for a plan ## List accounts for a plan -GET https://api.github.com/marketplace_listing/plans/{{plan_id}}/accounts +GET https://api.github.com/marketplace_listing/plans/{{plan_id}}/accounts?sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List accounts for a plan (stubbed) ## List accounts for a plan (stubbed) -GET https://api.github.com/marketplace_listing/stubbed/plans/{{plan_id}}/accounts +GET https://api.github.com/marketplace_listing/stubbed/plans/{{plan_id}}/accounts?sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories accessible to the user access token ## List repositories accessible to the user access token -GET https://api.github.com/user/installations/{{installation_id}}/repositories +GET https://api.github.com/user/installations/{{installation_id}}/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List installation requests for the authenticated app ## List installation requests for the authenticated app -GET https://api.github.com/app/installation-requests +GET https://api.github.com/app/installation-requests?perPage={{perPage}}&page={{page}} Accept: application/json ### List installations for the authenticated app ## List installations for the authenticated app -GET https://api.github.com/app/installations +GET https://api.github.com/app/installations?perPage={{perPage}}&page={{page}}&since={{since}}&outdated={{outdated}} Accept: application/json ### List app installations accessible to the user access token ## List app installations accessible to the user access token -GET https://api.github.com/user/installations +GET https://api.github.com/user/installations?perPage={{perPage}}&page={{page}} Accept: application/json ### List plans ## List plans -GET https://api.github.com/marketplace_listing/plans +GET https://api.github.com/marketplace_listing/plans?perPage={{perPage}}&page={{page}} Accept: application/json ### List plans (stubbed) ## List plans (stubbed) -GET https://api.github.com/marketplace_listing/stubbed/plans +GET https://api.github.com/marketplace_listing/stubbed/plans?perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories accessible to the app installation ## List repositories accessible to the app installation -GET https://api.github.com/installation/repositories +GET https://api.github.com/installation/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List subscriptions for the authenticated user ## List subscriptions for the authenticated user -GET https://api.github.com/user/marketplace_purchases +GET https://api.github.com/user/marketplace_purchases?perPage={{perPage}}&page={{page}} Accept: application/json ### List subscriptions for the authenticated user (stubbed) ## List subscriptions for the authenticated user (stubbed) -GET https://api.github.com/user/marketplace_purchases/stubbed +GET https://api.github.com/user/marketplace_purchases/stubbed?perPage={{perPage}}&page={{page}} Accept: application/json ### List deliveries for an app webhook ## List deliveries for an app webhook -GET https://api.github.com/app/hook/deliveries +GET https://api.github.com/app/hook/deliveries?perPage={{perPage}}&cursor={{cursor}}&redelivery={{redelivery}} Accept: application/json Accept: application/scim+json diff --git a/samples/client/github/jetbrains/http/client/Apis/ChecksApi.http b/samples/client/github/jetbrains/http/client/Apis/ChecksApi.http index f066b958182..231cbe41304 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ChecksApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ChecksApi.http @@ -43,22 +43,22 @@ Accept: application/json ### List check run annotations ## List check run annotations -GET https://api.github.com/repos/{{owner}}/{{repo}}/check-runs/{{check_run_id}}/annotations +GET https://api.github.com/repos/{{owner}}/{{repo}}/check-runs/{{check_run_id}}/annotations?perPage={{perPage}}&page={{page}} Accept: application/json ### List check runs for a Git reference ## List check runs for a Git reference -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/check-runs +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/check-runs?checkName={{checkName}}&status={{status}}&filter={{filter}}&perPage={{perPage}}&page={{page}}&appId={{appId}} Accept: application/json ### List check runs in a check suite ## List check runs in a check suite -GET https://api.github.com/repos/{{owner}}/{{repo}}/check-suites/{{check_suite_id}}/check-runs +GET https://api.github.com/repos/{{owner}}/{{repo}}/check-suites/{{check_suite_id}}/check-runs?checkName={{checkName}}&status={{status}}&filter={{filter}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List check suites for a Git reference ## List check suites for a Git reference -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/check-suites +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/check-suites?appId={{appId}}&checkName={{checkName}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Rerequest a check run diff --git a/samples/client/github/jetbrains/http/client/Apis/ClassroomApi.http b/samples/client/github/jetbrains/http/client/Apis/ClassroomApi.http index 187f091d314..31ed31e4cef 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ClassroomApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ClassroomApi.http @@ -17,15 +17,15 @@ Accept: application/json ### List accepted assignments for an assignment ## List accepted assignments for an assignment -GET https://api.github.com/assignments/{{assignment_id}}/accepted_assignments +GET https://api.github.com/assignments/{{assignment_id}}/accepted_assignments?page={{page}}&perPage={{perPage}} Accept: application/json ### List assignments for a classroom ## List assignments for a classroom -GET https://api.github.com/classrooms/{{classroom_id}}/assignments +GET https://api.github.com/classrooms/{{classroom_id}}/assignments?page={{page}}&perPage={{perPage}} Accept: application/json ### List classrooms ## List classrooms -GET https://api.github.com/classrooms +GET https://api.github.com/classrooms?page={{page}}&perPage={{perPage}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/CodeScanningApi.http b/samples/client/github/jetbrains/http/client/Apis/CodeScanningApi.http index 1048d45688f..2594ec45d06 100644 --- a/samples/client/github/jetbrains/http/client/Apis/CodeScanningApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/CodeScanningApi.http @@ -2,7 +2,7 @@ ### Delete a code scanning analysis from a repository ## Delete a code scanning analysis from a repository -DELETE https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/analyses/{{analysis_id}} +DELETE https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/analyses/{{analysis_id}}?confirmDelete={{confirmDelete}} Accept: application/json Accept: application/scim+json @@ -34,17 +34,17 @@ Accept: application/json ### List instances of a code scanning alert ## List instances of a code scanning alert -GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/alerts/{{alert_number}}/instances +GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/alerts/{{alert_number}}/instances?page={{page}}&perPage={{perPage}}&ref={{ref}} Accept: application/json ### List code scanning alerts for an organization ## List code scanning alerts for an organization -GET https://api.github.com/orgs/{{org}}/code-scanning/alerts +GET https://api.github.com/orgs/{{org}}/code-scanning/alerts?toolName={{toolName}}&toolGuid={{toolGuid}}&before={{before}}&after={{after}}&page={{page}}&perPage={{perPage}}&direction={{direction}}&state={{state}}&sort={{sort}}&severity={{severity}} Accept: application/json ### List code scanning alerts for a repository ## List code scanning alerts for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/alerts +GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/alerts?toolName={{toolName}}&toolGuid={{toolGuid}}&page={{page}}&perPage={{perPage}}&ref={{ref}}&direction={{direction}}&sort={{sort}}&state={{state}}&severity={{severity}} Accept: application/json ### List CodeQL databases for a repository @@ -54,7 +54,7 @@ Accept: application/json ### List code scanning analyses for a repository ## List code scanning analyses for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/analyses +GET https://api.github.com/repos/{{owner}}/{{repo}}/code-scanning/analyses?toolName={{toolName}}&toolGuid={{toolGuid}}&page={{page}}&perPage={{perPage}}&ref={{ref}}&sarifId={{sarifId}}&direction={{direction}}&sort={{sort}} Accept: application/json ### Update a code scanning alert diff --git a/samples/client/github/jetbrains/http/client/Apis/CodespacesApi.http b/samples/client/github/jetbrains/http/client/Apis/CodespacesApi.http index 466b9529358..bb571b22fe9 100644 --- a/samples/client/github/jetbrains/http/client/Apis/CodespacesApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/CodespacesApi.http @@ -12,7 +12,7 @@ Accept: application/json ### Check if permissions defined by a devcontainer have been accepted by the authenticated user ## Check if permissions defined by a devcontainer have been accepted by the authenticated user -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/permissions_check +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/permissions_check?ref={{ref}}&devcontainerPath={{devcontainerPath}} Accept: application/json ### List machine types for a codespace @@ -138,7 +138,7 @@ Accept: application/json ### List codespaces for a user in organization ## List codespaces for a user in organization -GET https://api.github.com/orgs/{{org}}/members/{{username}}/codespaces +GET https://api.github.com/orgs/{{org}}/members/{{username}}/codespaces?perPage={{perPage}}&page={{page}} Accept: application/json ### Get details about a codespace export @@ -183,33 +183,33 @@ Accept: application/json ### List devcontainer configurations in a repository for the authenticated user ## List devcontainer configurations in a repository for the authenticated user -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/devcontainers +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/devcontainers?perPage={{perPage}}&page={{page}} Accept: application/json Accept: application/scim+json ### List codespaces for the authenticated user ## List codespaces for the authenticated user -GET https://api.github.com/user/codespaces +GET https://api.github.com/user/codespaces?perPage={{perPage}}&page={{page}}&repositoryId={{repositoryId}} Accept: application/json ### List codespaces for the organization ## List codespaces for the organization -GET https://api.github.com/orgs/{{org}}/codespaces +GET https://api.github.com/orgs/{{org}}/codespaces?perPage={{perPage}}&page={{page}} Accept: application/json ### List codespaces in a repository for the authenticated user ## List codespaces in a repository for the authenticated user -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization secrets ## List organization secrets -GET https://api.github.com/orgs/{{org}}/codespaces/secrets +GET https://api.github.com/orgs/{{org}}/codespaces/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository secrets ## List repository secrets -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/secrets +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List selected repositories for a user secret @@ -219,17 +219,17 @@ Accept: application/json ### List secrets for the authenticated user ## List secrets for the authenticated user -GET https://api.github.com/user/codespaces/secrets +GET https://api.github.com/user/codespaces/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List selected repositories for an organization secret ## List selected repositories for an organization secret -GET https://api.github.com/orgs/{{org}}/codespaces/secrets/{{secret_name}}/repositories +GET https://api.github.com/orgs/{{org}}/codespaces/secrets/{{secret_name}}/repositories?page={{page}}&perPage={{perPage}} Accept: application/json ### Get default attributes for a codespace ## Get default attributes for a codespace -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/new +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/new?ref={{ref}}&clientIp={{clientIp}} Accept: application/json ### Create a repository from an unpublished codespace @@ -256,7 +256,7 @@ Accept: application/json ### List available machine types for a repository ## List available machine types for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/machines +GET https://api.github.com/repos/{{owner}}/{{repo}}/codespaces/machines?location={{location}}&clientIp={{clientIp}}&ref={{ref}} Accept: application/json ### Manage access control for organization codespaces diff --git a/samples/client/github/jetbrains/http/client/Apis/CopilotApi.http b/samples/client/github/jetbrains/http/client/Apis/CopilotApi.http index 405ce68f3db..70c545e85a1 100644 --- a/samples/client/github/jetbrains/http/client/Apis/CopilotApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/CopilotApi.http @@ -56,5 +56,5 @@ Accept: application/json ### List all Copilot seat assignments for an organization ## List all Copilot seat assignments for an organization -GET https://api.github.com/orgs/{{org}}/copilot/billing/seats +GET https://api.github.com/orgs/{{org}}/copilot/billing/seats?page={{page}}&perPage={{perPage}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/DependabotApi.http b/samples/client/github/jetbrains/http/client/Apis/DependabotApi.http index 1602fb71e3c..1bfbb7d33c7 100644 --- a/samples/client/github/jetbrains/http/client/Apis/DependabotApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/DependabotApi.http @@ -65,34 +65,34 @@ Accept: application/json ### List Dependabot alerts for an enterprise ## List Dependabot alerts for an enterprise -GET https://api.github.com/enterprises/{{enterprise}}/dependabot/alerts +GET https://api.github.com/enterprises/{{enterprise}}/dependabot/alerts?state={{state}}&severity={{severity}}&ecosystem={{ecosystem}}&package={{package}}&scope={{scope}}&sort={{sort}}&direction={{direction}}&before={{before}}&after={{after}}&first={{first}}&last={{last}}&perPage={{perPage}} Accept: application/json ### List Dependabot alerts for an organization ## List Dependabot alerts for an organization -GET https://api.github.com/orgs/{{org}}/dependabot/alerts +GET https://api.github.com/orgs/{{org}}/dependabot/alerts?state={{state}}&severity={{severity}}&ecosystem={{ecosystem}}&package={{package}}&scope={{scope}}&sort={{sort}}&direction={{direction}}&before={{before}}&after={{after}}&first={{first}}&last={{last}}&perPage={{perPage}} Accept: application/json Accept: application/scim+json ### List Dependabot alerts for a repository ## List Dependabot alerts for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/dependabot/alerts +GET https://api.github.com/repos/{{owner}}/{{repo}}/dependabot/alerts?state={{state}}&severity={{severity}}&ecosystem={{ecosystem}}&package={{package}}&manifest={{manifest}}&scope={{scope}}&sort={{sort}}&direction={{direction}}&page={{page}}&perPage={{perPage}}&before={{before}}&after={{after}}&first={{first}}&last={{last}} Accept: application/json Accept: application/scim+json ### List organization secrets ## List organization secrets -GET https://api.github.com/orgs/{{org}}/dependabot/secrets +GET https://api.github.com/orgs/{{org}}/dependabot/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository secrets ## List repository secrets -GET https://api.github.com/repos/{{owner}}/{{repo}}/dependabot/secrets +GET https://api.github.com/repos/{{owner}}/{{repo}}/dependabot/secrets?perPage={{perPage}}&page={{page}} Accept: application/json ### List selected repositories for an organization secret ## List selected repositories for an organization secret -GET https://api.github.com/orgs/{{org}}/dependabot/secrets/{{secret_name}}/repositories +GET https://api.github.com/orgs/{{org}}/dependabot/secrets/{{secret_name}}/repositories?page={{page}}&perPage={{perPage}} Accept: application/json ### Remove selected repository from an organization secret diff --git a/samples/client/github/jetbrains/http/client/Apis/DependencyGraphApi.http b/samples/client/github/jetbrains/http/client/Apis/DependencyGraphApi.http index 50698db6064..2667c6b1c71 100644 --- a/samples/client/github/jetbrains/http/client/Apis/DependencyGraphApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/DependencyGraphApi.http @@ -46,7 +46,7 @@ Accept: application/json ### Get a diff of the dependencies between commits ## Get a diff of the dependencies between commits -GET https://api.github.com/repos/{{owner}}/{{repo}}/dependency-graph/compare/{{basehead}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/dependency-graph/compare/{{basehead}}?name={{name}} Accept: application/json ### Export a software bill of materials (SBOM) for a repository. diff --git a/samples/client/github/jetbrains/http/client/Apis/GistsApi.http b/samples/client/github/jetbrains/http/client/Apis/GistsApi.http index 218a9496eca..ee504b674aa 100644 --- a/samples/client/github/jetbrains/http/client/Apis/GistsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/GistsApi.http @@ -65,37 +65,37 @@ Accept: application/json ### List gists for the authenticated user ## List gists for the authenticated user -GET https://api.github.com/gists +GET https://api.github.com/gists?since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List gist comments ## List gist comments -GET https://api.github.com/gists/{{gist_id}}/comments +GET https://api.github.com/gists/{{gist_id}}/comments?perPage={{perPage}}&page={{page}} Accept: application/json ### List gist commits ## List gist commits -GET https://api.github.com/gists/{{gist_id}}/commits +GET https://api.github.com/gists/{{gist_id}}/commits?perPage={{perPage}}&page={{page}} Accept: application/json ### List gists for a user ## List gists for a user -GET https://api.github.com/users/{{username}}/gists +GET https://api.github.com/users/{{username}}/gists?since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List gist forks ## List gist forks -GET https://api.github.com/gists/{{gist_id}}/forks +GET https://api.github.com/gists/{{gist_id}}/forks?perPage={{perPage}}&page={{page}} Accept: application/json ### List public gists ## List public gists -GET https://api.github.com/gists/public +GET https://api.github.com/gists/public?since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List starred gists ## List starred gists -GET https://api.github.com/gists/starred +GET https://api.github.com/gists/starred?since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Star a gist diff --git a/samples/client/github/jetbrains/http/client/Apis/GitApi.http b/samples/client/github/jetbrains/http/client/Apis/GitApi.http index 49ba7d3cc24..d1dbe922c87 100644 --- a/samples/client/github/jetbrains/http/client/Apis/GitApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/GitApi.http @@ -106,7 +106,7 @@ Accept: application/json ### Get a tree ## Get a tree -GET https://api.github.com/repos/{{owner}}/{{repo}}/git/trees/{{tree_sha}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/git/trees/{{tree_sha}}?recursive={{recursive}} Accept: application/json ### List matching references diff --git a/samples/client/github/jetbrains/http/client/Apis/IssuesApi.http b/samples/client/github/jetbrains/http/client/Apis/IssuesApi.http index ca9584917e9..bf47e257e01 100644 --- a/samples/client/github/jetbrains/http/client/Apis/IssuesApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/IssuesApi.http @@ -126,72 +126,72 @@ Accept: application/json ### List issues assigned to the authenticated user ## List issues assigned to the authenticated user -GET https://api.github.com/issues +GET https://api.github.com/issues?filter={{filter}}&state={{state}}&labels={{labels}}&sort={{sort}}&direction={{direction}}&since={{since}}&collab={{collab}}&orgs={{orgs}}&owned={{owned}}&pulls={{pulls}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List assignees ## List assignees -GET https://api.github.com/repos/{{owner}}/{{repo}}/assignees +GET https://api.github.com/repos/{{owner}}/{{repo}}/assignees?perPage={{perPage}}&page={{page}} Accept: application/json ### List issue comments ## List issue comments -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/comments?since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List issue comments for a repository ## List issue comments for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/comments?sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List issue events ## List issue events -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/events +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List issue events for a repository ## List issue events for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/events +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/events?perPage={{perPage}}&page={{page}} Accept: application/json ### List timeline events for an issue ## List timeline events for an issue -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/timeline +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/timeline?perPage={{perPage}}&page={{page}} Accept: application/json ### List user account issues assigned to the authenticated user ## List user account issues assigned to the authenticated user -GET https://api.github.com/user/issues +GET https://api.github.com/user/issues?filter={{filter}}&state={{state}}&labels={{labels}}&sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List organization issues assigned to the authenticated user ## List organization issues assigned to the authenticated user -GET https://api.github.com/orgs/{{org}}/issues +GET https://api.github.com/orgs/{{org}}/issues?filter={{filter}}&state={{state}}&labels={{labels}}&sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repository issues ## List repository issues -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues?milestone={{milestone}}&state={{state}}&assignee={{assignee}}&creator={{creator}}&mentioned={{mentioned}}&labels={{labels}}&sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List labels for issues in a milestone ## List labels for issues in a milestone -GET https://api.github.com/repos/{{owner}}/{{repo}}/milestones/{{milestone_number}}/labels +GET https://api.github.com/repos/{{owner}}/{{repo}}/milestones/{{milestone_number}}/labels?perPage={{perPage}}&page={{page}} Accept: application/json ### List labels for a repository ## List labels for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/labels +GET https://api.github.com/repos/{{owner}}/{{repo}}/labels?perPage={{perPage}}&page={{page}} Accept: application/json ### List labels for an issue ## List labels for an issue -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/labels +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/labels?perPage={{perPage}}&page={{page}} Accept: application/json ### List milestones ## List milestones -GET https://api.github.com/repos/{{owner}}/{{repo}}/milestones +GET https://api.github.com/repos/{{owner}}/{{repo}}/milestones?state={{state}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Lock an issue diff --git a/samples/client/github/jetbrains/http/client/Apis/LicensesApi.http b/samples/client/github/jetbrains/http/client/Apis/LicensesApi.http index 5098f03ae53..8e2b7d9fed3 100644 --- a/samples/client/github/jetbrains/http/client/Apis/LicensesApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/LicensesApi.http @@ -7,10 +7,10 @@ Accept: application/json ### Get all commonly used licenses ## Get all commonly used licenses -GET https://api.github.com/licenses +GET https://api.github.com/licenses?featured={{featured}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Get the license for a repository ## Get the license for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/license +GET https://api.github.com/repos/{{owner}}/{{repo}}/license?ref={{ref}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/MetaApi.http b/samples/client/github/jetbrains/http/client/Apis/MetaApi.http index 966524a21b3..f4dcdf553bd 100644 --- a/samples/client/github/jetbrains/http/client/Apis/MetaApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/MetaApi.http @@ -12,7 +12,7 @@ Accept: application/json ### Get Octocat ## Get Octocat -GET https://api.github.com/octocat +GET https://api.github.com/octocat?s={{s}} Accept: application/octocat-stream ### Get the Zen of GitHub diff --git a/samples/client/github/jetbrains/http/client/Apis/MigrationsApi.http b/samples/client/github/jetbrains/http/client/Apis/MigrationsApi.http index 9cb2a9d9aaf..f626cbde66c 100644 --- a/samples/client/github/jetbrains/http/client/Apis/MigrationsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/MigrationsApi.http @@ -27,7 +27,7 @@ Accept: application/json ### Get commit authors ## Get commit authors -GET https://api.github.com/repos/{{owner}}/{{repo}}/import/authors +GET https://api.github.com/repos/{{owner}}/{{repo}}/import/authors?since={{since}} Accept: application/json ### Get an import status @@ -42,32 +42,32 @@ Accept: application/json ### Get a user migration status ## Get a user migration status -GET https://api.github.com/user/migrations/{{migration_id}} +GET https://api.github.com/user/migrations/{{migration_id}}?exclude={{exclude}} Accept: application/json ### Get an organization migration status ## Get an organization migration status -GET https://api.github.com/orgs/{{org}}/migrations/{{migration_id}} +GET https://api.github.com/orgs/{{org}}/migrations/{{migration_id}}?exclude={{exclude}} Accept: application/json ### List user migrations ## List user migrations -GET https://api.github.com/user/migrations +GET https://api.github.com/user/migrations?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization migrations ## List organization migrations -GET https://api.github.com/orgs/{{org}}/migrations +GET https://api.github.com/orgs/{{org}}/migrations?perPage={{perPage}}&page={{page}}&exclude={{exclude}} Accept: application/json ### List repositories for a user migration ## List repositories for a user migration -GET https://api.github.com/user/migrations/{{migration_id}}/repositories +GET https://api.github.com/user/migrations/{{migration_id}}/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories in an organization migration ## List repositories in an organization migration -GET https://api.github.com/orgs/{{org}}/migrations/{{migration_id}}/repositories +GET https://api.github.com/orgs/{{org}}/migrations/{{migration_id}}/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### Map a commit author diff --git a/samples/client/github/jetbrains/http/client/Apis/OrgsApi.http b/samples/client/github/jetbrains/http/client/Apis/OrgsApi.http index 255218e5d8e..2460ad4e436 100644 --- a/samples/client/github/jetbrains/http/client/Apis/OrgsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/OrgsApi.http @@ -214,62 +214,62 @@ Accept: application/scim+json ### List organizations ## List organizations -GET https://api.github.com/organizations +GET https://api.github.com/organizations?since={{since}}&perPage={{perPage}} Accept: application/json ### List app installations for an organization ## List app installations for an organization -GET https://api.github.com/orgs/{{org}}/installations +GET https://api.github.com/orgs/{{org}}/installations?perPage={{perPage}}&page={{page}} Accept: application/json ### List users blocked by an organization ## List users blocked by an organization -GET https://api.github.com/orgs/{{org}}/blocks +GET https://api.github.com/orgs/{{org}}/blocks?perPage={{perPage}}&page={{page}} Accept: application/json ### List custom property values for organization repositories ## List custom property values for organization repositories -GET https://api.github.com/orgs/{{org}}/properties/values +GET https://api.github.com/orgs/{{org}}/properties/values?perPage={{perPage}}&page={{page}}&repositoryQuery={{repositoryQuery}} Accept: application/json ### List failed organization invitations ## List failed organization invitations -GET https://api.github.com/orgs/{{org}}/failed_invitations +GET https://api.github.com/orgs/{{org}}/failed_invitations?perPage={{perPage}}&page={{page}} Accept: application/json ### List organizations for the authenticated user ## List organizations for the authenticated user -GET https://api.github.com/user/orgs +GET https://api.github.com/user/orgs?perPage={{perPage}}&page={{page}} Accept: application/json ### List organizations for a user ## List organizations for a user -GET https://api.github.com/users/{{username}}/orgs +GET https://api.github.com/users/{{username}}/orgs?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization invitation teams ## List organization invitation teams -GET https://api.github.com/orgs/{{org}}/invitations/{{invitation_id}}/teams +GET https://api.github.com/orgs/{{org}}/invitations/{{invitation_id}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization members ## List organization members -GET https://api.github.com/orgs/{{org}}/members +GET https://api.github.com/orgs/{{org}}/members?filter={{filter}}&role={{role}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List organization memberships for the authenticated user ## List organization memberships for the authenticated user -GET https://api.github.com/user/memberships/orgs +GET https://api.github.com/user/memberships/orgs?state={{state}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List teams that are assigned to an organization role ## List teams that are assigned to an organization role -GET https://api.github.com/orgs/{{org}}/organization-roles/{{role_id}}/teams +GET https://api.github.com/orgs/{{org}}/organization-roles/{{role_id}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List users that are assigned to an organization role ## List users that are assigned to an organization role -GET https://api.github.com/orgs/{{org}}/organization-roles/{{role_id}}/users +GET https://api.github.com/orgs/{{org}}/organization-roles/{{role_id}}/users?perPage={{perPage}}&page={{page}} Accept: application/json ### Get all organization roles for an organization @@ -284,37 +284,37 @@ Accept: application/json ### List outside collaborators for an organization ## List outside collaborators for an organization -GET https://api.github.com/orgs/{{org}}/outside_collaborators +GET https://api.github.com/orgs/{{org}}/outside_collaborators?filter={{filter}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories a fine-grained personal access token has access to ## List repositories a fine-grained personal access token has access to -GET https://api.github.com/orgs/{{org}}/personal-access-tokens/{{pat_id}}/repositories +GET https://api.github.com/orgs/{{org}}/personal-access-tokens/{{pat_id}}/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories requested to be accessed by a fine-grained personal access token ## List repositories requested to be accessed by a fine-grained personal access token -GET https://api.github.com/orgs/{{org}}/personal-access-token-requests/{{pat_request_id}}/repositories +GET https://api.github.com/orgs/{{org}}/personal-access-token-requests/{{pat_request_id}}/repositories?perPage={{perPage}}&page={{page}} Accept: application/json ### List requests to access organization resources with fine-grained personal access tokens ## List requests to access organization resources with fine-grained personal access tokens -GET https://api.github.com/orgs/{{org}}/personal-access-token-requests +GET https://api.github.com/orgs/{{org}}/personal-access-token-requests?perPage={{perPage}}&page={{page}}&sort={{sort}}&direction={{direction}}&owner={{owner}}&repository={{repository}}&permission={{permission}}&lastUsedBefore={{lastUsedBefore}}&lastUsedAfter={{lastUsedAfter}} Accept: application/json ### List fine-grained personal access tokens with access to organization resources ## List fine-grained personal access tokens with access to organization resources -GET https://api.github.com/orgs/{{org}}/personal-access-tokens +GET https://api.github.com/orgs/{{org}}/personal-access-tokens?perPage={{perPage}}&page={{page}}&sort={{sort}}&direction={{direction}}&owner={{owner}}&repository={{repository}}&permission={{permission}}&lastUsedBefore={{lastUsedBefore}}&lastUsedAfter={{lastUsedAfter}} Accept: application/json ### List pending organization invitations ## List pending organization invitations -GET https://api.github.com/orgs/{{org}}/invitations +GET https://api.github.com/orgs/{{org}}/invitations?perPage={{perPage}}&page={{page}}&role={{role}}&invitationSource={{invitationSource}} Accept: application/json ### List public organization members ## List public organization members -GET https://api.github.com/orgs/{{org}}/public_members +GET https://api.github.com/orgs/{{org}}/public_members?perPage={{perPage}}&page={{page}} Accept: application/json ### List security manager teams @@ -324,13 +324,13 @@ Accept: application/json ### List deliveries for an organization webhook ## List deliveries for an organization webhook -GET https://api.github.com/orgs/{{org}}/hooks/{{hook_id}}/deliveries +GET https://api.github.com/orgs/{{org}}/hooks/{{hook_id}}/deliveries?perPage={{perPage}}&cursor={{cursor}}&redelivery={{redelivery}} Accept: application/json Accept: application/scim+json ### List organization webhooks ## List organization webhooks -GET https://api.github.com/orgs/{{org}}/hooks +GET https://api.github.com/orgs/{{org}}/hooks?perPage={{perPage}}&page={{page}} Accept: application/json ### Update a custom organization role diff --git a/samples/client/github/jetbrains/http/client/Apis/PackagesApi.http b/samples/client/github/jetbrains/http/client/Apis/PackagesApi.http index 3721beb039c..dc12017e501 100644 --- a/samples/client/github/jetbrains/http/client/Apis/PackagesApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/PackagesApi.http @@ -32,12 +32,12 @@ Accept: application/json ### List package versions for a package owned by the authenticated user ## List package versions for a package owned by the authenticated user -GET https://api.github.com/user/packages/{{package_type}}/{{package_name}}/versions +GET https://api.github.com/user/packages/{{package_type}}/{{package_name}}/versions?page={{page}}&perPage={{perPage}}&state={{state}} Accept: application/json ### List package versions for a package owned by an organization ## List package versions for a package owned by an organization -GET https://api.github.com/orgs/{{org}}/packages/{{package_type}}/{{package_name}}/versions +GET https://api.github.com/orgs/{{org}}/packages/{{package_type}}/{{package_name}}/versions?page={{page}}&perPage={{perPage}}&state={{state}} Accept: application/json ### List package versions for a package owned by a user @@ -92,32 +92,32 @@ Accept: application/json ### List packages for the authenticated user's namespace ## List packages for the authenticated user's namespace -GET https://api.github.com/user/packages +GET https://api.github.com/user/packages?packageType={{packageType}}&visibility={{visibility}}&page={{page}}&perPage={{perPage}} Accept: application/json ### List packages for an organization ## List packages for an organization -GET https://api.github.com/orgs/{{org}}/packages +GET https://api.github.com/orgs/{{org}}/packages?packageType={{packageType}}&visibility={{visibility}}&page={{page}}&perPage={{perPage}} Accept: application/json ### List packages for a user ## List packages for a user -GET https://api.github.com/users/{{username}}/packages +GET https://api.github.com/users/{{username}}/packages?packageType={{packageType}}&visibility={{visibility}}&page={{page}}&perPage={{perPage}} Accept: application/json ### Restore a package for the authenticated user ## Restore a package for the authenticated user -POST https://api.github.com/user/packages/{{package_type}}/{{package_name}}/restore +POST https://api.github.com/user/packages/{{package_type}}/{{package_name}}/restore?token={{token}} Accept: application/json ### Restore a package for an organization ## Restore a package for an organization -POST https://api.github.com/orgs/{{org}}/packages/{{package_type}}/{{package_name}}/restore +POST https://api.github.com/orgs/{{org}}/packages/{{package_type}}/{{package_name}}/restore?token={{token}} Accept: application/json ### Restore a package for a user ## Restore a package for a user -POST https://api.github.com/users/{{username}}/packages/{{package_type}}/{{package_name}}/restore +POST https://api.github.com/users/{{username}}/packages/{{package_type}}/{{package_name}}/restore?token={{token}} Accept: application/json ### Restore a package version for the authenticated user diff --git a/samples/client/github/jetbrains/http/client/Apis/ProjectsApi.http b/samples/client/github/jetbrains/http/client/Apis/ProjectsApi.http index b7c6cd111ea..f734fe530dd 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ProjectsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ProjectsApi.http @@ -106,32 +106,32 @@ Accept: application/json ### List project cards ## List project cards -GET https://api.github.com/projects/columns/{{column_id}}/cards +GET https://api.github.com/projects/columns/{{column_id}}/cards?archivedState={{archivedState}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List project collaborators ## List project collaborators -GET https://api.github.com/projects/{{project_id}}/collaborators +GET https://api.github.com/projects/{{project_id}}/collaborators?affiliation={{affiliation}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List project columns ## List project columns -GET https://api.github.com/projects/{{project_id}}/columns +GET https://api.github.com/projects/{{project_id}}/columns?perPage={{perPage}}&page={{page}} Accept: application/json ### List organization projects ## List organization projects -GET https://api.github.com/orgs/{{org}}/projects +GET https://api.github.com/orgs/{{org}}/projects?state={{state}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repository projects ## List repository projects -GET https://api.github.com/repos/{{owner}}/{{repo}}/projects +GET https://api.github.com/repos/{{owner}}/{{repo}}/projects?state={{state}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List user projects ## List user projects -GET https://api.github.com/users/{{username}}/projects +GET https://api.github.com/users/{{username}}/projects?state={{state}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Move a project card diff --git a/samples/client/github/jetbrains/http/client/Apis/PullsApi.http b/samples/client/github/jetbrains/http/client/Apis/PullsApi.http index 34466eceb3d..0752af228e0 100644 --- a/samples/client/github/jetbrains/http/client/Apis/PullsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/PullsApi.http @@ -103,22 +103,22 @@ Accept: application/json ### List pull requests ## List pull requests -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls?state={{state}}&head={{head}}&base={{base}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List comments for a pull request review ## List comments for a pull request review -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/reviews/{{review_id}}/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/reviews/{{review_id}}/comments?perPage={{perPage}}&page={{page}} Accept: application/json ### List commits on a pull request ## List commits on a pull request -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/commits +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/commits?perPage={{perPage}}&page={{page}} Accept: application/json ### List pull requests files ## List pull requests files -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/files +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/files?perPage={{perPage}}&page={{page}} Accept: application/json ### Get all requested reviewers for a pull request @@ -128,17 +128,17 @@ Accept: application/json ### List review comments on a pull request ## List review comments on a pull request -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/comments?sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List review comments in a repository ## List review comments in a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/comments?sort={{sort}}&direction={{direction}}&since={{since}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reviews for a pull request ## List reviews for a pull request -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/reviews +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/{{pull_number}}/reviews?perPage={{perPage}}&page={{page}} Accept: application/json ### Merge a pull request diff --git a/samples/client/github/jetbrains/http/client/Apis/ReactionsApi.http b/samples/client/github/jetbrains/http/client/Apis/ReactionsApi.http index 05fbddca52a..385430c5d12 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ReactionsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ReactionsApi.http @@ -129,45 +129,45 @@ DELETE https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{dis ### List reactions for a commit comment ## List reactions for a commit comment -GET https://api.github.com/repos/{{owner}}/{{repo}}/comments/{{comment_id}}/reactions +GET https://api.github.com/repos/{{owner}}/{{repo}}/comments/{{comment_id}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for an issue ## List reactions for an issue -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/reactions +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/{{issue_number}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for an issue comment ## List reactions for an issue comment -GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/comments/{{comment_id}}/reactions +GET https://api.github.com/repos/{{owner}}/{{repo}}/issues/comments/{{comment_id}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a pull request review comment ## List reactions for a pull request review comment -GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/comments/{{comment_id}}/reactions +GET https://api.github.com/repos/{{owner}}/{{repo}}/pulls/comments/{{comment_id}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a release ## List reactions for a release -GET https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/reactions +GET https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a team discussion comment ## List reactions for a team discussion comment -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/comments/{{comment_number}}/reactions +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/comments/{{comment_number}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a team discussion comment (Legacy) ## List reactions for a team discussion comment (Legacy) -GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/comments/{{comment_number}}/reactions +GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/comments/{{comment_number}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a team discussion ## List reactions for a team discussion -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/reactions +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List reactions for a team discussion (Legacy) ## List reactions for a team discussion (Legacy) -GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/reactions +GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/reactions?content={{content}}&perPage={{perPage}}&page={{page}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/ReposApi.http b/samples/client/github/jetbrains/http/client/Apis/ReposApi.http index 958800c1d2a..eb3db68c7bc 100644 --- a/samples/client/github/jetbrains/http/client/Apis/ReposApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/ReposApi.http @@ -80,12 +80,12 @@ GET https://api.github.com/repos/{{owner}}/{{repo}}/vulnerability-alerts ### List CODEOWNERS errors ## List CODEOWNERS errors -GET https://api.github.com/repos/{{owner}}/{{repo}}/codeowners/errors +GET https://api.github.com/repos/{{owner}}/{{repo}}/codeowners/errors?ref={{ref}} Accept: application/json ### Compare two commits ## Compare two commits -GET https://api.github.com/repos/{{owner}}/{{repo}}/compare/{{basehead}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/compare/{{basehead}}?page={{page}}&perPage={{perPage}} Accept: application/json ### Create an autolink reference for a repository @@ -665,7 +665,7 @@ Accept: application/json ### List environments ## List environments -GET https://api.github.com/repos/{{owner}}/{{repo}}/environments +GET https://api.github.com/repos/{{owner}}/{{repo}}/environments?perPage={{perPage}}&page={{page}} Accept: application/json ### Get all status check contexts @@ -675,7 +675,7 @@ Accept: application/json ### Get all repository topics ## Get all repository topics -GET https://api.github.com/repos/{{owner}}/{{repo}}/topics +GET https://api.github.com/repos/{{owner}}/{{repo}}/topics?page={{page}}&perPage={{perPage}} Accept: application/json ### Get apps with access to the protected branch @@ -700,12 +700,12 @@ Accept: application/json ### Get rules for a branch ## Get rules for a branch -GET https://api.github.com/repos/{{owner}}/{{repo}}/rules/branches/{{branch}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/rules/branches/{{branch}}?perPage={{perPage}}&page={{page}} Accept: application/json ### Get repository clones ## Get repository clones -GET https://api.github.com/repos/{{owner}}/{{repo}}/traffic/clones +GET https://api.github.com/repos/{{owner}}/{{repo}}/traffic/clones?per={{per}} Accept: application/json ### Get the weekly commit activity @@ -720,12 +720,12 @@ Accept: application/json ### Get the combined status for a specific reference ## Get the combined status for a specific reference -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/status +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/status?perPage={{perPage}}&page={{page}} Accept: application/json ### Get a commit ## Get a commit -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}?page={{page}}&perPage={{perPage}} Accept: application/json ### Get the last year of commit activity @@ -750,7 +750,7 @@ Accept: application/json ### Get repository content ## Get repository content -GET https://api.github.com/repos/{{owner}}/{{repo}}/contents/{{path}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/contents/{{path}}?ref={{ref}} Accept: application/vnd.github.object Accept: application/json @@ -811,7 +811,7 @@ Accept: application/json ### List organization rule suites ## List organization rule suites -GET https://api.github.com/orgs/{{org}}/rulesets/rule-suites +GET https://api.github.com/orgs/{{org}}/rulesets/rule-suites?repositoryName={{repositoryName}}&timePeriod={{timePeriod}}&actorName={{actorName}}&ruleSuiteResult={{ruleSuiteResult}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Get an organization repository ruleset @@ -821,7 +821,7 @@ Accept: application/json ### Get all organization repository rulesets ## Get all organization repository rulesets -GET https://api.github.com/orgs/{{org}}/rulesets +GET https://api.github.com/orgs/{{org}}/rulesets?perPage={{perPage}}&page={{page}} Accept: application/json ### Get a GitHub Pages site @@ -861,12 +861,12 @@ Accept: application/json ### Get a repository README ## Get a repository README -GET https://api.github.com/repos/{{owner}}/{{repo}}/readme +GET https://api.github.com/repos/{{owner}}/{{repo}}/readme?ref={{ref}} Accept: application/json ### Get a repository README for a directory ## Get a repository README for a directory -GET https://api.github.com/repos/{{owner}}/{{repo}}/readme/{{dir}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/readme/{{dir}}?ref={{ref}} Accept: application/json ### Get a release @@ -891,17 +891,17 @@ Accept: application/json ### List repository rule suites ## List repository rule suites -GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets/rule-suites +GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets/rule-suites?ref={{ref}}&timePeriod={{timePeriod}}&actorName={{actorName}}&ruleSuiteResult={{ruleSuiteResult}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Get a repository ruleset ## Get a repository ruleset -GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets/{{ruleset_id}} +GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets/{{ruleset_id}}?includesParents={{includesParents}} Accept: application/json ### Get all repository rulesets ## Get all repository rulesets -GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets +GET https://api.github.com/repos/{{owner}}/{{repo}}/rulesets?perPage={{perPage}}&page={{page}}&includesParents={{includesParents}} Accept: application/json ### Get status checks protection @@ -931,7 +931,7 @@ Accept: application/json ### Get page views ## Get page views -GET https://api.github.com/repos/{{owner}}/{{repo}}/traffic/views +GET https://api.github.com/repos/{{owner}}/{{repo}}/traffic/views?per={{per}} Accept: application/json ### Get a repository webhook @@ -952,7 +952,7 @@ Accept: application/scim+json ### List repository activities ## List repository activities -GET https://api.github.com/repos/{{owner}}/{{repo}}/activity +GET https://api.github.com/repos/{{owner}}/{{repo}}/activity?direction={{direction}}&perPage={{perPage}}&before={{before}}&after={{after}}&ref={{ref}}&actor={{actor}}&timePeriod={{timePeriod}}&activityType={{activityType}} Accept: application/json ### Get all autolinks of a repository @@ -962,7 +962,7 @@ Accept: application/json ### List branches ## List branches -GET https://api.github.com/repos/{{owner}}/{{repo}}/branches +GET https://api.github.com/repos/{{owner}}/{{repo}}/branches?protected={{protected}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List branches for HEAD commit @@ -972,89 +972,89 @@ Accept: application/json ### List repository collaborators ## List repository collaborators -GET https://api.github.com/repos/{{owner}}/{{repo}}/collaborators +GET https://api.github.com/repos/{{owner}}/{{repo}}/collaborators?affiliation={{affiliation}}&permission={{permission}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List commit comments ## List commit comments -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{commit_sha}}/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{commit_sha}}/comments?perPage={{perPage}}&page={{page}} Accept: application/json ### List commit comments for a repository ## List commit comments for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/comments +GET https://api.github.com/repos/{{owner}}/{{repo}}/comments?perPage={{perPage}}&page={{page}} Accept: application/json ### List commit statuses for a reference ## List commit statuses for a reference -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/statuses +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{ref}}/statuses?perPage={{perPage}}&page={{page}} Accept: application/json ### List commits ## List commits -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits?sha={{sha}}&path={{path}}&author={{author}}&committer={{committer}}&since={{since}}&until={{until}}&perPage={{perPage}}&page={{page}} Accept: application/json Accept: application/scim+json ### List repository contributors ## List repository contributors -GET https://api.github.com/repos/{{owner}}/{{repo}}/contributors +GET https://api.github.com/repos/{{owner}}/{{repo}}/contributors?anon={{anon}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List custom deployment rule integrations available for an environment ## List custom deployment rule integrations available for an environment -GET https://api.github.com/repos/{{owner}}/{{repo}}/environments/{{environment_name}}/deployment_protection_rules/apps +GET https://api.github.com/repos/{{owner}}/{{repo}}/environments/{{environment_name}}/deployment_protection_rules/apps?page={{page}}&perPage={{perPage}} Accept: application/json ### List deploy keys ## List deploy keys -GET https://api.github.com/repos/{{owner}}/{{repo}}/keys +GET https://api.github.com/repos/{{owner}}/{{repo}}/keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List deployment branch policies ## List deployment branch policies -GET https://api.github.com/repos/{{owner}}/{{repo}}/environments/{{environment_name}}/deployment-branch-policies +GET https://api.github.com/repos/{{owner}}/{{repo}}/environments/{{environment_name}}/deployment-branch-policies?perPage={{perPage}}&page={{page}} Accept: application/json ### List deployment statuses ## List deployment statuses -GET https://api.github.com/repos/{{owner}}/{{repo}}/deployments/{{deployment_id}}/statuses +GET https://api.github.com/repos/{{owner}}/{{repo}}/deployments/{{deployment_id}}/statuses?perPage={{perPage}}&page={{page}} Accept: application/json ### List deployments ## List deployments -GET https://api.github.com/repos/{{owner}}/{{repo}}/deployments +GET https://api.github.com/repos/{{owner}}/{{repo}}/deployments?sha={{sha}}&ref={{ref}}&task={{task}}&environment={{environment}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories for the authenticated user ## List repositories for the authenticated user -GET https://api.github.com/user/repos +GET https://api.github.com/user/repos?visibility={{visibility}}&affiliation={{affiliation}}&type={{type}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}}&since={{since}}&before={{before}} Accept: application/json ### List organization repositories ## List organization repositories -GET https://api.github.com/orgs/{{org}}/repos +GET https://api.github.com/orgs/{{org}}/repos?type={{type}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List repositories for a user ## List repositories for a user -GET https://api.github.com/users/{{username}}/repos +GET https://api.github.com/users/{{username}}/repos?type={{type}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List forks ## List forks -GET https://api.github.com/repos/{{owner}}/{{repo}}/forks +GET https://api.github.com/repos/{{owner}}/{{repo}}/forks?sort={{sort}}&perPage={{perPage}}&page={{page}} Accept: application/json Accept: application/scim+json ### List repository invitations ## List repository invitations -GET https://api.github.com/repos/{{owner}}/{{repo}}/invitations +GET https://api.github.com/repos/{{owner}}/{{repo}}/invitations?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository invitations for the authenticated user ## List repository invitations for the authenticated user -GET https://api.github.com/user/repository_invitations +GET https://api.github.com/user/repository_invitations?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository languages @@ -1064,27 +1064,27 @@ Accept: application/json ### List GitHub Pages builds ## List GitHub Pages builds -GET https://api.github.com/repos/{{owner}}/{{repo}}/pages/builds +GET https://api.github.com/repos/{{owner}}/{{repo}}/pages/builds?perPage={{perPage}}&page={{page}} Accept: application/json ### List public repositories ## List public repositories -GET https://api.github.com/repositories +GET https://api.github.com/repositories?since={{since}} Accept: application/json ### List pull requests associated with a commit ## List pull requests associated with a commit -GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{commit_sha}}/pulls +GET https://api.github.com/repos/{{owner}}/{{repo}}/commits/{{commit_sha}}/pulls?perPage={{perPage}}&page={{page}} Accept: application/json ### List release assets ## List release assets -GET https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/assets +GET https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/assets?perPage={{perPage}}&page={{page}} Accept: application/json ### List releases ## List releases -GET https://api.github.com/repos/{{owner}}/{{repo}}/releases +GET https://api.github.com/repos/{{owner}}/{{repo}}/releases?perPage={{perPage}}&page={{page}} Accept: application/json ### List tag protection states for a repository @@ -1094,23 +1094,23 @@ Accept: application/json ### List repository tags ## List repository tags -GET https://api.github.com/repos/{{owner}}/{{repo}}/tags +GET https://api.github.com/repos/{{owner}}/{{repo}}/tags?perPage={{perPage}}&page={{page}} Accept: application/json ### List repository teams ## List repository teams -GET https://api.github.com/repos/{{owner}}/{{repo}}/teams +GET https://api.github.com/repos/{{owner}}/{{repo}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List deliveries for a repository webhook ## List deliveries for a repository webhook -GET https://api.github.com/repos/{{owner}}/{{repo}}/hooks/{{hook_id}}/deliveries +GET https://api.github.com/repos/{{owner}}/{{repo}}/hooks/{{hook_id}}/deliveries?perPage={{perPage}}&cursor={{cursor}}&redelivery={{redelivery}} Accept: application/json Accept: application/scim+json ### List repository webhooks ## List repository webhooks -GET https://api.github.com/repos/{{owner}}/{{repo}}/hooks +GET https://api.github.com/repos/{{owner}}/{{repo}}/hooks?perPage={{perPage}}&page={{page}} Accept: application/json ### Merge a branch @@ -1559,7 +1559,7 @@ Accept: application/json ### Upload a release asset ## Upload a release asset -POST https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/assets +POST https://api.github.com/repos/{{owner}}/{{repo}}/releases/{{release_id}}/assets?name={{name}}&label={{label}} Content-Type: application/octet-stream Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/SearchApi.http b/samples/client/github/jetbrains/http/client/Apis/SearchApi.http index ef3094ae09b..64cda158bf6 100644 --- a/samples/client/github/jetbrains/http/client/Apis/SearchApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/SearchApi.http @@ -2,35 +2,35 @@ ### Search code ## Search code -GET https://api.github.com/search/code +GET https://api.github.com/search/code?q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search commits ## Search commits -GET https://api.github.com/search/commits +GET https://api.github.com/search/commits?q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search issues and pull requests ## Search issues and pull requests -GET https://api.github.com/search/issues +GET https://api.github.com/search/issues?q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search labels ## Search labels -GET https://api.github.com/search/labels +GET https://api.github.com/search/labels?repositoryId={{repositoryId}}&q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search repositories ## Search repositories -GET https://api.github.com/search/repositories +GET https://api.github.com/search/repositories?q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search topics ## Search topics -GET https://api.github.com/search/topics +GET https://api.github.com/search/topics?q={{q}}&perPage={{perPage}}&page={{page}} Accept: application/json ### Search users ## Search users -GET https://api.github.com/search/users +GET https://api.github.com/search/users?q={{q}}&sort={{sort}}&order={{order}}&perPage={{perPage}}&page={{page}} Accept: application/json diff --git a/samples/client/github/jetbrains/http/client/Apis/SecretScanningApi.http b/samples/client/github/jetbrains/http/client/Apis/SecretScanningApi.http index cee20eb1ff4..c5e53d7561f 100644 --- a/samples/client/github/jetbrains/http/client/Apis/SecretScanningApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/SecretScanningApi.http @@ -7,22 +7,22 @@ Accept: application/json ### List secret scanning alerts for an enterprise ## List secret scanning alerts for an enterprise -GET https://api.github.com/enterprises/{{enterprise}}/secret-scanning/alerts +GET https://api.github.com/enterprises/{{enterprise}}/secret-scanning/alerts?state={{state}}&secretType={{secretType}}&resolution={{resolution}}&sort={{sort}}&direction={{direction}}&perPage={{perPage}}&before={{before}}&after={{after}}&validity={{validity}} Accept: application/json ### List secret scanning alerts for an organization ## List secret scanning alerts for an organization -GET https://api.github.com/orgs/{{org}}/secret-scanning/alerts +GET https://api.github.com/orgs/{{org}}/secret-scanning/alerts?state={{state}}&secretType={{secretType}}&resolution={{resolution}}&sort={{sort}}&direction={{direction}}&page={{page}}&perPage={{perPage}}&before={{before}}&after={{after}}&validity={{validity}} Accept: application/json ### List secret scanning alerts for a repository ## List secret scanning alerts for a repository -GET https://api.github.com/repos/{{owner}}/{{repo}}/secret-scanning/alerts +GET https://api.github.com/repos/{{owner}}/{{repo}}/secret-scanning/alerts?state={{state}}&secretType={{secretType}}&resolution={{resolution}}&sort={{sort}}&direction={{direction}}&page={{page}}&perPage={{perPage}}&before={{before}}&after={{after}}&validity={{validity}} Accept: application/json ### List locations for a secret scanning alert ## List locations for a secret scanning alert -GET https://api.github.com/repos/{{owner}}/{{repo}}/secret-scanning/alerts/{{alert_number}}/locations +GET https://api.github.com/repos/{{owner}}/{{repo}}/secret-scanning/alerts/{{alert_number}}/locations?page={{page}}&perPage={{perPage}} Accept: application/json ### Update a secret scanning alert diff --git a/samples/client/github/jetbrains/http/client/Apis/SecurityAdvisoriesApi.http b/samples/client/github/jetbrains/http/client/Apis/SecurityAdvisoriesApi.http index 524caffffae..549d5ce6c19 100644 --- a/samples/client/github/jetbrains/http/client/Apis/SecurityAdvisoriesApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/SecurityAdvisoriesApi.http @@ -78,18 +78,18 @@ Accept: application/json ### List global security advisories ## List global security advisories -GET https://api.github.com/advisories +GET https://api.github.com/advisories?ghsaId={{ghsaId}}&type={{type}}&cveId={{cveId}}&ecosystem={{ecosystem}}&severity={{severity}}&cwes={{cwes}}&isWithdrawn={{isWithdrawn}}&affects={{affects}}&published={{published}}&updated={{updated}}&modified={{modified}}&before={{before}}&after={{after}}&direction={{direction}}&perPage={{perPage}}&sort={{sort}} Accept: application/json ### List repository security advisories for an organization ## List repository security advisories for an organization -GET https://api.github.com/orgs/{{org}}/security-advisories +GET https://api.github.com/orgs/{{org}}/security-advisories?direction={{direction}}&sort={{sort}}&before={{before}}&after={{after}}&perPage={{perPage}}&state={{state}} Accept: application/json Accept: application/scim+json ### List repository security advisories ## List repository security advisories -GET https://api.github.com/repos/{{owner}}/{{repo}}/security-advisories +GET https://api.github.com/repos/{{owner}}/{{repo}}/security-advisories?direction={{direction}}&sort={{sort}}&before={{before}}&after={{after}}&perPage={{perPage}}&state={{state}} Accept: application/json Accept: application/scim+json diff --git a/samples/client/github/jetbrains/http/client/Apis/TeamsApi.http b/samples/client/github/jetbrains/http/client/Apis/TeamsApi.http index fe9b1d98add..2bcc6f1296f 100644 --- a/samples/client/github/jetbrains/http/client/Apis/TeamsApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/TeamsApi.http @@ -222,82 +222,82 @@ Accept: application/json ### List teams ## List teams -GET https://api.github.com/orgs/{{org}}/teams +GET https://api.github.com/orgs/{{org}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List child teams ## List child teams -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/teams +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List child teams (Legacy) ## List child teams (Legacy) -GET https://api.github.com/teams/{{team_id}}/teams +GET https://api.github.com/teams/{{team_id}}/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List discussion comments ## List discussion comments -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/comments +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions/{{discussion_number}}/comments?direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List discussion comments (Legacy) ## List discussion comments (Legacy) -GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/comments +GET https://api.github.com/teams/{{team_id}}/discussions/{{discussion_number}}/comments?direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List discussions ## List discussions -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/discussions?direction={{direction}}&perPage={{perPage}}&page={{page}}&pinned={{pinned}} Accept: application/json ### List discussions (Legacy) ## List discussions (Legacy) -GET https://api.github.com/teams/{{team_id}}/discussions +GET https://api.github.com/teams/{{team_id}}/discussions?direction={{direction}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List teams for the authenticated user ## List teams for the authenticated user -GET https://api.github.com/user/teams +GET https://api.github.com/user/teams?perPage={{perPage}}&page={{page}} Accept: application/json ### List team members ## List team members -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/members +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/members?role={{role}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List team members (Legacy) ## List team members (Legacy) -GET https://api.github.com/teams/{{team_id}}/members +GET https://api.github.com/teams/{{team_id}}/members?role={{role}}&perPage={{perPage}}&page={{page}} Accept: application/json ### List pending team invitations ## List pending team invitations -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/invitations +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/invitations?perPage={{perPage}}&page={{page}} Accept: application/json ### List pending team invitations (Legacy) ## List pending team invitations (Legacy) -GET https://api.github.com/teams/{{team_id}}/invitations +GET https://api.github.com/teams/{{team_id}}/invitations?perPage={{perPage}}&page={{page}} Accept: application/json ### List team projects ## List team projects -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/projects +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/projects?perPage={{perPage}}&page={{page}} Accept: application/json ### List team projects (Legacy) ## List team projects (Legacy) -GET https://api.github.com/teams/{{team_id}}/projects +GET https://api.github.com/teams/{{team_id}}/projects?perPage={{perPage}}&page={{page}} Accept: application/json ### List team repositories ## List team repositories -GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/repos +GET https://api.github.com/orgs/{{org}}/teams/{{team_slug}}/repos?perPage={{perPage}}&page={{page}} Accept: application/json ### List team repositories (Legacy) ## List team repositories (Legacy) -GET https://api.github.com/teams/{{team_id}}/repos +GET https://api.github.com/teams/{{team_id}}/repos?perPage={{perPage}}&page={{page}} Accept: application/json ### Remove team member (Legacy) diff --git a/samples/client/github/jetbrains/http/client/Apis/UsersApi.http b/samples/client/github/jetbrains/http/client/Apis/UsersApi.http index 99f25ec325b..1c88c359606 100644 --- a/samples/client/github/jetbrains/http/client/Apis/UsersApi.http +++ b/samples/client/github/jetbrains/http/client/Apis/UsersApi.http @@ -131,7 +131,7 @@ Accept: application/json ### Get contextual information for a user ## Get contextual information for a user -GET https://api.github.com/users/{{username}}/hovercard +GET https://api.github.com/users/{{username}}/hovercard?subjectType={{subjectType}}&subjectId={{subjectId}} Accept: application/json ### Get a GPG key for the authenticated user @@ -151,82 +151,82 @@ Accept: application/json ### List users ## List users -GET https://api.github.com/users +GET https://api.github.com/users?since={{since}}&perPage={{perPage}} Accept: application/json ### List users blocked by the authenticated user ## List users blocked by the authenticated user -GET https://api.github.com/user/blocks +GET https://api.github.com/user/blocks?perPage={{perPage}}&page={{page}} Accept: application/json ### List email addresses for the authenticated user ## List email addresses for the authenticated user -GET https://api.github.com/user/emails +GET https://api.github.com/user/emails?perPage={{perPage}}&page={{page}} Accept: application/json ### List the people the authenticated user follows ## List the people the authenticated user follows -GET https://api.github.com/user/following +GET https://api.github.com/user/following?perPage={{perPage}}&page={{page}} Accept: application/json ### List followers of the authenticated user ## List followers of the authenticated user -GET https://api.github.com/user/followers +GET https://api.github.com/user/followers?perPage={{perPage}}&page={{page}} Accept: application/json ### List followers of a user ## List followers of a user -GET https://api.github.com/users/{{username}}/followers +GET https://api.github.com/users/{{username}}/followers?perPage={{perPage}}&page={{page}} Accept: application/json ### List the people a user follows ## List the people a user follows -GET https://api.github.com/users/{{username}}/following +GET https://api.github.com/users/{{username}}/following?perPage={{perPage}}&page={{page}} Accept: application/json ### List GPG keys for the authenticated user ## List GPG keys for the authenticated user -GET https://api.github.com/user/gpg_keys +GET https://api.github.com/user/gpg_keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List GPG keys for a user ## List GPG keys for a user -GET https://api.github.com/users/{{username}}/gpg_keys +GET https://api.github.com/users/{{username}}/gpg_keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List public email addresses for the authenticated user ## List public email addresses for the authenticated user -GET https://api.github.com/user/public_emails +GET https://api.github.com/user/public_emails?perPage={{perPage}}&page={{page}} Accept: application/json ### List public keys for a user ## List public keys for a user -GET https://api.github.com/users/{{username}}/keys +GET https://api.github.com/users/{{username}}/keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List public SSH keys for the authenticated user ## List public SSH keys for the authenticated user -GET https://api.github.com/user/keys +GET https://api.github.com/user/keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List social accounts for the authenticated user ## List social accounts for the authenticated user -GET https://api.github.com/user/social_accounts +GET https://api.github.com/user/social_accounts?perPage={{perPage}}&page={{page}} Accept: application/json ### List social accounts for a user ## List social accounts for a user -GET https://api.github.com/users/{{username}}/social_accounts +GET https://api.github.com/users/{{username}}/social_accounts?perPage={{perPage}}&page={{page}} Accept: application/json ### List SSH signing keys for the authenticated user ## List SSH signing keys for the authenticated user -GET https://api.github.com/user/ssh_signing_keys +GET https://api.github.com/user/ssh_signing_keys?perPage={{perPage}}&page={{page}} Accept: application/json ### List SSH signing keys for a user ## List SSH signing keys for a user -GET https://api.github.com/users/{{username}}/ssh_signing_keys +GET https://api.github.com/users/{{username}}/ssh_signing_keys?perPage={{perPage}}&page={{page}} Accept: application/json ### Set primary email visibility for the authenticated user diff --git a/samples/client/github/jetbrains/http/client/Apis/http-client.template.env.json b/samples/client/github/jetbrains/http/client/Apis/http-client.template.env.json new file mode 100644 index 00000000000..bcd91c0ba8d --- /dev/null +++ b/samples/client/github/jetbrains/http/client/Apis/http-client.template.env.json @@ -0,0 +1,198 @@ +{ + "dev": { + "review_id" : "", + "discussion_number" : "", + "actorName" : "", + "team_id" : "", + "artifact_id" : "", + "checkName" : "", + "invitationSource" : "", + "cwes" : "", + "branch" : "", + "resolution" : "", + "subjectId" : "", + "path" : "", + "secret_name" : "", + "status_id" : "", + "protected" : "", + "state" : "", + "repositoryQuery" : "", + "tree_sha" : "", + "labels" : "", + "perPage" : "", + "build_id" : "", + "lastUsedBefore" : "", + "assignee" : "", + "orgs" : "", + "runner_id" : "", + "role" : "", + "gist_id" : "", + "custom_property_name" : "", + "devcontainerPath" : "", + "ruleSuiteResult" : "", + "milestone_number" : "", + "reaction_id" : "", + "after" : "", + "key" : "", + "run_id" : "", + "actor" : "", + "q" : "", + "account_id" : "", + "event_id" : "", + "s" : "", + "isWithdrawn" : "", + "clientIp" : "", + "target_user" : "", + "validity" : "", + "featured" : "", + "language" : "", + "dir" : "", + "packageType" : "", + "subjectType" : "", + "client_id" : "", + "ref" : "", + "outdated" : "", + "committer" : "", + "codespace_name" : "", + "project_id" : "", + "affiliation" : "", + "appId" : "", + "exclude" : "", + "autolink_id" : "", + "pat_id" : "", + "last" : "", + "visibility" : "", + "key_id" : "", + "cveId" : "", + "export_id" : "", + "sha" : "", + "pulls" : "", + "column_id" : "", + "name" : "", + "page" : "", + "updated" : "", + "cursor" : "", + "pinned" : "", + "delivery_id" : "", + "team_slug" : "", + "content" : "", + "cache_id" : "", + "attempt_number" : "", + "scope" : "", + "repo_name" : "", + "environment_name" : "", + "owner" : "", + "severity" : "", + "anon" : "", + "comment_number" : "", + "org" : "", + "archivedState" : "", + "affects" : "", + "permission" : "", + "label" : "", + "confirmDelete" : "", + "ghsa_id" : "", + "environment" : "", + "owned" : "", + "hook_id" : "", + "package_name" : "", + "location" : "", + "username" : "", + "base" : "", + "ecosystem" : "", + "installation_id" : "", + "asset_id" : "", + "repository" : "", + "type" : "", + "commit_sha" : "", + "issue_number" : "", + "toolGuid" : "", + "participating" : "", + "per" : "", + "ssh_signing_key_id" : "", + "toolName" : "", + "order" : "", + "rule_suite_id" : "", + "collab" : "", + "tag_sha" : "", + "pages_deployment_id" : "", + "status" : "", + "invitation_id" : "", + "file_sha" : "", + "enterprise" : "", + "repo" : "", + "recursive" : "", + "template_repo" : "", + "gpg_key_id" : "", + "archive_format" : "", + "event" : "", + "basehead" : "", + "protection_rule_id" : "", + "creator" : "", + "comment_id" : "", + "repositoryName" : "", + "analysis_id" : "", + "token" : "", + "filter" : "", + "secretType" : "", + "package_version_id" : "", + "checkSuiteId" : "", + "plan_id" : "", + "first" : "", + "workflow_id" : "", + "enablement" : "", + "alert_number" : "", + "before" : "", + "package_type" : "", + "includesParents" : "", + "lastUsedAfter" : "", + "thread_id" : "", + "app_slug" : "", + "security_product" : "", + "role_id" : "", + "sarifId" : "", + "modified" : "", + "repository_id" : "", + "tag" : "", + "excludePullRequests" : "", + "all" : "", + "check_run_id" : "", + "branch_policy_id" : "", + "classroom_id" : "", + "package" : "", + "check_suite_id" : "", + "created" : "", + "pat_request_id" : "", + "author" : "", + "sort" : "", + "published" : "", + "card_id" : "", + "license" : "", + "task" : "", + "migration_id" : "", + "template_owner" : "", + "timePeriod" : "", + "author_id" : "", + "since" : "", + "release_id" : "", + "code" : "", + "pull_number" : "", + "ruleset_id" : "", + "tag_protection_id" : "", + "headSha" : "", + "head" : "", + "ghsaId" : "", + "deployment_id" : "", + "mentioned" : "", + "direction" : "", + "manifest" : "", + "redelivery" : "", + "assignment_id" : "", + "milestone" : "", + "job_id" : "", + "repositoryId" : "", + "sarif_id" : "", + "until" : "", + "activityType" : "" + } +} \ No newline at end of file diff --git a/samples/client/jetbrains/adyen/adyen/http/client/.openapi-generator/FILES b/samples/client/jetbrains/adyen/adyen/http/client/.openapi-generator/FILES index ae4035d9e7a..2123a76ec53 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/.openapi-generator/FILES +++ b/samples/client/jetbrains/adyen/adyen/http/client/.openapi-generator/FILES @@ -6,4 +6,5 @@ Apis/PaymentLinksApi.http Apis/PaymentsApi.http Apis/RecurringApi.http Apis/UtilityApi.http +Apis/http-client.template.env.json README.md diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/ClassicCheckoutSDKApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/ClassicCheckoutSDKApi.http index 5bab18fd1dc..ffb64cea0cc 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/ClassicCheckoutSDKApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/ClassicCheckoutSDKApi.http @@ -5,6 +5,7 @@ POST https://checkout-test.adyen.com/v71/paymentSession Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -29,6 +30,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentSession Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -55,6 +57,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentSession Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -79,6 +82,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentSession Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -117,6 +121,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentSession Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -142,6 +147,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/result Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/DonationsApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/DonationsApi.http index a453a5507e1..c5380ae0dca 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/DonationsApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/DonationsApi.http @@ -5,6 +5,7 @@ POST https://checkout-test.adyen.com/v71/donations Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -30,6 +31,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/donations Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/ModificationsApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/ModificationsApi.http index 3086a791ba7..5c9cd88b6d4 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/ModificationsApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/ModificationsApi.http @@ -5,6 +5,7 @@ POST https://checkout-test.adyen.com/v71/cancels Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -20,6 +21,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/{{paymentPspReference}}/amountUpdates Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -38,6 +40,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/{{paymentPspReference}}/cancels Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -52,6 +55,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/{{paymentPspReference}}/captures Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -75,6 +79,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/{{paymentPspReference}}/refunds Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -93,6 +98,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/{{paymentPspReference}}/reversals Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/OrdersApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/OrdersApi.http index fbfac9e285e..d41c3d3e869 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/OrdersApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/OrdersApi.http @@ -5,6 +5,7 @@ POST https://checkout-test.adyen.com/v71/orders Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -23,6 +24,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/orders/cancel Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -40,6 +42,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentMethods/balance Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -61,6 +64,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentMethods/balance Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentLinksApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentLinksApi.http index b6e39ff44d1..eaf49571295 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentLinksApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentLinksApi.http @@ -25,6 +25,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentLinks Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentsApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentsApi.http index 1da649be2c5..3677502bd60 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentsApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/PaymentsApi.http @@ -2,7 +2,7 @@ ### Get the result of a payment session ## Get the result of a payment session -GET https://checkout-test.adyen.com/v71/sessions/{{sessionId}} +GET https://checkout-test.adyen.com/v71/sessions/{{sessionId}}?sessionResult={{sessionResult}} Accept: application/json Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -12,6 +12,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/cardDetails Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -25,6 +26,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/cardDetails Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -40,6 +42,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentMethods Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -52,6 +55,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentMethods Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -70,6 +74,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/paymentMethods Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -89,6 +94,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -111,6 +117,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -164,6 +171,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -200,6 +208,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -226,6 +235,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -251,6 +261,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -280,6 +291,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -302,6 +314,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -324,6 +337,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -369,6 +383,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -395,6 +410,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -420,6 +436,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -451,6 +468,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -477,6 +495,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -507,6 +526,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/details Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -521,6 +541,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/payments/details Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -536,6 +557,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/sessions Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -555,6 +577,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/sessions Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -599,6 +622,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/sessions Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -622,6 +646,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/sessions Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/RecurringApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/RecurringApi.http index 72150a2723f..37354c2e97f 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/RecurringApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/RecurringApi.http @@ -2,13 +2,13 @@ ### Delete a token for stored payment details ## Delete a token for stored payment details -DELETE https://checkout-test.adyen.com/v71/storedPaymentMethods/{{storedPaymentMethodId}} +DELETE https://checkout-test.adyen.com/v71/storedPaymentMethods/{{storedPaymentMethodId}}?shopperReference={{shopperReference}}&merchantAccount={{merchantAccount}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} ### Get tokens for stored payment details ## Get tokens for stored payment details -GET https://checkout-test.adyen.com/v71/storedPaymentMethods +GET https://checkout-test.adyen.com/v71/storedPaymentMethods?shopperReference={{shopperReference}}&merchantAccount={{merchantAccount}} Accept: application/json Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/UtilityApi.http b/samples/client/jetbrains/adyen/adyen/http/client/Apis/UtilityApi.http index 66189fa7d99..0be9bddd2df 100644 --- a/samples/client/jetbrains/adyen/adyen/http/client/Apis/UtilityApi.http +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/UtilityApi.http @@ -5,6 +5,7 @@ POST https://checkout-test.adyen.com/v71/applePay/sessions Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} @@ -20,6 +21,7 @@ X-API-Key: {{apiKey}} POST https://checkout-test.adyen.com/v71/originKeys Content-Type: application/json Accept: application/json +Idempotency-Key: {{idempotencyKey}} Authorization: Basic: {{username-password}} X-API-Key: {{apiKey}} diff --git a/samples/client/jetbrains/adyen/adyen/http/client/Apis/http-client.template.env.json b/samples/client/jetbrains/adyen/adyen/http/client/Apis/http-client.template.env.json new file mode 100644 index 00000000000..ee1f0b62566 --- /dev/null +++ b/samples/client/jetbrains/adyen/adyen/http/client/Apis/http-client.template.env.json @@ -0,0 +1,12 @@ +{ + "dev": { + "linkId" : "", + "sessionResult" : "", + "merchantAccount" : "", + "paymentPspReference" : "", + "Idempotency-Key" : "", + "storedPaymentMethodId" : "", + "sessionId" : "", + "shopperReference" : "" + } +} \ No newline at end of file diff --git a/samples/client/jetbrains/adyen/checkoutbasic/http/client/.openapi-generator/FILES b/samples/client/jetbrains/adyen/checkoutbasic/http/client/.openapi-generator/FILES index bfbdad8e476..d3eef9dea9b 100644 --- a/samples/client/jetbrains/adyen/checkoutbasic/http/client/.openapi-generator/FILES +++ b/samples/client/jetbrains/adyen/checkoutbasic/http/client/.openapi-generator/FILES @@ -1,2 +1,3 @@ Apis/PaymentsApi.http +Apis/http-client.template.env.json README.md diff --git a/samples/client/jetbrains/adyen/checkoutbasic/http/client/Apis/http-client.template.env.json b/samples/client/jetbrains/adyen/checkoutbasic/http/client/Apis/http-client.template.env.json new file mode 100644 index 00000000000..68ea6ffdda6 --- /dev/null +++ b/samples/client/jetbrains/adyen/checkoutbasic/http/client/Apis/http-client.template.env.json @@ -0,0 +1,5 @@ +{ + "dev": { + "id" : "" + } +} \ No newline at end of file diff --git a/samples/client/opendota/jetbrains/http/client/.openapi-generator/FILES b/samples/client/opendota/jetbrains/http/client/.openapi-generator/FILES index 509584327d3..883340f1188 100644 --- a/samples/client/opendota/jetbrains/http/client/.openapi-generator/FILES +++ b/samples/client/opendota/jetbrains/http/client/.openapi-generator/FILES @@ -25,4 +25,5 @@ Apis/SchemaApi.http Apis/SearchApi.http Apis/StatusApi.http Apis/TeamsApi.http +Apis/http-client.template.env.json README.md diff --git a/samples/client/opendota/jetbrains/http/client/Apis/BenchmarksApi.http b/samples/client/opendota/jetbrains/http/client/Apis/BenchmarksApi.http index 51198b29006..3577ffa2a2d 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/BenchmarksApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/BenchmarksApi.http @@ -2,5 +2,5 @@ ### GET /benchmarks ## GET /benchmarks -GET https://api.opendota.com/api/benchmarks +GET https://api.opendota.com/api/benchmarks?heroId={{heroId}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/ExplorerApi.http b/samples/client/opendota/jetbrains/http/client/Apis/ExplorerApi.http index c8cd683cfb6..78232e5551f 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/ExplorerApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/ExplorerApi.http @@ -2,5 +2,5 @@ ### GET /explorer ## GET /explorer -GET https://api.opendota.com/api/explorer +GET https://api.opendota.com/api/explorer?sql={{sql}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/FindMatchesApi.http b/samples/client/opendota/jetbrains/http/client/Apis/FindMatchesApi.http index 98dff2dc01b..2cd775ae90f 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/FindMatchesApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/FindMatchesApi.http @@ -2,5 +2,5 @@ ### GET / ## GET / -GET https://api.opendota.com/api/findMatches +GET https://api.opendota.com/api/findMatches?teamA={{teamA}}&teamB={{teamB}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/ParsedMatchesApi.http b/samples/client/opendota/jetbrains/http/client/Apis/ParsedMatchesApi.http index d34b5820e39..76445b45baa 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/ParsedMatchesApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/ParsedMatchesApi.http @@ -2,5 +2,5 @@ ### GET /parsedMatches ## GET /parsedMatches -GET https://api.opendota.com/api/parsedMatches +GET https://api.opendota.com/api/parsedMatches?lessThanMatchId={{lessThanMatchId}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/PlayersApi.http b/samples/client/opendota/jetbrains/http/client/Apis/PlayersApi.http index 3d01db4f8eb..82b119eda31 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/PlayersApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/PlayersApi.http @@ -2,7 +2,7 @@ ### GET /players/{account_id}/counts ## GET /players/{account_id}/counts -GET https://api.opendota.com/api/players/{{account_id}}/counts +GET https://api.opendota.com/api/players/{{account_id}}/counts?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id} @@ -12,27 +12,27 @@ Accept: application/json; charset=utf-8 ### GET /players/{account_id}/heroes ## GET /players/{account_id}/heroes -GET https://api.opendota.com/api/players/{{account_id}}/heroes +GET https://api.opendota.com/api/players/{{account_id}}/heroes?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/histograms ## GET /players/{account_id}/histograms -GET https://api.opendota.com/api/players/{{account_id}}/histograms/{{field}} +GET https://api.opendota.com/api/players/{{account_id}}/histograms/{{field}}?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/matches ## GET /players/{account_id}/matches -GET https://api.opendota.com/api/players/{{account_id}}/matches +GET https://api.opendota.com/api/players/{{account_id}}/matches?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}}&project={{project}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/peers ## GET /players/{account_id}/peers -GET https://api.opendota.com/api/players/{{account_id}}/peers +GET https://api.opendota.com/api/players/{{account_id}}/peers?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/pros ## GET /players/{account_id}/pros -GET https://api.opendota.com/api/players/{{account_id}}/pros +GET https://api.opendota.com/api/players/{{account_id}}/pros?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/rankings @@ -57,20 +57,20 @@ Accept: application/json; charset=utf-8 ### GET /players/{account_id}/totals ## GET /players/{account_id}/totals -GET https://api.opendota.com/api/players/{{account_id}}/totals +GET https://api.opendota.com/api/players/{{account_id}}/totals?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/wardmap ## GET /players/{account_id}/wardmap -GET https://api.opendota.com/api/players/{{account_id}}/wardmap +GET https://api.opendota.com/api/players/{{account_id}}/wardmap?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/wl ## GET /players/{account_id}/wl -GET https://api.opendota.com/api/players/{{account_id}}/wl +GET https://api.opendota.com/api/players/{{account_id}}/wl?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 ### GET /players/{account_id}/wordcloud ## GET /players/{account_id}/wordcloud -GET https://api.opendota.com/api/players/{{account_id}}/wordcloud +GET https://api.opendota.com/api/players/{{account_id}}/wordcloud?limit={{limit}}&offset={{offset}}&win={{win}}&patch={{patch}}&gameMode={{gameMode}}&lobbyType={{lobbyType}}®ion={{region}}&date={{date}}&laneRole={{laneRole}}&heroId={{heroId}}&isRadiant={{isRadiant}}&includedAccountId={{includedAccountId}}&excludedAccountId={{excludedAccountId}}&withHeroId={{withHeroId}}&againstHeroId={{againstHeroId}}&significant={{significant}}&having={{having}}&sort={{sort}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/ProMatchesApi.http b/samples/client/opendota/jetbrains/http/client/Apis/ProMatchesApi.http index 56f6646bcef..00a5aac6c91 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/ProMatchesApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/ProMatchesApi.http @@ -2,5 +2,5 @@ ### GET /proMatches ## GET /proMatches -GET https://api.opendota.com/api/proMatches +GET https://api.opendota.com/api/proMatches?lessThanMatchId={{lessThanMatchId}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/PublicMatchesApi.http b/samples/client/opendota/jetbrains/http/client/Apis/PublicMatchesApi.http index d4ab569a98d..51d205860f4 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/PublicMatchesApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/PublicMatchesApi.http @@ -2,5 +2,5 @@ ### GET /publicMatches ## GET /publicMatches -GET https://api.opendota.com/api/publicMatches +GET https://api.opendota.com/api/publicMatches?mmrAscending={{mmrAscending}}&mmrDescending={{mmrDescending}}&lessThanMatchId={{lessThanMatchId}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/RankingsApi.http b/samples/client/opendota/jetbrains/http/client/Apis/RankingsApi.http index 4d764544388..4453a59a523 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/RankingsApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/RankingsApi.http @@ -2,5 +2,5 @@ ### GET /rankings ## GET /rankings -GET https://api.opendota.com/api/rankings +GET https://api.opendota.com/api/rankings?heroId={{heroId}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/ScenariosApi.http b/samples/client/opendota/jetbrains/http/client/Apis/ScenariosApi.http index 801cf08d3bd..300d0071628 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/ScenariosApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/ScenariosApi.http @@ -2,15 +2,15 @@ ### GET /scenarios/itemTimings ## GET /scenarios/itemTimings -GET https://api.opendota.com/api/scenarios/itemTimings +GET https://api.opendota.com/api/scenarios/itemTimings?item={{item}}&heroId={{heroId}} Accept: application/json; charset=utf-8 ### GET /scenarios/laneRoles ## GET /scenarios/laneRoles -GET https://api.opendota.com/api/scenarios/laneRoles +GET https://api.opendota.com/api/scenarios/laneRoles?laneRole={{laneRole}}&heroId={{heroId}} Accept: application/json; charset=utf-8 ### GET /scenarios/misc ## GET /scenarios/misc -GET https://api.opendota.com/api/scenarios/misc +GET https://api.opendota.com/api/scenarios/misc?scenario={{scenario}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/SearchApi.http b/samples/client/opendota/jetbrains/http/client/Apis/SearchApi.http index 066924a4503..ec49128db51 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/SearchApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/SearchApi.http @@ -2,5 +2,5 @@ ### GET /search ## GET /search -GET https://api.opendota.com/api/search +GET https://api.opendota.com/api/search?q={{q}} Accept: application/json; charset=utf-8 diff --git a/samples/client/opendota/jetbrains/http/client/Apis/TeamsApi.http b/samples/client/opendota/jetbrains/http/client/Apis/TeamsApi.http index 7200bf64b80..9c7245f7a0a 100644 --- a/samples/client/opendota/jetbrains/http/client/Apis/TeamsApi.http +++ b/samples/client/opendota/jetbrains/http/client/Apis/TeamsApi.http @@ -2,7 +2,7 @@ ### GET /teams ## GET /teams -GET https://api.opendota.com/api/teams +GET https://api.opendota.com/api/teams?page={{page}} Accept: application/json; charset=utf-8 ### GET /teams/{team_id} diff --git a/samples/client/opendota/jetbrains/http/client/Apis/http-client.template.env.json b/samples/client/opendota/jetbrains/http/client/Apis/http-client.template.env.json new file mode 100644 index 00000000000..38a3878f209 --- /dev/null +++ b/samples/client/opendota/jetbrains/http/client/Apis/http-client.template.env.json @@ -0,0 +1,41 @@ +{ + "dev": { + "lobbyType" : "", + "date" : "", + "heroId" : "", + "project" : "", + "team_id" : "", + "includedAccountId" : "", + "sql" : "", + "patch" : "", + "scenario" : "", + "teamA" : "", + "teamB" : "", + "limit" : "", + "isRadiant" : "", + "hero_id" : "", + "win" : "", + "item" : "", + "having" : "", + "offset" : "", + "laneRole" : "", + "resource" : "", + "match_id" : "", + "lessThanMatchId" : "", + "mmrDescending" : "", + "significant" : "", + "sort" : "", + "jobId" : "", + "q" : "", + "excludedAccountId" : "", + "account_id" : "", + "field" : "", + "mmrAscending" : "", + "page" : "", + "gameMode" : "", + "region" : "", + "withHeroId" : "", + "league_id" : "", + "againstHeroId" : "" + } +} \ No newline at end of file diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs index a5389ded4f2..789c14ac264 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,12 +22,15 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -68,10 +71,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -116,7 +119,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -127,7 +130,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -149,13 +152,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -202,7 +205,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } ///

    @@ -259,14 +262,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -374,7 +377,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -384,6 +387,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -428,57 +438,45 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -536,90 +534,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + Func> getResponse = (client) => { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -632,7 +620,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -647,7 +635,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -662,7 +650,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -677,7 +665,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -692,7 +680,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -707,7 +695,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -722,7 +710,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs index faccc14b6b4..a9568625dbc 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs index c30d95968d9..5c75594cab7 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs index 05fd815de56..22c4d970da1 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs index c7872d5b83e..f3922222c8d 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 7a054ad52eb..392f159a7e8 100644 --- a/samples/client/others/go/allof_multiple_ref_and_discriminator/client.go +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/client.go @@ -490,18 +490,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { 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 index 5bcb2298242..0a765d499c4 100644 --- a/samples/client/others/go/allof_multiple_ref_and_discriminator/utils.go +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package openapi import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/client/others/go/oneof-anyof-required/client.go b/samples/client/others/go/oneof-anyof-required/client.go index 7a054ad52eb..392f159a7e8 100644 --- a/samples/client/others/go/oneof-anyof-required/client.go +++ b/samples/client/others/go/oneof-anyof-required/client.go @@ -490,18 +490,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/client/others/go/oneof-anyof-required/model_object.go b/samples/client/others/go/oneof-anyof-required/model_object.go index 9d47261ecc1..f0a03353b5c 100644 --- a/samples/client/others/go/oneof-anyof-required/model_object.go +++ b/samples/client/others/go/oneof-anyof-required/model_object.go @@ -12,6 +12,7 @@ package openapi import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -47,7 +48,11 @@ func (dst *Object) UnmarshalJSON(data []byte) error { if string(jsonNestedObject1) == "{}" { // empty struct dst.NestedObject1 = nil } else { - match++ + if err = validator.Validate(dst.NestedObject1); err != nil { + dst.NestedObject1 = nil + } else { + match++ + } } } else { dst.NestedObject1 = nil @@ -60,7 +65,11 @@ func (dst *Object) UnmarshalJSON(data []byte) error { if string(jsonNestedObject2) == "{}" { // empty struct dst.NestedObject2 = nil } else { - match++ + if err = validator.Validate(dst.NestedObject2); err != nil { + dst.NestedObject2 = nil + } else { + match++ + } } } else { dst.NestedObject2 = nil diff --git a/samples/client/others/go/oneof-anyof-required/utils.go b/samples/client/others/go/oneof-anyof-required/utils.go index 5bcb2298242..0a765d499c4 100644 --- a/samples/client/others/go/oneof-anyof-required/utils.go +++ b/samples/client/others/go/oneof-anyof-required/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package openapi import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle b/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle index beeebe76b2a..2b41fd98da2 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle +++ b/samples/client/others/java/jersey2-oneOf-Mixed/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/build.sbt b/samples/client/others/java/jersey2-oneOf-Mixed/build.sbt index 6ccdf173c99..ce81568d784 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/build.sbt +++ b/samples/client/others/java/jersey2-oneOf-Mixed/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml b/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml index 02adce12170..cb6629fa41a 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml +++ b/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml @@ -329,8 +329,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java index e94f72a489c..2c8f6eabe80 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 04e2753379d..c2525747e20 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/Example.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/Example.java index a88133e1efb..534bf46f19d 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/Example.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/model/Example.java @@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Example() { super("oneOf", Boolean.FALSE); @@ -160,7 +160,7 @@ public class Example extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Example.schemas; } diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle b/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle index beeebe76b2a..2b41fd98da2 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle +++ b/samples/client/others/java/jersey2-oneOf-duplicates/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/build.sbt b/samples/client/others/java/jersey2-oneOf-duplicates/build.sbt index 6ccdf173c99..ce81568d784 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/build.sbt +++ b/samples/client/others/java/jersey2-oneOf-duplicates/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml b/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml index 02adce12170..cb6629fa41a 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml +++ b/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml @@ -329,8 +329,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java index e94f72a489c..2c8f6eabe80 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 04e2753379d..c2525747e20 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/Example.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/Example.java index dc98193e0b1..57d8e753572 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/Example.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/model/Example.java @@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Example() { super("oneOf", Boolean.FALSE); @@ -156,7 +156,7 @@ public class Example extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Example.schemas; } diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.gradle b/samples/client/others/java/okhttp-gson-oneOf/build.gradle index 06b2fd80c4c..d1dc4ac2a57 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf/build.gradle @@ -112,14 +112,13 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.sbt b/samples/client/others/java/okhttp-gson-oneOf/build.sbt index 5aea48501a0..ecdac6b908f 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf/build.sbt @@ -14,14 +14,13 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/others/java/okhttp-gson-oneOf/pom.xml index bb8290ae29a..dd68d59ceee 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf/pom.xml @@ -301,14 +301,9 @@ ${jackson-databind-nullable-version}
    - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -329,14 +324,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/JSON.java index f4e972e414e..c6b151d0ccc 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -333,7 +326,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -343,7 +336,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -368,7 +361,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -387,7 +380,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 1d8e5987be0..329fd820f05 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index de95fe59eb4..b454a3a8132 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -112,14 +112,13 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index 43dc93b5862..b776f34e427 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -14,14 +14,13 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 83e02f07a08..0904061dbb9 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -301,14 +301,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -329,14 +324,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java index 2aac67fb5b2..999628dc1f7 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -334,7 +327,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -344,7 +337,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -369,7 +362,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -388,7 +381,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index ef15ff6a57d..46185868ad2 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; 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 1828f3bc5ec..f9c6336cf63 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 @@ -132,10 +132,10 @@ public class SomeObj implements Serializable { return this; } - /** + /** * Get $type * @return $type - **/ + */ @javax.annotation.Nullable public TypeEnum get$Type() { return $type; @@ -151,10 +151,10 @@ public class SomeObj implements Serializable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -170,10 +170,10 @@ public class SomeObj implements Serializable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -189,10 +189,10 @@ public class SomeObj implements Serializable { return this; } - /** + /** * Get active * @return active - **/ + */ @javax.annotation.Nullable public Boolean getActive() { return active; @@ -208,10 +208,10 @@ public class SomeObj implements Serializable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -285,12 +285,12 @@ public class SomeObj implements Serializable { 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 SomeObj - */ + /** + * 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 SomeObj + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SomeObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -350,22 +350,22 @@ public class SomeObj implements Serializable { } } - /** - * Create an instance of SomeObj given an JSON string - * - * @param jsonString JSON string - * @return An instance of SomeObj - * @throws IOException if the JSON string is invalid with respect to SomeObj - */ + /** + * Create an instance of SomeObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of SomeObj + * @throws IOException if the JSON string is invalid with respect to SomeObj + */ public static SomeObj fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SomeObj.class); } - /** - * Convert an instance of SomeObj to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SomeObj to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/README.md b/samples/client/others/java/restclient-useAbstractionForFiles/README.md index 89942d1c287..e7cdb4a8809 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/README.md +++ b/samples/client/others/java/restclient-useAbstractionForFiles/README.md @@ -89,17 +89,17 @@ import org.openapitools.client.api.ResourceApi; public class ResourceApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost"); ResourceApi apiInstance = new ResourceApi(defaultClient); try { File result = apiInstance.resourceInResponse(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException 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("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle index 7f1376a230b..89044977e9c 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "6.1.6" jakarta_annotation_version = "2.1.1" diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml b/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml index 645a79f1e82..70570f31c89 100644 --- a/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml +++ b/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml @@ -281,8 +281,8 @@ UTF-8 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 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 index b8b55b2cefb..ceadfbde2a9 100644 --- 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 @@ -10,8 +10,8 @@ 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.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; diff --git a/samples/client/others/java/resttemplate-list-schema-validation/build.gradle b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle index be0c4deb2e2..8ff1803614c 100644 --- a/samples/client/others/java/resttemplate-list-schema-validation/build.gradle +++ b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/others/java/resttemplate-list-schema-validation/pom.xml b/samples/client/others/java/resttemplate-list-schema-validation/pom.xml index 7e87e58c74d..6775510dc3b 100644 --- a/samples/client/others/java/resttemplate-list-schema-validation/pom.xml +++ b/samples/client/others/java/resttemplate-list-schema-validation/pom.xml @@ -288,8 +288,8 @@ UTF-8 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 3.0.2 diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle b/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle index 03f09b945a0..d3c5c07c66f 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/pom.xml b/samples/client/others/java/resttemplate-useAbstractionForFiles/pom.xml index 54a248e8541..0399f1dfa6a 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/pom.xml +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/pom.xml @@ -281,8 +281,8 @@ UTF-8 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle index 215eeffc398..f8ab8c7a41f 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle @@ -116,8 +116,8 @@ ext { jakarta_annotation_version = "1.3.5" reactor_version = "3.4.34" reactor_netty_version = "1.0.39" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" junit_version = "5.10.2" } diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml b/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml index 9014ea37c66..2c86f52c45c 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml +++ b/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml @@ -120,8 +120,8 @@ UTF-8 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.7.17 1.3.5 diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java index 3f60d6b5b58..f63736b6c04 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java @@ -41,7 +41,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f62430f4b25..6bc5fb44aec 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 379f913033d..a1b702225ed 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,8 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/README.md b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/README.md index 3b9fcba5983..b7f0db11df5 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/README.md +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**findPetsByStatus**](docs/DefaultApi.md#findpetsbystatus) | **GET** /test/parameters/{path_default}/{path_nullable} | Finds Pets by status +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**findPetsByStatus**](docs/DefaultApi.md#findpetsbystatus) | **GET** /test/parameters/{path_default}/{path_nullable} | Finds Pets by status | diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md index 4e81da579cb..9eef33d4af1 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**findPetsByStatus**](DefaultApi.md#findPetsByStatus) | **GET** /test/parameters/{path_default}/{path_nullable} | Finds Pets by status +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**findPetsByStatus**](DefaultApi.md#findPetsByStatus) | **GET** /test/parameters/{path_default}/{path_nullable} | Finds Pets by status | @@ -49,24 +49,23 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pathDefault** | **kotlin.String**| path default | - **pathNullable** | **kotlin.String**| path_nullable | - **queryDefault** | **kotlin.String**| query default | [optional] [default to "available"] - **queryDefaultEnum** | **kotlin.String**| query default enum | [optional] [default to B] [enum: A, B, C] - **queryDefaultInt** | **java.math.BigDecimal**| query default int | [optional] [default to 3] - **headerDefault** | **kotlin.String**| header default | [optional] [default to "available"] - **headerDefaultEnum** | **kotlin.String**| header default enum | [optional] [default to B] [enum: A, B, C] - **headerDefaultInt** | **java.math.BigDecimal**| header default int | [optional] [default to 3] - **cookieDefault** | **kotlin.String**| cookie default | [optional] [default to "available"] - **cookieDefaultEnum** | **kotlin.String**| cookie default enum | [optional] [default to B] [enum: A, B, C] - **cookieDefaultInt** | **java.math.BigDecimal**| cookie default int | [optional] [default to 3] - **queryNullable** | **kotlin.String**| query nullable | [optional] - **headerNullable** | **kotlin.String**| header nullable | [optional] - **cookieNullable** | **kotlin.String**| cookie_nullable | [optional] - **dollarQueryDollarDollarSign** | **kotlin.String**| query parameter with dollar sign | [optional] +| **pathDefault** | **kotlin.String**| path default | | +| **pathNullable** | **kotlin.String**| path_nullable | | +| **queryDefault** | **kotlin.String**| query default | [optional] [default to "available"] | +| **queryDefaultEnum** | **kotlin.String**| query default enum | [optional] [default to B] [enum: A, B, C] | +| **queryDefaultInt** | **java.math.BigDecimal**| query default int | [optional] [default to 3] | +| **headerDefault** | **kotlin.String**| header default | [optional] [default to "available"] | +| **headerDefaultEnum** | **kotlin.String**| header default enum | [optional] [default to B] [enum: A, B, C] | +| **headerDefaultInt** | **java.math.BigDecimal**| header default int | [optional] [default to 3] | +| **cookieDefault** | **kotlin.String**| cookie default | [optional] [default to "available"] | +| **cookieDefaultEnum** | **kotlin.String**| cookie default enum | [optional] [default to B] [enum: A, B, C] | +| **cookieDefaultInt** | **java.math.BigDecimal**| cookie default int | [optional] [default to 3] | +| **queryNullable** | **kotlin.String**| query nullable | [optional] | +| **headerNullable** | **kotlin.String**| header nullable | [optional] | +| **cookieNullable** | **kotlin.String**| cookie_nullable | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dollarQueryDollarDollarSign** | **kotlin.String**| query parameter with dollar sign | [optional] | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 138966eedaf..54863fe75c6 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -50,7 +50,16 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient enum class QueryDefaultEnumFindPetsByStatus(val value: kotlin.String) { @Json(name = "A") A("A"), @Json(name = "B") B("B"), - @Json(name = "C") C("C") + @Json(name = "C") C("C"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** @@ -59,7 +68,16 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient enum class HeaderDefaultEnumFindPetsByStatus(val value: kotlin.String) { @Json(name = "A") A("A"), @Json(name = "B") B("B"), - @Json(name = "C") C("C") + @Json(name = "C") C("C"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** @@ -68,7 +86,16 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient enum class CookieDefaultEnumFindPetsByStatus(val value: kotlin.String) { @Json(name = "A") A("A"), @Json(name = "B") B("B"), - @Json(name = "C") C("C") + @Json(name = "C") C("C"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/others/rust/Cargo.lock b/samples/client/others/rust/Cargo.lock index 3505b332dae..706f45503fa 100644 --- a/samples/client/others/rust/Cargo.lock +++ b/samples/client/others/rust/Cargo.lock @@ -23,11 +23,11 @@ version = "0.0.0" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -39,12 +39,17 @@ version = "0.0.0" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -78,9 +83,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -108,9 +113,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437" [[package]] name = "cfg-if" @@ -124,11 +129,11 @@ version = "1.0.0" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -140,7 +145,6 @@ version = "1.0.0" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -168,11 +172,11 @@ version = "1.0.0" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -184,7 +188,6 @@ version = "1.0.0" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -258,9 +261,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -373,16 +376,16 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "h2" -version = "0.3.24" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http", + "http 1.1.0", "indexmap", "slab", "tokio", @@ -414,13 +417,36 @@ dependencies = [ ] [[package]] -name = "http-body" -version = "0.4.6" +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", - "http", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body", "pin-project-lite", ] @@ -438,46 +464,83 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http", + "http 1.1.0", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -542,9 +605,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" @@ -618,16 +681,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" version = "0.31.1" @@ -649,11 +702,11 @@ version = "0.0.1" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -665,7 +718,6 @@ version = "0.0.1" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -677,11 +729,11 @@ version = "0.0.1" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -693,7 +745,6 @@ version = "0.0.1" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -705,11 +756,11 @@ version = "1.0.0" dependencies = [ "base64 0.7.0", "futures", - "http", + "http 0.2.11", + "http-body-util", "hyper", - "hyper-tls", + "hyper-util", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -721,7 +772,6 @@ version = "1.0.0" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -773,9 +823,29 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "pin-project-lite" @@ -828,7 +898,6 @@ version = "0.1.0" dependencies = [ "reqwest", "serde", - "serde_derive", "serde_json", "url", "uuid", @@ -836,20 +905,24 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.24" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", - "http", + "http 1.1.0", "http-body", + "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -875,6 +948,21 @@ dependencies = [ "winreg", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -896,12 +984,43 @@ dependencies = [ ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "base64 0.21.7", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -953,6 +1072,9 @@ name = "serde" version = "1.0.173" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" @@ -997,6 +1119,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "socket2" version = "0.5.4" @@ -1007,6 +1135,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" version = "2.0.26" @@ -1020,9 +1160,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "system-configuration" @@ -1083,7 +1223,6 @@ dependencies = [ "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", "windows-sys 0.48.0", @@ -1099,6 +1238,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -1113,6 +1263,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -1175,10 +1346,16 @@ dependencies = [ ] [[package]] -name = "url" -version = "2.4.0" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1187,9 +1364,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ "getrandom", "serde", @@ -1331,6 +1508,15 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -1361,6 +1547,22 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -1373,6 +1575,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -1385,6 +1593,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -1397,6 +1611,18 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -1409,6 +1635,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -1421,6 +1653,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -1433,6 +1671,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -1446,11 +1690,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] -name = "winreg" -version = "0.50.0" +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 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 bbf7d006f49..00f46b1c7d3 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 @@ -10,10 +10,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/client.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/client.rs index 021112f848c..0702fb3c752 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/client.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -8,7 +9,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/configuration.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/configuration.rs index bc8b7d53f16..a36bab029a6 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://localhost".to_owned(), user_agent: Some("OpenAPI-Generator/0.0.0/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/default_api.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/default_api.rs index fc935532992..03e9e272f45 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/default_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct DefaultApiClient +pub struct DefaultApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl DefaultApiClient +impl DefaultApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> DefaultApiClient { DefaultApiClient { @@ -39,7 +40,7 @@ pub trait DefaultApi { fn demo_color_get(&self, color: models::Color) -> Pin>>>; } -implDefaultApi for DefaultApiClient +implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn demo_color_get(&self, color: models::Color) -> Pin>>> { 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 4d85ccfc475..58227e44cb3 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 @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/request.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/request.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } 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 1de74d07cff..f5cfd231540 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/hyper/composed-oneof/Cargo.toml b/samples/client/others/rust/hyper/composed-oneof/Cargo.toml index c91777db137..4c0a00557c5 100644 --- a/samples/client/others/rust/hyper/composed-oneof/Cargo.toml +++ b/samples/client/others/rust/hyper/composed-oneof/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/client.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/client.rs index 021112f848c..0702fb3c752 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/client.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -8,7 +9,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/configuration.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/configuration.rs index 22d9ed18fd9..8f7d059ecbb 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://localhost:8000".to_owned(), user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs index 3db27d7c1bc..6b8604dd916 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/default_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct DefaultApiClient +pub struct DefaultApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl DefaultApiClient +impl DefaultApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> DefaultApiClient { DefaultApiClient { @@ -40,7 +41,7 @@ pub trait DefaultApi { fn get_state(&self, ) -> Pin>>>; } -implDefaultApi for DefaultApiClient +implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn create_state(&self, create_state_request: models::CreateStateRequest) -> Pin>>> { 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 4d85ccfc475..58227e44cb3 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 @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/request.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } 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 1de74d07cff..f5cfd231540 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/hyper/emptyObject/Cargo.toml b/samples/client/others/rust/hyper/emptyObject/Cargo.toml index 7e570fe7056..1efb624b65d 100644 --- a/samples/client/others/rust/hyper/emptyObject/Cargo.toml +++ b/samples/client/others/rust/hyper/emptyObject/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/client.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/client.rs index 021112f848c..0702fb3c752 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/client.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -8,7 +9,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/configuration.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/configuration.rs index 565960de859..0576e0bfa59 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://localhost".to_owned(), user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs index 1ad9fa3768e..b5d0f3e85fb 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/default_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct DefaultApiClient +pub struct DefaultApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl DefaultApiClient +impl DefaultApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> DefaultApiClient { DefaultApiClient { @@ -39,7 +40,7 @@ pub trait DefaultApi { fn endpoint_get(&self, ) -> Pin>>>; } -implDefaultApi for DefaultApiClient +implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn endpoint_get(&self, ) -> Pin>>> { 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 4d85ccfc475..58227e44cb3 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/request.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/request.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } diff --git a/samples/client/others/rust/hyper/emptyObject/src/lib.rs b/samples/client/others/rust/hyper/emptyObject/src/lib.rs index 1de74d07cff..f5cfd231540 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/lib.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; 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 7e1c7960f6d..1bb7aa7bb54 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs index 021112f848c..0702fb3c752 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -8,7 +9,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs index 4a2bb63cbef..14b8ac197b8 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://localhost".to_owned(), user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs index 90082edd0ee..219604dba07 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/default_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct DefaultApiClient +pub struct DefaultApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl DefaultApiClient +impl DefaultApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> DefaultApiClient { DefaultApiClient { @@ -40,7 +41,7 @@ pub trait DefaultApi { fn test(&self, body: Option) -> Pin>>>; } -implDefaultApi for DefaultApiClient +implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn root_get(&self, ) -> Pin>>> { 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 4d85ccfc475..58227e44cb3 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 @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } 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 1de74d07cff..f5cfd231540 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml index 6ff45ef734e..07b8f6cf6d8 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml @@ -9,10 +9,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs index 021112f848c..0702fb3c752 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -8,7 +9,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs index fdbc91ffdf0..974ec289c31 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://api.example.xyz/v1".to_owned(), user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs index 9e2ede9bb93..6d193a52b4e 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/default_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct DefaultApiClient +pub struct DefaultApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl DefaultApiClient +impl DefaultApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> DefaultApiClient { DefaultApiClient { @@ -39,7 +40,7 @@ pub trait DefaultApi { fn get_fruit(&self, ) -> Pin>>>; } -implDefaultApi for DefaultApiClient +implDefaultApi for DefaultApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn get_fruit(&self, ) -> Pin>>> { 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 4d85ccfc475..58227e44cb3 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 @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } 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 1de74d07cff..f5cfd231540 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/hyper/oneOf/Cargo.toml b/samples/client/others/rust/hyper/oneOf/Cargo.toml index 647e2769394..fb78d69e910 100644 --- a/samples/client/others/rust/hyper/oneOf/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs index 588e9451b9e..f00ea150c31 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/bar_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct BarApiClient +pub struct BarApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl BarApiClient +impl BarApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> BarApiClient { BarApiClient { @@ -39,7 +40,7 @@ pub trait BarApi { fn create_bar(&self, bar_create: models::BarCreate) -> Pin>>>; } -implBarApi for BarApiClient +implBarApi for BarApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn create_bar(&self, bar_create: models::BarCreate) -> Pin>>> { diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/client.rs b/samples/client/others/rust/hyper/oneOf/src/apis/client.rs index 50a8c070c15..d01360bc001 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/client.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -9,7 +10,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/configuration.rs b/samples/client/others/rust/hyper/oneOf/src/apis/configuration.rs index ceb9b776914..608bb9bca28 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/configuration.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://localhost:8080".to_owned(), user_agent: Some("OpenAPI-Generator/0.0.1/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs index 95cc653a9cd..fee425fd6e8 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/foo_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct FooApiClient +pub struct FooApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl FooApiClient +impl FooApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> FooApiClient { FooApiClient { @@ -40,7 +41,7 @@ pub trait FooApi { fn get_all_foos(&self, ) -> Pin, Error>>>>; } -implFooApi for FooApiClient +implFooApi for FooApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn create_foo(&self, foo: Option) -> Pin>>> { 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 288eec40a0e..69fded9b6dc 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/request.rs b/samples/client/others/rust/hyper/oneOf/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/request.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } diff --git a/samples/client/others/rust/hyper/oneOf/src/lib.rs b/samples/client/others/rust/hyper/oneOf/src/lib.rs index 1de74d07cff..f5cfd231540 100644 --- a/samples/client/others/rust/hyper/oneOf/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/reqwest-regression-16119/Cargo.toml b/samples/client/others/rust/reqwest-regression-16119/Cargo.toml index 1919da46b08..a1e41446d88 100644 --- a/samples/client/others/rust/reqwest-regression-16119/Cargo.toml +++ b/samples/client/others/rust/reqwest-regression-16119/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/lib.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; 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 7fc367e02dd..e4edc99b719 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 @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/api-with-ref-param/src/lib.rs index a1837b966dc..e1520628d76 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml b/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml index 0a06ebb4f87..f06effdcb10 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml +++ b/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/reqwest/emptyObject/Cargo.toml b/samples/client/others/rust/reqwest/emptyObject/Cargo.toml index 8245af0063c..d35bad9e88d 100644 --- a/samples/client/others/rust/reqwest/emptyObject/Cargo.toml +++ b/samples/client/others/rust/reqwest/emptyObject/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/lib.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; 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 0b23d93ace1..5f2d99d1804 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs index a1837b966dc..e1520628d76 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml index 4d69b38b2e5..64b0d4bf92f 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml @@ -9,6 +9,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/rust/reqwest/oneOf/Cargo.toml b/samples/client/others/rust/reqwest/oneOf/Cargo.toml index 89997ba9566..8966bd1292c 100644 --- a/samples/client/others/rust/reqwest/oneOf/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/others/rust/reqwest/oneOf/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator-ignore b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.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/others/typescript-fetch/self-import-issue/.openapi-generator/FILES b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES new file mode 100644 index 00000000000..e75080e4b5f --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/FILES @@ -0,0 +1,7 @@ +index.ts +models/AbstractUserDto.ts +models/BranchDto.ts +models/InternalAuthenticatedUserDto.ts +models/RemoteAuthenticatedUserDto.ts +models/index.ts +runtime.ts diff --git a/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/others/typescript-fetch/self-import-issue/index.ts b/samples/client/others/typescript-fetch/self-import-issue/index.ts new file mode 100644 index 00000000000..ff7dac6ec15 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/index.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './models/index'; diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts new file mode 100644 index 00000000000..0b133d0c066 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; + +import { InternalAuthenticatedUserDtoFromJSONTyped } from './InternalAuthenticatedUserDto'; +import { RemoteAuthenticatedUserDtoFromJSONTyped } from './RemoteAuthenticatedUserDto'; +/** + * + * @export + * @interface AbstractUserDto + */ +export interface AbstractUserDto { + /** + * + * @type {string} + * @memberof AbstractUserDto + */ + username?: string; + /** + * + * @type {BranchDto} + * @memberof AbstractUserDto + */ + branch?: BranchDto; + /** + * + * @type {string} + * @memberof AbstractUserDto + */ + type?: string; +} + +/** + * Check if a given object implements the AbstractUserDto interface. + */ +export function instanceOfAbstractUserDto(value: object): value is AbstractUserDto { + return true; +} + +export function AbstractUserDtoFromJSON(json: any): AbstractUserDto { + return AbstractUserDtoFromJSONTyped(json, false); +} + +export function AbstractUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbstractUserDto { + if (json == null) { + return json; + } + if (!ignoreDiscriminator) { + if (json['type'] === 'internal-authenticated') { + return InternalAuthenticatedUserDtoFromJSONTyped(json, true); + } + if (json['type'] === 'remote-authenticated') { + return RemoteAuthenticatedUserDtoFromJSONTyped(json, true); + } + } + return { + + 'username': json['username'] == null ? undefined : json['username'], + 'branch': json['branch'] == null ? undefined : BranchDtoFromJSON(json['branch']), + 'type': json['type'] == null ? undefined : json['type'], + }; +} + +export function AbstractUserDtoToJSON(value?: AbstractUserDto | null): any { + if (value == null) { + return value; + } + return { + + 'username': value['username'], + 'branch': BranchDtoToJSON(value['branch']), + 'type': value['type'], + }; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts new file mode 100644 index 00000000000..916a5431fdb --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/BranchDto.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface BranchDto + */ +export interface BranchDto { + /** + * + * @type {string} + * @memberof BranchDto + */ + name?: string; +} + +/** + * Check if a given object implements the BranchDto interface. + */ +export function instanceOfBranchDto(value: object): value is BranchDto { + return true; +} + +export function BranchDtoFromJSON(json: any): BranchDto { + return BranchDtoFromJSONTyped(json, false); +} + +export function BranchDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): BranchDto { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function BranchDtoToJSON(value?: BranchDto | null): any { + if (value == null) { + return value; + } + return { + + 'name': value['name'], + }; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts new file mode 100644 index 00000000000..9d4c6761335 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/InternalAuthenticatedUserDto.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; +import type { AbstractUserDto } from './AbstractUserDto'; +import { + AbstractUserDtoFromJSON, + AbstractUserDtoFromJSONTyped, + AbstractUserDtoToJSON, +} from './AbstractUserDto'; + +/** + * + * @export + * @interface InternalAuthenticatedUserDto + */ +export interface InternalAuthenticatedUserDto extends AbstractUserDto { +} + +/** + * Check if a given object implements the InternalAuthenticatedUserDto interface. + */ +export function instanceOfInternalAuthenticatedUserDto(value: object): value is InternalAuthenticatedUserDto { + return true; +} + +export function InternalAuthenticatedUserDtoFromJSON(json: any): InternalAuthenticatedUserDto { + return InternalAuthenticatedUserDtoFromJSONTyped(json, false); +} + +export function InternalAuthenticatedUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalAuthenticatedUserDto { + return json; +} + +export function InternalAuthenticatedUserDtoToJSON(value?: InternalAuthenticatedUserDto | null): any { + return value; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts new file mode 100644 index 00000000000..041a5657702 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/RemoteAuthenticatedUserDto.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { BranchDto } from './BranchDto'; +import { + BranchDtoFromJSON, + BranchDtoFromJSONTyped, + BranchDtoToJSON, +} from './BranchDto'; +import type { AbstractUserDto } from './AbstractUserDto'; +import { + AbstractUserDtoFromJSON, + AbstractUserDtoFromJSONTyped, + AbstractUserDtoToJSON, +} from './AbstractUserDto'; + +/** + * + * @export + * @interface RemoteAuthenticatedUserDto + */ +export interface RemoteAuthenticatedUserDto extends AbstractUserDto { +} + +/** + * Check if a given object implements the RemoteAuthenticatedUserDto interface. + */ +export function instanceOfRemoteAuthenticatedUserDto(value: object): value is RemoteAuthenticatedUserDto { + return true; +} + +export function RemoteAuthenticatedUserDtoFromJSON(json: any): RemoteAuthenticatedUserDto { + return RemoteAuthenticatedUserDtoFromJSONTyped(json, false); +} + +export function RemoteAuthenticatedUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RemoteAuthenticatedUserDto { + return json; +} + +export function RemoteAuthenticatedUserDtoToJSON(value?: RemoteAuthenticatedUserDto | null): any { + return value; +} + diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/index.ts b/samples/client/others/typescript-fetch/self-import-issue/models/index.ts new file mode 100644 index 00000000000..4eb72f75acc --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/models/index.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AbstractUserDto'; +export * from './BranchDto'; +export * from './InternalAuthenticatedUserDto'; +export * from './RemoteAuthenticatedUserDto'; diff --git a/samples/client/others/typescript-fetch/self-import-issue/runtime.ts b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts new file mode 100644 index 00000000000..7dab7bfd087 --- /dev/null +++ b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts @@ -0,0 +1,426 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/samples/client/others/typescript/builds/with-unique-items/package.json b/samples/client/others/typescript/builds/with-unique-items/package.json index 5396cefd2a8..ea853317fbd 100644 --- a/samples/client/others/typescript/builds/with-unique-items/package.json +++ b/samples/client/others/typescript/builds/with-unique-items/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index 5f68295fc19..7e7b8b9bc73 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.0-SNAPSHOT \ No newline at end of file +7.7.0-SNAPSHOT diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 325ce22b90c..da0f496c192 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -117,13 +117,6 @@ Class | Method | HTTP request | Description ## Documentation for Authorization Authentication schemes defined for the API: -### api_key - -- **Type**: API key - -- **API key parameter name**: api_key -- **Location**: HTTP header - ### petstore_auth @@ -134,6 +127,13 @@ Authentication schemes defined for the API: - 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 diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle index d0dbd5aaf7a..99a604edddd 100644 --- a/samples/client/petstore/android/httpclient/build.gradle +++ b/samples/client/petstore/android/httpclient/build.gradle @@ -1,92 +1,60 @@ -group = 'org.openapitools' -project.version = '1.0.0' - -buildscript { - repositories { - maven { url "https://repo1.maven.org/maven2" } - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } +plugins { + id 'com.android.library' version '8.0.0' + id 'maven-publish' } -allprojects { - repositories { - jcenter() - } -} - - -apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' + namespace "org.openapitools.client" + compileSdkVersion 33 + buildToolsVersion '34.0.0' useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion 14 - targetSdkVersion 25 + targetSdkVersion 33 } 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) - } + publishing { + singleVariant('release') { + withSourcesJar() } } } - ext { swagger_annotations_version = "1.6.6" - gson_version = "2.8.9" + gson_version = "2.10.1" httpclient_version = "4.5.13" httpcore_version = "4.4.4" junit_version = "4.13" } dependencies { - compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "com.google.code.gson:gson:$gson_version" - compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpclient:$httpclient_version" - compile ("org.apache.httpcomponents:httpcore:$httpcore_version") { + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "org.apache.httpcomponents:httpcore:$httpcore_version" + implementation "org.apache.httpcomponents:httpclient:$httpclient_version" + implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") { exclude(group: 'org.apache.httpcomponents', module: 'httpclient') } - compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { + implementation ("org.apache.httpcomponents:httpmime:$httpclient_version") { exclude(group: 'org.apache.httpcomponents', module: 'httpclient') } - testCompile "junit:junit:$junit_version" + testImplementation "junit:junit:$junit_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.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); +publishing { + publications { + release(MavenPublication) { + groupId = 'org.openapitools' + artifactId = 'openapi-android-client' + version = '1.0.0' + + afterEvaluate { + from components.release + } + } } } - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} diff --git a/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties index 4d9ca164914..d951fac2bf3 100644 --- a/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 85f84bcccba..dd975c043a8 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -39,12 +39,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -172,7 +172,7 @@ UTF-8 1.6.6 - 2.8.9 + 2.10.1 1.0.0 4.13.2 4.5.13 diff --git a/samples/client/petstore/android/httpclient/settings.gradle b/samples/client/petstore/android/httpclient/settings.gradle index 666307984ab..3bd3fb626ee 100644 --- a/samples/client/petstore/android/httpclient/settings.gradle +++ b/samples/client/petstore/android/httpclient/settings.gradle @@ -1 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + rootProject.name = "openapi-android-client" diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 2e0db8b1bf7..86fb1b18ab7 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -38,4 +38,12 @@ public class ApiException extends Exception { public void setMessage(String message) { this.message = message; } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", message=" + message + + '}'; + } } diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 361994a058f..9bad358c49f 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -22,6 +22,7 @@ import java.util.*; import org.openapitools.client.model.ApiResponse; import java.io.File; +import java.util.*; import org.openapitools.client.model.Pet; import org.apache.http.entity.mime.MultipartEntityBuilder; diff --git a/samples/client/petstore/android/volley/.openapi-generator/FILES b/samples/client/petstore/android/volley/.openapi-generator/FILES index 2b570751c94..61db245e598 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/FILES +++ b/samples/client/petstore/android/volley/.openapi-generator/FILES @@ -16,6 +16,7 @@ gradle/wrapper/gradle-wrapper.properties gradlew gradlew.bat pom.xml +settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/ApiInvoker.java diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index 5f68295fc19..7e7b8b9bc73 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.0-SNAPSHOT \ No newline at end of file +7.7.0-SNAPSHOT diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index d4f8c7a7f17..0246a5e12da 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -117,13 +117,6 @@ Class | Method | HTTP request | Description ## Documentation for Authorization Authentication schemes defined for the API: -### api_key - -- **Type**: API key - -- **API key parameter name**: api_key -- **Location**: HTTP header - ### petstore_auth @@ -134,6 +127,13 @@ Authentication schemes defined for the API: - 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 diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index 7572522ee9f..22cf6326581 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -1,38 +1,15 @@ -group = 'org.openapitools' -project.version = '1.0.0' - -buildscript { - repositories { - mavenLocal() - google() - maven { - url 'https://dl.google.com/dl/android/maven2' - } - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.2.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } +plugins { + id 'com.android.library' version '8.0.0' + id 'maven-publish' } -allprojects { - repositories { - google() - jcenter() - } -} - - -apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' - android { - compileSdkVersion 26 - buildToolsVersion '28.0.3' + namespace "org.openapitools.client" + compileSdkVersion 33 + buildToolsVersion '34.0.0' defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 33 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -41,58 +18,51 @@ android { lintOptions { abortOnError false } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.all { output -> - if (outputFile != null && outputFileName.endsWith('.aar')) { - outputFileName = "${archivesBaseName}-${version}.aar" - } - } + packagingOptions { + resources.excludes += "META-INF/DEPENDENCIES" } - testOptions { unitTests.returnDefaultValues = true } + publishing { + singleVariant('release') { + withSourcesJar() + } + } } ext { swagger_annotations_version = "1.6.6" - gson_version = "2.8.9" - httpmime_version = "4.5.13" + gson_version = "2.10.1" + httpcore_version = "4.4.16" + httpmime_version = "4.5.14" volley_version = "1.2.1" junit_version = "4.13.2" - robolectric_version = "4.5.1" - concurrent_unit_version = "0.4.6" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.gson:gson:$gson_version" - implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") { + exclude(group: "org.apache.httpcomponents", module: "httpclient") + } + implementation ("org.apache.httpcomponents:httpmime:$httpmime_version") { + exclude(group: "org.apache.httpcomponents", module: "httpclient") + } implementation "com.android.volley:volley:${volley_version}" testImplementation "junit:junit:$junit_version" - testImplementation "org.robolectric:robolectric:${robolectric_version}" - testImplementation "net.jodah:concurrentunit:${concurrent_unit_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.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); +publishing { + publications { + release(MavenPublication) { + groupId = 'org.openapitools' + artifactId = 'petstore-android-volley' + version = '1.0.0' + + afterEvaluate { + from components.release + } + } } } - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} diff --git a/samples/client/petstore/android/volley/gradle.properties b/samples/client/petstore/android/volley/gradle.properties new file mode 100644 index 00000000000..24083f932f1 --- /dev/null +++ b/samples/client/petstore/android/volley/gradle.properties @@ -0,0 +1,15 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +#Sun Jun 16 04:30:24 ART 2024 +#android.enableJetifier=true +#android.useAndroidX=true diff --git a/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties index 4d9ca164914..d951fac2bf3 100644 --- a/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 19e2aa66a4b..83498b55469 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -54,8 +54,8 @@ UTF-8 1.6.6 - 4.5.13 - 2.8.9 + 4.5.14 + 2.10.1 1.2.1 4.1.1.4 diff --git a/samples/client/petstore/android/volley/settings.gradle b/samples/client/petstore/android/volley/settings.gradle new file mode 100644 index 00000000000..3d30c1ca105 --- /dev/null +++ b/samples/client/petstore/android/volley/settings.gradle @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "petstore-android-volley" diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 2f57c83eeb7..e22aa161ee1 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -58,4 +58,12 @@ public class ApiException extends Exception { public void setMessage(String message) { this.message = message; } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", message=" + message + + '}'; + } } diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 9ff0422de5f..be0cffeaffa 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -203,9 +203,9 @@ public class ApiInvoker { // Setup authentications (key: authentication name, value: authentication). INSTANCE.authentications = new HashMap(); - INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key")); // TODO: comment out below as OAuth does not exist //INSTANCE.authentications.put("petstore_auth", new OAuth()); + INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key")); // Prevent the authentications from being modified. INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications); } diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index a80910cd4c8..d7a596d46ee 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -25,6 +25,7 @@ import com.android.volley.VolleyError; import org.openapitools.client.model.ApiResponse; import java.io.File; +import java.util.*; import org.openapitools.client.model.Pet; import org.apache.http.HttpEntity; diff --git a/samples/client/petstore/cpp-qt/client/PFXHttpFileElement.cpp b/samples/client/petstore/cpp-qt/client/PFXHttpFileElement.cpp index 60c6818c38b..088836d16c7 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHttpFileElement.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXHttpFileElement.cpp @@ -65,11 +65,7 @@ QJsonValue PFXHttpFileElement::asJsonValue() const { if (!result) { qDebug() << "Error opening file " << local_filename; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) return QJsonDocument::fromJson(bArray.data()).object(); -#else - return QJsonDocument::fromBinaryData(bArray.data()).object(); -#endif } bool PFXHttpFileElement::fromStringValue(const QString &instr) { @@ -94,11 +90,7 @@ bool PFXHttpFileElement::fromJsonValue(const QJsonValue &jval) { file.remove(); } result = file.open(QIODevice::WriteOnly); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) file.write(QJsonDocument(jval.toObject()).toJson()); -#else - file.write(QJsonDocument(jval.toObject()).toBinaryData()); -#endif file.close(); if (!result) { qDebug() << "Error creating file " << local_filename; diff --git a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp index 4664b9a399b..40d869cfaf6 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.cpp @@ -17,11 +17,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - #define SKIP_EMPTY_PARTS Qt::SkipEmptyParts -#else - #define SKIP_EMPTY_PARTS QString::SkipEmptyParts -#endif + #include "PFXHttpRequest.h" @@ -447,14 +443,14 @@ void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { } if (!contentDispositionHdr.isEmpty()) { - auto contentDisposition = contentDispositionHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto contentDisposition = contentDispositionHdr.split(QString(";"), Qt::SkipEmptyParts); auto contentType = - !contentTypeHdr.isEmpty() ? contentTypeHdr.split(QString(";"), SKIP_EMPTY_PARTS).first() : QString(); + !contentTypeHdr.isEmpty() ? contentTypeHdr.split(QString(";"), Qt::SkipEmptyParts).first() : QString(); if ((contentDisposition.count() > 0) && (contentDisposition.first() == QString("attachment"))) { QString filename = QUuid::createUuid().toString(); for (const auto &file : contentDisposition) { if (file.contains(QString("filename"))) { - filename = file.split(QString("="), SKIP_EMPTY_PARTS).at(1); + filename = file.split(QString("="), Qt::SkipEmptyParts).at(1); break; } } @@ -464,14 +460,14 @@ void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { } } else if (!contentTypeHdr.isEmpty()) { - auto contentType = contentTypeHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto contentType = contentTypeHdr.split(QString(";"), Qt::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { // TODO : Handle Multipart responses } else { if(!contentEncodingHdr.isEmpty()){ - auto encoding = contentEncodingHdr.split(QString(";"), SKIP_EMPTY_PARTS); + auto encoding = contentEncodingHdr.split(QString(";"), Qt::SkipEmptyParts); if(encoding.count() > 0){ - auto compressionTypes = encoding.first().split(',', SKIP_EMPTY_PARTS); + auto compressionTypes = encoding.first().split(',', Qt::SkipEmptyParts); if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ response = decompress(reply->readAll()); } else if(compressionTypes.contains("identity", Qt::CaseInsensitive)){ diff --git a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.h index 31e2ec823af..8d9656ed867 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHttpRequest.h +++ b/samples/client/petstore/cpp-qt/client/PFXHttpRequest.h @@ -24,9 +24,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - #include -#endif +#include #include "PFXHttpFileElement.h" @@ -97,9 +95,7 @@ private: bool isResponseCompressionEnabled; bool isRequestCompressionEnabled; int httpResponseCode; -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QRandomGenerator randomGenerator; -#endif void on_reply_timeout(QNetworkReply *reply); void on_reply_finished(QNetworkReply *reply); diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp index 3aad8a2e9e3..298c9458a8e 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp @@ -128,15 +128,9 @@ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } -#else - for (auto &e : _serverIndices.keys()) { - setServerIndex(e, addServerConfiguration(e, url, description, variables)); - } -#endif } /** @@ -242,15 +236,9 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) { QByteArray output = pfx_pet.asJson().toUtf8(); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -356,15 +344,9 @@ void PFXPetApi::allPets() { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::allPetsCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -460,15 +442,9 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional input.headers.insert("api_key", ::test_namespace::toStringValue(api_key.value())); } } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -660,15 +636,9 @@ void PFXPetApi::findPetsByStatus(const QList &status) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -870,15 +840,9 @@ void PFXPetApi::findPetsByTags(const QList &tags) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -1012,15 +976,9 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::getPetByIdCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -1092,15 +1050,9 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) { QByteArray output = pfx_pet.asJson().toUtf8(); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -1228,15 +1180,9 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace:: input.add_var("status", ::test_namespace::toStringValue(status.value())); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -1364,15 +1310,9 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona input.add_file("file", file.value().local_filename, file.value().request_filename, file.value().mime_type); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback); connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); diff --git a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp index 6badeb2c05f..143ad71ca04 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp @@ -114,15 +114,9 @@ int PFXPrimitivesApi::addServerConfiguration(const QString &operation, const QUr * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ void PFXPrimitivesApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } -#else - for (auto &e : _serverIndices.keys()) { - setServerIndex(e, addServerConfiguration(e, url, description, variables)); - } -#endif } /** @@ -227,15 +221,9 @@ void PFXPrimitivesApi::primitivesIntegerPost(const ::test_namespace::OptionalPar QByteArray output = QByteArray::number(body.value()); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPrimitivesApi::primitivesIntegerPostCallback); connect(this, &PFXPrimitivesApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -305,15 +293,9 @@ void PFXPrimitivesApi::primitivesNumberPut(const ::test_namespace::OptionalParam QByteArray output = QByteArray::number(body.value()); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPrimitivesApi::primitivesNumberPutCallback); connect(this, &PFXPrimitivesApi::abortRequestsSignal, worker, &QObject::deleteLater); diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp index af5cdb421e0..64671535936 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp @@ -118,15 +118,9 @@ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &ur * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } -#else - for (auto &e : _serverIndices.keys()) { - setServerIndex(e, addServerConfiguration(e, url, description, variables)); - } -#endif } /** @@ -241,15 +235,9 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { PFXHttpRequestInput input(fullPath, "DELETE"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::deleteOrderCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -319,15 +307,9 @@ void PFXStoreApi::getInventory() { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getInventoryCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -417,15 +399,9 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getOrderByIdCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -497,15 +473,9 @@ void PFXStoreApi::placeOrder(const PFXOrder &pfx_order) { QByteArray output = pfx_order.asJson().toUtf8(); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::placeOrderCallback); connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp index 7949f0afa3a..d404aeb1769 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp @@ -126,15 +126,9 @@ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. */ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); } -#else - for (auto &e : _serverIndices.keys()) { - setServerIndex(e, addServerConfiguration(e, url, description, variables)); - } -#endif } /** @@ -240,15 +234,9 @@ void PFXUserApi::createUser(const PFXUser &pfx_user) { QByteArray output = pfx_user.asJson().toUtf8(); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -318,15 +306,9 @@ void PFXUserApi::createUsersWithArrayInput(const QList &pfx_user) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithArrayInputCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -396,15 +378,9 @@ void PFXUserApi::createUsersWithListInput(const QList &pfx_user) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithListInputCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -484,15 +460,9 @@ void PFXUserApi::deleteUser(const QString &username) { PFXHttpRequestInput input(fullPath, "DELETE"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::deleteUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -572,15 +542,9 @@ void PFXUserApi::getUserByName(const QString &username) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::getUserByNameCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -678,15 +642,9 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::loginUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -754,15 +712,9 @@ void PFXUserApi::logoutUser() { PFXHttpRequestInput input(fullPath, "GET"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::logoutUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); @@ -847,15 +799,9 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &pfx_user) { QByteArray output = pfx_user.asJson().toUtf8(); input.request_body.append(output); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) for (auto keyValueIt = _defaultHeaders.keyValueBegin(); keyValueIt != _defaultHeaders.keyValueEnd(); keyValueIt++) { input.headers.insert(keyValueIt->first, keyValueIt->second); } -#else - for (auto key : _defaultHeaders.keys()) { - input.headers.insert(key, _defaultHeaders[key]); - } -#endif connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::updateUserCallback); connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES index 06401fbfbce..0570b3e661c 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES @@ -16,8 +16,10 @@ include/CppRestPetstoreClient/Object.h include/CppRestPetstoreClient/api/PetApi.h include/CppRestPetstoreClient/api/StoreApi.h include/CppRestPetstoreClient/api/UserApi.h +include/CppRestPetstoreClient/api/UserOrPetApi.h include/CppRestPetstoreClient/model/ApiResponse.h include/CppRestPetstoreClient/model/Category.h +include/CppRestPetstoreClient/model/CreateUserOrPet_request.h include/CppRestPetstoreClient/model/Order.h include/CppRestPetstoreClient/model/Pet.h include/CppRestPetstoreClient/model/SchemaWithSet.h @@ -37,8 +39,10 @@ src/Object.cpp src/api/PetApi.cpp src/api/StoreApi.cpp src/api/UserApi.cpp +src/api/UserOrPetApi.cpp src/model/ApiResponse.cpp src/model/Category.cpp +src/model/CreateUserOrPet_request.cpp src/model/Order.cpp src/model/Pet.cpp src/model/SchemaWithSet.cpp diff --git a/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt b/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt index 1212e2c4d0f..4c823658436 100644 --- a/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt +++ b/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt @@ -8,16 +8,27 @@ # # NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech). -cmake_minimum_required (VERSION 3.1) +cmake_minimum_required (VERSION 3.5) -project(CppRestPetstoreClient) +project(CppRestPetstoreClient CXX) # Force -fPIC even if the project is configured for building a static library. set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CXX_STANDARD_REQUIRED ON) +set(CXX_STANDARD_REQUIRED ON) if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) + if(DEFINED CMAKE_CXX20_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX20_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 20) + elseif(DEFINED CMAKE_CXX17_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX17_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 17) + elseif(DEFINED CMAKE_CXX14_STANDARD_COMPILE_OPTION OR + DEFINED CMAKE_CXX14_EXTENSION_COMPILE_OPTION) + set(CMAKE_CXX_STANDARD 14) + else() + set(CMAKE_CXX_STANDARD 11) + endif() endif() if(NOT CMAKE_BUILD_TYPE) @@ -38,12 +49,12 @@ add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) target_compile_options(${PROJECT_NAME} PRIVATE $<$,$,$>: - -Wall -Wno-unused-variable> + -Wall -Wno-unused-variable -Wno-unused-lambda-capture> ) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $ ) @@ -90,4 +101,4 @@ install( install( EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -) \ No newline at end of file +) diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserOrPetApi.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserOrPetApi.h new file mode 100644 index 00000000000..b60a2ee1321 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserOrPetApi.h @@ -0,0 +1,66 @@ +/** + * 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. + */ + +/* + * UserOrPetApi.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_API_UserOrPetApi_H_ +#define ORG_OPENAPITOOLS_CLIENT_API_UserOrPetApi_H_ + + + +#include "CppRestPetstoreClient/ApiClient.h" + +#include "CppRestPetstoreClient/model/CreateUserOrPet_request.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + + + +class UserOrPetApi +{ +public: + + explicit UserOrPetApi( std::shared_ptr apiClient ); + + virtual ~UserOrPetApi(); + + /// + /// Create user or pet + /// + /// + /// This can only be done by the logged in user or pet. + /// + /// Created user or pet object + pplx::task createUserOrPet( + std::shared_ptr createUserOrPetRequest + ) const; + +protected: + std::shared_ptr m_ApiClient; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_API_UserOrPetApi_H_ */ + diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h index 8f00f4b5814..c1e6c23922a 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/ApiResponse.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// Describes the result of uploading an image resource /// diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h index 47085d2ac7f..6604a63d655 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Category.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// A category for a pet /// diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h new file mode 100644 index 00000000000..6493913c842 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/CreateUserOrPet_request.h @@ -0,0 +1,98 @@ +/** + * 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. + */ + +/* + * CreateUserOrPet_request.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ + +#include + +#include "CppRestPetstoreClient/ModelBase.h" + +#include "CppRestPetstoreClient/model/User.h" +#include "CppRestPetstoreClient/model/Tag.h" +#include "CppRestPetstoreClient/model/Category.h" +#include +#include "CppRestPetstoreClient/model/Pet.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Category; +class Tag; + + +class CreateUserOrPet_request +{ +public: + CreateUserOrPet_request() = default; + ~CreateUserOrPet_request() = default; + + ///////////////////////////////////////////// + + void validate(); + + web::json::value toJson() const; + + template + bool fromJson(const web::json::value& json) { + // convert json to Target type + Target target; + if (!target.fromJson(json)) { + return false; + } + + m_variantValue = target; + return true; + } + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const; + + template + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) { + // convert multipart to Target type + Target target; + if (!target.fromMultiPart(multipart, namePrefix)) { + return false; + } + + m_variantValue = target; + return true; + } + + ///////////////////////////////////////////// + /// CreateUserOrPet_request members + + using VariantType = std::variant; + + const VariantType& getVariant() const; + void setVariant(VariantType value); + +protected: + VariantType m_variantValue; +}; + + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_CreateUserOrPet_request_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h index 46a82097066..06e5101003e 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Order.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// An order for a pets from the pet store /// diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h index b20146e8109..8e52aeb4d45 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet.h @@ -34,6 +34,7 @@ namespace model { class Category; class Tag; + /// /// A pet for sale in the pet store /// 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 index 1faef1272b4..cf6d673fcf5 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h @@ -32,6 +32,7 @@ namespace model { class SchemaWithSet_vaccinationBook; + /// /// Schema with a set property /// 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 index 0f50805b938..7e2fe89c23b 100644 --- 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 @@ -31,6 +31,7 @@ namespace model { class Vaccine; + /// /// Vaccination book of the pet /// diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h index f06c4ee3122..23f63328641 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Tag.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// A tag for a pet /// diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h index aaeb28f7bef..de25d51e460 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/User.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// A User who is purchasing from the pet store /// 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 index 42dd8b87d3c..fc0cfbfa9f0 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h @@ -29,6 +29,7 @@ namespace client { namespace model { + /// /// /// diff --git a/samples/client/petstore/cpp-restsdk/client/pom.xml b/samples/client/petstore/cpp-restsdk/client/pom.xml index f127ec6ede3..6c5f5ed24c9 100644 --- a/samples/client/petstore/cpp-restsdk/client/pom.xml +++ b/samples/client/petstore/cpp-restsdk/client/pom.xml @@ -37,6 +37,7 @@ -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib" + -DCMAKE_BUILD_TYPE=Debug 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 d66684b4db9..a1fe7426859 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp @@ -128,7 +128,7 @@ pplx::task> PetApi::addPet(std::shared_ptr pet) const // oauth2 authentication is added automatically as part of the http_client_config return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -161,7 +161,7 @@ pplx::task> PetApi::addPet(std::shared_ptr pet) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new Pet()); @@ -256,7 +256,7 @@ pplx::task PetApi::deletePet(int64_t petId, boost::optionalcallApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -289,7 +289,7 @@ pplx::task PetApi::deletePet(int64_t petId, boost::optional>> PetApi::findPetsByStatus(std::vect // oauth2 authentication is added automatically as part of the http_client_config return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -399,7 +399,7 @@ pplx::task>> PetApi::findPetsByStatus(std::vect return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::vector> localVarResult; @@ -498,7 +498,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector // oauth2 authentication is added automatically as part of the http_client_config return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -531,7 +531,7 @@ pplx::task>> PetApi::findPetsByTags(std::vector return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::vector> localVarResult; @@ -634,7 +634,7 @@ pplx::task> PetApi::getPetById(int64_t petId) const } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -667,7 +667,7 @@ pplx::task> PetApi::getPetById(int64_t petId) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new Pet()); @@ -783,7 +783,7 @@ pplx::task> PetApi::updatePet(std::shared_ptr pet) con // oauth2 authentication is added automatically as part of the http_client_config return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -816,7 +816,7 @@ pplx::task> PetApi::updatePet(std::shared_ptr pet) con return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new Pet()); @@ -916,7 +916,7 @@ pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optionalcallApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -949,7 +949,7 @@ pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optional> PetApi::uploadFile(int64_t petId, boost // oauth2 authentication is added automatically as part of the http_client_config return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -1065,7 +1065,7 @@ pplx::task> PetApi::uploadFile(int64_t petId, boost return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new ApiResponse()); 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 e70054adbc7..87f56c64a8e 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp @@ -101,7 +101,7 @@ pplx::task StoreApi::deleteOrder(utility::string_t orderId) const return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -134,7 +134,7 @@ pplx::task StoreApi::deleteOrder(utility::string_t orderId) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { return void(); }); @@ -213,7 +213,7 @@ pplx::task> StoreApi::getInventory() const } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -246,7 +246,7 @@ pplx::task> StoreApi::getInventory() const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::map localVarResult; @@ -342,7 +342,7 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) const return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -375,7 +375,7 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new Order()); @@ -488,7 +488,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr o return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -521,7 +521,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr o return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new 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 7e00f72f853..24fd4076a0f 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp @@ -131,7 +131,7 @@ pplx::task UserApi::createUser(std::shared_ptr user) const } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -164,7 +164,7 @@ pplx::task UserApi::createUser(std::shared_ptr user) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { return void(); }); @@ -270,7 +270,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vectorcallApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -303,7 +303,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector UserApi::createUsersWithListInput(std::vectorcallApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -442,7 +442,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector UserApi::deleteUser(utility::string_t username) const } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -554,7 +554,7 @@ pplx::task UserApi::deleteUser(utility::string_t username) const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { return void(); }); @@ -627,7 +627,7 @@ pplx::task> UserApi::getUserByName(utility::string_t usern return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -660,7 +660,7 @@ pplx::task> UserApi::getUserByName(utility::string_t usern return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { std::shared_ptr localVarResult(new User()); @@ -761,7 +761,7 @@ pplx::task UserApi::loginUser(utility::string_t username, uti return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -794,7 +794,7 @@ pplx::task UserApi::loginUser(utility::string_t username, uti return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { utility::string_t localVarResult(utility::conversions::to_string_t("")); @@ -894,7 +894,7 @@ pplx::task UserApi::logoutUser() const } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -927,7 +927,7 @@ pplx::task UserApi::logoutUser() const return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { return void(); }); @@ -1029,7 +1029,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) + .then([=, this](web::http::http_response localVarResponse) { if (m_ApiClient->getResponseHandler()) { @@ -1062,7 +1062,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr return localVarResponse.extract_string(); }) - .then([=](utility::string_t localVarResponse) + .then([=, this](utility::string_t localVarResponse) { return void(); }); diff --git a/samples/client/petstore/cpp-restsdk/client/src/api/UserOrPetApi.cpp b/samples/client/petstore/cpp-restsdk/client/src/api/UserOrPetApi.cpp new file mode 100644 index 00000000000..5a737fc500b --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/api/UserOrPetApi.cpp @@ -0,0 +1,177 @@ +/** + * 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/api/UserOrPetApi.h" +#include "CppRestPetstoreClient/IHttpBody.h" +#include "CppRestPetstoreClient/JsonBody.h" +#include "CppRestPetstoreClient/MultipartFormData.h" + +#include + +#include + +namespace org { +namespace openapitools { +namespace client { +namespace api { + +using namespace org::openapitools::client::model; + +UserOrPetApi::UserOrPetApi( std::shared_ptr apiClient ) + : m_ApiClient(apiClient) +{ +} + +UserOrPetApi::~UserOrPetApi() +{ +} + +pplx::task UserOrPetApi::createUserOrPet(std::shared_ptr createUserOrPetRequest) const +{ + + // verify the required parameter 'createUserOrPetRequest' is set + if (createUserOrPetRequest == nullptr) + { + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'createUserOrPetRequest' when calling UserOrPetApi->createUserOrPet")); + } + + + std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); + utility::string_t localVarPath = utility::conversions::to_string_t("/user_or_pet"); + + std::map localVarQueryParams; + std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); + std::map localVarFormParams; + std::map> localVarFileParams; + + std::unordered_set localVarResponseHttpContentTypes; + + utility::string_t localVarResponseHttpContentType; + + // use JSON if possible + if ( localVarResponseHttpContentTypes.size() == 0 ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // JSON + else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); + } + // multipart formdata + else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) + { + localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + } + else + { + throw ApiException(400, utility::conversions::to_string_t("UserOrPetApi->createUserOrPet does not produce any supported media type")); + } + + 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; + utility::string_t localVarRequestHttpContentType; + + // use JSON if possible + if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); + web::json::value localVarJson; + + localVarJson = ModelBase::toJson(createUserOrPetRequest); + + + localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); + } + // multipart formdata + else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); + std::shared_ptr localVarMultipart(new MultipartFormData); + + if(createUserOrPetRequest.get()) + { + createUserOrPetRequest->toMultipart(localVarMultipart, utility::conversions::to_string_t("createUserOrPetRequest")); + } + + + localVarHttpBody = localVarMultipart; + localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); + } + else if (localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/x-www-form-urlencoded")) != localVarConsumeHttpContentTypes.end()) + { + localVarRequestHttpContentType = utility::conversions::to_string_t("application/x-www-form-urlencoded"); + } + else + { + throw ApiException(415, utility::conversions::to_string_t("UserOrPetApi->createUserOrPet 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([=, this](web::http::http_response localVarResponse) + { + if (m_ApiClient->getResponseHandler()) + { + m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); + } + + // 1xx - informational : OK + // 2xx - successful : OK + // 3xx - redirection : OK + // 4xx - client error : not OK + // 5xx - client error : not OK + if (localVarResponse.status_code() >= 400) + { + throw ApiException(localVarResponse.status_code() + , utility::conversions::to_string_t("error calling createUserOrPet: ") + localVarResponse.reason_phrase() + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + + // check response content type + if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) + { + utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; + if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling createUserOrPet: unexpected response type: ") + localVarContentType + , std::make_shared(localVarResponse.extract_utf8string(true).get())); + } + } + + return localVarResponse.extract_string(); + }) + .then([=, this](utility::string_t localVarResponse) + { + return void(); + }); +} + +} +} +} +} + diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp new file mode 100644 index 00000000000..56c52bd2ae1 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/model/CreateUserOrPet_request.cpp @@ -0,0 +1,74 @@ +/** + * 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/CreateUserOrPet_request.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + +void CreateUserOrPet_request::validate() +{ + // TODO: implement validation +} + +const CreateUserOrPet_request::VariantType& CreateUserOrPet_request::getVariant() const +{ + return m_variantValue; +} + +void CreateUserOrPet_request::setVariant(CreateUserOrPet_request::VariantType value) +{ + m_variantValue = value; +} + +web::json::value CreateUserOrPet_request::toJson() const +{ + web::json::value val = web::json::value::object(); + + std::visit([&](auto&& arg) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + val = web::json::value::null(); + } else { + val = arg.toJson(); + } + }, m_variantValue); + + return val; +} + +void CreateUserOrPet_request::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + std::visit([&](auto&& arg) { + using T = std::decay_t; + if constexpr (!std::is_same_v) { + arg.toMultipart(multipart, prefix); + } + }, m_variantValue); +} + +template bool CreateUserOrPet_request::fromJson(const web::json::value& json); +template bool CreateUserOrPet_request::fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix); +template bool CreateUserOrPet_request::fromJson(const web::json::value& json); +template bool CreateUserOrPet_request::fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix); + + +} +} +} +} + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.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/csharp/generichost/net4.7/AllOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator/FILES new file mode 100644 index 00000000000..47b2b9b5c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Adult.md +docs/models/Child.md +docs/models/Person.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Adult.cs +src/Org.OpenAPITools/Model/Child.cs +src/Org.OpenAPITools/Model/Person.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/AllOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml new file mode 100644 index 00000000000..a6144ccdba8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml @@ -0,0 +1,71 @@ +openapi: 3.0.1 +info: + license: + name: MIT + title: Example + version: 1.0.0 +servers: +- url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + operationId: list + parameters: + - description: The id of the person to retrieve + explode: false + in: path + name: personId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Person' + description: OK +components: + schemas: + Person: + discriminator: + mapping: + a: '#/components/schemas/Adult' + c: Child + propertyName: $_type + example: + lastName: lastName + firstName: firstName + $_type: $_type + properties: + $_type: + type: string + lastName: + type: string + firstName: + type: string + type: object + Adult: + allOf: + - $ref: '#/components/schemas/Person' + - properties: + children: + items: + $ref: '#/components/schemas/Child' + type: array + type: object + description: A representation of an adult + Child: + allOf: + - properties: + age: + format: int32 + type: integer + type: object + - $ref: '#/components/schemas/Person' + description: A representation of a child + properties: + boosterSeat: + type: boolean + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/AllOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..c203cd813bb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/apis/DefaultApi.md @@ -0,0 +1,95 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**List**](DefaultApi.md#list) | **GET** /person/display/{personId} | | + + +# **List** +> Person List (string personId) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class ListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://api.example.xyz/v1"; + var apiInstance = new DefaultApi(config); + var personId = "personId_example"; // string | The id of the person to retrieve + + try + { + Person result = apiInstance.List(personId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.List: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.ListWithHttpInfo(personId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.ListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **personId** | **string** | The id of the person to retrieve | | + +### Return type + +[**Person**](Person.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md new file mode 100644 index 00000000000..4bf74e4efc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Adult +A representation of an adult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [optional] +**Children** | [**List<Child>**](Child.md) | | [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/net4.7/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md new file mode 100644 index 00000000000..bb2a1e5a561 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Child +A representation of a child + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [optional] +**Age** | **int** | | [optional] +**BoosterSeat** | **bool** | | [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/net4.7/AllOf/docs/models/Person.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md new file mode 100644 index 00000000000..42c19689f9a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Person + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [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/net4.7/AllOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5dd80394d3f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..8181a987b5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,65 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test List + /// + [Fact (Skip = "not implemented")] + public async Task ListAsyncTest() + { + string personId = default; + var response = await _instance.ListAsync(personId); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..470d080ffd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs new file mode 100644 index 00000000000..31079eac974 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs @@ -0,0 +1,65 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Adult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Adult + //private Adult instance; + + public AdultTests() + { + // TODO uncomment below to create an instance of Adult + //instance = new Adult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Adult + /// + [Fact] + public void AdultInstanceTest() + { + // TODO uncomment below to test "IsType" Adult + //Assert.IsType(instance); + } + + /// + /// Test the property 'Children' + /// + [Fact] + public void ChildrenTest() + { + // TODO unit test for the property 'Children' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs new file mode 100644 index 00000000000..17720f6e735 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs @@ -0,0 +1,74 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Child + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Child + //private Child instance; + + public ChildTests() + { + // TODO uncomment below to create an instance of Child + //instance = new Child(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Child + /// + [Fact] + public void ChildInstanceTest() + { + // TODO uncomment below to test "IsType" Child + //Assert.IsType(instance); + } + + /// + /// Test the property 'Age' + /// + [Fact] + public void AgeTest() + { + // TODO unit test for the property 'Age' + } + + /// + /// Test the property 'BoosterSeat' + /// + [Fact] + public void BoosterSeatTest() + { + // TODO unit test for the property 'BoosterSeat' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs new file mode 100644 index 00000000000..aa3fc482188 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs @@ -0,0 +1,103 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Person + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PersonTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Person + //private Person instance; + + public PersonTests() + { + // TODO uncomment below to create an instance of Person + //instance = new Person(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Person + /// + [Fact] + public void PersonInstanceTest() + { + // TODO uncomment below to test "IsType" Person + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Adult from type Person + /// + [Fact] + public void AdultDeserializeFromPersonTest() + { + // TODO uncomment below to test deserialize a Adult from type Person + //Assert.IsType(JsonConvert.DeserializeObject(new Adult().ToJson())); + } + + /// + /// Test deserialize a Child from type Person + /// + [Fact] + public void ChildDeserializeFromPersonTest() + { + // TODO uncomment below to test deserialize a Child from type Person + //Assert.IsType(JsonConvert.DeserializeObject(new Child().ToJson())); + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..7b111e173ae --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,355 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + Task ListAsync(string personId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + Task ListOrDefaultAsync(string personId, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IListApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnList; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorList; + + internal void ExecuteOnList(DefaultApi.ListApiResponse apiResponse) + { + OnList?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorList(Exception exception) + { + OnErrorList?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + partial void FormatList(ref string personId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateList(string personId) + { + if (personId == null) + throw new ArgumentNullException(nameof(personId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterListDefaultImplementation(IListApiResponse apiResponseLocalVar, string personId) + { + bool suppressDefaultLog = false; + AfterList(ref suppressDefaultLog, apiResponseLocalVar, personId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterList(ref bool suppressDefaultLog, IListApiResponse apiResponseLocalVar, string personId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorListDefaultImplementation(Exception exception, string pathFormat, string path, string personId) + { + bool suppressDefaultLog = false; + OnErrorList(ref suppressDefaultLog, exception, pathFormat, path, personId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorList(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string personId); + + /// + /// + /// + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + public async Task ListOrDefaultAsync(string personId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await ListAsync(personId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + public async Task ListAsync(string personId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateList(personId); + + FormatList(ref personId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/person/display/{personId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpersonId%7D", Uri.EscapeDataString(personId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + ListApiResponse apiResponseLocalVar = new ListApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/person/display/{personId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterListDefaultImplementation(apiResponseLocalVar, personId); + + Events.ExecuteOnList(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorListDefaultImplementation(e, "/person/display/{personId}", uriBuilderLocalVar.Path, personId); + Events.ExecuteOnErrorList(e); + throw; + } + } + + /// + /// The + /// + public partial class ListApiResponse : Org.OpenAPITools.Client.ApiResponse, IListApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Person Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Person result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..78fdad8039f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..16e55f8c7b9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..8ea796e8169 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://api.example.xyz/v1"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v1"; + + /// + /// The host of the API + /// + public const string HOST = "api.example.xyz"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..a7f3806b960 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..c818977618f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..7b7d86c3238 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AdultJsonConverter()); + _jsonOptions.Converters.Add(new ChildJsonConverter()); + _jsonOptions.Converters.Add(new PersonJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..0b113d11177 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..53ad628a9a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..ed829aca772 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..2221ca651c6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..a4c5431cf87 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..3995735c8ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs new file mode 100644 index 00000000000..7806add08bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -0,0 +1,205 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// A representation of an adult + /// + public partial class Adult : Person, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// children + /// firstName + /// lastName + [JsonConstructor] + public Adult(Option> children = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) + { + ChildrenOption = children; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Children + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ChildrenOption { get; private set; } + + /// + /// Gets or Sets Children + /// + [JsonPropertyName("children")] + public List Children { get { return this.ChildrenOption; } set { this.ChildrenOption = new Option>(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Adult"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Adult {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Children: ").Append(Children).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class AdultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Adult 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> children = default; + Option firstName = default; + Option lastName = default; + Option type = 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 "children": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (children.IsSet && children.Value == null) + throw new ArgumentNullException(nameof(children), "Property is not nullable for class Adult."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Adult."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Adult."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Adult."); + + return new Adult(children, firstName, lastName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Adult adult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, adult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (adult.FirstNameOption.IsSet && adult.FirstName == null) + throw new ArgumentNullException(nameof(adult.FirstName), "Property is required for class Adult."); + + if (adult.LastNameOption.IsSet && adult.LastName == null) + throw new ArgumentNullException(nameof(adult.LastName), "Property is required for class Adult."); + + if (adult.ChildrenOption.IsSet) + { + writer.WritePropertyName("children"); + JsonSerializer.Serialize(writer, adult.Children, jsonSerializerOptions); + } + if (adult.FirstNameOption.IsSet) + writer.WriteString("firstName", adult.FirstName); + + if (adult.LastNameOption.IsSet) + writer.WriteString("lastName", adult.LastName); + + writer.WriteString("$_type", adult.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs new file mode 100644 index 00000000000..35adb6d4880 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -0,0 +1,227 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// A representation of a child + /// + public partial class Child : Person, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// age + /// firstName + /// lastName + /// boosterSeat + [JsonConstructor] + public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) + { + AgeOption = age; + BoosterSeatOption = boosterSeat; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Age + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AgeOption { get; private set; } + + /// + /// Gets or Sets Age + /// + [JsonPropertyName("age")] + public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + + /// + /// Used to track the state of BoosterSeat + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoosterSeatOption { get; private set; } + + /// + /// Gets or Sets BoosterSeat + /// + [JsonPropertyName("boosterSeat")] + public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Child {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Age: ").Append(Age).Append("\n"); + sb.Append(" BoosterSeat: ").Append(BoosterSeat).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Child 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 age = default; + Option firstName = default; + Option lastName = default; + Option type = default; + Option boosterSeat = 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 "age": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + age = new Option(utf8JsonReader.GetInt32()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + case "boosterSeat": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (age.IsSet && age.Value == null) + throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Child."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child."); + + if (boosterSeat.IsSet && boosterSeat.Value == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); + + return new Child(age, firstName, lastName, boosterSeat); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Child child, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, child, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (child.LastNameOption.IsSet && child.LastName == null) + throw new ArgumentNullException(nameof(child.LastName), "Property is required for class Child."); + + if (child.AgeOption.IsSet) + writer.WriteNumber("age", child.AgeOption.Value.Value); + + if (child.FirstNameOption.IsSet) + writer.WriteString("firstName", child.FirstName); + + if (child.LastNameOption.IsSet) + writer.WriteString("lastName", child.LastName); + + writer.WriteString("$_type", child.Type); + + if (child.BoosterSeatOption.IsSet) + writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs new file mode 100644 index 00000000000..c1944c79014 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs @@ -0,0 +1,247 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// Person + /// + public partial class Person : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// firstName + /// lastName + [JsonConstructor] + public Person(Option firstName = default, Option lastName = default) + { + FirstNameOption = firstName; + LastNameOption = lastName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string Type { get; } = "Person"; + + /// + /// 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 Person {\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PersonJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Person 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 firstName = default; + 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) + 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 "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Person."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Person."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Person."); + + return new Person(firstName, lastName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, person, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (person.LastNameOption.IsSet && person.LastName == null) + throw new ArgumentNullException(nameof(person.LastName), "Property is required for class Person."); + + if (person.FirstNameOption.IsSet) + writer.WriteString("firstName", person.FirstName); + + if (person.LastNameOption.IsSet) + writer.WriteString("lastName", person.LastName); + + writer.WriteString("$_type", person.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c6529e05402 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..a0c250d8619 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + ListApiResponse apiResponse = await api.ListAsync("todo"); + Person model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: Example +- appVersion: 1.0.0 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.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/csharp/generichost/net4.7/AnyOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/api/openapi.yaml new file mode 100644 index 00000000000..25b9adb5f50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/api/openapi.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + example: + color: color + properties: + color: + type: string + title: fruit + type: object + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.7/AnyOf/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.7/AnyOf/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/AnyOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..91e5f4c09c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..b8a2dfc1dc6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,174 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..e7289665b3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,172 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..99db2b0a04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,242 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public Fruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new Fruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); + 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(writer, fruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c6529e05402 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..01afdb93332 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.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/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/api/openapi.yaml new file mode 100644 index 00000000000..25b9adb5f50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/api/openapi.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + example: + color: color + properties: + color: + type: string + title: fruit + type: object + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.7/AnyOfNoCompare/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.7/AnyOfNoCompare/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/AnyOfNoCompare/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..4c9be2b60cf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,314 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..67a32fa90b5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,173 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..7ac2140b8e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,171 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..eb932d45136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,241 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public Fruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new Fruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); + 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(writer, fruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..201640a24d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,32 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..fd1673a036a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/README.md @@ -0,0 +1,176 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.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/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES new file mode 100644 index 00000000000..45c476af318 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES @@ -0,0 +1,290 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ChildCatAllOfPetType.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DateOnlyClass.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumArraysArrayEnumInner.md +docs/models/EnumArraysJustSymbol.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EnumTestEnumInteger.md +docs/models/EnumTestEnumIntegerOnly.md +docs/models/EnumTestEnumString.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/FindPetsByStatusStatusParameterInner.md +docs/models/Foo.md +docs/models/FooGetDefaultResponse.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/LiteralStringClass.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MapTestMapOfEnumStringValue.md +docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NotificationtestGetElementsV1ResponseMPayload.md +docs/models/NullableClass.md +docs/models/NullableGuidClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/OneOfString.md +docs/models/Order.md +docs/models/OrderStatus.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/OuterEnumTest.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/PetStatus.md +docs/models/Pig.md +docs/models/PolymorphicProperty.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/RequiredClass.md +docs/models/RequiredClassRequiredNotnullableEnumInteger.md +docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md +docs/models/RequiredClassRequiredNotnullableEnumString.md +docs/models/RequiredClassRequiredNullableEnumInteger.md +docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md +docs/models/RequiredClassRequiredNullableEnumString.md +docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestEnumParametersEnumHeaderStringParameter.md +docs/models/TestEnumParametersEnumQueryDoubleParameter.md +docs/models/TestEnumParametersEnumQueryIntegerParameter.md +docs/models/TestEnumParametersRequestEnumFormString.md +docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/models/ZebraType.md +docs/models/ZeroBasedEnum.md +docs/models/ZeroBasedEnumClass.md +docs/models/ZeroBasedEnumClassZeroBasedEnum.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs +src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs +src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/EnumTestEnumString.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +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/MapTestMapOfEnumStringValue.cs +src/Org.OpenAPITools/Model/MixLog.cs +src/Org.OpenAPITools/Model/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/OneOfString.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OrderStatus.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumTest.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/PetStatus.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/RequiredClass.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/RolesReportsHash.cs +src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs +src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Model/ZebraType.cs +src/Org.OpenAPITools/Model/ZeroBasedEnum.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/FormModels/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml new file mode 100644 index 00000000000..c64890a0634 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml @@ -0,0 +1,3042 @@ +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_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /roles/report: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/RolesReport' + type: array + description: returns report + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /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: + $ref: '#/components/schemas/findPetsByStatus_status_parameter_inner' + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - 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 + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - 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: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - 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: [] + - api_key_query: [] + summary: Find pet by ID + tags: + - 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: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - 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 + /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 + /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 + /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 + 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 + /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 + /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 + /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 + /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: + 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 + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - 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 + 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 + "598": + description: Not a real HTTP status code + "599": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Not a real HTTP status code with a return object + summary: Get user by user name + tags: + - 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 + /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#$%^ + /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 + 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: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_header_string_parameter' + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_header_string_parameter' + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_query_integer_parameter' + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_query_double_parameter' + 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 + 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 + 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 + /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 + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + 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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - 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: requiredNotNullable + required: true + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: requiredNullable + required: true + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: notRequiredNotNullable + required: false + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: notRequiredNullable + required: false + schema: + nullable: true + type: string + style: form + responses: + "200": + description: Success + tags: + - 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' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - 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 + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK + /test: + get: + operationId: Test + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload' + description: Successful response + summary: Retrieve an existing Notificationtest's Elements +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + 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: + RolesReport: + description: Roles report + items: + $ref: '#/components/schemas/RolesReportsHash' + type: array + RolesReportsHash: + description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + role_uuid: + format: uuid + type: string + role: + $ref: '#/components/schemas/RolesReportsHash_role' + type: object + 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: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + $ref: '#/components/schemas/Order_status' + 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 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + 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 + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + 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 + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + $ref: '#/components/schemas/Pet_status' + 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 + lock: + type: string + abstract: + nullable: true + type: string + unsafe: + type: string + required: + - abstract + - lock + 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' + - $ref: '#/components/schemas/Address' + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + 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 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + 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: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_backslash: + description: None + pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ + /([0-9]|[1-2][0-9]|3[0-2]))$" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Outer_Enum_Test: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test: + properties: + enum_string: + $ref: '#/components/schemas/Enum_Test_enum_string' + enum_string_required: + $ref: '#/components/schemas/Enum_Test_enum_string' + enum_integer: + $ref: '#/components/schemas/Enum_Test_enum_integer' + enum_integer_only: + $ref: '#/components/schemas/Enum_Test_enum_integer_only' + enum_number: + $ref: '#/components/schemas/testEnumParameters_enum_query_double_parameter' + 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 + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + 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: + $ref: '#/components/schemas/MapTest_map_of_enum_string_value' + 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 + 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 + x-cls-compliant: true + x-com-visible: true + 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: + $ref: '#/components/schemas/EnumArrays_just_symbol' + array_enum: + items: + $ref: '#/components/schemas/EnumArrays_array_enum_inner' + 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 + 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 + 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 + _special_model.name_: + type: string + 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 + RequiredClass: + properties: + required_nullable_integer_prop: + nullable: true + type: integer + required_notnullableinteger_prop: + nullable: false + type: integer + not_required_nullable_integer_prop: + nullable: true + type: integer + not_required_notnullableinteger_prop: + nullable: false + type: integer + required_nullable_string_prop: + nullable: true + type: string + required_notnullable_string_prop: + nullable: false + type: string + notrequired_nullable_string_prop: + nullable: true + type: string + notrequired_notnullable_string_prop: + nullable: false + type: string + required_nullable_boolean_prop: + nullable: true + type: boolean + required_notnullable_boolean_prop: + nullable: false + type: boolean + notrequired_nullable_boolean_prop: + nullable: true + type: boolean + notrequired_notnullable_boolean_prop: + nullable: false + type: boolean + required_nullable_date_prop: + format: date + nullable: true + type: string + required_not_nullable_date_prop: + format: date + nullable: false + type: string + not_required_nullable_date_prop: + format: date + nullable: true + type: string + not_required_notnullable_date_prop: + format: date + nullable: false + type: string + required_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer' + required_notnullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer' + notrequired_nullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer' + notrequired_notnullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer' + required_nullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer_only' + required_notnullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer_only' + notrequired_nullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer_only' + notrequired_notnullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer_only' + required_notnullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_string' + required_nullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_string' + notrequired_nullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_string' + notrequired_notnullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_string' + required_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + required_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + notrequired_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + notrequired_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + required_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + required_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + notrequired_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + notrequired_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + required_nullable_array_of_string: + items: + type: string + nullable: true + type: array + required_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + notrequired_nullable_array_of_string: + items: + type: string + nullable: true + type: array + notrequired_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + required: + - required_not_nullable_date_prop + - required_notnullable_array_of_string + - required_notnullable_boolean_prop + - required_notnullable_datetime_prop + - required_notnullable_enum_integer + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_notnullable_outerEnumDefaultValue + - required_notnullable_string_prop + - required_notnullable_uuid + - required_notnullableinteger_prop + - required_nullable_array_of_string + - required_nullable_boolean_prop + - required_nullable_date_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_nullable_enum_integer_only + - required_nullable_enum_string + - required_nullable_integer_prop + - required_nullable_outerEnumDefaultValue + - required_nullable_string_prop + - required_nullable_uuid + 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 + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + color_code: + pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + $ref: '#/components/schemas/zebra_type' + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - properties: + name: + type: string + pet_type: + $ref: '#/components/schemas/ChildCat_allOf_pet_type' + required: + - pet_type + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + 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 + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + OneOfString: + oneOf: + - pattern: ^a + type: string + - pattern: ^b + type: string + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + ZeroBasedEnumClass: + properties: + ZeroBasedEnum: + $ref: '#/components/schemas/ZeroBasedEnumClass_ZeroBasedEnum' + type: object + Custom-Variableobject-Response: + additionalProperties: true + description: A Variable object without predefined property names + type: object + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + example: + a_objVariableobject: + - null + - null + pkiNotificationtestID: 0 + properties: + pkiNotificationtestID: + type: integer + a_objVariableobject: + items: + $ref: '#/components/schemas/Custom-Variableobject-Response' + type: array + required: + - a_objVariableobject + - pkiNotificationtestID + type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string + 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: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + findPetsByStatus_status_parameter_inner: + default: available + enum: + - available + - pending + - sold + type: string + 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_enum_form_string_array_inner: + default: $ + enum: + - '>' + - $ + type: string + testEnumParameters_request_enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + enum_form_string: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string' + type: object + testEnumParameters_enum_header_string_parameter: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + testEnumParameters_enum_query_integer_parameter: + enum: + - 1 + - -2 + format: int32 + type: integer + testEnumParameters_enum_query_double_parameter: + enum: + - 1.1 + - -1.2 + format: double + type: number + 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: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + 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 + 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 + getCountry_request: + allOf: + - properties: + country: + type: string + required: + - country + type: object + RolesReportsHash_role: + example: + name: name + properties: + name: + type: string + type: object + Order_status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + Pet_status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + Enum_Test_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test_enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + Enum_Test_enum_integer_only: + enum: + - 2 + - -2 + type: integer + MapTest_map_of_enum_string_value: + enum: + - UPPER + - lower + type: string + EnumArrays_just_symbol: + enum: + - '>=' + - $ + type: string + EnumArrays_array_enum_inner: + enum: + - fish + - crab + type: string + RequiredClass_required_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + RequiredClass_required_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + RequiredClass_required_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + RequiredClass_required_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + RequiredClass_required_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + RequiredClass_required_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + zebra_type: + enum: + - plains + - mountain + - grevys + type: string + ChildCat_allOf_pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + ZeroBasedEnumClass_ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing + 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/csharp/generichost/net4.7/FormModels/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/FormModels/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md new file mode 100644 index 00000000000..36948898657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/AnotherFakeApi.md @@ -0,0 +1,99 @@ +# Org.OpenAPITools.Api.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** +> ModelClient Call123TestSpecialTags (ModelClient modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the Call123TestSpecialTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test special tags + ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..0bdfd6af347 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/DefaultApi.md @@ -0,0 +1,429 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | +| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | +| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | | +| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements | + + +# **FooGet** +> FooGetDefaultResponse FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + FooGetDefaultResponse result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FooGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FooGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetCountry** +> void GetCountry (string country) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + var country = "country_example"; // string | + + try + { + apiInstance.GetCountry(country); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.GetCountryWithHttpInfo(country); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | | | + +### Return type + +void (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** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **RolesReportGet** +> List<List<RolesReportsHash>> RolesReportGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RolesReportGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + List> result = apiInstance.RolesReportGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RolesReportGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns report | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Test** +> NotificationtestGetElementsV1ResponseMPayload Test () + +Retrieve an existing Notificationtest's Elements + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Retrieve an existing Notificationtest's Elements + NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Test: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve an existing Notificationtest's Elements + ApiResponse response = apiInstance.TestWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md new file mode 100644 index 00000000000..8e9abed3c22 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md @@ -0,0 +1,1830 @@ +# Org.OpenAPITools.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**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 | | +| [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | +| [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + +# **FakeHealthGet** +> HealthCheckResult FakeHealthGet () + +Health check endpoint + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeHealthGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Health check endpoint + ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeHealthGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterBooleanSerialize** +> bool FakeOuterBooleanSerialize (bool body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterBooleanSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **bool** | Input boolean as post body | [optional] | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterCompositeSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterNumberSerialize** +> decimal FakeOuterNumberSerialize (decimal body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterNumberSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **decimal** | Input number as post body | [optional] | + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterStringSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | +| **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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetArrayOfEnumsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Array of Enums + ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestAdditionalPropertiesReference** +> void TestAdditionalPropertiesReference (Dictionary requestBody) + +test referenced additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestAdditionalPropertiesReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, Object>**](Object.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithFileSchema** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithFileSchemaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User user, string query) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var user = new User(); // User | + var query = "query_example"; // string | + + try + { + apiInstance.TestBodyWithQueryParams(user, query); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithQueryParamsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithQueryParamsWithHttpInfo(user, query); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | | | +| **query** | **string** | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClientModelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test \"client\" model + ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestClientModelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, DateTime date = null, System.IO.Stream binary = null, float varFloat = null, int integer = null, int int32 = null, long int64 = null, string varString = null, string password = null, string callback = null, DateTime dateTime = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var number = 8.14D; // decimal | None + var varDouble = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var varFloat = 3.4F; // float | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789L; // long | None (optional) + var varString = "varString_example"; // string | None (optional) + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEndpointParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParametersWithHttpInfo(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **varByte** | **byte[]** | None | | +| **number** | **decimal** | None | | +| **varDouble** | **double** | None | | +| **patternWithoutDelimiter** | **string** | None | | +| **date** | **DateTime** | None | [optional] | +| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] | +| **varFloat** | **float** | None | [optional] | +| **integer** | **int** | None | [optional] | +| **int32** | **int** | None | [optional] | +| **int64** | **long** | None | [optional] | +| **varString** | **string** | None | [optional] | +| **password** | **string** | None | [optional] | +| **callback** | **string** | None | [optional] | +| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumHeaderStringArray = null, List enumQueryStringArray = null, List enumFormStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersRequestEnumFormString enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) + var enumHeaderString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Header parameter enum test (string) (optional) + var enumQueryString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Query parameter enum test (string) (optional) + var enumQueryDouble = (TestEnumParametersEnumQueryDoubleParameter) "1.1"; // TestEnumParametersEnumQueryDoubleParameter | Query parameter enum test (double) (optional) + var enumQueryInteger = (TestEnumParametersEnumQueryIntegerParameter) "1"; // TestEnumParametersEnumQueryIntegerParameter | Query parameter enum test (double) (optional) + var enumFormString = (TestEnumParametersRequestEnumFormString) "_abc"; // TestEnumParametersRequestEnumFormString | (optional) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEnumParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test enum parameters + apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **enumHeaderStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Header parameter enum test (string array) | [optional] | +| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] | +| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] | +| **enumHeaderString** | **TestEnumParametersEnumHeaderStringParameter** | Header parameter enum test (string) | [optional] | +| **enumQueryString** | **TestEnumParametersEnumHeaderStringParameter** | Query parameter enum test (string) | [optional] | +| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] | +| **enumQueryInteger** | **TestEnumParametersEnumQueryIntegerParameter** | Query parameter enum test (double) | [optional] | +| **enumFormString** | **TestEnumParametersRequestEnumFormString** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestGroupParameters** +> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool booleanGroup = null, int stringGroup = null, long int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var stringGroup = 56; // int | String in group parameters (optional) + var int64Group = 789L; // long | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestGroupParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | | +| **requiredStringGroup** | **int** | Required String in group parameters | | +| **requiredInt64Group** | **long** | Required Integer in group parameters | | +| **booleanGroup** | **bool** | Boolean in group parameters | [optional] | +| **stringGroup** | **int** | String in group parameters | [optional] | +| **int64Group** | **long** | Integer in group parameters | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline additionalProperties + apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestJsonFormDataWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test json serialization of form data + apiInstance.TestJsonFormDataWithHttpInfo(param, param2); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **param** | **string** | field1 | | +| **param2** | **string** | field2 | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestQueryParameterCollectionFormat** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = null, string notRequiredNullable = null) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + var requiredNotNullable = "requiredNotNullable_example"; // string | + var requiredNullable = "requiredNullable_example"; // string | + var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional) + var notRequiredNullable = "notRequiredNullable_example"; // string | (optional) + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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) | | | +| **requiredNotNullable** | **string** | | | +| **requiredNullable** | **string** | | | +| **notRequiredNotNullable** | **string** | | [optional] | +| **notRequiredNullable** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..dfe1adefd0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,104 @@ +# Org.OpenAPITools.Api.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** +> ModelClient TestClassname (ModelClient modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClassnameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test class name in snake case + ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md new file mode 100644 index 00000000000..862c66f0bee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md @@ -0,0 +1,860 @@ +# Org.OpenAPITools.Api.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 pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<FindPetsByStatusStatusParameterInner>**](FindPetsByStatusStatusParameterInner.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md new file mode 100644 index 00000000000..4a1cd29ada7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.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 (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md new file mode 100644 index 00000000000..ee189c866ec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md @@ -0,0 +1,715 @@ +# Org.OpenAPITools.Api.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 user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | +| **598** | Not a real HTTP status code | - | +| **599** | Not a real HTTP status code with a return object | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdateUser** +> void UpdateUser (User user, string username) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Updated user object + var username = "username_example"; // string | name that need to be deleted + + try + { + // Updated user + apiInstance.UpdateUser(user, username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(user, username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Updated user object | | +| **username** | **string** | name that need to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Activity.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [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/net4.7/FormModels/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ActivityOutputElementRepresentation.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ActivityOutputElementRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | [optional] +**Prop2** | **Object** | | [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/net4.7/FormModels/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..2bbe882fcfc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Anytype1** | **Object** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [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/net4.7/FormModels/docs/models/Animal.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Animal.md new file mode 100644 index 00000000000..1a1760bd869 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ApiResponse.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ApiResponse.md new file mode 100644 index 00000000000..d89ed1a25dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Message** | **string** | | [optional] +**Type** | **string** | | [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/net4.7/FormModels/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Apple.md new file mode 100644 index 00000000000..9ad1da8cd68 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Apple.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ColorCode** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [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/net4.7/FormModels/docs/models/AppleReq.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/AppleReq.md new file mode 100644 index 00000000000..325521123f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [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/net4.7/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..a23ba59e609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [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/net4.7/FormModels/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..10b8413439b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [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/net4.7/FormModels/docs/models/ArrayTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayTest.md new file mode 100644 index 00000000000..ed572120cd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] +**ArrayOfString** | **List<string>** | | [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/net4.7/FormModels/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Banana.md new file mode 100644 index 00000000000..d32e90cf298 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [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/net4.7/FormModels/docs/models/BananaReq.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/BananaReq.md new file mode 100644 index 00000000000..c8372b73c5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/net4.7/FormModels/docs/models/BasquePig.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/BasquePig.md new file mode 100644 index 00000000000..db4f7a36226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/FormModels/docs/models/Capitalization.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Capitalization.md new file mode 100644 index 00000000000..9e225c17232 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ATT_NAME** | **string** | Name of the pet | [optional] +**CapitalCamel** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**SmallCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [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/net4.7/FormModels/docs/models/Cat.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Cat.md new file mode 100644 index 00000000000..310a5e6575e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [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/net4.7/FormModels/docs/models/Category.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Category.md new file mode 100644 index 00000000000..6eb0a2e13ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ChildCat.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ChildCat.md new file mode 100644 index 00000000000..4085cdef26d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **ChildCatAllOfPetType** | | +**Name** | **string** | | [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/net4.7/FormModels/docs/models/ChildCatAllOfPetType.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ChildCatAllOfPetType.md new file mode 100644 index 00000000000..47a390dc581 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ChildCatAllOfPetType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ChildCatAllOfPetType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ClassModel.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ClassModel.md new file mode 100644 index 00000000000..bb35816c914 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [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/net4.7/FormModels/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ComplexQuadrilateral.md new file mode 100644 index 00000000000..fb00d4ebf08 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/DanishPig.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DanishPig.md new file mode 100644 index 00000000000..4d6ec1400a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/FormModels/docs/models/DateOnlyClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DateOnlyClass.md new file mode 100644 index 00000000000..5dd63b313cc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DateOnlyClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DateOnlyClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateOnlyProperty** | **DateTime** | | [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/net4.7/FormModels/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DeprecatedObject.md new file mode 100644 index 00000000000..e90c59555a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.7/FormModels/docs/models/Dog.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Dog.md new file mode 100644 index 00000000000..70cdc80e83e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [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/net4.7/FormModels/docs/models/Drawing.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Drawing.md new file mode 100644 index 00000000000..95f49b2ed60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [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/net4.7/FormModels/docs/models/EnumArrays.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArrays.md new file mode 100644 index 00000000000..ae3e81632c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayEnum** | [**List<EnumArraysArrayEnumInner>**](EnumArraysArrayEnumInner.md) | | [optional] +**JustSymbol** | **EnumArraysJustSymbol** | | [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/net4.7/FormModels/docs/models/EnumArraysArrayEnumInner.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArraysArrayEnumInner.md new file mode 100644 index 00000000000..9c08ed9cfed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArraysArrayEnumInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumArraysArrayEnumInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EnumArraysJustSymbol.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArraysJustSymbol.md new file mode 100644 index 00000000000..4cf0e643400 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumArraysJustSymbol.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumArraysJustSymbol + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EnumClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumClass.md new file mode 100644 index 00000000000..d259f0f4696 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EnumTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTest.md new file mode 100644 index 00000000000..898c1ea1fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumStringRequired** | **EnumTestEnumString** | | +**EnumInteger** | **EnumTestEnumInteger** | | [optional] +**EnumIntegerOnly** | **EnumTestEnumIntegerOnly** | | [optional] +**EnumNumber** | **TestEnumParametersEnumQueryDoubleParameter** | | [optional] +**EnumString** | **EnumTestEnumString** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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/net4.7/FormModels/docs/models/EnumTestEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumInteger.md new file mode 100644 index 00000000000..2476caf61c7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EnumTestEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumIntegerOnly.md new file mode 100644 index 00000000000..08f59f08776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EnumTestEnumString.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumString.md new file mode 100644 index 00000000000..783198941ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EnumTestEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EquilateralTriangle.md new file mode 100644 index 00000000000..8360b5c16a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/FormModels/docs/models/File.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/File.md new file mode 100644 index 00000000000..58b9c2fc369 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [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/net4.7/FormModels/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FileSchemaTestClass.md new file mode 100644 index 00000000000..a47efad77d8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [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/net4.7/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md new file mode 100644 index 00000000000..e4b9110e6a6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FindPetsByStatusStatusParameterInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Foo.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Foo.md new file mode 100644 index 00000000000..b9e7d261736 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/FooGetDefaultResponse.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FooGetDefaultResponse.md new file mode 100644 index 00000000000..47e50daca3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FooGetDefaultResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FooGetDefaultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [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/net4.7/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md new file mode 100644 index 00000000000..0983002c5da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md @@ -0,0 +1,28 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Number** | **decimal** | | +**Password** | **string** | | +**Binary** | **System.IO.Stream** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Decimal** | **decimal** | | [optional] +**Double** | **double** | | [optional] +**Float** | **float** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Integer** | **int** | | [optional] +**PatternWithBackslash** | **string** | None | [optional] +**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] +**String** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] +**Uuid** | **Guid** | | [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/net4.7/FormModels/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/FormModels/docs/models/FruitReq.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FruitReq.md new file mode 100644 index 00000000000..38ab0c1a6ca --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FruitReq.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/GmFruit.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/GmFruit.md new file mode 100644 index 00000000000..584c4fd323d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/GmFruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/FormModels/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/GrandparentAnimal.md new file mode 100644 index 00000000000..eca96162b6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.7/FormModels/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/HasOnlyReadOnly.md new file mode 100644 index 00000000000..060a614a698 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/HealthCheckResult.md new file mode 100644 index 00000000000..682cfc50e3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.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] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/IsoscelesTriangle.md new file mode 100644 index 00000000000..07c62ac9338 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/FormModels/docs/models/List.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/List.md new file mode 100644 index 00000000000..0b54858ac24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | **string** | | [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/net4.7/FormModels/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Mammal.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Mammal.md new file mode 100644 index 00000000000..ac14f00c0ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Mammal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/FormModels/docs/models/MapTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MapTest.md new file mode 100644 index 00000000000..b2dea1b6cb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | [**Dictionary<string, MapTestMapOfEnumStringValue>**](MapTestMapOfEnumStringValue.md) | | [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/net4.7/FormModels/docs/models/MapTestMapOfEnumStringValue.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MapTestMapOfEnumStringValue.md new file mode 100644 index 00000000000..f587f829988 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MapTestMapOfEnumStringValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.MapTestMapOfEnumStringValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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/net4.7/FormModels/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/net4.7/FormModels/docs/models/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/net4.7/FormModels/docs/models/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..1bc0740add9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] +**Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [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/net4.7/FormModels/docs/models/MixedSubId.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/net4.7/FormModels/docs/models/Model200Response.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Model200Response.md new file mode 100644 index 00000000000..2752a0d87c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] +**Name** | **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/generichost/net4.7/FormModels/docs/models/ModelClient.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ModelClient.md new file mode 100644 index 00000000000..c658e84ef57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarClient** | **string** | | [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/net4.7/FormModels/docs/models/Name.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Name.md new file mode 100644 index 00000000000..ffe61a31d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarName** | **int** | | +**Property** | **string** | | [optional] +**SnakeCase** | **int** | | [optional] [readonly] +**Var123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md new file mode 100644 index 00000000000..25f223a8360 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AObjVariableobject** | **List<Dictionary<string, Object>>** | | +**PkiNotificationtestID** | **int** | | + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/NullableClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableClass.md new file mode 100644 index 00000000000..5d9965f55c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**BooleanProp** | **bool** | | [optional] +**DateProp** | **DateTime** | | [optional] +**DatetimeProp** | **DateTime** | | [optional] +**IntegerProp** | **int** | | [optional] +**NumberProp** | **decimal** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**StringProp** | **string** | | [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/net4.7/FormModels/docs/models/NullableGuidClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableGuidClass.md new file mode 100644 index 00000000000..8d939afe998 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableGuidClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NullableGuidClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [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/net4.7/FormModels/docs/models/NullableShape.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableShape.md new file mode 100644 index 00000000000..2720167ccaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NullableShape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/NumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NumberOnly.md new file mode 100644 index 00000000000..1b83cce764d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [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/net4.7/FormModels/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..9f44c24d19a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bars** | **List<string>** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Id** | **decimal** | | [optional] +**Uuid** | **string** | | [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/net4.7/FormModels/docs/models/OneOfString.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OneOfString.md new file mode 100644 index 00000000000..54caf618776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OneOfString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OneOfString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Order.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Order.md new file mode 100644 index 00000000000..f3fcb0f21f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Complete** | **bool** | | [optional] [default to false] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **OrderStatus** | | [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/net4.7/FormModels/docs/models/OrderStatus.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OrderStatus.md new file mode 100644 index 00000000000..5a80d8efa8c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OrderStatus.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.OrderStatus +Order Status + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/OuterComposite.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterComposite.md new file mode 100644 index 00000000000..8985c59d094 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyBoolean** | **bool** | | [optional] +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [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/net4.7/FormModels/docs/models/OuterEnum.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnum.md new file mode 100644 index 00000000000..36844bc4b17 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..351383f0aea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumInteger.md new file mode 100644 index 00000000000..1013b5b1956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..55e314e3102 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/OuterEnumTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumTest.md new file mode 100644 index 00000000000..b99d27c2c2e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/OuterEnumTest.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ParentPet.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ParentPet.md new file mode 100644 index 00000000000..bdf57005637 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.7/FormModels/docs/models/Pet.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Pet.md new file mode 100644 index 00000000000..2de6e7ef512 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Category** | [**Category**](Category.md) | | [optional] +**Id** | **long** | | [optional] +**Status** | **PetStatus** | | [optional] +**Tags** | [**List<Tag>**](Tag.md) | | [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/net4.7/FormModels/docs/models/PetStatus.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/PetStatus.md new file mode 100644 index 00000000000..c710ca8cbce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/PetStatus.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.PetStatus +pet status in the store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Pig.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Pig.md new file mode 100644 index 00000000000..fd7bb9359ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/FormModels/docs/models/PolymorphicProperty.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/PolymorphicProperty.md new file mode 100644 index 00000000000..4507ec41cd5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/PolymorphicProperty.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PolymorphicProperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Quadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Quadrilateral.md new file mode 100644 index 00000000000..fbbf4f81cec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Quadrilateral.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.7/FormModels/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/QuadrilateralInterface.md new file mode 100644 index 00000000000..756ba09c6dd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.7/FormModels/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ReadOnlyFirst.md new file mode 100644 index 00000000000..afaf2ee4fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [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/net4.7/FormModels/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClass.md new file mode 100644 index 00000000000..11265eef841 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClass.md @@ -0,0 +1,53 @@ +# Org.OpenAPITools.Model.RequiredClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequiredNotNullableDateProp** | **DateTime** | | +**RequiredNotnullableArrayOfString** | **List<string>** | | +**RequiredNotnullableBooleanProp** | **bool** | | +**RequiredNotnullableDatetimeProp** | **DateTime** | | +**RequiredNotnullableEnumInteger** | **RequiredClassRequiredNotnullableEnumInteger** | | +**RequiredNotnullableEnumIntegerOnly** | **RequiredClassRequiredNotnullableEnumIntegerOnly** | | +**RequiredNotnullableEnumString** | **RequiredClassRequiredNotnullableEnumString** | | +**RequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNotnullableStringProp** | **string** | | +**RequiredNotnullableUuid** | **Guid** | | +**RequiredNotnullableintegerProp** | **int** | | +**NotRequiredNotnullableDateProp** | **DateTime** | | [optional] +**NotRequiredNotnullableintegerProp** | **int** | | [optional] +**NotRequiredNullableDateProp** | **DateTime** | | [optional] +**NotRequiredNullableIntegerProp** | **int** | | [optional] +**NotrequiredNotnullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNotnullableBooleanProp** | **bool** | | [optional] +**NotrequiredNotnullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNotnullableEnumInteger** | **RequiredClassRequiredNotnullableEnumInteger** | | [optional] +**NotrequiredNotnullableEnumIntegerOnly** | **RequiredClassRequiredNotnullableEnumIntegerOnly** | | [optional] +**NotrequiredNotnullableEnumString** | **RequiredClassRequiredNotnullableEnumString** | | [optional] +**NotrequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNotnullableStringProp** | **string** | | [optional] +**NotrequiredNotnullableUuid** | **Guid** | | [optional] +**NotrequiredNullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNullableBooleanProp** | **bool** | | [optional] +**NotrequiredNullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNullableEnumInteger** | **RequiredClassRequiredNullableEnumInteger** | | [optional] +**NotrequiredNullableEnumIntegerOnly** | **RequiredClassRequiredNullableEnumIntegerOnly** | | [optional] +**NotrequiredNullableEnumString** | **RequiredClassRequiredNullableEnumString** | | [optional] +**NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNullableStringProp** | **string** | | [optional] +**NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateTime** | | +**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/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md new file mode 100644 index 00000000000..e229576c45b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md new file mode 100644 index 00000000000..da648bc919d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md new file mode 100644 index 00000000000..d0e080d727c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md new file mode 100644 index 00000000000..7f04aa4d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md new file mode 100644 index 00000000000..2d0eb8b05c5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md new file mode 100644 index 00000000000..cb0fbdac213 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/Return.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Return.md new file mode 100644 index 00000000000..ad96a170bbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Return.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lock** | **string** | | +**Abstract** | **string** | | +**VarReturn** | **int** | | [optional] +**Unsafe** | **string** | | [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/net4.7/FormModels/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **Guid** | | [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/net4.7/FormModels/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/RolesReportsHashRole.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.RolesReportsHashRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.7/FormModels/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ScaleneTriangle.md new file mode 100644 index 00000000000..d3f15354bcc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/FormModels/docs/models/Shape.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Shape.md new file mode 100644 index 00000000000..ae75c592540 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Shape.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/ShapeInterface.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ShapeInterface.md new file mode 100644 index 00000000000..882d3186830 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ShapeOrNull.md new file mode 100644 index 00000000000..7fcd31a3a5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ShapeOrNull.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/SimpleQuadrilateral.md new file mode 100644 index 00000000000..a9c7f93b67a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.7/FormModels/docs/models/SpecialModelName.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/SpecialModelName.md new file mode 100644 index 00000000000..890bcd923de --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarSpecialModelName** | **string** | | [optional] +**SpecialPropertyName** | **long** | | [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/net4.7/FormModels/docs/models/Tag.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Tag.md new file mode 100644 index 00000000000..2b2d9674d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [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/net4.7/FormModels/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **string** | | [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/net4.7/FormModels/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.md) | | [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/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md new file mode 100644 index 00000000000..b5768f76fa5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumHeaderStringParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md new file mode 100644 index 00000000000..72510955c1a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumQueryDoubleParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md new file mode 100644 index 00000000000..b2c9b9c5a9d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumQueryIntegerParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md new file mode 100644 index 00000000000..b734496b5fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestEnumParametersRequestEnumFormString +Form parameter enum test (string) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md new file mode 100644 index 00000000000..ca4e762853a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersRequestEnumFormStringArrayInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [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/net4.7/FormModels/docs/models/Triangle.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Triangle.md new file mode 100644 index 00000000000..e1510991195 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Triangle.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.7/FormModels/docs/models/TriangleInterface.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TriangleInterface.md new file mode 100644 index 00000000000..4127c08b14f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.7/FormModels/docs/models/User.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/User.md new file mode 100644 index 00000000000..b5700f1c75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**Email** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**Id** | **long** | | [optional] +**LastName** | **string** | | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**Username** | **string** | | [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/net4.7/FormModels/docs/models/Whale.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Whale.md new file mode 100644 index 00000000000..1c633fdce61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [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/net4.7/FormModels/docs/models/Zebra.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Zebra.md new file mode 100644 index 00000000000..5b0d6780969 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Type** | **ZebraType** | | [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/net4.7/FormModels/docs/models/ZebraType.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZebraType.md new file mode 100644 index 00000000000..d3197017490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZebraType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZebraType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnum.md new file mode 100644 index 00000000000..cb71966c4c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/models/ZeroBasedEnumClass.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnumClass.md new file mode 100644 index 00000000000..afb2e863064 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnumClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ZeroBasedEnum** | **ZeroBasedEnumClassZeroBasedEnum** | | [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/net4.7/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md new file mode 100644 index 00000000000..bf5145894ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClassZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/FormModels/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..cf82a3e39bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..c178aac4eab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + string apiKeyTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken1 = new ApiKeyToken(apiKeyTokenValue1, ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + string apiKeyTokenValue2 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken2 = new ApiKeyToken(apiKeyTokenValue2, ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + string bearerTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken1 = new BearerToken(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + string basicTokenUsername1 = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword1 = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken1 = new BasicToken(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + string oauthTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken1 = new OAuthToken(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..88cf05ba9ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + var model = response.Default(); + Assert.IsType(model); + } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test RolesReportGet + /// + [Fact (Skip = "not implemented")] + public async Task RolesReportGetAsyncTest() + { + var response = await _instance.RolesReportGetAsync(); + var model = response.Ok(); + Assert.IsType>>(model); + } + + /// + /// Test Test + /// + [Fact (Skip = "not implemented")] + public async Task TestAsyncTest() + { + var response = await _instance.TestAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..bbccd77b29c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,243 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..00017fc4214 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + Client.Option outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + Guid requiredStringUuid = default; + Client.Option body = default; + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + User user = default; + string query = default; + await _instance.TestBodyWithQueryParamsAsync(user, query); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + byte[] varByte = default; + decimal number = default; + double varDouble = default; + string patternWithoutDelimiter = default; + Client.Option date = default; + Client.Option binary = default; + Client.Option varFloat = default; + Client.Option integer = default; + Client.Option int32 = default; + Client.Option int64 = default; + Client.Option varString = default; + Client.Option password = default; + Client.Option callback = default; + Client.Option dateTime = default; + await _instance.TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + Client.Option> enumHeaderStringArray = default; + Client.Option> enumQueryStringArray = default; + Client.Option> enumFormStringArray = default; + Client.Option enumHeaderString = default; + Client.Option enumQueryString = default; + Client.Option enumQueryDouble = default; + Client.Option enumQueryInteger = default; + Client.Option enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + bool requiredBooleanGroup = default; + int requiredStringGroup = default; + long requiredInt64Group = default; + Client.Option booleanGroup = default; + Client.Option stringGroup = default; + Client.Option int64Group = default; + await _instance.TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestInlineFreeformAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineFreeformAdditionalPropertiesAsyncTest() + { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default; + await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + string requiredNotNullable = default; + string requiredNullable = default; + Client.Option notRequiredNotNullable = default; + 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/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..5964bf6e51d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..01ef5de875e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + Client.Option apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + Client.Option name = default; + Client.Option status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + Client.Option file = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileAsync(petId, file, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + System.IO.Stream requiredFile = default; + long petId = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..1b75e341700 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..38ee1125438 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + User user = default; + string username = default; + await _instance.UpdateUserAsync(user, username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..adbf639fd72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -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 + * 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 ActivityOutputElementRepresentation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityOutputElementRepresentationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation + //private ActivityOutputElementRepresentation instance; + + public ActivityOutputElementRepresentationTests() + { + // TODO uncomment below to create an instance of ActivityOutputElementRepresentation + //instance = new ActivityOutputElementRepresentation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ActivityOutputElementRepresentation + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..6cc2927eaaf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -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 + * 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 Activity + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Activity + //private Activity instance; + + public ActivityTests() + { + // TODO uncomment below to create an instance of Activity + //instance = new Activity(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Activity + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..e157b477193 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -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 + * 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 AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..1db9725afb8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -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 + * 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 Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..c296a82116a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -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 + * 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 ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 00000000000..d698ee44504 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -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 + * 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 AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..c7c8ccd47c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -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 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'ColorCode' + /// + [Fact] + public void ColorCodeTest() + { + // TODO unit test for the property 'ColorCode' + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..29fe9cfb1d4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..2b0956c0b98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..3b01d0b7abb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -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 + * 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 ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 00000000000..1e54c1f3e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -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 + * 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 BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5a88e9dabbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -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 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 00000000000..4ffd6c2c0c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -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 + * 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 BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..d0391fb47f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -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 + * 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 Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 00000000000..a5d4bf43bbf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -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 + * 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 Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..7fe8f333c81 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -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 + * 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 Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs new file mode 100644 index 00000000000..f24fa44b0e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs @@ -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 + * 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 ChildCatAllOfPetType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfPetTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOfPetType + //private ChildCatAllOfPetType instance; + + public ChildCatAllOfPetTypeTests() + { + // TODO uncomment below to create an instance of ChildCatAllOfPetType + //instance = new ChildCatAllOfPetType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOfPetType + /// + [Fact] + public void ChildCatAllOfPetTypeInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOfPetType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 00000000000..4aecdf9bed3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -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 + * 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 ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..a866bfbe242 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -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 + * 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 ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 00000000000..a7a864154ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -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 + * 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 ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 00000000000..e7c505b5136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -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 + * 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 DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs new file mode 100644 index 00000000000..83a4185e53d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -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 + * 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 DateOnlyClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DateOnlyClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DateOnlyClass + //private DateOnlyClass instance; + + public DateOnlyClassTests() + { + // TODO uncomment below to create an instance of DateOnlyClass + //instance = new DateOnlyClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DateOnlyClass + /// + [Fact] + public void DateOnlyClassInstanceTest() + { + // TODO uncomment below to test "IsType" DateOnlyClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateOnlyProperty' + /// + [Fact] + public void DateOnlyPropertyTest() + { + // TODO unit test for the property 'DateOnlyProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 00000000000..95e56f782da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -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 + * 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 DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 00000000000..b8e8bca0538 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -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 + * 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 Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 00000000000..a2de4a1b97b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs new file mode 100644 index 00000000000..131ed18d63f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs @@ -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 + * 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 EnumArraysArrayEnumInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysArrayEnumInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArraysArrayEnumInner + //private EnumArraysArrayEnumInner instance; + + public EnumArraysArrayEnumInnerTests() + { + // TODO uncomment below to create an instance of EnumArraysArrayEnumInner + //instance = new EnumArraysArrayEnumInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArraysArrayEnumInner + /// + [Fact] + public void EnumArraysArrayEnumInnerInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArraysArrayEnumInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs new file mode 100644 index 00000000000..98fb4af3a1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs @@ -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 + * 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 EnumArraysJustSymbol + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysJustSymbolTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArraysJustSymbol + //private EnumArraysJustSymbol instance; + + public EnumArraysJustSymbolTests() + { + // TODO uncomment below to create an instance of EnumArraysJustSymbol + //instance = new EnumArraysJustSymbol(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArraysJustSymbol + /// + [Fact] + public void EnumArraysJustSymbolInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArraysJustSymbol + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..c6fee27690b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -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 + * 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 EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..44dbbe4d324 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -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 + * 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 EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..5354a6a395c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs @@ -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 + * 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 EnumTestEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumIntegerOnly + //private EnumTestEnumIntegerOnly instance; + + public EnumTestEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of EnumTestEnumIntegerOnly + //instance = new EnumTestEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumIntegerOnly + /// + [Fact] + public void EnumTestEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs new file mode 100644 index 00000000000..da32ebb09ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs @@ -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 + * 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 EnumTestEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumInteger + //private EnumTestEnumInteger instance; + + public EnumTestEnumIntegerTests() + { + // TODO uncomment below to create an instance of EnumTestEnumInteger + //instance = new EnumTestEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumInteger + /// + [Fact] + public void EnumTestEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs new file mode 100644 index 00000000000..02321eb5de6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs @@ -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 + * 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 EnumTestEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumString + //private EnumTestEnumString instance; + + public EnumTestEnumStringTests() + { + // TODO uncomment below to create an instance of EnumTestEnumString + //instance = new EnumTestEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumString + /// + [Fact] + public void EnumTestEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..3781eebbfcf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -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 + * 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 EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 00000000000..f8d3daec3fe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -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 + * 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 EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 00000000000..e2685848d5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -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 + * 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 FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 00000000000..c305c5356b0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -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 + * 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 File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs new file mode 100644 index 00000000000..33d0a40c803 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs @@ -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 + * 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 FindPetsByStatusStatusParameterInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FindPetsByStatusStatusParameterInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FindPetsByStatusStatusParameterInner + //private FindPetsByStatusStatusParameterInner instance; + + public FindPetsByStatusStatusParameterInnerTests() + { + // TODO uncomment below to create an instance of FindPetsByStatusStatusParameterInner + //instance = new FindPetsByStatusStatusParameterInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FindPetsByStatusStatusParameterInner + /// + [Fact] + public void FindPetsByStatusStatusParameterInnerInstanceTest() + { + // TODO uncomment below to test "IsType" FindPetsByStatusStatusParameterInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs new file mode 100644 index 00000000000..55086a7cf24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -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 + * 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 FooGetDefaultResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooGetDefaultResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FooGetDefaultResponse + //private FooGetDefaultResponse instance; + + public FooGetDefaultResponseTests() + { + // TODO uncomment below to create an instance of FooGetDefaultResponse + //instance = new FooGetDefaultResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FooGetDefaultResponse + /// + [Fact] + public void FooGetDefaultResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FooGetDefaultResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 00000000000..871506eeaac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -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 + * 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 Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..b658f317f1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + + /// + /// Test the property 'PatternWithBackslash' + /// + [Fact] + public void PatternWithBackslashTest() + { + // TODO unit test for the property 'PatternWithBackslash' + } + + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 00000000000..a33c55ae487 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -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 + * 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 FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..46448efc62f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -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 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 00000000000..7e79cd06792 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -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 + * 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 GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 00000000000..5f0e8672ed5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -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 + * 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 GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..134a7d515eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -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 + * 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 HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 00000000000..18bb8672e98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -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 + * 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 HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 00000000000..464750233cd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -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 + * 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 IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 00000000000..d95303d9751 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -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 + * 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 List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + /// + /// Test the property 'Var123List' + /// + [Fact] + public void Var123ListTest() + { + // TODO unit test for the property 'Var123List' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..31d21de5b60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * 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 LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 00000000000..64bd9e89034 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -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 + * 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 Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs new file mode 100644 index 00000000000..37713bb0496 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs @@ -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 + * 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 MapTestMapOfEnumStringValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestMapOfEnumStringValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTestMapOfEnumStringValue + //private MapTestMapOfEnumStringValue instance; + + public MapTestMapOfEnumStringValueTests() + { + // TODO uncomment below to create an instance of MapTestMapOfEnumStringValue + //instance = new MapTestMapOfEnumStringValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTestMapOfEnumStringValue + /// + [Fact] + public void MapTestMapOfEnumStringValueInstanceTest() + { + // TODO uncomment below to test "IsType" MapTestMapOfEnumStringValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..2dc6d8d8e04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..d3689c15f40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..3b5e94c5f8f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -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 + * 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 Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..5a986cfdc6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -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 + * 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 ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarClient' + /// + [Fact] + public void VarClientTest() + { + // TODO unit test for the property 'VarClient' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 00000000000..3aac92ae468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarName' + /// + [Fact] + public void VarNameTest() + { + // TODO unit test for the property 'VarName' + } + + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + + /// + /// Test the property 'Var123Number' + /// + [Fact] + public void Var123NumberTest() + { + // TODO unit test for the property 'Var123Number' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs new file mode 100644 index 00000000000..dd3b74e3306 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs @@ -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 + * 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 NotificationtestGetElementsV1ResponseMPayload + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NotificationtestGetElementsV1ResponseMPayloadTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NotificationtestGetElementsV1ResponseMPayload + //private NotificationtestGetElementsV1ResponseMPayload instance; + + public NotificationtestGetElementsV1ResponseMPayloadTests() + { + // TODO uncomment below to create an instance of NotificationtestGetElementsV1ResponseMPayload + //instance = new NotificationtestGetElementsV1ResponseMPayload(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NotificationtestGetElementsV1ResponseMPayload + /// + [Fact] + public void NotificationtestGetElementsV1ResponseMPayloadInstanceTest() + { + // TODO uncomment below to test "IsType" NotificationtestGetElementsV1ResponseMPayload + //Assert.IsType(instance); + } + + /// + /// Test the property 'AObjVariableobject' + /// + [Fact] + public void AObjVariableobjectTest() + { + // TODO unit test for the property 'AObjVariableobject' + } + + /// + /// Test the property 'PkiNotificationtestID' + /// + [Fact] + public void PkiNotificationtestIDTest() + { + // TODO unit test for the property 'PkiNotificationtestID' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 00000000000..1e19aa6b823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs new file mode 100644 index 00000000000..db8c9aa0956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -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 + * 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 NullableGuidClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableGuidClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableGuidClass + //private NullableGuidClass instance; + + public NullableGuidClassTests() + { + // TODO uncomment below to create an instance of NullableGuidClass + //instance = new NullableGuidClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableGuidClass + /// + [Fact] + public void NullableGuidClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableGuidClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 00000000000..e65ba44efa2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -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 + * 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 NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..2b88fb1a609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -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 + * 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 NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 00000000000..078655aaba7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs new file mode 100644 index 00000000000..8ef411a15eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs @@ -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 + * 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 OneOfString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OneOfStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OneOfString + //private OneOfString instance; + + public OneOfStringTests() + { + // TODO uncomment below to create an instance of OneOfString + //instance = new OneOfString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OneOfString + /// + [Fact] + public void OneOfStringInstanceTest() + { + // TODO uncomment below to test "IsType" OneOfString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs new file mode 100644 index 00000000000..4b9bcdbbc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs @@ -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 + * 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 OrderStatus + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderStatusTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OrderStatus + //private OrderStatus instance; + + public OrderStatusTests() + { + // TODO uncomment below to create an instance of OrderStatus + //instance = new OrderStatus(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OrderStatus + /// + [Fact] + public void OrderStatusInstanceTest() + { + // TODO uncomment below to test "IsType" OrderStatus + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..e7187bbdc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -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 + * 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 Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..0bb8ce5e5d9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -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 + * 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 OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 00000000000..a1d1e152777 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -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 + * 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 OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 00000000000..030326d7579 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -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 + * 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 OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 00000000000..1f3bfe459e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -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 + * 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 OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs new file mode 100644 index 00000000000..c4cb8eeecee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs @@ -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 + * 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 OuterEnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumTest + //private OuterEnumTest instance; + + public OuterEnumTestTests() + { + // TODO uncomment below to create an instance of OuterEnumTest + //instance = new OuterEnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumTest + /// + [Fact] + public void OuterEnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumTest + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..2859494010b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -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 + * 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 OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 00000000000..b0ebddd374f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -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 + * 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 ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs new file mode 100644 index 00000000000..0b3bb9f168b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs @@ -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 + * 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 PetStatus + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetStatusTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PetStatus + //private PetStatus instance; + + public PetStatusTests() + { + // TODO uncomment below to create an instance of PetStatus + //instance = new PetStatus(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PetStatus + /// + [Fact] + public void PetStatusInstanceTest() + { + // TODO uncomment below to test "IsType" PetStatus + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 00000000000..8485d1213ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -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 + * 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 Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 00000000000..bd052bc705b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -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 + * 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 Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs new file mode 100644 index 00000000000..23120ba7bdf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -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 + * 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 PolymorphicProperty + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PolymorphicPropertyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PolymorphicProperty + //private PolymorphicProperty instance; + + public PolymorphicPropertyTests() + { + // TODO uncomment below to create an instance of PolymorphicProperty + //instance = new PolymorphicProperty(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PolymorphicProperty + /// + [Fact] + public void PolymorphicPropertyInstanceTest() + { + // TODO uncomment below to test "IsType" PolymorphicProperty + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 00000000000..2ddd31cfcbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -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 + * 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 QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 00000000000..65673847d75 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -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 + * 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 Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..a4c91cf44a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -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 + * 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 ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..d0f0ae6b6f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumIntegerOnly + //private RequiredClassRequiredNotnullableEnumIntegerOnly instance; + + public RequiredClassRequiredNotnullableEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumIntegerOnly + //instance = new RequiredClassRequiredNotnullableEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumIntegerOnly + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs new file mode 100644 index 00000000000..60c35933cc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumInteger + //private RequiredClassRequiredNotnullableEnumInteger instance; + + public RequiredClassRequiredNotnullableEnumIntegerTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumInteger + //instance = new RequiredClassRequiredNotnullableEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumInteger + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs new file mode 100644 index 00000000000..0cd9b817a01 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumString + //private RequiredClassRequiredNotnullableEnumString instance; + + public RequiredClassRequiredNotnullableEnumStringTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumString + //instance = new RequiredClassRequiredNotnullableEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumString + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..890639ce905 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumIntegerOnly + //private RequiredClassRequiredNullableEnumIntegerOnly instance; + + public RequiredClassRequiredNullableEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumIntegerOnly + //instance = new RequiredClassRequiredNullableEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumIntegerOnly + /// + [Fact] + public void RequiredClassRequiredNullableEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs new file mode 100644 index 00000000000..ed87acb3c0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumInteger + //private RequiredClassRequiredNullableEnumInteger instance; + + public RequiredClassRequiredNullableEnumIntegerTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumInteger + //instance = new RequiredClassRequiredNullableEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumInteger + /// + [Fact] + public void RequiredClassRequiredNullableEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs new file mode 100644 index 00000000000..965d4bbd2e3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumString + //private RequiredClassRequiredNullableEnumString instance; + + public RequiredClassRequiredNullableEnumStringTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumString + //instance = new RequiredClassRequiredNullableEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumString + /// + [Fact] + public void RequiredClassRequiredNullableEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs new file mode 100644 index 00000000000..d1da68281ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -0,0 +1,452 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 RequiredClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClass + //private RequiredClass instance; + + public RequiredClassTests() + { + // TODO uncomment below to create an instance of RequiredClass + //instance = new RequiredClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClass + /// + [Fact] + public void RequiredClassInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'RequiredNotNullableDateProp' + /// + [Fact] + public void RequiredNotNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNotNullableDateProp' + } + + /// + /// Test the property 'RequiredNotnullableArrayOfString' + /// + [Fact] + public void RequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'RequiredNotnullableBooleanProp' + /// + [Fact] + public void RequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'RequiredNotnullableDatetimeProp' + /// + [Fact] + public void RequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNotnullableEnumInteger' + /// + [Fact] + public void RequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'RequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNotnullableEnumString' + /// + [Fact] + public void RequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumString' + } + + /// + /// Test the property 'RequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNotnullableStringProp' + /// + [Fact] + public void RequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'RequiredNotnullableStringProp' + } + + /// + /// Test the property 'RequiredNotnullableUuid' + /// + [Fact] + public void RequiredNotnullableUuidTest() + { + // TODO unit test for the property 'RequiredNotnullableUuid' + } + + /// + /// Test the property 'RequiredNotnullableintegerProp' + /// + [Fact] + public void RequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'RequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNotnullableDateProp' + /// + [Fact] + public void NotRequiredNotnullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableDateProp' + } + + /// + /// Test the property 'NotRequiredNotnullableintegerProp' + /// + [Fact] + public void NotRequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNullableDateProp' + /// + [Fact] + public void NotRequiredNullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNullableDateProp' + } + + /// + /// Test the property 'NotRequiredNullableIntegerProp' + /// + [Fact] + public void NotRequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'NotRequiredNullableIntegerProp' + } + + /// + /// Test the property 'NotrequiredNotnullableArrayOfString' + /// + [Fact] + public void NotrequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNotnullableBooleanProp' + /// + [Fact] + public void NotrequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNotnullableDatetimeProp' + /// + [Fact] + public void NotrequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumInteger' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumString' + /// + [Fact] + public void NotrequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumString' + } + + /// + /// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNotnullableStringProp' + /// + [Fact] + public void NotrequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableStringProp' + } + + /// + /// Test the property 'NotrequiredNotnullableUuid' + /// + [Fact] + public void NotrequiredNotnullableUuidTest() + { + // TODO unit test for the property 'NotrequiredNotnullableUuid' + } + + /// + /// Test the property 'NotrequiredNullableArrayOfString' + /// + [Fact] + public void NotrequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNullableBooleanProp' + /// + [Fact] + public void NotrequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNullableDatetimeProp' + /// + [Fact] + public void NotrequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNullableEnumInteger' + /// + [Fact] + public void NotrequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNullableEnumString' + /// + [Fact] + public void NotrequiredNullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumString' + } + + /// + /// Test the property 'NotrequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNullableStringProp' + /// + [Fact] + public void NotrequiredNullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNullableStringProp' + } + + /// + /// Test the property 'NotrequiredNullableUuid' + /// + [Fact] + public void NotrequiredNullableUuidTest() + { + // 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/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..bbea79ed951 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //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' + /// + [Fact] + public void VarReturnTest() + { + // 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/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 + * 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 RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashRoleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHashRole + //private RolesReportsHashRole instance; + + public RolesReportsHashRoleTests() + { + // TODO uncomment below to create an instance of RolesReportsHashRole + //instance = new RolesReportsHashRole(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 + * 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 RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHash + //private RolesReportsHash instance; + + public RolesReportsHashTests() + { + // TODO uncomment below to create an instance of RolesReportsHash + //instance = new RolesReportsHash(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 00000000000..085d3e550a1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -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 + * 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 ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 00000000000..62d6d69ff72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -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 + * 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 ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 00000000000..dc6970b16f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -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 + * 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 ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 00000000000..dbdf012c5ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -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 + * 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 Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 00000000000..baa6e1e9f6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -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 + * 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 SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..23763d9c3af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -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 + * 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 SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarSpecialModelName' + /// + [Fact] + public void VarSpecialModelNameTest() + { + // TODO unit test for the property 'VarSpecialModelName' + } + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 00000000000..fe7f3d82bab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -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 + * 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 Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..eca020ce1fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -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 + * 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 TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e3c86aefabe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -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 + * 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 TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs new file mode 100644 index 00000000000..13a2e1eb54f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumHeaderStringParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumHeaderStringParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumHeaderStringParameter + //private TestEnumParametersEnumHeaderStringParameter instance; + + public TestEnumParametersEnumHeaderStringParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumHeaderStringParameter + //instance = new TestEnumParametersEnumHeaderStringParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumHeaderStringParameter + /// + [Fact] + public void TestEnumParametersEnumHeaderStringParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumHeaderStringParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs new file mode 100644 index 00000000000..4d7a6d9b665 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumQueryDoubleParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumQueryDoubleParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumQueryDoubleParameter + //private TestEnumParametersEnumQueryDoubleParameter instance; + + public TestEnumParametersEnumQueryDoubleParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumQueryDoubleParameter + //instance = new TestEnumParametersEnumQueryDoubleParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumQueryDoubleParameter + /// + [Fact] + public void TestEnumParametersEnumQueryDoubleParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumQueryDoubleParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs new file mode 100644 index 00000000000..700dbb98ec9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumQueryIntegerParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumQueryIntegerParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumQueryIntegerParameter + //private TestEnumParametersEnumQueryIntegerParameter instance; + + public TestEnumParametersEnumQueryIntegerParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumQueryIntegerParameter + //instance = new TestEnumParametersEnumQueryIntegerParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumQueryIntegerParameter + /// + [Fact] + public void TestEnumParametersEnumQueryIntegerParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumQueryIntegerParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs new file mode 100644 index 00000000000..9dd379868e6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs @@ -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 + * 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 TestEnumParametersRequestEnumFormStringArrayInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersRequestEnumFormStringArrayInner + //private TestEnumParametersRequestEnumFormStringArrayInner instance; + + public TestEnumParametersRequestEnumFormStringArrayInnerTests() + { + // TODO uncomment below to create an instance of TestEnumParametersRequestEnumFormStringArrayInner + //instance = new TestEnumParametersRequestEnumFormStringArrayInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersRequestEnumFormStringArrayInner + /// + [Fact] + public void TestEnumParametersRequestEnumFormStringArrayInnerInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersRequestEnumFormStringArrayInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs new file mode 100644 index 00000000000..a99aa2d7d3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs @@ -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 + * 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 TestEnumParametersRequestEnumFormString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersRequestEnumFormStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersRequestEnumFormString + //private TestEnumParametersRequestEnumFormString instance; + + public TestEnumParametersRequestEnumFormStringTests() + { + // TODO uncomment below to create an instance of TestEnumParametersRequestEnumFormString + //instance = new TestEnumParametersRequestEnumFormString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersRequestEnumFormString + /// + [Fact] + public void TestEnumParametersRequestEnumFormStringInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersRequestEnumFormString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -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 + * 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 TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 00000000000..1293a2b212e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -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 + * 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 TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 00000000000..4cb53522348 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -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 + * 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 Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 00000000000..6415f8561f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 00000000000..7d05cc5e59a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -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 + * 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 Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 00000000000..cd0d1c1c361 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -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 + * 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 Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs new file mode 100644 index 00000000000..d257a4a319e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs @@ -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 + * 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 ZebraType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZebraType + //private ZebraType instance; + + public ZebraTypeTests() + { + // TODO uncomment below to create an instance of ZebraType + //instance = new ZebraType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZebraType + /// + [Fact] + public void ZebraTypeInstanceTest() + { + // TODO uncomment below to test "IsType" ZebraType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs new file mode 100644 index 00000000000..b432edb28c2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs @@ -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 + * 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 ZeroBasedEnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClass + //private ZeroBasedEnumClass instance; + + public ZeroBasedEnumClassTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClass + //instance = new ZeroBasedEnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClass + /// + [Fact] + public void ZeroBasedEnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ZeroBasedEnum' + /// + [Fact] + public void ZeroBasedEnumTest() + { + // TODO unit test for the property 'ZeroBasedEnum' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs new file mode 100644 index 00000000000..42fabdfc6a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnumClassZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClassZeroBasedEnum + //private ZeroBasedEnumClassZeroBasedEnum instance; + + public ZeroBasedEnumClassZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClassZeroBasedEnum + //instance = new ZeroBasedEnumClassZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClassZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumClassZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClassZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs new file mode 100644 index 00000000000..3689a873c34 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnum + //private ZeroBasedEnum instance; + + public ZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnum + //instance = new ZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..c629057faad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,402 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IAnotherFakeApi : IApi + { + /// + /// The class containing the events + /// + AnotherFakeApiEvents Events { get; } + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICall123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class AnotherFakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCall123TestSpecialTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCall123TestSpecialTags; + + internal void ExecuteOnCall123TestSpecialTags(AnotherFakeApi.Call123TestSpecialTagsApiResponse apiResponse) + { + OnCall123TestSpecialTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCall123TestSpecialTags(Exception exception) + { + OnErrorCall123TestSpecialTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class AnotherFakeApi : IAnotherFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public AnotherFakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, AnotherFakeApiEvents anotherFakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = anotherFakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCall123TestSpecialTags(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCall123TestSpecialTags(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCall123TestSpecialTagsDefaultImplementation(ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterCall123TestSpecialTags(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCall123TestSpecialTags(ref bool suppressDefaultLog, ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorCall123TestSpecialTags(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await Call123TestSpecialTagsAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCall123TestSpecialTags(modelClient); + + FormatCall123TestSpecialTags(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + Call123TestSpecialTagsApiResponse apiResponseLocalVar = new Call123TestSpecialTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/another-fake/dummy", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCall123TestSpecialTagsDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnCall123TestSpecialTags(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCall123TestSpecialTagsDefaultImplementation(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorCall123TestSpecialTags(e); + throw; + } + } + + /// + /// The + /// + public partial class Call123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, ICall123TestSpecialTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public Call123TestSpecialTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..d58e3391473 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,1352 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task HelloAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Cancellation Token to cancel the request. + /// <> + Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task TestAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFooGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IDefault + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IGetCountryApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IHelloApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFooGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFooGet; + + internal void ExecuteOnFooGet(DefaultApi.FooGetApiResponse apiResponse) + { + OnFooGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFooGet(Exception exception) + { + OnErrorFooGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetCountry; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetCountry; + + internal void ExecuteOnGetCountry(DefaultApi.GetCountryApiResponse apiResponse) + { + OnGetCountry?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetCountry(Exception exception) + { + OnErrorGetCountry?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnHello; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorHello; + + internal void ExecuteOnHello(DefaultApi.HelloApiResponse apiResponse) + { + OnHello?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorHello(Exception exception) + { + OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(DefaultApi.RolesReportGetApiResponse apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTest; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTest; + + internal void ExecuteOnTest(DefaultApi.TestApiResponse apiResponse) + { + OnTest?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTest(Exception exception) + { + OnErrorTest?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFooGetDefaultImplementation(IFooGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFooGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFooGet(ref bool suppressDefaultLog, IFooGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFooGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFooGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFooGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FooGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FooGetApiResponse apiResponseLocalVar = new FooGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/foo", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFooGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFooGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFooGetDefaultImplementation(e, "/foo", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFooGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FooGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFooGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + /// + /// Deserializes the response if the response is 0 Default + /// + /// + public Org.OpenAPITools.Model.FooGetDefaultResponse Default() + { + // This logic may be modified with the AsModel.mustache template + return IsDefault + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 0 Default and the deserialized response is not null + /// + /// + /// + public bool TryDefault(out Org.OpenAPITools.Model.FooGetDefaultResponse result) + { + result = null; + + try + { + result = Default(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)0); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetCountry(ref string country); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetCountry(string country) + { + if (country == null) + throw new ArgumentNullException(nameof(country)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetCountryDefaultImplementation(IGetCountryApiResponse apiResponseLocalVar, string country) + { + bool suppressDefaultLog = false; + AfterGetCountry(ref suppressDefaultLog, apiResponseLocalVar, country); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetCountry(ref bool suppressDefaultLog, IGetCountryApiResponse apiResponseLocalVar, string country); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetCountryDefaultImplementation(Exception exception, string pathFormat, string path, string country) + { + bool suppressDefaultLog = false; + OnErrorGetCountry(ref suppressDefaultLog, exception, pathFormat, path, country); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetCountry(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string country); + + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetCountryAsync(country, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetCountry(country); + + FormatGetCountry(ref country); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetCountryApiResponse apiResponseLocalVar = new GetCountryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/country", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetCountryDefaultImplementation(apiResponseLocalVar, country); + + Events.ExecuteOnGetCountry(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetCountryDefaultImplementation(e, "/country", uriBuilderLocalVar.Path, country); + Events.ExecuteOnErrorGetCountry(e); + throw; + } + } + + /// + /// The + /// + public partial class GetCountryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetCountryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetCountryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterHelloDefaultImplementation(IHelloApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterHello(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterHello(ref bool suppressDefaultLog, IHelloApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorHelloDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorHello(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorHello(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Hello Hello + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await HelloAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + HelloApiResponse apiResponseLocalVar = new HelloApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/hello", requestedAtLocalVar, _jsonSerializerOptions); + + AfterHelloDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnHello(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHelloDefaultImplementation(e, "/hello", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorHello(e); + throw; + } + } + + /// + /// The + /// + public partial class HelloApiResponse : Org.OpenAPITools.Client.ApiResponse, IHelloApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(IRolesReportGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, IRolesReportGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RolesReportGetApiResponse apiResponseLocalVar = new RolesReportGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RolesReportGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRolesReportGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RolesReportGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterTestDefaultImplementation(ITestApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterTest(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterTest(ref bool suppressDefaultLog, ITestApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorTestDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorTest(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorTest(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/test"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestApiResponse apiResponseLocalVar = new TestApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnTest(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestDefaultImplementation(e, "/test", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorTest(e); + throw; + } + } + + /// + /// The + /// + public partial class TestApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 00000000000..01eeeb00511 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,5673 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeApi : IApi + { + /// + /// The class containing the events + /// + FakeApiEvents Events { get; } + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFakeHealthGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestClientModelApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestEndpointParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestEnumParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestGroupParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ITestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestJsonFormDataApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeHealthGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeHealthGet; + + internal void ExecuteOnFakeHealthGet(FakeApi.FakeHealthGetApiResponse apiResponse) + { + OnFakeHealthGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeHealthGet(Exception exception) + { + OnErrorFakeHealthGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterBooleanSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterBooleanSerialize; + + internal void ExecuteOnFakeOuterBooleanSerialize(FakeApi.FakeOuterBooleanSerializeApiResponse apiResponse) + { + OnFakeOuterBooleanSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterBooleanSerialize(Exception exception) + { + OnErrorFakeOuterBooleanSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterCompositeSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterCompositeSerialize; + + internal void ExecuteOnFakeOuterCompositeSerialize(FakeApi.FakeOuterCompositeSerializeApiResponse apiResponse) + { + OnFakeOuterCompositeSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterCompositeSerialize(Exception exception) + { + OnErrorFakeOuterCompositeSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterNumberSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterNumberSerialize; + + internal void ExecuteOnFakeOuterNumberSerialize(FakeApi.FakeOuterNumberSerializeApiResponse apiResponse) + { + OnFakeOuterNumberSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterNumberSerialize(Exception exception) + { + OnErrorFakeOuterNumberSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterStringSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterStringSerialize; + + internal void ExecuteOnFakeOuterStringSerialize(FakeApi.FakeOuterStringSerializeApiResponse apiResponse) + { + OnFakeOuterStringSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterStringSerialize(Exception exception) + { + OnErrorFakeOuterStringSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetArrayOfEnums; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetArrayOfEnums; + + internal void ExecuteOnGetArrayOfEnums(FakeApi.GetArrayOfEnumsApiResponse apiResponse) + { + OnGetArrayOfEnums?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetArrayOfEnums(Exception exception) + { + OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestAdditionalPropertiesReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestAdditionalPropertiesReference; + + internal void ExecuteOnTestAdditionalPropertiesReference(FakeApi.TestAdditionalPropertiesReferenceApiResponse apiResponse) + { + OnTestAdditionalPropertiesReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestAdditionalPropertiesReference(Exception exception) + { + OnErrorTestAdditionalPropertiesReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithFileSchema; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithFileSchema; + + internal void ExecuteOnTestBodyWithFileSchema(FakeApi.TestBodyWithFileSchemaApiResponse apiResponse) + { + OnTestBodyWithFileSchema?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithFileSchema(Exception exception) + { + OnErrorTestBodyWithFileSchema?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithQueryParams; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithQueryParams; + + internal void ExecuteOnTestBodyWithQueryParams(FakeApi.TestBodyWithQueryParamsApiResponse apiResponse) + { + OnTestBodyWithQueryParams?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithQueryParams(Exception exception) + { + OnErrorTestBodyWithQueryParams?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClientModel; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClientModel; + + internal void ExecuteOnTestClientModel(FakeApi.TestClientModelApiResponse apiResponse) + { + OnTestClientModel?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClientModel(Exception exception) + { + OnErrorTestClientModel?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEndpointParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEndpointParameters; + + internal void ExecuteOnTestEndpointParameters(FakeApi.TestEndpointParametersApiResponse apiResponse) + { + OnTestEndpointParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEndpointParameters(Exception exception) + { + OnErrorTestEndpointParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEnumParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEnumParameters; + + internal void ExecuteOnTestEnumParameters(FakeApi.TestEnumParametersApiResponse apiResponse) + { + OnTestEnumParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEnumParameters(Exception exception) + { + OnErrorTestEnumParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestGroupParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestGroupParameters; + + internal void ExecuteOnTestGroupParameters(FakeApi.TestGroupParametersApiResponse apiResponse) + { + OnTestGroupParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestGroupParameters(Exception exception) + { + OnErrorTestGroupParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineAdditionalProperties; + + internal void ExecuteOnTestInlineAdditionalProperties(FakeApi.TestInlineAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineAdditionalProperties(Exception exception) + { + OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(FakeApi.TestInlineFreeformAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestJsonFormData; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestJsonFormData; + + internal void ExecuteOnTestJsonFormData(FakeApi.TestJsonFormDataApiResponse apiResponse) + { + OnTestJsonFormData?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestJsonFormData(Exception exception) + { + OnErrorTestJsonFormData?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestQueryParameterCollectionFormat; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestQueryParameterCollectionFormat; + + internal void ExecuteOnTestQueryParameterCollectionFormat(FakeApi.TestQueryParameterCollectionFormatApiResponse apiResponse) + { + OnTestQueryParameterCollectionFormat?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception exception) + { + OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeApi : IFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeApiEvents fakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFakeHealthGetDefaultImplementation(IFakeHealthGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFakeHealthGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFakeHealthGet(ref bool suppressDefaultLog, IFakeHealthGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFakeHealthGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFakeHealthGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFakeHealthGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Health check endpoint + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeHealthGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeHealthGetApiResponse apiResponseLocalVar = new FakeHealthGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/health", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeHealthGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFakeHealthGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeHealthGetDefaultImplementation(e, "/fake/health", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFakeHealthGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeHealthGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeHealthGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.HealthCheckResult Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.HealthCheckResult result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterBooleanSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterBooleanSerializeDefaultImplementation(IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterBooleanSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterBooleanSerialize(ref bool suppressDefaultLog, IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterBooleanSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterBooleanSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterBooleanSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterBooleanSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterBooleanSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterBooleanSerializeApiResponse apiResponseLocalVar = new FakeOuterBooleanSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/boolean", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterBooleanSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterBooleanSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterBooleanSerializeDefaultImplementation(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterBooleanSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterBooleanSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public bool? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out bool? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterCompositeSerialize(Option outerComposite); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterCompositeSerialize(Option outerComposite) + { + if (outerComposite.IsSet && outerComposite.Value == null) + throw new ArgumentNullException(nameof(outerComposite)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterCompositeSerializeDefaultImplementation(IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite) + { + bool suppressDefaultLog = false; + AfterFakeOuterCompositeSerialize(ref suppressDefaultLog, apiResponseLocalVar, outerComposite); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterCompositeSerialize(ref bool suppressDefaultLog, IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterCompositeSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option outerComposite) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterCompositeSerialize(ref suppressDefaultLog, exception, pathFormat, path, outerComposite); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterCompositeSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option outerComposite); + + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterCompositeSerializeAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterCompositeSerialize(outerComposite); + + FormatFakeOuterCompositeSerialize(outerComposite); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if (outerComposite.IsSet) + httpRequestMessageLocalVar.Content = (outerComposite.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterCompositeSerializeApiResponse apiResponseLocalVar = new FakeOuterCompositeSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/composite", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterCompositeSerializeDefaultImplementation(apiResponseLocalVar, outerComposite); + + Events.ExecuteOnFakeOuterCompositeSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterCompositeSerializeDefaultImplementation(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); + Events.ExecuteOnErrorFakeOuterCompositeSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterCompositeSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.OuterComposite Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.OuterComposite result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterNumberSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterNumberSerializeDefaultImplementation(IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterNumberSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterNumberSerialize(ref bool suppressDefaultLog, IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterNumberSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterNumberSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterNumberSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterNumberSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterNumberSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterNumberSerializeApiResponse apiResponseLocalVar = new FakeOuterNumberSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/number", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterNumberSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterNumberSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterNumberSerializeDefaultImplementation(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterNumberSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterNumberSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public decimal? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out decimal? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterStringSerialize(ref Guid requiredStringUuid, ref Option body); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterStringSerialize(Option body) + { + if (body.IsSet && body.Value == null) + throw new ArgumentNullException(nameof(body)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterFakeOuterStringSerializeDefaultImplementation(IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterStringSerialize(ref suppressDefaultLog, apiResponseLocalVar, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterFakeOuterStringSerialize(ref bool suppressDefaultLog, IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorFakeOuterStringSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterStringSerialize(ref suppressDefaultLog, exception, pathFormat, path, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterStringSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body); + + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterStringSerializeAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterStringSerialize(body); + + FormatFakeOuterStringSerialize(ref requiredStringUuid, ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_uuid"] = ClientUtils.ParameterToString(requiredStringUuid); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterStringSerializeApiResponse apiResponseLocalVar = new FakeOuterStringSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/string", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterStringSerializeDefaultImplementation(apiResponseLocalVar, requiredStringUuid, body); + + Events.ExecuteOnFakeOuterStringSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterStringSerializeDefaultImplementation(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); + Events.ExecuteOnErrorFakeOuterStringSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterStringSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetArrayOfEnumsDefaultImplementation(IGetArrayOfEnumsApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetArrayOfEnums(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetArrayOfEnums(ref bool suppressDefaultLog, IGetArrayOfEnumsApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetArrayOfEnumsDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetArrayOfEnums(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetArrayOfEnums(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Array of Enums + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetArrayOfEnumsAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetArrayOfEnumsApiResponse apiResponseLocalVar = new GetArrayOfEnumsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/array-of-enums", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetArrayOfEnumsDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetArrayOfEnums(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetArrayOfEnumsDefaultImplementation(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetArrayOfEnums(e); + throw; + } + } + + /// + /// The + /// + public partial class GetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetArrayOfEnumsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new GetMixedAnyOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new GetMixedOneOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestAdditionalPropertiesReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestAdditionalPropertiesReferenceDefaultImplementation(ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestAdditionalPropertiesReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestAdditionalPropertiesReference(ref bool suppressDefaultLog, ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestAdditionalPropertiesReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestAdditionalPropertiesReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAdditionalPropertiesReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestAdditionalPropertiesReference(requestBody); + + FormatTestAdditionalPropertiesReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/additionalProperties-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar = new TestAdditionalPropertiesReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/additionalProperties-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestAdditionalPropertiesReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestAdditionalPropertiesReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(e, "/fake/additionalProperties-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestAdditionalPropertiesReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestAdditionalPropertiesReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestAdditionalPropertiesReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + { + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestBodyWithFileSchemaDefaultImplementation(ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + AfterTestBodyWithFileSchema(ref suppressDefaultLog, apiResponseLocalVar, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestBodyWithFileSchema(ref bool suppressDefaultLog, ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithFileSchemaDefaultImplementation(Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithFileSchema(ref suppressDefaultLog, exception, pathFormat, path, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithFileSchema(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass); + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithFileSchemaAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithFileSchema(fileSchemaTestClass); + + FormatTestBodyWithFileSchema(fileSchemaTestClass); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithFileSchemaApiResponse apiResponseLocalVar = new TestBodyWithFileSchemaApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-file-schema", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithFileSchemaDefaultImplementation(apiResponseLocalVar, fileSchemaTestClass); + + Events.ExecuteOnTestBodyWithFileSchema(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithFileSchemaDefaultImplementation(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); + Events.ExecuteOnErrorTestBodyWithFileSchema(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithFileSchemaApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithFileSchemaApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithQueryParams(User user, ref string query); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestBodyWithQueryParams(User user, string query) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (query == null) + throw new ArgumentNullException(nameof(query)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query) + { + bool suppressDefaultLog = false; + AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, user, query); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, User user, string query) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, user, query); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string query); + + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithQueryParamsAsync(user, query, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithQueryParams(user, query); + + FormatTestBodyWithQueryParams(user, ref query); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["query"] = ClientUtils.ParameterToString(query); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithQueryParamsApiResponse apiResponseLocalVar = new TestBodyWithQueryParamsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-query-params", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, user, query); + + Events.ExecuteOnTestBodyWithQueryParams(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); + Events.ExecuteOnErrorTestBodyWithQueryParams(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithQueryParamsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithQueryParamsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestClientModel(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClientModel(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClientModelDefaultImplementation(ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClientModel(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClientModel(ref bool suppressDefaultLog, ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClientModelDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClientModel(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClientModel(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test \"client\" model To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClientModelAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClientModel(modelClient); + + FormatTestClientModel(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClientModelApiResponse apiResponseLocalVar = new TestClientModelApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClientModelDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClientModel(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClientModelDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClientModel(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClientModelApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClientModelApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEndpointParameters(ref byte[] varByte, ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref Option date, ref Option binary, ref Option varFloat, ref Option integer, ref Option int32, ref Option int64, ref Option varString, ref Option password, ref Option callback, ref Option dateTime); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + { + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary)); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString)); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); + + if (callback.IsSet && callback.Value == null) + throw new ArgumentNullException(nameof(callback)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + + FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(varByte))); + + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(varDouble))); + + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + if (date.IsSet) + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date.Value))); + + if (binary.IsSet) + multipartContentLocalVar.Add(new StreamContent(binary.Value)); + + if (varFloat.IsSet) + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(varFloat.Value))); + + if (integer.IsSet) + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer.Value))); + + if (int32.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32.Value))); + + if (int64.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64.Value))); + + if (varString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(varString.Value))); + + if (password.IsSet) + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password.Value))); + + if (callback.IsSet) + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback.Value))); + + if (dateTime.IsSet) + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEndpointParametersApiResponse apiResponseLocalVar = new TestEndpointParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEndpointParametersDefaultImplementation(apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + + Events.ExecuteOnTestEndpointParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEndpointParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + Events.ExecuteOnErrorTestEndpointParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEndpointParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEndpointParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEndpointParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, ref Option enumHeaderString, ref Option enumQueryString, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumFormString); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray) + { + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); + + if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) + throw new ArgumentNullException(nameof(enumQueryStringArray)); + + if (enumFormStringArray.IsSet && enumFormStringArray.Value == null) + throw new ArgumentNullException(nameof(enumFormStringArray)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString) + { + bool suppressDefaultLog = false; + AfterTestEnumParameters(ref suppressDefaultLog, apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEnumParametersDefaultImplementation(Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString) + { + bool suppressDefaultLog = false; + OnErrorTestEnumParameters(ref suppressDefaultLog, exception, pathFormat, path, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEnumParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString); + + /// + /// To test enum parameters To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray); + + FormatTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, ref enumHeaderString, ref enumQueryString, ref enumQueryDouble, ref enumQueryInteger, ref enumFormString); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if (enumQueryStringArray.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); + + if (enumQueryString.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); + + if (enumQueryDouble.IsSet) + // here too + parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); + + if (enumQueryInteger.IsSet) + // here too + parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (enumHeaderStringArray.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray.Value)); + + if (enumHeaderString.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString.Value)); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray.Value))); + + if (enumFormString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString.Value))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEnumParametersApiResponse apiResponseLocalVar = new TestEnumParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEnumParametersDefaultImplementation(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + + Events.ExecuteOnTestEnumParameters(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEnumParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + Events.ExecuteOnErrorTestEnumParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEnumParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEnumParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEnumParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestGroupParameters(ref bool requiredBooleanGroup, ref int requiredStringGroup, ref long requiredInt64Group, ref Option booleanGroup, ref Option stringGroup, ref Option int64Group); + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestGroupParametersDefaultImplementation(ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + AfterTestGroupParameters(ref suppressDefaultLog, apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestGroupParameters(ref bool suppressDefaultLog, ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestGroupParametersDefaultImplementation(Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + OnErrorTestGroupParameters(ref suppressDefaultLog, exception, pathFormat, path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestGroupParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatTestGroupParameters(ref requiredBooleanGroup, ref requiredStringGroup, ref requiredInt64Group, ref booleanGroup, ref stringGroup, ref int64Group); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_group"] = ClientUtils.ParameterToString(requiredStringGroup); + parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); + + if (stringGroup.IsSet) + // here too + parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); + + if (int64Group.IsSet) + // here too + parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup.IsSet) + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestGroupParametersApiResponse apiResponseLocalVar = new TestGroupParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestGroupParametersDefaultImplementation(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + + Events.ExecuteOnTestGroupParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestGroupParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + Events.ExecuteOnErrorTestGroupParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestGroupParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestGroupParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestGroupParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineAdditionalProperties(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineAdditionalProperties(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineAdditionalPropertiesDefaultImplementation(ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestInlineAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineAdditionalProperties(ref bool suppressDefaultLog, ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestInlineAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test inline additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineAdditionalPropertiesAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineAdditionalProperties(requestBody); + + FormatTestInlineAdditionalProperties(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestInlineAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineAdditionalPropertiesDefaultImplementation(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestInlineAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineFreeformAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineFreeformAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineFreeformAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestJsonFormData(ref string param, ref string param2); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestJsonFormData(string param, string param2) + { + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestJsonFormDataDefaultImplementation(ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2) + { + bool suppressDefaultLog = false; + AfterTestJsonFormData(ref suppressDefaultLog, apiResponseLocalVar, param, param2); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestJsonFormData(ref bool suppressDefaultLog, ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestJsonFormDataDefaultImplementation(Exception exception, string pathFormat, string path, string param, string param2) + { + bool suppressDefaultLog = false; + OnErrorTestJsonFormData(ref suppressDefaultLog, exception, pathFormat, path, param, param2); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestJsonFormData(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string param, string param2); + + /// + /// test json serialization of form data + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestJsonFormDataAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestJsonFormData(param, param2); + + FormatTestJsonFormData(ref param, ref param2); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestJsonFormDataApiResponse apiResponseLocalVar = new TestJsonFormDataApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/jsonFormData", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestJsonFormDataDefaultImplementation(apiResponseLocalVar, param, param2); + + Events.ExecuteOnTestJsonFormData(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestJsonFormDataDefaultImplementation(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); + Events.ExecuteOnErrorTestJsonFormData(e); + throw; + } + } + + /// + /// The + /// + public partial class TestJsonFormDataApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestJsonFormDataApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestJsonFormDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ref string requiredNotNullable, ref string requiredNullable, ref Option notRequiredNotNullable, ref Option notRequiredNullable); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + { + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + if (requiredNotNullable == null) + throw new ArgumentNullException(nameof(requiredNotNullable)); + + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestQueryParameterCollectionFormatDefaultImplementation(ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + AfterTestQueryParameterCollectionFormat(ref suppressDefaultLog, apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestQueryParameterCollectionFormatDefaultImplementation(Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + OnErrorTestQueryParameterCollectionFormat(ref suppressDefaultLog, exception, pathFormat, path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + + FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["pipe"] = ClientUtils.ParameterToString(pipe); + parseQueryStringLocalVar["ioutil"] = ClientUtils.ParameterToString(ioutil); + parseQueryStringLocalVar["http"] = ClientUtils.ParameterToString(http); + parseQueryStringLocalVar["url"] = ClientUtils.ParameterToString(url); + parseQueryStringLocalVar["context"] = ClientUtils.ParameterToString(context); + parseQueryStringLocalVar["requiredNotNullable"] = ClientUtils.ParameterToString(requiredNotNullable); + parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); + + if (notRequiredNotNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); + + if (notRequiredNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestQueryParameterCollectionFormatApiResponse apiResponseLocalVar = new TestQueryParameterCollectionFormatApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/test-query-parameters", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestQueryParameterCollectionFormatDefaultImplementation(apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + + Events.ExecuteOnTestQueryParameterCollectionFormat(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestQueryParameterCollectionFormatDefaultImplementation(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + Events.ExecuteOnErrorTestQueryParameterCollectionFormat(e); + throw; + } + } + + /// + /// The + /// + public partial class TestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestQueryParameterCollectionFormatApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestQueryParameterCollectionFormatApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new TestStringMapReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..1d5bd38c527 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,415 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// The class containing the events + /// + FakeClassnameTags123ApiEvents Events { get; } + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ITestClassnameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeClassnameTags123ApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClassname; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClassname; + + internal void ExecuteOnTestClassname(FakeClassnameTags123Api.TestClassnameApiResponse apiResponse) + { + OnTestClassname?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClassname(Exception exception) + { + OnErrorTestClassname?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeClassnameTags123ApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeClassnameTags123ApiEvents fakeClassnameTags123ApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeClassnameTags123ApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatTestClassname(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClassname(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClassnameDefaultImplementation(ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClassname(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClassname(ref bool suppressDefaultLog, ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClassnameDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClassname(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClassname(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test class name in snake case To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClassnameAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClassname(modelClient); + + FormatTestClassname(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + + apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClassnameApiResponse apiResponseLocalVar = new TestClassnameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake_classname_test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClassnameDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClassname(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClassnameDefaultImplementation(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClassname(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClassnameApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClassnameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClassnameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 00000000000..d97995fd5ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2784 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IPetApi : IApi + { + /// + /// The class containing the events + /// + PetApiEvents Events { get; } + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IAddPetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IDeletePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByStatusApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IGetPetByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IUpdatePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUpdatePetWithFormApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUploadFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IUploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PetApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnAddPet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorAddPet; + + internal void ExecuteOnAddPet(PetApi.AddPetApiResponse apiResponse) + { + OnAddPet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorAddPet(Exception exception) + { + OnErrorAddPet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeletePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeletePet; + + internal void ExecuteOnDeletePet(PetApi.DeletePetApiResponse apiResponse) + { + OnDeletePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeletePet(Exception exception) + { + OnErrorDeletePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByStatus; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByStatus; + + internal void ExecuteOnFindPetsByStatus(PetApi.FindPetsByStatusApiResponse apiResponse) + { + OnFindPetsByStatus?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByStatus(Exception exception) + { + OnErrorFindPetsByStatus?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByTags; + + internal void ExecuteOnFindPetsByTags(PetApi.FindPetsByTagsApiResponse apiResponse) + { + OnFindPetsByTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByTags(Exception exception) + { + OnErrorFindPetsByTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetPetById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetPetById; + + internal void ExecuteOnGetPetById(PetApi.GetPetByIdApiResponse apiResponse) + { + OnGetPetById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetPetById(Exception exception) + { + OnErrorGetPetById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePet; + + internal void ExecuteOnUpdatePet(PetApi.UpdatePetApiResponse apiResponse) + { + OnUpdatePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePet(Exception exception) + { + OnErrorUpdatePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePetWithForm; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePetWithForm; + + internal void ExecuteOnUpdatePetWithForm(PetApi.UpdatePetWithFormApiResponse apiResponse) + { + OnUpdatePetWithForm?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePetWithForm(Exception exception) + { + OnErrorUpdatePetWithForm?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFile; + + internal void ExecuteOnUploadFile(PetApi.UploadFileApiResponse apiResponse) + { + OnUploadFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFile(Exception exception) + { + OnErrorUploadFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFileWithRequiredFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFileWithRequiredFile; + + internal void ExecuteOnUploadFileWithRequiredFile(PetApi.UploadFileWithRequiredFileApiResponse apiResponse) + { + OnUploadFileWithRequiredFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFileWithRequiredFile(Exception exception) + { + OnErrorUploadFileWithRequiredFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class PetApi : IPetApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PetApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PetApiEvents petApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = petApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatAddPet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateAddPet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterAddPetDefaultImplementation(IAddPetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterAddPet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterAddPet(ref bool suppressDefaultLog, IAddPetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorAddPetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorAddPet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorAddPet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await AddPetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateAddPet(pet); + + FormatAddPet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + AddPetApiResponse apiResponseLocalVar = new AddPetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterAddPetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnAddPet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorAddPetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorAddPet(e); + throw; + } + } + + /// + /// The + /// + public partial class AddPetApiResponse : Org.OpenAPITools.Client.ApiResponse, IAddPetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public AddPetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeletePet(ref long petId, ref Option apiKey); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeletePet(Option apiKey) + { + if (apiKey.IsSet && apiKey.Value == null) + throw new ArgumentNullException(nameof(apiKey)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDeletePetDefaultImplementation(IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + AfterDeletePet(ref suppressDefaultLog, apiResponseLocalVar, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDeletePet(ref bool suppressDefaultLog, IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDeletePetDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + OnErrorDeletePet(ref suppressDefaultLog, exception, pathFormat, path, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDeletePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option apiKey); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeletePetAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeletePet(apiKey); + + FormatDeletePet(ref petId, ref apiKey); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeletePetApiResponse apiResponseLocalVar = new DeletePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeletePetDefaultImplementation(apiResponseLocalVar, petId, apiKey); + + Events.ExecuteOnDeletePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeletePetDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); + Events.ExecuteOnErrorDeletePet(e); + throw; + } + } + + /// + /// The + /// + public partial class DeletePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeletePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeletePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByStatus(List status); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByStatus(List status) + { + if (status == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByStatusDefaultImplementation(IFindPetsByStatusApiResponse apiResponseLocalVar, List status) + { + bool suppressDefaultLog = false; + AfterFindPetsByStatus(ref suppressDefaultLog, apiResponseLocalVar, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByStatus(ref bool suppressDefaultLog, IFindPetsByStatusApiResponse apiResponseLocalVar, List status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByStatusDefaultImplementation(Exception exception, string pathFormat, string path, List status) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByStatus(ref suppressDefaultLog, exception, pathFormat, path, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByStatus(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List status); + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByStatusAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByStatus(status); + + FormatFindPetsByStatus(status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["status"] = ClientUtils.ParameterToString(status); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByStatusApiResponse apiResponseLocalVar = new FindPetsByStatusApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByStatus", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByStatusDefaultImplementation(apiResponseLocalVar, status); + + Events.ExecuteOnFindPetsByStatus(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByStatusDefaultImplementation(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); + Events.ExecuteOnErrorFindPetsByStatus(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByStatusApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByStatusApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByTags(List tags); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByTags(List tags) + { + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByTagsDefaultImplementation(IFindPetsByTagsApiResponse apiResponseLocalVar, List tags) + { + bool suppressDefaultLog = false; + AfterFindPetsByTags(ref suppressDefaultLog, apiResponseLocalVar, tags); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByTags(ref bool suppressDefaultLog, IFindPetsByTagsApiResponse apiResponseLocalVar, List tags); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByTagsDefaultImplementation(Exception exception, string pathFormat, string path, List tags) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByTags(ref suppressDefaultLog, exception, pathFormat, path, tags); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List tags); + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByTagsAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByTags(tags); + + FormatFindPetsByTags(tags); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["tags"] = ClientUtils.ParameterToString(tags); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByTagsApiResponse apiResponseLocalVar = new FindPetsByTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByTags", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByTagsDefaultImplementation(apiResponseLocalVar, tags); + + Events.ExecuteOnFindPetsByTags(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByTagsDefaultImplementation(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); + Events.ExecuteOnErrorFindPetsByTags(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetPetById(ref long petId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetPetByIdDefaultImplementation(IGetPetByIdApiResponse apiResponseLocalVar, long petId) + { + bool suppressDefaultLog = false; + AfterGetPetById(ref suppressDefaultLog, apiResponseLocalVar, petId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetPetById(ref bool suppressDefaultLog, IGetPetByIdApiResponse apiResponseLocalVar, long petId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetPetByIdDefaultImplementation(Exception exception, string pathFormat, string path, long petId) + { + bool suppressDefaultLog = false; + OnErrorGetPetById(ref suppressDefaultLog, exception, pathFormat, path, petId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetPetById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId); + + /// + /// Find pet by ID Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetPetByIdAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetPetById(ref petId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + + apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetPetByIdApiResponse apiResponseLocalVar = new GetPetByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetPetByIdDefaultImplementation(apiResponseLocalVar, petId); + + Events.ExecuteOnGetPetById(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetPetByIdDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); + Events.ExecuteOnErrorGetPetById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetPetByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetPetByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Pet Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Pet result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateUpdatePet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterUpdatePetDefaultImplementation(IUpdatePetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterUpdatePet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterUpdatePet(ref bool suppressDefaultLog, IUpdatePetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorUpdatePetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorUpdatePet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePet(pet); + + FormatUpdatePet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetApiResponse apiResponseLocalVar = new UpdatePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnUpdatePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorUpdatePet(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePetWithForm(ref long petId, ref Option name, ref Option status); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatePetWithForm(Option name, Option status) + { + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUpdatePetWithFormDefaultImplementation(IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + AfterUpdatePetWithForm(ref suppressDefaultLog, apiResponseLocalVar, petId, name, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUpdatePetWithForm(ref bool suppressDefaultLog, IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatePetWithFormDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + OnErrorUpdatePetWithForm(ref suppressDefaultLog, exception, pathFormat, path, petId, name, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePetWithForm(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option name, Option status); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetWithFormAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePetWithForm(name, status); + + FormatUpdatePetWithForm(ref petId, ref name, ref status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name.IsSet) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name.Value))); + + if (status.IsSet) + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetWithFormApiResponse apiResponseLocalVar = new UpdatePetWithFormApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetWithFormDefaultImplementation(apiResponseLocalVar, petId, name, status); + + Events.ExecuteOnUpdatePetWithForm(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetWithFormDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); + Events.ExecuteOnErrorUpdatePetWithForm(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetWithFormApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetWithFormApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetWithFormApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFile(ref long petId, ref Option file, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFile(Option file, Option additionalMetadata) + { + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileDefaultImplementation(IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFile(ref suppressDefaultLog, apiResponseLocalVar, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFile(ref bool suppressDefaultLog, IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFile(ref suppressDefaultLog, exception, pathFormat, path, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata); + + /// + /// uploads an image + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFile(file, additionalMetadata); + + FormatUploadFile(ref petId, ref file, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file.IsSet) + multipartContentLocalVar.Add(new StreamContent(file.Value)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileApiResponse apiResponseLocalVar = new UploadFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}/uploadImage", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileDefaultImplementation(apiResponseLocalVar, petId, file, additionalMetadata); + + Events.ExecuteOnUploadFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileDefaultImplementation(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); + Events.ExecuteOnErrorUploadFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFileWithRequiredFile(ref System.IO.Stream requiredFile, ref long petId, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFileWithRequiredFile(System.IO.Stream requiredFile, Option additionalMetadata) + { + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileWithRequiredFileDefaultImplementation(IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFileWithRequiredFile(ref suppressDefaultLog, apiResponseLocalVar, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFileWithRequiredFile(ref bool suppressDefaultLog, IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileWithRequiredFileDefaultImplementation(Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFileWithRequiredFile(ref suppressDefaultLog, exception, pathFormat, path, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFileWithRequiredFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// uploads an image (required) + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFileWithRequiredFile(requiredFile, additionalMetadata); + + FormatUploadFileWithRequiredFile(ref requiredFile, ref petId, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileWithRequiredFileApiResponse apiResponseLocalVar = new UploadFileWithRequiredFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/{petId}/uploadImageWithRequiredFile", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileWithRequiredFileDefaultImplementation(apiResponseLocalVar, requiredFile, petId, additionalMetadata); + + Events.ExecuteOnUploadFileWithRequiredFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileWithRequiredFileDefaultImplementation(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); + Events.ExecuteOnErrorUploadFileWithRequiredFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileWithRequiredFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 00000000000..4e9980c869e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,1197 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IStoreApi : IApi + { + /// + /// The class containing the events + /// + StoreApiEvents Events { get; } + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteOrderApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetInventoryApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetOrderByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IPlaceOrderApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class StoreApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteOrder; + + internal void ExecuteOnDeleteOrder(StoreApi.DeleteOrderApiResponse apiResponse) + { + OnDeleteOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteOrder(Exception exception) + { + OnErrorDeleteOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetInventory; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetInventory; + + internal void ExecuteOnGetInventory(StoreApi.GetInventoryApiResponse apiResponse) + { + OnGetInventory?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetInventory(Exception exception) + { + OnErrorGetInventory?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetOrderById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetOrderById; + + internal void ExecuteOnGetOrderById(StoreApi.GetOrderByIdApiResponse apiResponse) + { + OnGetOrderById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetOrderById(Exception exception) + { + OnErrorGetOrderById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPlaceOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPlaceOrder; + + internal void ExecuteOnPlaceOrder(StoreApi.PlaceOrderApiResponse apiResponse) + { + OnPlaceOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPlaceOrder(Exception exception) + { + OnErrorPlaceOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class StoreApi : IStoreApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public StoreApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, StoreApiEvents storeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = storeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatDeleteOrder(ref string orderId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteOrder(string orderId) + { + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteOrderDefaultImplementation(IDeleteOrderApiResponse apiResponseLocalVar, string orderId) + { + bool suppressDefaultLog = false; + AfterDeleteOrder(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteOrder(ref bool suppressDefaultLog, IDeleteOrderApiResponse apiResponseLocalVar, string orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteOrderDefaultImplementation(Exception exception, string pathFormat, string path, string orderId) + { + bool suppressDefaultLog = false; + OnErrorDeleteOrder(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteOrderAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteOrder(orderId); + + FormatDeleteOrder(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteOrderApiResponse apiResponseLocalVar = new DeleteOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteOrderDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnDeleteOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteOrderDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorDeleteOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetInventoryDefaultImplementation(IGetInventoryApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetInventory(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetInventory(ref bool suppressDefaultLog, IGetInventoryApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetInventoryDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetInventory(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetInventory(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetInventoryAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetInventoryApiResponse apiResponseLocalVar = new GetInventoryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/inventory", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetInventoryDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetInventory(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetInventoryDefaultImplementation(e, "/store/inventory", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetInventory(e); + throw; + } + } + + /// + /// The + /// + public partial class GetInventoryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetInventoryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Dictionary Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Dictionary result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetOrderById(ref long orderId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetOrderByIdDefaultImplementation(IGetOrderByIdApiResponse apiResponseLocalVar, long orderId) + { + bool suppressDefaultLog = false; + AfterGetOrderById(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetOrderById(ref bool suppressDefaultLog, IGetOrderByIdApiResponse apiResponseLocalVar, long orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetOrderByIdDefaultImplementation(Exception exception, string pathFormat, string path, long orderId) + { + bool suppressDefaultLog = false; + OnErrorGetOrderById(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetOrderById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetOrderByIdAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetOrderById(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetOrderByIdApiResponse apiResponseLocalVar = new GetOrderByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetOrderByIdDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnGetOrderById(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetOrderByIdDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorGetOrderById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetOrderByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetOrderByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPlaceOrder(Order order); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidatePlaceOrder(Order order) + { + if (order == null) + throw new ArgumentNullException(nameof(order)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterPlaceOrderDefaultImplementation(IPlaceOrderApiResponse apiResponseLocalVar, Order order) + { + bool suppressDefaultLog = false; + AfterPlaceOrder(ref suppressDefaultLog, apiResponseLocalVar, order); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterPlaceOrder(ref bool suppressDefaultLog, IPlaceOrderApiResponse apiResponseLocalVar, Order order); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorPlaceOrderDefaultImplementation(Exception exception, string pathFormat, string path, Order order) + { + bool suppressDefaultLog = false; + OnErrorPlaceOrder(ref suppressDefaultLog, exception, pathFormat, path, order); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorPlaceOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Order order); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PlaceOrderAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePlaceOrder(order); + + FormatPlaceOrder(order); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PlaceOrderApiResponse apiResponseLocalVar = new PlaceOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPlaceOrderDefaultImplementation(apiResponseLocalVar, order); + + Events.ExecuteOnPlaceOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPlaceOrderDefaultImplementation(e, "/store/order", uriBuilderLocalVar.Path, order); + Events.ExecuteOnErrorPlaceOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class PlaceOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IPlaceOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 00000000000..721984089ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,2223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IUserApi : IApi + { + /// + /// The class containing the events + /// + UserApiEvents Events { get; } + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICreateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IDeleteUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetUserByNameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk, ICustomHttpStatusCode599 + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + bool IsCustomHttpStatusCode598 { get; } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + bool IsCustomHttpStatusCode599 { get; } + } + + /// + /// The + /// + public interface ILoginUserApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ILogoutUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IUpdateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UserApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUser; + + internal void ExecuteOnCreateUser(UserApi.CreateUserApiResponse apiResponse) + { + OnCreateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUser(Exception exception) + { + OnErrorCreateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithArrayInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithArrayInput; + + internal void ExecuteOnCreateUsersWithArrayInput(UserApi.CreateUsersWithArrayInputApiResponse apiResponse) + { + OnCreateUsersWithArrayInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithArrayInput(Exception exception) + { + OnErrorCreateUsersWithArrayInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithListInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithListInput; + + internal void ExecuteOnCreateUsersWithListInput(UserApi.CreateUsersWithListInputApiResponse apiResponse) + { + OnCreateUsersWithListInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithListInput(Exception exception) + { + OnErrorCreateUsersWithListInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteUser; + + internal void ExecuteOnDeleteUser(UserApi.DeleteUserApiResponse apiResponse) + { + OnDeleteUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteUser(Exception exception) + { + OnErrorDeleteUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetUserByName; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetUserByName; + + internal void ExecuteOnGetUserByName(UserApi.GetUserByNameApiResponse apiResponse) + { + OnGetUserByName?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetUserByName(Exception exception) + { + OnErrorGetUserByName?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLoginUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLoginUser; + + internal void ExecuteOnLoginUser(UserApi.LoginUserApiResponse apiResponse) + { + OnLoginUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLoginUser(Exception exception) + { + OnErrorLoginUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLogoutUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLogoutUser; + + internal void ExecuteOnLogoutUser(UserApi.LogoutUserApiResponse apiResponse) + { + OnLogoutUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLogoutUser(Exception exception) + { + OnErrorLogoutUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateUser; + + internal void ExecuteOnUpdateUser(UserApi.UpdateUserApiResponse apiResponse) + { + OnUpdateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdateUser(Exception exception) + { + OnErrorUpdateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class UserApi : IUserApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public UserApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UserApiEvents userApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = userApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCreateUser(User user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUser(User user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUserDefaultImplementation(ICreateUserApiResponse apiResponseLocalVar, User user) + { + bool suppressDefaultLog = false; + AfterCreateUser(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUser(ref bool suppressDefaultLog, ICreateUserApiResponse apiResponseLocalVar, User user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user) + { + bool suppressDefaultLog = false; + OnErrorCreateUser(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user); + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUserAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUser(user); + + FormatCreateUser(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUserApiResponse apiResponseLocalVar = new CreateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUserDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUserDefaultImplementation(e, "/user", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithArrayInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithArrayInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithArrayInputDefaultImplementation(ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithArrayInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithArrayInput(ref bool suppressDefaultLog, ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithArrayInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithArrayInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithArrayInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithArrayInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithArrayInput(user); + + FormatCreateUsersWithArrayInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithArrayInputApiResponse apiResponseLocalVar = new CreateUsersWithArrayInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithArray", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithArrayInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithArrayInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithArrayInputDefaultImplementation(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithArrayInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithArrayInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithArrayInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithListInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithListInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithListInputDefaultImplementation(ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithListInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithListInput(ref bool suppressDefaultLog, ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithListInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithListInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithListInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithListInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithListInput(user); + + FormatCreateUsersWithListInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithListInputApiResponse apiResponseLocalVar = new CreateUsersWithListInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithList", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithListInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithListInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithListInputDefaultImplementation(e, "/user/createWithList", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithListInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithListInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithListInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeleteUser(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteUser(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteUserDefaultImplementation(IDeleteUserApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterDeleteUser(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteUser(ref bool suppressDefaultLog, IDeleteUserApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteUserDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorDeleteUser(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteUserAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteUser(username); + + FormatDeleteUser(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteUserApiResponse apiResponseLocalVar = new DeleteUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteUserDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnDeleteUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorDeleteUser(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetUserByName(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetUserByName(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetUserByNameDefaultImplementation(IGetUserByNameApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterGetUserByName(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetUserByName(ref bool suppressDefaultLog, IGetUserByNameApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetUserByNameDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorGetUserByName(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetUserByName(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetUserByNameAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetUserByName(username); + + FormatGetUserByName(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetUserByNameApiResponse apiResponseLocalVar = new GetUserByNameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetUserByNameDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnGetUserByName(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetUserByNameDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorGetUserByName(e); + throw; + } + } + + /// + /// The + /// + public partial class GetUserByNameApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetUserByNameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.User Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + public bool IsCustomHttpStatusCode598 => 598 == (int)StatusCode; + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + public bool IsCustomHttpStatusCode599 => 599 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 599 CustomHttpStatusCode599 + /// + /// + public Org.OpenAPITools.Model.User CustomHttpStatusCode599() + { + // This logic may be modified with the AsModel.mustache template + return IsCustomHttpStatusCode599 + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + public bool TryCustomHttpStatusCode599(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = CustomHttpStatusCode599(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)599); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatLoginUser(ref string username, ref string password); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateLoginUser(string username, string password) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterLoginUserDefaultImplementation(ILoginUserApiResponse apiResponseLocalVar, string username, string password) + { + bool suppressDefaultLog = false; + AfterLoginUser(ref suppressDefaultLog, apiResponseLocalVar, username, password); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterLoginUser(ref bool suppressDefaultLog, ILoginUserApiResponse apiResponseLocalVar, string username, string password); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorLoginUserDefaultImplementation(Exception exception, string pathFormat, string path, string username, string password) + { + bool suppressDefaultLog = false; + OnErrorLoginUser(ref suppressDefaultLog, exception, pathFormat, path, username, password); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorLoginUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username, string password); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LoginUserAsync(username, password, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateLoginUser(username, password); + + FormatLoginUser(ref username, ref password); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["username"] = ClientUtils.ParameterToString(username); + parseQueryStringLocalVar["password"] = ClientUtils.ParameterToString(password); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LoginUserApiResponse apiResponseLocalVar = new LoginUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/login", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLoginUserDefaultImplementation(apiResponseLocalVar, username, password); + + Events.ExecuteOnLoginUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLoginUserDefaultImplementation(e, "/user/login", uriBuilderLocalVar.Path, username, password); + Events.ExecuteOnErrorLoginUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LoginUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILoginUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterLogoutUserDefaultImplementation(ILogoutUserApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterLogoutUser(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterLogoutUser(ref bool suppressDefaultLog, ILogoutUserApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorLogoutUserDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorLogoutUser(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorLogoutUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Logs out current logged in user session + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LogoutUserAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LogoutUserApiResponse apiResponseLocalVar = new LogoutUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/logout", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLogoutUserDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnLogoutUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLogoutUserDefaultImplementation(e, "/user/logout", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorLogoutUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LogoutUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILogoutUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LogoutUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateUser(User user, ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdateUser(User user, string username) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdateUserDefaultImplementation(IUpdateUserApiResponse apiResponseLocalVar, User user, string username) + { + bool suppressDefaultLog = false; + AfterUpdateUser(ref suppressDefaultLog, apiResponseLocalVar, user, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdateUser(ref bool suppressDefaultLog, IUpdateUserApiResponse apiResponseLocalVar, User user, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user, string username) + { + bool suppressDefaultLog = false; + OnErrorUpdateUser(ref suppressDefaultLog, exception, pathFormat, path, user, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string username); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateUserAsync(user, username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateUser(user, username); + + FormatUpdateUser(user, ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdateUserApiResponse apiResponseLocalVar = new UpdateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdateUserDefaultImplementation(apiResponseLocalVar, user, username); + + Events.ExecuteOnUpdateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdateUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); + Events.ExecuteOnErrorUpdateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..fdd11dd19c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiException.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 00000000000..b8bdf9964ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..63c4e7c4bc3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICustomHttpStatusCode599 : IApiResponse + { + /// + /// Deserializes the response if the response is CustomHttpStatusCode599 + /// + /// + TType CustomHttpStatusCode599(); + + /// + /// Returns true if the response is CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + bool TryCustomHttpStatusCode599(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IDefault : IApiResponse + { + /// + /// Deserializes the response if the response is Default + /// + /// + TType Default(); + + /// + /// Returns true if the response is Default and the deserialized response is not null + /// + /// + /// + bool TryDefault(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 00000000000..c58c0563231 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 00000000000..df5c2310bac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..efff79097e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,423 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + /// + /// The api_key header + /// + Api_key, + /// + /// The api_key_query header + /// + Api_key_query + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) + { + switch(value) + { + case ApiKeyHeader.Api_key: + return "api_key"; + case ApiKeyHeader.Api_key_query: + return "api_key_query"; + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ChildCatAllOfPetType childCatAllOfPetType) + return ChildCatAllOfPetTypeValueConverter.ToJsonValue(childCatAllOfPetType); + if (obj is EnumArraysArrayEnumInner enumArraysArrayEnumInner) + return EnumArraysArrayEnumInnerValueConverter.ToJsonValue(enumArraysArrayEnumInner); + if (obj is EnumArraysJustSymbol enumArraysJustSymbol) + return EnumArraysJustSymbolValueConverter.ToJsonValue(enumArraysJustSymbol); + if (obj is EnumClass enumClass) + return EnumClassValueConverter.ToJsonValue(enumClass); + if (obj is EnumTestEnumInteger enumTestEnumInteger) + return EnumTestEnumIntegerValueConverter.ToJsonValue(enumTestEnumInteger).ToString(); + if (obj is EnumTestEnumIntegerOnly enumTestEnumIntegerOnly) + return EnumTestEnumIntegerOnlyValueConverter.ToJsonValue(enumTestEnumIntegerOnly).ToString(); + if (obj is EnumTestEnumString enumTestEnumString) + return EnumTestEnumStringValueConverter.ToJsonValue(enumTestEnumString); + if (obj is FindPetsByStatusStatusParameterInner findPetsByStatusStatusParameterInner) + return FindPetsByStatusStatusParameterInnerValueConverter.ToJsonValue(findPetsByStatusStatusParameterInner); + if (obj is MapTestMapOfEnumStringValue mapTestMapOfEnumStringValue) + return MapTestMapOfEnumStringValueValueConverter.ToJsonValue(mapTestMapOfEnumStringValue); + if (obj is OrderStatus orderStatus) + return OrderStatusValueConverter.ToJsonValue(orderStatus); + if (obj is OuterEnum outerEnum) + return OuterEnumValueConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerValueConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is OuterEnumTest outerEnumTest) + return OuterEnumTestValueConverter.ToJsonValue(outerEnumTest); + if (obj is PetStatus petStatus) + return PetStatusValueConverter.ToJsonValue(petStatus); + if (obj is RequiredClassRequiredNotnullableEnumInteger requiredClassRequiredNotnullableEnumInteger) + return RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumInteger).ToString(); + if (obj is RequiredClassRequiredNotnullableEnumIntegerOnly requiredClassRequiredNotnullableEnumIntegerOnly) + return RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnly).ToString(); + if (obj is RequiredClassRequiredNotnullableEnumString requiredClassRequiredNotnullableEnumString) + return RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumString); + if (obj is RequiredClassRequiredNullableEnumInteger requiredClassRequiredNullableEnumInteger) + return RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClassRequiredNullableEnumInteger).ToString(); + if (obj is RequiredClassRequiredNullableEnumIntegerOnly requiredClassRequiredNullableEnumIntegerOnly) + return RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClassRequiredNullableEnumIntegerOnly).ToString(); + if (obj is RequiredClassRequiredNullableEnumString requiredClassRequiredNullableEnumString) + return RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClassRequiredNullableEnumString); + if (obj is TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter) + return TestEnumParametersEnumHeaderStringParameterValueConverter.ToJsonValue(testEnumParametersEnumHeaderStringParameter); + if (obj is TestEnumParametersEnumQueryDoubleParameter testEnumParametersEnumQueryDoubleParameter) + return TestEnumParametersEnumQueryDoubleParameterValueConverter.ToJsonValue(testEnumParametersEnumQueryDoubleParameter).ToString(); + if (obj is TestEnumParametersEnumQueryIntegerParameter testEnumParametersEnumQueryIntegerParameter) + return TestEnumParametersEnumQueryIntegerParameterValueConverter.ToJsonValue(testEnumParametersEnumQueryIntegerParameter).ToString(); + if (obj is TestEnumParametersRequestEnumFormString testEnumParametersRequestEnumFormString) + return TestEnumParametersRequestEnumFormStringValueConverter.ToJsonValue(testEnumParametersRequestEnumFormString); + if (obj is TestEnumParametersRequestEnumFormStringArrayInner testEnumParametersRequestEnumFormStringArrayInner) + return TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.ToJsonValue(testEnumParametersRequestEnumFormStringArrayInner); + if (obj is ZebraType zebraType) + return ZebraTypeValueConverter.ToJsonValue(zebraType); + if (obj is ZeroBasedEnum zeroBasedEnum) + return ZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnum); + if (obj is ZeroBasedEnumClassZeroBasedEnum zeroBasedEnumClassZeroBasedEnum) + return ZeroBasedEnumClassZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnumClassZeroBasedEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..973f9e9d4e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..b491c61f07f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..c706302171c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ActivityJsonConverter()); + _jsonOptions.Converters.Add(new ActivityOutputElementRepresentationJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new AnimalJsonConverter()); + _jsonOptions.Converters.Add(new ApiResponseJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new AppleReqJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayTestJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new BananaReqJsonConverter()); + _jsonOptions.Converters.Add(new BasquePigJsonConverter()); + _jsonOptions.Converters.Add(new CapitalizationJsonConverter()); + _jsonOptions.Converters.Add(new CatJsonConverter()); + _jsonOptions.Converters.Add(new CategoryJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatAllOfPetTypeJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatAllOfPetTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ClassModelJsonConverter()); + _jsonOptions.Converters.Add(new ComplexQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new DanishPigJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyClassJsonConverter()); + _jsonOptions.Converters.Add(new DeprecatedObjectJsonConverter()); + _jsonOptions.Converters.Add(new DogJsonConverter()); + _jsonOptions.Converters.Add(new DrawingJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysArrayEnumInnerJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysArrayEnumInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJustSymbolJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJustSymbolNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new EquilateralTriangleJsonConverter()); + _jsonOptions.Converters.Add(new FileJsonConverter()); + _jsonOptions.Converters.Add(new FileSchemaTestClassJsonConverter()); + _jsonOptions.Converters.Add(new FindPetsByStatusStatusParameterInnerJsonConverter()); + _jsonOptions.Converters.Add(new FindPetsByStatusStatusParameterInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new FooJsonConverter()); + _jsonOptions.Converters.Add(new FooGetDefaultResponseJsonConverter()); + _jsonOptions.Converters.Add(new FormatTestJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + _jsonOptions.Converters.Add(new FruitReqJsonConverter()); + _jsonOptions.Converters.Add(new GmFruitJsonConverter()); + _jsonOptions.Converters.Add(new GrandparentAnimalJsonConverter()); + _jsonOptions.Converters.Add(new HasOnlyReadOnlyJsonConverter()); + _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); + _jsonOptions.Converters.Add(new MammalJsonConverter()); + _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueJsonConverter()); + _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); + _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); + _jsonOptions.Converters.Add(new ModelClientJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new NotificationtestGetElementsV1ResponseMPayloadJsonConverter()); + _jsonOptions.Converters.Add(new NullableClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableGuidClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableShapeJsonConverter()); + _jsonOptions.Converters.Add(new NumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ObjectWithDeprecatedFieldsJsonConverter()); + _jsonOptions.Converters.Add(new OneOfStringJsonConverter()); + _jsonOptions.Converters.Add(new OrderJsonConverter()); + _jsonOptions.Converters.Add(new OrderStatusJsonConverter()); + _jsonOptions.Converters.Add(new OrderStatusNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterCompositeJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestNullableJsonConverter()); + _jsonOptions.Converters.Add(new ParentPetJsonConverter()); + _jsonOptions.Converters.Add(new PetJsonConverter()); + _jsonOptions.Converters.Add(new PetStatusJsonConverter()); + _jsonOptions.Converters.Add(new PetStatusNullableJsonConverter()); + _jsonOptions.Converters.Add(new PigJsonConverter()); + _jsonOptions.Converters.Add(new PolymorphicPropertyJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); + _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ShapeJsonConverter()); + _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ShapeOrNullJsonConverter()); + _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); + _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryIntegerParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryIntegerParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringArrayInnerJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringArrayInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); + _jsonOptions.Converters.Add(new TriangleJsonConverter()); + _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new UserJsonConverter()); + _jsonOptions.Converters.Add(new WhaleJsonConverter()); + _jsonOptions.Converters.Add(new ZebraJsonConverter()); + _jsonOptions.Converters.Add(new ZebraTypeJsonConverter()); + _jsonOptions.Converters.Add(new ZebraTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassZeroBasedEnumNullableJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 00000000000..53f435c05f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,641 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPhrase = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 format + return null; + } + + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 00000000000..b6301dc17c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,41 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 00000000000..ec4d08e9c99 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..8cf79a713b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/Option.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..534f27a8cc5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, Channel.CreateBounded(options)); + } + } + else + { + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + } + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..36d7dad03e2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..dce7b971eaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..40eeffc9676 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..c82fea7a865 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..428d69dd8ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -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 + * 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 +{ + /// + /// test map of maps + /// + public partial class Activity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + [JsonConstructor] + public Activity(Option>> activityOutputs = default) + { + ActivityOutputsOption = activityOutputs; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ActivityOutputs + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ActivityOutputsOption { get; private set; } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get { return this.ActivityOutputsOption; } set { this.ActivityOutputsOption = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 ActivityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Activity 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>> activityOutputs = 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 "activity_outputs": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (activityOutputs.IsSet && activityOutputs.Value == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is not nullable for class Activity."); + + return new Activity(activityOutputs); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activity.ActivityOutputsOption.IsSet) + { + writer.WritePropertyName("activity_outputs"); + JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs new file mode 100644 index 00000000000..8ae65f50c23 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,207 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + [JsonConstructor] + public ActivityOutputElementRepresentation(Option prop1 = default, Option prop2 = default) + { + Prop1Option = prop1; + Prop2Option = prop2; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Prop1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop1Option { get; private set; } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get { return this.Prop1Option; } set { this.Prop1Option = new Option(value); } } + + /// + /// Used to track the state of Prop2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop2Option { get; private set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get { return this.Prop2Option; } set { this.Prop2Option = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ActivityOutputElementRepresentation 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 prop1 = default; + Option prop2 = 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 "prop1": + prop1 = new Option(utf8JsonReader.GetString()); + break; + case "prop2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (prop1.IsSet && prop1.Value == null) + throw new ArgumentNullException(nameof(prop1), "Property is not nullable for class ActivityOutputElementRepresentation."); + + if (prop2.IsSet && prop2.Value == null) + throw new ArgumentNullException(nameof(prop2), "Property is not nullable for class ActivityOutputElementRepresentation."); + + return new ActivityOutputElementRepresentation(prop1, prop2); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activityOutputElementRepresentation.Prop2Option.IsSet && activityOutputElementRepresentation.Prop2 == null) + throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop2), "Property is required for class ActivityOutputElementRepresentation."); + + if (activityOutputElementRepresentation.Prop1Option.IsSet) + writer.WriteString("prop1", activityOutputElementRepresentation.Prop1); + + if (activityOutputElementRepresentation.Prop2Option.IsSet) + { + writer.WritePropertyName("prop2"); + JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d7857e4aad8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,400 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AdditionalPropertiesClass + /// + public partial class AdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// anytype1 + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// mapOfMapProperty + /// mapProperty + /// mapWithUndeclaredPropertiesAnytype1 + /// mapWithUndeclaredPropertiesAnytype2 + /// mapWithUndeclaredPropertiesAnytype3 + /// mapWithUndeclaredPropertiesString + [JsonConstructor] + public AdditionalPropertiesClass(Option anytype1 = default, Option emptyMap = default, Option>> mapOfMapProperty = default, Option> mapProperty = default, Option mapWithUndeclaredPropertiesAnytype1 = default, Option mapWithUndeclaredPropertiesAnytype2 = default, Option> mapWithUndeclaredPropertiesAnytype3 = default, Option> mapWithUndeclaredPropertiesString = default) + { + Anytype1Option = anytype1; + EmptyMapOption = emptyMap; + MapOfMapPropertyOption = mapOfMapProperty; + MapPropertyOption = mapProperty; + MapWithUndeclaredPropertiesAnytype1Option = mapWithUndeclaredPropertiesAnytype1; + MapWithUndeclaredPropertiesAnytype2Option = mapWithUndeclaredPropertiesAnytype2; + MapWithUndeclaredPropertiesAnytype3Option = mapWithUndeclaredPropertiesAnytype3; + MapWithUndeclaredPropertiesStringOption = mapWithUndeclaredPropertiesString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Anytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Anytype1Option { get; private set; } + + /// + /// Gets or Sets Anytype1 + /// + [JsonPropertyName("anytype_1")] + public Object Anytype1 { get { return this.Anytype1Option; } set { this.Anytype1Option = new Option(value); } } + + /// + /// Used to track the state of EmptyMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmptyMapOption { get; private set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [JsonPropertyName("empty_map")] + public Object EmptyMap { get { return this.EmptyMapOption; } set { this.EmptyMapOption = new Option(value); } } + + /// + /// Used to track the state of MapOfMapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapOfMapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [JsonPropertyName("map_of_map_property")] + public Dictionary> MapOfMapProperty { get { return this.MapOfMapPropertyOption; } set { this.MapOfMapPropertyOption = new Option>>(value); } } + + /// + /// Used to track the state of MapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapProperty + /// + [JsonPropertyName("map_property")] + public Dictionary MapProperty { get { return this.MapPropertyOption; } set { this.MapPropertyOption = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype1Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_1")] + public Object MapWithUndeclaredPropertiesAnytype1 { get { return this.MapWithUndeclaredPropertiesAnytype1Option; } set { this.MapWithUndeclaredPropertiesAnytype1Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype2Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_2")] + public Object MapWithUndeclaredPropertiesAnytype2 { get { return this.MapWithUndeclaredPropertiesAnytype2Option; } set { this.MapWithUndeclaredPropertiesAnytype2Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype3 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesAnytype3Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_3")] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get { return this.MapWithUndeclaredPropertiesAnytype3Option; } set { this.MapWithUndeclaredPropertiesAnytype3Option = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesStringOption { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [JsonPropertyName("map_with_undeclared_properties_string")] + public Dictionary MapWithUndeclaredPropertiesString { get { return this.MapWithUndeclaredPropertiesStringOption; } set { this.MapWithUndeclaredPropertiesStringOption = 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 AdditionalPropertiesClass {\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).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 AdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AdditionalPropertiesClass 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 anytype1 = default; + Option emptyMap = default; + Option>> mapOfMapProperty = default; + Option> mapProperty = default; + Option mapWithUndeclaredPropertiesAnytype1 = default; + Option mapWithUndeclaredPropertiesAnytype2 = default; + Option> mapWithUndeclaredPropertiesAnytype3 = default; + Option> mapWithUndeclaredPropertiesString = 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 "anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "empty_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_3": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (emptyMap.IsSet && emptyMap.Value == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapOfMapProperty.IsSet && mapOfMapProperty.Value == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapProperty.IsSet && mapProperty.Value == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1.IsSet && mapWithUndeclaredPropertiesAnytype1.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2.IsSet && mapWithUndeclaredPropertiesAnytype2.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3.IsSet && mapWithUndeclaredPropertiesAnytype3.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString.IsSet && mapWithUndeclaredPropertiesString.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is not nullable for class AdditionalPropertiesClass."); + + return new AdditionalPropertiesClass(anytype1, emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet && additionalPropertiesClass.MapOfMapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapPropertyOption.IsSet && additionalPropertiesClass.MapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.Anytype1Option.IsSet) + if (additionalPropertiesClass.Anytype1Option.Value != null) + { + writer.WritePropertyName("anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions); + } + else + writer.WriteNull("anytype_1"); + if (additionalPropertiesClass.EmptyMapOption.IsSet) + { + writer.WritePropertyName("empty_map"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet) + { + writer.WritePropertyName("map_of_map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapPropertyOption.IsSet) + { + writer.WritePropertyName("map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_2"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_3"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_string"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 00000000000..6abbd41a281 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Animal + /// + public partial class Animal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + [JsonConstructor] + public Animal(Option color = default) + { + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Animal {\n"); + sb.Append(" Color: ").Append(Color).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Animal 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 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) + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Animal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Animal."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); + + return new Animal(color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, animal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + { + if (animal.ColorOption.IsSet && animal.Color == null) + throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); + + writer.WriteString("className", animal.ClassName); + + if (animal.ColorOption.IsSet) + writer.WriteString("color", animal.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 00000000000..f6fa613cbbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,230 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ApiResponse + /// + public partial class ApiResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code + /// message + /// type + [JsonConstructor] + public ApiResponse(Option code = default, Option message = default, Option type = default) + { + CodeOption = code; + MessageOption = message; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } + + /// + /// Gets or Sets Code + /// + [JsonPropertyName("code")] + public int? Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of Message + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageOption { get; private set; } + + /// + /// Gets or Sets Message + /// + [JsonPropertyName("message")] + public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [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 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 ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ApiResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ApiResponse 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 code = default; + Option message = default; + Option type = 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 "code": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = new Option(utf8JsonReader.GetInt32()); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class ApiResponse."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class ApiResponse."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApiResponse."); + + return new ApiResponse(code, message, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apiResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apiResponse.TypeOption.IsSet && apiResponse.Type == null) + throw new ArgumentNullException(nameof(apiResponse.Type), "Property is required for class ApiResponse."); + + if (apiResponse.CodeOption.IsSet) + writer.WriteNumber("code", apiResponse.CodeOption.Value.Value); + + if (apiResponse.MessageOption.IsSet) + writer.WriteString("message", apiResponse.Message); + + if (apiResponse.TypeOption.IsSet) + writer.WriteString("type", apiResponse.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..e0c09dbf5f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// colorCode + /// cultivar + /// origin + [JsonConstructor] + public Apple(Option colorCode = default, Option cultivar = default, Option origin = default) + { + ColorCodeOption = colorCode; + CultivarOption = cultivar; + OriginOption = origin; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ColorCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorCodeOption { get; private set; } + + /// + /// Gets or Sets ColorCode + /// + [JsonPropertyName("color_code")] + public string ColorCode { get { return this.ColorCodeOption; } set { this.ColorCodeOption = new Option(value); } } + + /// + /// Used to track the state of Cultivar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CultivarOption { get; private set; } + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get { return this.CultivarOption; } set { this.CultivarOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } + + /// + /// Gets or Sets Origin + /// + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = 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 Apple {\n"); + sb.Append(" ColorCode: ").Append(ColorCode).Append("\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).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) + { + if (this.ColorCodeOption.Value != null) { + // ColorCode (string) pattern + Regex regexColorCode = new Regex(@"^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$", RegexOptions.CultureInvariant); + + if (this.ColorCodeOption.Value != null &&!regexColorCode.Match(this.ColorCodeOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ColorCode, must match a pattern of " + regexColorCode, new [] { "ColorCode" }); + } + } + + if (this.CultivarOption.Value != null) { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); + + if (this.CultivarOption.Value != null &&!regexCultivar.Match(this.CultivarOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + } + + if (this.OriginOption.Value != null) { + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.OriginOption.Value != null &&!regexOrigin.Match(this.OriginOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 colorCode = default; + Option cultivar = default; + Option origin = 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 "color_code": + colorCode = new Option(utf8JsonReader.GetString()); + break; + case "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (colorCode.IsSet && colorCode.Value == null) + throw new ArgumentNullException(nameof(colorCode), "Property is not nullable for class Apple."); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class Apple."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class Apple."); + + return new Apple(colorCode, cultivar, origin); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.CultivarOption.IsSet && apple.Cultivar == null) + throw new ArgumentNullException(nameof(apple.Cultivar), "Property is required for class Apple."); + + if (apple.OriginOption.IsSet && apple.Origin == null) + throw new ArgumentNullException(nameof(apple.Origin), "Property is required for class Apple."); + + if (apple.ColorCodeOption.IsSet) + writer.WriteString("color_code", apple.ColorCode); + + if (apple.CultivarOption.IsSet) + writer.WriteString("cultivar", apple.Cultivar); + + if (apple.OriginOption.IsSet) + writer.WriteString("origin", apple.Origin); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 00000000000..7f69b627038 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AppleReq + /// + public partial class AppleReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar + /// mealy + [JsonConstructor] + public AppleReq(string cultivar, Option mealy = default) + { + Cultivar = cultivar; + MealyOption = mealy; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get; set; } + + /// + /// Used to track the state of Mealy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MealyOption { get; private set; } + + /// + /// Gets or Sets Mealy + /// + [JsonPropertyName("mealy")] + public bool? Mealy { get { return this.MealyOption; } set { this.MealyOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).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 AppleReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AppleReq 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 cultivar = default; + Option mealy = 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 "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "mealy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!cultivar.IsSet) + throw new ArgumentException("Property is required for class AppleReq.", nameof(cultivar)); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class AppleReq."); + + if (mealy.IsSet && mealy.Value == null) + throw new ArgumentNullException(nameof(mealy), "Property is not nullable for class AppleReq."); + + return new AppleReq(cultivar.Value, mealy); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, appleReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("cultivar", appleReq.Cultivar); + + if (appleReq.MealyOption.IsSet) + writer.WriteBoolean("mealy", appleReq.MealyOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..9f6f55f4bc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + public partial class ArrayOfArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber + [JsonConstructor] + public ArrayOfArrayOfNumberOnly(Option>> arrayArrayNumber = default) + { + ArrayArrayNumberOption = arrayArrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [JsonPropertyName("ArrayArrayNumber")] + public List> ArrayArrayNumber { get { return this.ArrayArrayNumberOption; } set { this.ArrayArrayNumberOption = 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 ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).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 ArrayOfArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfArrayOfNumberOnly 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>> arrayArrayNumber = 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 "ArrayArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayNumber.IsSet && arrayArrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is not nullable for class ArrayOfArrayOfNumberOnly."); + + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..3e38c89877d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfNumberOnly + /// + public partial class ArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber + [JsonConstructor] + public ArrayOfNumberOnly(Option> arrayNumber = default) + { + ArrayNumberOption = arrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayNumber + /// + [JsonPropertyName("ArrayNumber")] + public List ArrayNumber { get { return this.ArrayNumberOption; } set { this.ArrayNumberOption = 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 ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).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 ArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfNumberOnly 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> arrayNumber = 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 "ArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayNumber.IsSet && arrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is not nullable for class ArrayOfNumberOnly."); + + return new ArrayOfNumberOnly(arrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfNumberOnly.ArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 00000000000..8ddbe4d6309 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,242 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ArrayTest + /// + public partial class ArrayTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayOfInteger + /// arrayArrayOfModel + /// arrayOfString + [JsonConstructor] + public ArrayTest(Option>> arrayArrayOfInteger = default, Option>> arrayArrayOfModel = default, Option> arrayOfString = default) + { + ArrayArrayOfIntegerOption = arrayArrayOfInteger; + ArrayArrayOfModelOption = arrayArrayOfModel; + ArrayOfStringOption = arrayOfString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayOfInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfIntegerOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [JsonPropertyName("array_array_of_integer")] + public List> ArrayArrayOfInteger { get { return this.ArrayArrayOfIntegerOption; } set { this.ArrayArrayOfIntegerOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayArrayOfModel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfModelOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [JsonPropertyName("array_array_of_model")] + public List> ArrayArrayOfModel { get { return this.ArrayArrayOfModelOption; } set { this.ArrayArrayOfModelOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets ArrayOfString + /// + [JsonPropertyName("array_of_string")] + public List ArrayOfString { get { return this.ArrayOfStringOption; } set { this.ArrayOfStringOption = 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 ArrayTest {\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).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 ArrayTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayTest 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>> arrayArrayOfInteger = default; + Option>> arrayArrayOfModel = default; + Option> arrayOfString = 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 "array_array_of_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_array_of_model": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayOfInteger.IsSet && arrayArrayOfInteger.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is not nullable for class ArrayTest."); + + if (arrayArrayOfModel.IsSet && arrayArrayOfModel.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is not nullable for class ArrayTest."); + + if (arrayOfString.IsSet && arrayOfString.Value == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is not nullable for class ArrayTest."); + + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayTest.ArrayArrayOfModelOption.IsSet && arrayTest.ArrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfModel), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayOfStringOption.IsSet && arrayTest.ArrayOfString == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayOfString), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayArrayOfIntegerOption.IsSet) + { + writer.WritePropertyName("array_array_of_integer"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions); + } + if (arrayTest.ArrayArrayOfModelOption.IsSet) + { + writer.WritePropertyName("array_array_of_model"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions); + } + if (arrayTest.ArrayOfStringOption.IsSet) + { + writer.WritePropertyName("array_of_string"); + JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..8fc9c71c574 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -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 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + [JsonConstructor] + public Banana(Option lengthCm = default) + { + LengthCmOption = lengthCm; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of LengthCm + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LengthCmOption { get; private set; } + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal? LengthCm { get { return this.LengthCmOption; } set { this.LengthCmOption = 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 Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 lengthCm = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class Banana."); + + return new Banana(lengthCm); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 00000000000..e4a3a99aafa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,187 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BananaReq + /// + public partial class BananaReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + /// sweet + [JsonConstructor] + public BananaReq(decimal lengthCm, Option sweet = default) + { + LengthCm = lengthCm; + SweetOption = sweet; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal LengthCm { get; set; } + + /// + /// Used to track the state of Sweet + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SweetOption { get; private set; } + + /// + /// Gets or Sets Sweet + /// + [JsonPropertyName("sweet")] + public bool? Sweet { get { return this.SweetOption; } set { this.SweetOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).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 BananaReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BananaReq 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 lengthCm = default; + Option sweet = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + case "sweet": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!lengthCm.IsSet) + throw new ArgumentException("Property is required for class BananaReq.", nameof(lengthCm)); + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class BananaReq."); + + if (sweet.IsSet && sweet.Value == null) + throw new ArgumentNullException(nameof(sweet), "Property is not nullable for class BananaReq."); + + return new BananaReq(lengthCm.Value.Value, sweet); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, bananaReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteNumber("lengthCm", bananaReq.LengthCm); + + if (bananaReq.SweetOption.IsSet) + writer.WriteBoolean("sweet", bananaReq.SweetOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 00000000000..9938d89e008 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BasquePig + /// + public partial class BasquePig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public BasquePig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 BasquePigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BasquePig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class BasquePig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class BasquePig."); + + return new BasquePig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, basquePig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", basquePig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 00000000000..ddf4f67e04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs @@ -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 + * 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 +{ + /// + /// Capitalization + /// + public partial class Capitalization : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the pet + /// capitalCamel + /// capitalSnake + /// sCAETHFlowPoints + /// smallCamel + /// smallSnake + [JsonConstructor] + public Capitalization(Option aTTNAME = default, Option capitalCamel = default, Option capitalSnake = default, Option sCAETHFlowPoints = default, Option smallCamel = default, Option smallSnake = default) + { + ATT_NAMEOption = aTTNAME; + CapitalCamelOption = capitalCamel; + CapitalSnakeOption = capitalSnake; + SCAETHFlowPointsOption = sCAETHFlowPoints; + SmallCamelOption = smallCamel; + SmallSnakeOption = smallSnake; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ATT_NAME + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ATT_NAMEOption { get; private set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [JsonPropertyName("ATT_NAME")] + public string ATT_NAME { get { return this.ATT_NAMEOption; } set { this.ATT_NAMEOption = new Option(value); } } + + /// + /// Used to track the state of CapitalCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalCamelOption { get; private set; } + + /// + /// Gets or Sets CapitalCamel + /// + [JsonPropertyName("CapitalCamel")] + public string CapitalCamel { get { return this.CapitalCamelOption; } set { this.CapitalCamelOption = new Option(value); } } + + /// + /// Used to track the state of CapitalSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalSnakeOption { get; private set; } + + /// + /// Gets or Sets CapitalSnake + /// + [JsonPropertyName("Capital_Snake")] + public string CapitalSnake { get { return this.CapitalSnakeOption; } set { this.CapitalSnakeOption = new Option(value); } } + + /// + /// Used to track the state of SCAETHFlowPoints + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SCAETHFlowPointsOption { get; private set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [JsonPropertyName("SCA_ETH_Flow_Points")] + public string SCAETHFlowPoints { get { return this.SCAETHFlowPointsOption; } set { this.SCAETHFlowPointsOption = new Option(value); } } + + /// + /// Used to track the state of SmallCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallCamelOption { get; private set; } + + /// + /// Gets or Sets SmallCamel + /// + [JsonPropertyName("smallCamel")] + public string SmallCamel { get { return this.SmallCamelOption; } set { this.SmallCamelOption = new Option(value); } } + + /// + /// Used to track the state of SmallSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallSnakeOption { get; private set; } + + /// + /// Gets or Sets SmallSnake + /// + [JsonPropertyName("small_Snake")] + public string SmallSnake { get { return this.SmallSnakeOption; } set { this.SmallSnakeOption = 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 Capitalization {\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).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 CapitalizationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Capitalization 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 aTTNAME = default; + Option capitalCamel = default; + Option capitalSnake = default; + Option sCAETHFlowPoints = default; + Option smallCamel = default; + Option smallSnake = 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 "ATT_NAME": + aTTNAME = new Option(utf8JsonReader.GetString()); + break; + case "CapitalCamel": + capitalCamel = new Option(utf8JsonReader.GetString()); + break; + case "Capital_Snake": + capitalSnake = new Option(utf8JsonReader.GetString()); + break; + case "SCA_ETH_Flow_Points": + sCAETHFlowPoints = new Option(utf8JsonReader.GetString()); + break; + case "smallCamel": + smallCamel = new Option(utf8JsonReader.GetString()); + break; + case "small_Snake": + smallSnake = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (aTTNAME.IsSet && aTTNAME.Value == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization."); + + if (capitalCamel.IsSet && capitalCamel.Value == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization."); + + if (capitalSnake.IsSet && capitalSnake.Value == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization."); + + if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization."); + + if (smallCamel.IsSet && smallCamel.Value == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization."); + + if (smallSnake.IsSet && smallSnake.Value == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization."); + + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, capitalization, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (capitalization.CapitalCamelOption.IsSet && capitalization.CapitalCamel == null) + throw new ArgumentNullException(nameof(capitalization.CapitalCamel), "Property is required for class Capitalization."); + + if (capitalization.CapitalSnakeOption.IsSet && capitalization.CapitalSnake == null) + throw new ArgumentNullException(nameof(capitalization.CapitalSnake), "Property is required for class Capitalization."); + + if (capitalization.SCAETHFlowPointsOption.IsSet && capitalization.SCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(capitalization.SCAETHFlowPoints), "Property is required for class Capitalization."); + + if (capitalization.SmallCamelOption.IsSet && capitalization.SmallCamel == null) + throw new ArgumentNullException(nameof(capitalization.SmallCamel), "Property is required for class Capitalization."); + + if (capitalization.SmallSnakeOption.IsSet && capitalization.SmallSnake == null) + throw new ArgumentNullException(nameof(capitalization.SmallSnake), "Property is required for class Capitalization."); + + if (capitalization.ATT_NAMEOption.IsSet) + writer.WriteString("ATT_NAME", capitalization.ATT_NAME); + + if (capitalization.CapitalCamelOption.IsSet) + writer.WriteString("CapitalCamel", capitalization.CapitalCamel); + + if (capitalization.CapitalSnakeOption.IsSet) + writer.WriteString("Capital_Snake", capitalization.CapitalSnake); + + if (capitalization.SCAETHFlowPointsOption.IsSet) + writer.WriteString("SCA_ETH_Flow_Points", capitalization.SCAETHFlowPoints); + + if (capitalization.SmallCamelOption.IsSet) + writer.WriteString("smallCamel", capitalization.SmallCamel); + + if (capitalization.SmallSnakeOption.IsSet) + writer.WriteString("small_Snake", capitalization.SmallSnake); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 00000000000..d11d16c855e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Cat + /// + public partial class Cat : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + /// declawed + [JsonConstructor] + public Cat(Option color = default, Option declawed = default) : base(color) + { + DeclawedOption = declawed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeclawedOption { get; private set; } + + /// + /// Gets or Sets Declawed + /// + [JsonPropertyName("declawed")] + public bool? Declawed { get { return this.DeclawedOption; } set { this.DeclawedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Cat 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 className = default; + Option color = default; + Option declawed = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "declawed": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Cat.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Cat."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Cat."); + + if (declawed.IsSet && declawed.Value == null) + throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); + + return new Cat(color, declawed); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + if (cat.ColorOption.IsSet && cat.Color == null) + throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); + + writer.WriteString("className", cat.ClassName); + + if (cat.ColorOption.IsSet) + writer.WriteString("color", cat.Color); + + if (cat.DeclawedOption.IsSet) + writer.WriteBoolean("declawed", cat.DeclawedOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 00000000000..1708429172a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,196 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Category + /// + public partial class Category : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name (default to "default-name") + [JsonConstructor] + public Category(Option id = default, string name = @"default-name") + { + IdOption = id; + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// 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 Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 CategoryJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Category 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Category.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Category."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Category."); + + return new Category(id, name.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, category, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (category.IdOption.IsSet) + writer.WriteNumber("id", category.IdOption.Value.Value); + + writer.WriteString("name", category.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 00000000000..437e8188ab4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs @@ -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 + * 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 +{ + /// + /// ChildCat + /// + public partial class ChildCat : ParentPet, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public ChildCat(Option name = default) : base() + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ChildCat 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 petType = default; + Option name = 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 "pet_type": + string petTypeRawValue = utf8JsonReader.GetString(); + if (petTypeRawValue != null) + petType = new Option(ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(petTypeRawValue)); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ChildCat.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat."); + + return new ChildCat(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, childCat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + 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/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs new file mode 100644 index 00000000000..9e8bc253fdb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs @@ -0,0 +1,160 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ChildCat_allOf_pet_type + /// + public enum ChildCatAllOfPetType + { + /// + /// Enum ChildCat for value: ChildCat + /// + ChildCat = 1 + } + + /// + /// Converts to and from the JSON value + /// + public static class ChildCatAllOfPetTypeValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ChildCatAllOfPetType FromString(string value) + { + if (value.Equals("ChildCat")) + return ChildCatAllOfPetType.ChildCat; + + throw new NotImplementedException($"Could not convert value to type ChildCatAllOfPetType: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ChildCatAllOfPetType? FromStringOrDefault(string value) + { + if (value.Equals("ChildCat")) + return ChildCatAllOfPetType.ChildCat; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ChildCatAllOfPetType value) + { + if (value == ChildCatAllOfPetType.ChildCat) + return "ChildCat"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ChildCatAllOfPetTypeJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ChildCatAllOfPetType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ChildCatAllOfPetType? result = rawValue == null + ? null + : ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ChildCatAllOfPetType to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCatAllOfPetType childCatAllOfPetType, JsonSerializerOptions options) + { + writer.WriteStringValue(childCatAllOfPetType.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatAllOfPetTypeNullableJsonConverter : JsonConverter + { + /// + /// Returns a ChildCatAllOfPetType from the Json object + /// + /// + /// + /// + /// + public override ChildCatAllOfPetType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ChildCatAllOfPetType? result = rawValue == null + ? null + : ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCatAllOfPetType? childCatAllOfPetType, JsonSerializerOptions options) + { + writer.WriteStringValue(childCatAllOfPetType?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 00000000000..cf37657bf45 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model with \"_class\" property + /// + public partial class ClassModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + [JsonConstructor] + public ClassModel(Option @class = default) + { + ClassOption = @class; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("_class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = 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 ClassModel {\n"); + sb.Append(" Class: ").Append(Class).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 ClassModelJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ClassModel 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 varClass = 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 "_class": + varClass = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class ClassModel."); + + return new ClassModel(varClass); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, classModel, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (classModel.ClassOption.IsSet) + writer.WriteString("_class", classModel.Class); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 00000000000..3023a45610e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// ComplexQuadrilateral + /// + public partial class ComplexQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public ComplexQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ComplexQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ComplexQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ComplexQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class ComplexQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ComplexQuadrilateral."); + + return new ComplexQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (complexQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(complexQuadrilateral.ShapeType), "Property is required for class ComplexQuadrilateral."); + + writer.WriteString("quadrilateralType", complexQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", complexQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 00000000000..14b2ed3b153 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DanishPig + /// + public partial class DanishPig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public DanishPig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 DanishPigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DanishPig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class DanishPig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class DanishPig."); + + return new DanishPig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, danishPig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", danishPig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs new file mode 100644 index 00000000000..62bd07a9513 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -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 + * 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 +{ + /// + /// DateOnlyClass + /// + public partial class DateOnlyClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateOnlyProperty + [JsonConstructor] + public DateOnlyClass(Option dateOnlyProperty = default) + { + DateOnlyPropertyOption = dateOnlyProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateOnlyProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOnlyPropertyOption { get; private set; } + + /// + /// Gets or Sets DateOnlyProperty + /// + /// Fri Jul 21 00:00:00 UTC 2017 + [JsonPropertyName("dateOnlyProperty")] + public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = 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 DateOnlyClass {\n"); + sb.Append(" DateOnlyProperty: ").Append(DateOnlyProperty).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 DateOnlyClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOnlyProperty + /// + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DateOnlyClass 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 dateOnlyProperty = 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 "dateOnlyProperty": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (dateOnlyProperty.IsSet && dateOnlyProperty.Value == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is not nullable for class DateOnlyClass."); + + return new DateOnlyClass(dateOnlyProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 00000000000..661b1e7c2c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DeprecatedObject + /// + public partial class DeprecatedObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public DeprecatedObject(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).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 DeprecatedObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DeprecatedObject 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class DeprecatedObject."); + + return new DeprecatedObject(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (deprecatedObject.NameOption.IsSet) + writer.WriteString("name", deprecatedObject.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 00000000000..75a60416f90 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Dog.cs @@ -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 + * 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 +{ + /// + /// Dog + /// + public partial class Dog : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed + /// color (default to "red") + [JsonConstructor] + public Dog(Option breed = default, Option color = default) : base(color) + { + BreedOption = breed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BreedOption { get; private set; } + + /// + /// Gets or Sets Breed + /// + [JsonPropertyName("breed")] + public string Breed { get { return this.BreedOption; } set { this.BreedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DogJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Dog 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 className = default; + Option breed = default; + Option color = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "breed": + breed = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Dog.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Dog."); + + if (breed.IsSet && breed.Value == null) + throw new ArgumentNullException(nameof(breed), "Property is not nullable for class Dog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); + + return new Dog(breed, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + if (dog.BreedOption.IsSet && dog.Breed == null) + throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); + + if (dog.ColorOption.IsSet && dog.Color == null) + throw new ArgumentNullException(nameof(dog.Color), "Property is required for class Dog."); + + writer.WriteString("className", dog.ClassName); + + if (dog.BreedOption.IsSet) + writer.WriteString("breed", dog.Breed); + + if (dog.ColorOption.IsSet) + writer.WriteString("color", dog.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 00000000000..70ff3517f49 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Drawing + /// + public partial class Drawing : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape + /// nullableShape + /// shapeOrNull + /// shapes + [JsonConstructor] + public Drawing(Option mainShape = default, Option nullableShape = default, Option shapeOrNull = default, Option> shapes = default) + { + MainShapeOption = mainShape; + NullableShapeOption = nullableShape; + ShapeOrNullOption = shapeOrNull; + ShapesOption = shapes; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MainShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MainShapeOption { get; private set; } + + /// + /// Gets or Sets MainShape + /// + [JsonPropertyName("mainShape")] + public Shape MainShape { get { return this.MainShapeOption; } set { this.MainShapeOption = new Option(value); } } + + /// + /// Used to track the state of NullableShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableShapeOption { get; private set; } + + /// + /// Gets or Sets NullableShape + /// + [JsonPropertyName("nullableShape")] + public NullableShape NullableShape { get { return this.NullableShapeOption; } set { this.NullableShapeOption = new Option(value); } } + + /// + /// Used to track the state of ShapeOrNull + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShapeOrNullOption { get; private set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [JsonPropertyName("shapeOrNull")] + public ShapeOrNull ShapeOrNull { get { return this.ShapeOrNullOption; } set { this.ShapeOrNullOption = new Option(value); } } + + /// + /// Used to track the state of Shapes + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ShapesOption { get; private set; } + + /// + /// Gets or Sets Shapes + /// + [JsonPropertyName("shapes")] + public List Shapes { get { return this.ShapesOption; } set { this.ShapesOption = 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 Drawing {\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).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 DrawingJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Drawing 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 mainShape = default; + Option nullableShape = default; + Option shapeOrNull = default; + Option> shapes = 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 "mainShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "nullableShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapeOrNull": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapes": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (mainShape.IsSet && mainShape.Value == null) + throw new ArgumentNullException(nameof(mainShape), "Property is not nullable for class Drawing."); + + if (shapes.IsSet && shapes.Value == null) + throw new ArgumentNullException(nameof(shapes), "Property is not nullable for class Drawing."); + + return new Drawing(mainShape, nullableShape, shapeOrNull, shapes); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, drawing, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (drawing.ShapesOption.IsSet && drawing.Shapes == null) + throw new ArgumentNullException(nameof(drawing.Shapes), "Property is required for class Drawing."); + + if (drawing.MainShapeOption.IsSet) + { + writer.WritePropertyName("mainShape"); + JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions); + } + if (drawing.NullableShapeOption.IsSet) + if (drawing.NullableShapeOption.Value != null) + { + writer.WritePropertyName("nullableShape"); + JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions); + } + else + writer.WriteNull("nullableShape"); + if (drawing.ShapeOrNullOption.IsSet) + if (drawing.ShapeOrNullOption.Value != null) + { + writer.WritePropertyName("shapeOrNull"); + JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions); + } + else + writer.WriteNull("shapeOrNull"); + if (drawing.ShapesOption.IsSet) + { + writer.WritePropertyName("shapes"); + JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 00000000000..37aba162b7b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,208 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumArrays + /// + public partial class EnumArrays : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayEnum + /// justSymbol + [JsonConstructor] + public EnumArrays(Option> arrayEnum = default, Option justSymbol = default) + { + ArrayEnumOption = arrayEnum; + JustSymbolOption = justSymbol; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustSymbol + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustSymbolOption { get; private set; } + + /// + /// Gets or Sets JustSymbol + /// + [JsonPropertyName("just_symbol")] + public EnumArraysJustSymbol? JustSymbol { get { return this.JustSymbolOption; } set { this.JustSymbolOption = new Option(value); } } + + /// + /// Used to track the state of ArrayEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayEnumOption { get; private set; } + + /// + /// Gets or Sets ArrayEnum + /// + [JsonPropertyName("array_enum")] + public List ArrayEnum { get { return this.ArrayEnumOption; } set { this.ArrayEnumOption = 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 EnumArrays {\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).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 EnumArraysJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumArrays 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> arrayEnum = default; + Option justSymbol = 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 "array_enum": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "just_symbol": + string justSymbolRawValue = utf8JsonReader.GetString(); + if (justSymbolRawValue != null) + justSymbol = new Option(EnumArraysJustSymbolValueConverter.FromStringOrDefault(justSymbolRawValue)); + break; + default: + break; + } + } + } + + if (arrayEnum.IsSet && arrayEnum.Value == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is not nullable for class EnumArrays."); + + if (justSymbol.IsSet && justSymbol.Value == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is not nullable for class EnumArrays."); + + return new EnumArrays(arrayEnum, justSymbol); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumArrays, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (enumArrays.ArrayEnumOption.IsSet) + { + writer.WritePropertyName("array_enum"); + JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions); + } + if (enumArrays.JustSymbolOption.IsSet) + { + var justSymbolRawValue = EnumArraysJustSymbolValueConverter.ToJsonValue(enumArrays.JustSymbol.Value); + writer.WriteString("just_symbol", justSymbolRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs new file mode 100644 index 00000000000..c620b7197c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumArrays_array_enum_inner + /// + public enum EnumArraysArrayEnumInner + { + /// + /// Enum Fish for value: fish + /// + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + Crab = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumArraysArrayEnumInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysArrayEnumInner FromString(string value) + { + if (value.Equals("fish")) + return EnumArraysArrayEnumInner.Fish; + + if (value.Equals("crab")) + return EnumArraysArrayEnumInner.Crab; + + throw new NotImplementedException($"Could not convert value to type EnumArraysArrayEnumInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysArrayEnumInner? FromStringOrDefault(string value) + { + if (value.Equals("fish")) + return EnumArraysArrayEnumInner.Fish; + + if (value.Equals("crab")) + return EnumArraysArrayEnumInner.Crab; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumArraysArrayEnumInner value) + { + if (value == EnumArraysArrayEnumInner.Fish) + return "fish"; + + if (value == EnumArraysArrayEnumInner.Crab) + return "crab"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumArraysArrayEnumInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumArraysArrayEnumInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysArrayEnumInner? result = rawValue == null + ? null + : EnumArraysArrayEnumInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumArraysArrayEnumInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysArrayEnumInner enumArraysArrayEnumInner, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysArrayEnumInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumArraysArrayEnumInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumArraysArrayEnumInner from the Json object + /// + /// + /// + /// + /// + public override EnumArraysArrayEnumInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysArrayEnumInner? result = rawValue == null + ? null + : EnumArraysArrayEnumInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysArrayEnumInner? enumArraysArrayEnumInner, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysArrayEnumInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs new file mode 100644 index 00000000000..4a414d11d0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumArrays_just_symbol + /// + public enum EnumArraysJustSymbol + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumArraysJustSymbolValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysJustSymbol FromString(string value) + { + if (value.Equals(">=")) + return EnumArraysJustSymbol.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return EnumArraysJustSymbol.Dollar; + + throw new NotImplementedException($"Could not convert value to type EnumArraysJustSymbol: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysJustSymbol? FromStringOrDefault(string value) + { + if (value.Equals(">=")) + return EnumArraysJustSymbol.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return EnumArraysJustSymbol.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumArraysJustSymbol value) + { + if (value == EnumArraysJustSymbol.GreaterThanOrEqualTo) + return ">="; + + if (value == EnumArraysJustSymbol.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumArraysJustSymbolJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumArraysJustSymbol Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysJustSymbol? result = rawValue == null + ? null + : EnumArraysJustSymbolValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumArraysJustSymbol to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysJustSymbol enumArraysJustSymbol, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysJustSymbol.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumArraysJustSymbolNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumArraysJustSymbol from the Json object + /// + /// + /// + /// + /// + public override EnumArraysJustSymbol? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysJustSymbol? result = rawValue == null + ? null + : EnumArraysJustSymbolValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysJustSymbol? enumArraysJustSymbol, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysJustSymbol?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 00000000000..b1aff0adf0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumClass + /// + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumClassValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass FromString(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + throw new NotImplementedException($"Could not convert value to type EnumClass: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumClass value) + { + if (value == EnumClass.Abc) + return "_abc"; + + if (value == EnumClass.Efg) + return "-efg"; + + if (value == EnumClass.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumClassJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumClass to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumClassNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumClass from the Json object + /// + /// + /// + /// + /// + public override EnumClass? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass? enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 00000000000..48e1f8c6e67 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,410 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumTest + /// + public partial class EnumTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// enumStringRequired + /// enumInteger + /// enumIntegerOnly + /// enumNumber + /// enumString + /// outerEnum + /// outerEnumDefaultValue + /// outerEnumInteger + /// outerEnumIntegerDefaultValue + [JsonConstructor] + public EnumTest(EnumTestEnumString enumStringRequired, Option enumInteger = default, Option enumIntegerOnly = default, Option enumNumber = default, Option enumString = default, Option outerEnum = default, Option outerEnumDefaultValue = default, Option outerEnumInteger = default, Option outerEnumIntegerDefaultValue = default) + { + EnumStringRequired = enumStringRequired; + EnumIntegerOption = enumInteger; + EnumIntegerOnlyOption = enumIntegerOnly; + EnumNumberOption = enumNumber; + EnumStringOption = enumString; + OuterEnumOption = outerEnum; + OuterEnumDefaultValueOption = outerEnumDefaultValue; + OuterEnumIntegerOption = outerEnumInteger; + OuterEnumIntegerDefaultValueOption = outerEnumIntegerDefaultValue; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EnumStringRequired + /// + [JsonPropertyName("enum_string_required")] + public EnumTestEnumString EnumStringRequired { get; set; } + + /// + /// Used to track the state of EnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOption { get; private set; } + + /// + /// Gets or Sets EnumInteger + /// + [JsonPropertyName("enum_integer")] + public EnumTestEnumInteger? EnumInteger { get { return this.EnumIntegerOption; } set { this.EnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of EnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets EnumIntegerOnly + /// + [JsonPropertyName("enum_integer_only")] + public EnumTestEnumIntegerOnly? EnumIntegerOnly { get { return this.EnumIntegerOnlyOption; } set { this.EnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of EnumNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumNumberOption { get; private set; } + + /// + /// Gets or Sets EnumNumber + /// + [JsonPropertyName("enum_number")] + public TestEnumParametersEnumQueryDoubleParameter? EnumNumber { get { return this.EnumNumberOption; } set { this.EnumNumberOption = new Option(value); } } + + /// + /// Used to track the state of EnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumStringOption { get; private set; } + + /// + /// Gets or Sets EnumString + /// + [JsonPropertyName("enum_string")] + public EnumTestEnumString? EnumString { get { return this.EnumStringOption; } set { this.EnumStringOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumOption { get; private set; } + + /// + /// Gets or Sets OuterEnum + /// + [JsonPropertyName("outerEnum")] + public OuterEnum? OuterEnum { get { return this.OuterEnumOption; } set { this.OuterEnumOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [JsonPropertyName("outerEnumDefaultValue")] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get { return this.OuterEnumDefaultValueOption; } set { this.OuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [JsonPropertyName("outerEnumInteger")] + public OuterEnumInteger? OuterEnumInteger { get { return this.OuterEnumIntegerOption; } set { this.OuterEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumIntegerDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [JsonPropertyName("outerEnumIntegerDefaultValue")] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get { return this.OuterEnumIntegerDefaultValueOption; } set { this.OuterEnumIntegerDefaultValueOption = 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 EnumTest {\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).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 EnumTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumTest 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 enumStringRequired = default; + Option enumInteger = default; + Option enumIntegerOnly = default; + Option enumNumber = default; + Option enumString = default; + Option outerEnum = default; + Option outerEnumDefaultValue = default; + Option outerEnumInteger = default; + Option outerEnumIntegerDefaultValue = 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 "enum_string_required": + string enumStringRequiredRawValue = utf8JsonReader.GetString(); + if (enumStringRequiredRawValue != null) + enumStringRequired = new Option(EnumTestEnumStringValueConverter.FromStringOrDefault(enumStringRequiredRawValue)); + break; + case "enum_integer": + string enumIntegerRawValue = utf8JsonReader.GetString(); + if (enumIntegerRawValue != null) + enumInteger = new Option(EnumTestEnumIntegerValueConverter.FromStringOrDefault(enumIntegerRawValue)); + break; + case "enum_integer_only": + string enumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (enumIntegerOnlyRawValue != null) + enumIntegerOnly = new Option(EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(enumIntegerOnlyRawValue)); + break; + case "enum_number": + string enumNumberRawValue = utf8JsonReader.GetString(); + if (enumNumberRawValue != null) + enumNumber = new Option(TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(enumNumberRawValue)); + break; + case "enum_string": + string enumStringRawValue = utf8JsonReader.GetString(); + if (enumStringRawValue != null) + enumString = new Option(EnumTestEnumStringValueConverter.FromStringOrDefault(enumStringRawValue)); + break; + case "outerEnum": + string outerEnumRawValue = utf8JsonReader.GetString(); + if (outerEnumRawValue != null) + outerEnum = new Option(OuterEnumValueConverter.FromStringOrDefault(outerEnumRawValue)); + break; + case "outerEnumDefaultValue": + string outerEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumDefaultValueRawValue != null) + outerEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(outerEnumDefaultValueRawValue)); + break; + case "outerEnumInteger": + string outerEnumIntegerRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerRawValue != null) + outerEnumInteger = new Option(OuterEnumIntegerValueConverter.FromStringOrDefault(outerEnumIntegerRawValue)); + break; + case "outerEnumIntegerDefaultValue": + string outerEnumIntegerDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerDefaultValueRawValue != null) + outerEnumIntegerDefaultValue = new Option(OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(outerEnumIntegerDefaultValueRawValue)); + break; + default: + break; + } + } + } + + if (!enumStringRequired.IsSet) + throw new ArgumentException("Property is required for class EnumTest.", nameof(enumStringRequired)); + + if (enumStringRequired.IsSet && enumStringRequired.Value == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is not nullable for class EnumTest."); + + if (enumInteger.IsSet && enumInteger.Value == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is not nullable for class EnumTest."); + + if (enumIntegerOnly.IsSet && enumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is not nullable for class EnumTest."); + + if (enumNumber.IsSet && enumNumber.Value == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is not nullable for class EnumTest."); + + if (enumString.IsSet && enumString.Value == null) + throw new ArgumentNullException(nameof(enumString), "Property is not nullable for class EnumTest."); + + if (outerEnumDefaultValue.IsSet && outerEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is not nullable for class EnumTest."); + + if (outerEnumInteger.IsSet && outerEnumInteger.Value == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is not nullable for class EnumTest."); + + if (outerEnumIntegerDefaultValue.IsSet && outerEnumIntegerDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is not nullable for class EnumTest."); + + return new EnumTest(enumStringRequired.Value.Value, enumInteger, enumIntegerOnly, enumNumber, enumString, outerEnum, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + var enumStringRequiredRawValue = EnumTestEnumStringValueConverter.ToJsonValue(enumTest.EnumStringRequired); + writer.WriteString("enum_string_required", enumStringRequiredRawValue); + + if (enumTest.EnumIntegerOption.IsSet) + { + var enumIntegerRawValue = EnumTestEnumIntegerValueConverter.ToJsonValue(enumTest.EnumInteger.Value); + writer.WriteNumber("enum_integer", enumIntegerRawValue); + } + if (enumTest.EnumIntegerOnlyOption.IsSet) + { + var enumIntegerOnlyRawValue = EnumTestEnumIntegerOnlyValueConverter.ToJsonValue(enumTest.EnumIntegerOnly.Value); + writer.WriteNumber("enum_integer_only", enumIntegerOnlyRawValue); + } + if (enumTest.EnumNumberOption.IsSet) + { + var enumNumberRawValue = TestEnumParametersEnumQueryDoubleParameterValueConverter.ToJsonValue(enumTest.EnumNumber.Value); + writer.WriteNumber("enum_number", enumNumberRawValue); + } + if (enumTest.EnumStringOption.IsSet) + { + var enumStringRawValue = EnumTestEnumStringValueConverter.ToJsonValue(enumTest.EnumString.Value); + writer.WriteString("enum_string", enumStringRawValue); + } + if (enumTest.OuterEnumOption.IsSet) + if (enumTest.OuterEnumOption.Value != null) + { + var outerEnumRawValue = OuterEnumValueConverter.ToJsonValue(enumTest.OuterEnumOption.Value.Value); + writer.WriteString("outerEnum", outerEnumRawValue); + } + else + writer.WriteNull("outerEnum"); + if (enumTest.OuterEnumDefaultValueOption.IsSet) + { + var outerEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumDefaultValue.Value); + writer.WriteString("outerEnumDefaultValue", outerEnumDefaultValueRawValue); + } + if (enumTest.OuterEnumIntegerOption.IsSet) + { + var outerEnumIntegerRawValue = OuterEnumIntegerValueConverter.ToJsonValue(enumTest.OuterEnumInteger.Value); + writer.WriteNumber("outerEnumInteger", outerEnumIntegerRawValue); + } + if (enumTest.OuterEnumIntegerDefaultValueOption.IsSet) + { + var outerEnumIntegerDefaultValueRawValue = OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumIntegerDefaultValue.Value); + writer.WriteNumber("outerEnumIntegerDefaultValue", outerEnumIntegerDefaultValueRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs new file mode 100644 index 00000000000..3a1302bf271 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines Enum_Test_enum_integer + /// + public enum EnumTestEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return EnumTestEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumTestEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return EnumTestEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumTestEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(EnumTestEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumInteger? result = rawValue == null + ? null + : EnumTestEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumInteger enumTestEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumInteger from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumInteger? result = rawValue == null + ? null + : EnumTestEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumInteger? enumTestEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs new file mode 100644 index 00000000000..cd0add6cf3c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines Enum_Test_enum_integer_only + /// + public enum EnumTestEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(EnumTestEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumIntegerOnly? result = rawValue == null + ? null + : EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumIntegerOnly enumTestEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumIntegerOnly? result = rawValue == null + ? null + : EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumIntegerOnly? enumTestEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs new file mode 100644 index 00000000000..adad28355b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines Enum_Test_enum_string + /// + public enum EnumTestEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return EnumTestEnumString.UPPER; + + if (value.Equals("lower")) + return EnumTestEnumString.Lower; + + if (value.Equals("")) + return EnumTestEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return EnumTestEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumTestEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumTestEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumTestEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumTestEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumTestEnumString.UPPER; + + if (value.Equals("lower")) + return EnumTestEnumString.Lower; + + if (value.Equals("")) + return EnumTestEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return EnumTestEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumTestEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumTestEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumTestEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumTestEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumTestEnumString value) + { + if (value == EnumTestEnumString.UPPER) + return "UPPER"; + + if (value == EnumTestEnumString.Lower) + return "lower"; + + if (value == EnumTestEnumString.Empty) + return ""; + + if (value == EnumTestEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumTestEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumTestEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumTestEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumTestEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumString? result = rawValue == null + ? null + : EnumTestEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumString enumTestEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumString from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumString? result = rawValue == null + ? null + : EnumTestEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumString? enumTestEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 00000000000..d65c7740e5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -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 + * 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 +{ + /// + /// EquilateralTriangle + /// + public partial class EquilateralTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public EquilateralTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 EquilateralTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EquilateralTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class EquilateralTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class EquilateralTriangle."); + + return new EquilateralTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (equilateralTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(equilateralTriangle.TriangleType), "Property is required for class EquilateralTriangle."); + + writer.WriteString("shapeType", equilateralTriangle.ShapeType); + + writer.WriteString("triangleType", equilateralTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..8d88c790110 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,175 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Must be named `File` for test. + /// + public partial class File : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization + [JsonConstructor] + public File(Option sourceURI = default) + { + SourceURIOption = sourceURI; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SourceURI + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SourceURIOption { get; private set; } + + /// + /// Test capitalization + /// + /// Test capitalization + [JsonPropertyName("sourceURI")] + public string SourceURI { get { return this.SourceURIOption; } set { this.SourceURIOption = 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 File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).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 FileJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override File 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 sourceURI = 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 "sourceURI": + sourceURI = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (sourceURI.IsSet && sourceURI.Value == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is not nullable for class File."); + + return new File(sourceURI); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, file, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (file.SourceURIOption.IsSet) + writer.WriteString("sourceURI", file.SourceURI); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..8610cbae21d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FileSchemaTestClass + /// + public partial class FileSchemaTestClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file + /// files + [JsonConstructor] + public FileSchemaTestClass(Option file = default, Option> files = default) + { + FileOption = file; + FilesOption = files; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of File + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FileOption { get; private set; } + + /// + /// Gets or Sets File + /// + [JsonPropertyName("file")] + public File File { get { return this.FileOption; } set { this.FileOption = new Option(value); } } + + /// + /// Used to track the state of Files + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> FilesOption { get; private set; } + + /// + /// Gets or Sets Files + /// + [JsonPropertyName("files")] + public List Files { get { return this.FilesOption; } set { this.FilesOption = 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 FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).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 FileSchemaTestClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FileSchemaTestClass 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 file = default; + Option> files = 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 "file": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "files": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file), "Property is not nullable for class FileSchemaTestClass."); + + if (files.IsSet && files.Value == null) + throw new ArgumentNullException(nameof(files), "Property is not nullable for class FileSchemaTestClass."); + + return new FileSchemaTestClass(file, files); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fileSchemaTestClass.FilesOption.IsSet && fileSchemaTestClass.Files == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass.Files), "Property is required for class FileSchemaTestClass."); + + if (fileSchemaTestClass.FileOption.IsSet) + { + writer.WritePropertyName("file"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.File, jsonSerializerOptions); + } + if (fileSchemaTestClass.FilesOption.IsSet) + { + writer.WritePropertyName("files"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs new file mode 100644 index 00000000000..da357d93dd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines findPetsByStatus_status_parameter_inner + /// + public enum FindPetsByStatusStatusParameterInner + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class FindPetsByStatusStatusParameterInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static FindPetsByStatusStatusParameterInner FromString(string value) + { + if (value.Equals("available")) + return FindPetsByStatusStatusParameterInner.Available; + + if (value.Equals("pending")) + return FindPetsByStatusStatusParameterInner.Pending; + + if (value.Equals("sold")) + return FindPetsByStatusStatusParameterInner.Sold; + + throw new NotImplementedException($"Could not convert value to type FindPetsByStatusStatusParameterInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static FindPetsByStatusStatusParameterInner? FromStringOrDefault(string value) + { + if (value.Equals("available")) + return FindPetsByStatusStatusParameterInner.Available; + + if (value.Equals("pending")) + return FindPetsByStatusStatusParameterInner.Pending; + + if (value.Equals("sold")) + return FindPetsByStatusStatusParameterInner.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(FindPetsByStatusStatusParameterInner value) + { + if (value == FindPetsByStatusStatusParameterInner.Available) + return "available"; + + if (value == FindPetsByStatusStatusParameterInner.Pending) + return "pending"; + + if (value == FindPetsByStatusStatusParameterInner.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class FindPetsByStatusStatusParameterInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override FindPetsByStatusStatusParameterInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + FindPetsByStatusStatusParameterInner? result = rawValue == null + ? null + : FindPetsByStatusStatusParameterInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the FindPetsByStatusStatusParameterInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FindPetsByStatusStatusParameterInner findPetsByStatusStatusParameterInner, JsonSerializerOptions options) + { + writer.WriteStringValue(findPetsByStatusStatusParameterInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class FindPetsByStatusStatusParameterInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a FindPetsByStatusStatusParameterInner from the Json object + /// + /// + /// + /// + /// + public override FindPetsByStatusStatusParameterInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + FindPetsByStatusStatusParameterInner? result = rawValue == null + ? null + : FindPetsByStatusStatusParameterInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FindPetsByStatusStatusParameterInner? findPetsByStatusStatusParameterInner, JsonSerializerOptions options) + { + writer.WriteStringValue(findPetsByStatusStatusParameterInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 00000000000..659b93c0913 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Foo + /// + public partial class Foo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar") + [JsonConstructor] + public Foo(Option bar = default) + { + BarOption = bar; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; private set; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } set { this.BarOption = 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 FooJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Foo 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 bar = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class Foo."); + + return new Foo(bar); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, foo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (foo.BarOption.IsSet) + writer.WriteString("bar", foo.Bar); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs new file mode 100644 index 00000000000..205b2f3f897 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -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 + * 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 +{ + /// + /// FooGetDefaultResponse + /// + public partial class FooGetDefaultResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// string + [JsonConstructor] + public FooGetDefaultResponse(Option @string = default) + { + StringOption = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public Foo String { get { return this.StringOption; } set { this.StringOption = 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 FooGetDefaultResponse {\n"); + sb.Append(" String: ").Append(String).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 FooGetDefaultResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FooGetDefaultResponse 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 varString = 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 "string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FooGetDefaultResponse."); + + return new FooGetDefaultResponse(varString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fooGetDefaultResponse.StringOption.IsSet) + { + writer.WritePropertyName("string"); + JsonSerializer.Serialize(writer, fooGetDefaultResponse.String, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 00000000000..3fc88d4d403 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,798 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FormatTest + /// + public partial class FormatTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// byte + /// date + /// number + /// password + /// binary + /// dateTime + /// decimal + /// double + /// float + /// int32 + /// int64 + /// integer + /// None + /// A string that is a 10 digit number. Can have leading zeros. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// string + /// unsignedInteger + /// unsignedLong + /// uuid + [JsonConstructor] + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int64 = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + { + Byte = @byte; + Date = date; + Number = number; + Password = password; + BinaryOption = binary; + DateTimeOption = dateTime; + DecimalOption = @decimal; + DoubleOption = @double; + FloatOption = @float; + Int32Option = int32; + Int64Option = int64; + IntegerOption = integer; + PatternWithBackslashOption = patternWithBackslash; + PatternWithDigitsOption = patternWithDigits; + PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; + StringOption = @string; + UnsignedIntegerOption = unsignedInteger; + UnsignedLongOption = unsignedLong; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Byte + /// + [JsonPropertyName("byte")] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + /// Sun Feb 02 00:00:00 UTC 2020 + [JsonPropertyName("date")] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Number + /// + [JsonPropertyName("number")] + public decimal Number { get; set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get; set; } + + /// + /// Used to track the state of Binary + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BinaryOption { get; private set; } + + /// + /// Gets or Sets Binary + /// + [JsonPropertyName("binary")] + public System.IO.Stream Binary { get { return this.BinaryOption; } set { this.BinaryOption = new Option(value); } } + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + /// 2007-12-03T10:15:30+01:00 + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + [JsonPropertyName("decimal")] + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of Double + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DoubleOption { get; private set; } + + /// + /// Gets or Sets Double + /// + [JsonPropertyName("double")] + public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + + /// + /// Used to track the state of Float + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FloatOption { get; private set; } + + /// + /// Gets or Sets Float + /// + [JsonPropertyName("float")] + public float? Float { get { return this.FloatOption; } set { this.FloatOption = new Option(value); } } + + /// + /// Used to track the state of Int32 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32Option { get; private set; } + + /// + /// Gets or Sets Int32 + /// + [JsonPropertyName("int32")] + public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + + /// + /// Used to track the state of Int64 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64Option { get; private set; } + + /// + /// Gets or Sets Int64 + /// + [JsonPropertyName("int64")] + public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + + /// + /// Used to track the state of Integer + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerOption { get; private set; } + + /// + /// Gets or Sets Integer + /// + [JsonPropertyName("integer")] + public int? Integer { get { return this.IntegerOption; } set { this.IntegerOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithBackslash + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithBackslashOption { get; private set; } + + /// + /// None + /// + /// None + [JsonPropertyName("pattern_with_backslash")] + public string PatternWithBackslash { get { return this.PatternWithBackslashOption; } set { this.PatternWithBackslashOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigits + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsOption { get; private set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [JsonPropertyName("pattern_with_digits")] + public string PatternWithDigits { get { return this.PatternWithDigitsOption; } set { this.PatternWithDigitsOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigitsAndDelimiter + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsAndDelimiterOption { get; private set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [JsonPropertyName("pattern_with_digits_and_delimiter")] + public string PatternWithDigitsAndDelimiter { get { return this.PatternWithDigitsAndDelimiterOption; } set { this.PatternWithDigitsAndDelimiterOption = new Option(value); } } + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedIntegerOption { get; private set; } + + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint? UnsignedInteger { get { return this.UnsignedIntegerOption; } set { this.UnsignedIntegerOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedLong + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedLongOption { get; private set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong? UnsignedLong { get { return this.UnsignedLongOption; } set { this.UnsignedLongOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 FormatTest {\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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) + { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // Double (double) maximum + if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) + { + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) + { + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // Float (float) maximum + if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) + { + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) + { + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Int32 (int) maximum + if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) + { + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) + { + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Integer (int) maximum + if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) + { + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) + { + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + if (this.PatternWithBackslashOption.Value != null) { + // PatternWithBackslash (string) pattern + Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); + + if (this.PatternWithBackslashOption.Value != null &&!regexPatternWithBackslash.Match(this.PatternWithBackslashOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); + } + } + + if (this.PatternWithDigitsOption.Value != null) { + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); + + if (this.PatternWithDigitsOption.Value != null &&!regexPatternWithDigits.Match(this.PatternWithDigitsOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + } + + if (this.PatternWithDigitsAndDelimiterOption.Value != null) { + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.PatternWithDigitsAndDelimiterOption.Value != null &&!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiterOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + } + + if (this.StringOption.Value != null) { + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.StringOption.Value != null &&!regexString.Match(this.StringOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + } + + // UnsignedInteger (uint) maximum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class FormatTestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Date + /// + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FormatTest 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 varByte = default; + Option date = default; + Option number = default; + Option password = default; + Option binary = default; + Option dateTime = default; + Option varDecimal = default; + Option varDouble = default; + Option varFloat = default; + Option int32 = default; + Option int64 = default; + Option integer = default; + Option patternWithBackslash = default; + Option patternWithDigits = default; + Option patternWithDigitsAndDelimiter = default; + Option varString = default; + Option unsignedInteger = default; + Option unsignedLong = default; + Option uuid = 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 "byte": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "date": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = new Option(utf8JsonReader.GetDecimal()); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "binary": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "decimal": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "double": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDouble = new Option(utf8JsonReader.GetDouble()); + break; + case "float": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varFloat = new Option((float)utf8JsonReader.GetDouble()); + break; + case "int32": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = new Option(utf8JsonReader.GetInt32()); + break; + case "int64": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = new Option(utf8JsonReader.GetInt64()); + break; + case "integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = new Option(utf8JsonReader.GetInt32()); + break; + case "pattern_with_backslash": + patternWithBackslash = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits": + patternWithDigits = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits_and_delimiter": + patternWithDigitsAndDelimiter = new Option(utf8JsonReader.GetString()); + break; + case "string": + varString = new Option(utf8JsonReader.GetString()); + break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = new Option(utf8JsonReader.GetUInt64()); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (!varByte.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(varByte)); + + if (!date.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(date)); + + if (!number.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(number)); + + if (!password.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + + if (varByte.IsSet && varByte.Value == null) + throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); + + if (date.IsSet && date.Value == null) + throw new ArgumentNullException(nameof(date), "Property is not nullable for class FormatTest."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class FormatTest."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class FormatTest."); + + if (varDecimal.IsSet && varDecimal.Value == null) + throw new ArgumentNullException(nameof(varDecimal), "Property is not nullable for class FormatTest."); + + if (varDouble.IsSet && varDouble.Value == null) + throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + + if (varFloat.IsSet && varFloat.Value == null) + throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); + + if (int32.IsSet && int32.Value == null) + throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + + if (int64.IsSet && int64.Value == null) + throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + + if (integer.IsSet && integer.Value == null) + throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); + + if (patternWithBackslash.IsSet && patternWithBackslash.Value == null) + throw new ArgumentNullException(nameof(patternWithBackslash), "Property is not nullable for class FormatTest."); + + if (patternWithDigits.IsSet && patternWithDigits.Value == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is not nullable for class FormatTest."); + + if (patternWithDigitsAndDelimiter.IsSet && patternWithDigitsAndDelimiter.Value == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is not nullable for class FormatTest."); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + + if (unsignedInteger.IsSet && unsignedInteger.Value == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); + + if (unsignedLong.IsSet && unsignedLong.Value == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is not nullable for class FormatTest."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); + + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, formatTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (formatTest.Password == null) + throw new ArgumentNullException(nameof(formatTest.Password), "Property is required for class FormatTest."); + + if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) + throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsOption.IsSet && formatTest.PatternWithDigits == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigits), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet && formatTest.PatternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + + if (formatTest.StringOption.IsSet && formatTest.String == null) + throw new ArgumentNullException(nameof(formatTest.String), "Property is required for class FormatTest."); + + writer.WritePropertyName("byte"); + JsonSerializer.Serialize(writer, formatTest.Byte, jsonSerializerOptions); + writer.WriteString("date", formatTest.Date.ToString(DateFormat)); + + writer.WriteNumber("number", formatTest.Number); + + writer.WriteString("password", formatTest.Password); + + if (formatTest.BinaryOption.IsSet) + { + writer.WritePropertyName("binary"); + JsonSerializer.Serialize(writer, formatTest.Binary, jsonSerializerOptions); + } + if (formatTest.DateTimeOption.IsSet) + writer.WriteString("dateTime", formatTest.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (formatTest.DecimalOption.IsSet) + { + writer.WritePropertyName("decimal"); + JsonSerializer.Serialize(writer, formatTest.Decimal, jsonSerializerOptions); + } + if (formatTest.DoubleOption.IsSet) + writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + + if (formatTest.FloatOption.IsSet) + writer.WriteNumber("float", formatTest.FloatOption.Value.Value); + + if (formatTest.Int32Option.IsSet) + writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + + if (formatTest.Int64Option.IsSet) + writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + + if (formatTest.IntegerOption.IsSet) + writer.WriteNumber("integer", formatTest.IntegerOption.Value.Value); + + if (formatTest.PatternWithBackslashOption.IsSet) + writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash); + + if (formatTest.PatternWithDigitsOption.IsSet) + writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet) + writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); + + if (formatTest.StringOption.IsSet) + writer.WriteString("string", formatTest.String); + + if (formatTest.UnsignedIntegerOption.IsSet) + writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); + + if (formatTest.UnsignedLongOption.IsSet) + writer.WriteNumber("unsigned_long", formatTest.UnsignedLongOption.Value.Value); + + if (formatTest.UuidOption.IsSet) + writer.WriteString("uuid", formatTest.UuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..0302533cd2f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Fruit.cs @@ -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 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 00000000000..1e72875d4d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FruitReq + /// + public partial class FruitReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(AppleReq appleReq) + { + AppleReq = appleReq; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(BananaReq bananaReq) + { + BananaReq = bananaReq; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AppleReq + /// + public AppleReq AppleReq { get; set; } + + /// + /// Gets or Sets BananaReq + /// + public BananaReq BananaReq { 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 FruitReq {\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 FruitReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FruitReq 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; + + AppleReq appleReq = default; + BananaReq bananaReq = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderAppleReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAppleReq, jsonSerializerOptions, out appleReq); + + Utf8JsonReader utf8JsonReaderBananaReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBananaReq, jsonSerializerOptions, out bananaReq); + } + } + + 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) + { + default: + break; + } + } + } + + if (appleReq != null) + return new FruitReq(appleReq); + + if (bananaReq != null) + return new FruitReq(bananaReq); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruitReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 00000000000..e2eb2c897a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,235 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// GmFruit + /// + public partial class GmFruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public GmFruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" Color: ").Append(Color).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 GmFruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GmFruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class GmFruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new GmFruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); + 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(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, gmFruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (gmFruit.ColorOption.IsSet) + writer.WriteString("color", gmFruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 00000000000..838cae14f98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -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 + * 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 +{ + /// + /// GrandparentAnimal + /// + public partial class GrandparentAnimal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + public GrandparentAnimal() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; + + /// + /// 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 GrandparentAnimal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GrandparentAnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GrandparentAnimal 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class GrandparentAnimal.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); + + return new GrandparentAnimal(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, grandparentAnimal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", grandparentAnimal.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..680ead387fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,244 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// HasOnlyReadOnly + /// + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// foo + [JsonConstructor] + internal HasOnlyReadOnly(Option bar = default, Option foo = default) + { + BarOption = bar; + FooOption = foo; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Foo + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FooOption { get; } + + /// + /// Gets or Sets Foo + /// + [JsonPropertyName("foo")] + public string Foo { get { return this.FooOption; } } + + /// + /// 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 HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + if (Foo != null) + hashCode = (hashCode * 59) + Foo.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 HasOnlyReadOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HasOnlyReadOnly 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 bar = default; + Option foo = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "foo": + foo = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class HasOnlyReadOnly."); + + if (foo.IsSet && foo.Value == null) + throw new ArgumentNullException(nameof(foo), "Property is not nullable for class HasOnlyReadOnly."); + + return new HasOnlyReadOnly(bar, foo); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (hasOnlyReadOnly.FooOption.IsSet && hasOnlyReadOnly.Foo == null) + throw new ArgumentNullException(nameof(hasOnlyReadOnly.Foo), "Property is required for class HasOnlyReadOnly."); + + if (hasOnlyReadOnly.BarOption.IsSet) + writer.WriteString("bar", hasOnlyReadOnly.Bar); + + if (hasOnlyReadOnly.FooOption.IsSet) + writer.WriteString("foo", hasOnlyReadOnly.Foo); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 00000000000..112f55c9ab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -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 + * 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 +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + public partial class HealthCheckResult : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage + [JsonConstructor] + public HealthCheckResult(Option nullableMessage = default) + { + NullableMessageOption = nullableMessage; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of NullableMessage + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableMessageOption { get; private set; } + + /// + /// Gets or Sets NullableMessage + /// + [JsonPropertyName("NullableMessage")] + public string NullableMessage { get { return this.NullableMessageOption; } set { this.NullableMessageOption = 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HealthCheckResult 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 nullableMessage = 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 "NullableMessage": + nullableMessage = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + return new HealthCheckResult(nullableMessage); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + if (healthCheckResult.NullableMessageOption.IsSet) + if (healthCheckResult.NullableMessageOption.Value != null) + writer.WriteString("NullableMessage", healthCheckResult.NullableMessage); + else + writer.WriteNull("NullableMessage"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 00000000000..cce85952411 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -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 + * 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 +{ + /// + /// IsoscelesTriangle + /// + public partial class IsoscelesTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public IsoscelesTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { 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 IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 IsoscelesTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IsoscelesTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class IsoscelesTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class IsoscelesTriangle."); + + return new IsoscelesTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (isoscelesTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(isoscelesTriangle.TriangleType), "Property is required for class IsoscelesTriangle."); + + writer.WriteString("shapeType", isoscelesTriangle.ShapeType); + + writer.WriteString("triangleType", isoscelesTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 00000000000..acadb2f2842 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// List + /// + public partial class List : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// var123List + [JsonConstructor] + public List(Option var123List = default) + { + Var123ListOption = var123List; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Var123List + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123ListOption { get; private set; } + + /// + /// Gets or Sets Var123List + /// + [JsonPropertyName("123-list")] + public string Var123List { get { return this.Var123ListOption; } set { this.Var123ListOption = 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 List {\n"); + sb.Append(" Var123List: ").Append(Var123List).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 ListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override List 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 var123List = 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 "123-list": + var123List = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (var123List.IsSet && var123List.Value == null) + throw new ArgumentNullException(nameof(var123List), "Property is not nullable for class List."); + + return new List(var123List); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, list, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (list.Var123ListOption.IsSet) + writer.WriteString("123-list", list.Var123List); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..bfcbb4465fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,203 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(Option escapedLiteralString = default, Option unescapedLiteralString = default) + { + EscapedLiteralStringOption = escapedLiteralString; + UnescapedLiteralStringOption = unescapedLiteralString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of EscapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EscapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get { return this.EscapedLiteralStringOption; } set { this.EscapedLiteralStringOption = new Option(value); } } + + /// + /// Used to track the state of UnescapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnescapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get { return this.UnescapedLiteralStringOption; } set { this.UnescapedLiteralStringOption = 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 LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).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 LiteralStringClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override LiteralStringClass 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 escapedLiteralString = default; + Option unescapedLiteralString = 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 "escapedLiteralString": + escapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + case "unescapedLiteralString": + unescapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (escapedLiteralString.IsSet && escapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + if (unescapedLiteralString.IsSet && unescapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, literalStringClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet && literalStringClass.UnescapedLiteralString == null) + throw new ArgumentNullException(nameof(literalStringClass.UnescapedLiteralString), "Property is required for class LiteralStringClass."); + + if (literalStringClass.EscapedLiteralStringOption.IsSet) + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet) + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 00000000000..267ac8769d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mammal + /// + public partial class Mammal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Whale whale) + { + Whale = whale; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Zebra zebra) + { + Zebra = zebra; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Pig pig) + { + Pig = pig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Whale + /// + public Whale Whale { get; set; } + + /// + /// Gets or Sets Zebra + /// + public Zebra Zebra { get; set; } + + /// + /// Gets or Sets Pig + /// + public Pig Pig { get; set; } + + /// + /// 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 Mammal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Mammal 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 className = default; + + Pig pig = null; + Whale whale = null; + Zebra zebra = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Pig")) + { + Utf8JsonReader utf8JsonReaderPig = utf8JsonReader; + pig = JsonSerializer.Deserialize(ref utf8JsonReaderPig, jsonSerializerOptions); + } + if (discriminator.Equals("whale")) + { + Utf8JsonReader utf8JsonReaderWhale = utf8JsonReader; + whale = JsonSerializer.Deserialize(ref utf8JsonReaderWhale, jsonSerializerOptions); + } + if (discriminator.Equals("zebra")) + { + Utf8JsonReader utf8JsonReaderZebra = utf8JsonReader; + zebra = JsonSerializer.Deserialize(ref utf8JsonReaderZebra, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Mammal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); + + if (pig != null) + return new Mammal(pig); + + if (whale != null) + return new Mammal(whale); + + if (zebra != null) + return new Mammal(zebra); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mammal.Whale != null) + { + WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); + } + + if (mammal.Zebra != null) + { + ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); + } + + if (mammal.Pig != null) + { + PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); + } + + WriteProperties(writer, mammal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 00000000000..51649bbb138 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,274 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MapTest + /// + public partial class MapTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// directMap + /// indirectMap + /// mapMapOfString + /// mapOfEnumString + [JsonConstructor] + public MapTest(Option> directMap = default, Option> indirectMap = default, Option>> mapMapOfString = default, Option> mapOfEnumString = default) + { + DirectMapOption = directMap; + IndirectMapOption = indirectMap; + MapMapOfStringOption = mapMapOfString; + MapOfEnumStringOption = mapOfEnumString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> DirectMapOption { get; private set; } + + /// + /// Gets or Sets DirectMap + /// + [JsonPropertyName("direct_map")] + public Dictionary DirectMap { get { return this.DirectMapOption; } set { this.DirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of IndirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> IndirectMapOption { get; private set; } + + /// + /// Gets or Sets IndirectMap + /// + [JsonPropertyName("indirect_map")] + public Dictionary IndirectMap { get { return this.IndirectMapOption; } set { this.IndirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of MapMapOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapMapOfStringOption { get; private set; } + + /// + /// Gets or Sets MapMapOfString + /// + [JsonPropertyName("map_map_of_string")] + public Dictionary> MapMapOfString { get { return this.MapMapOfStringOption; } set { this.MapMapOfStringOption = new Option>>(value); } } + + /// + /// Used to track the state of MapOfEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOfEnumStringOption { get; private set; } + + /// + /// Gets or Sets MapOfEnumString + /// + [JsonPropertyName("map_of_enum_string")] + public Dictionary MapOfEnumString { get { return this.MapOfEnumStringOption; } set { this.MapOfEnumStringOption = 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 MapTest {\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).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 MapTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MapTest 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> directMap = default; + Option> indirectMap = default; + Option>> mapMapOfString = default; + Option> mapOfEnumString = 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 "direct_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "indirect_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_map_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_enum_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (directMap.IsSet && directMap.Value == null) + throw new ArgumentNullException(nameof(directMap), "Property is not nullable for class MapTest."); + + if (indirectMap.IsSet && indirectMap.Value == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is not nullable for class MapTest."); + + if (mapMapOfString.IsSet && mapMapOfString.Value == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is not nullable for class MapTest."); + + if (mapOfEnumString.IsSet && mapOfEnumString.Value == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is not nullable for class MapTest."); + + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mapTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mapTest.IndirectMapOption.IsSet && mapTest.IndirectMap == null) + throw new ArgumentNullException(nameof(mapTest.IndirectMap), "Property is required for class MapTest."); + + if (mapTest.MapMapOfStringOption.IsSet && mapTest.MapMapOfString == null) + throw new ArgumentNullException(nameof(mapTest.MapMapOfString), "Property is required for class MapTest."); + + if (mapTest.MapOfEnumStringOption.IsSet && mapTest.MapOfEnumString == null) + throw new ArgumentNullException(nameof(mapTest.MapOfEnumString), "Property is required for class MapTest."); + + if (mapTest.DirectMapOption.IsSet) + { + writer.WritePropertyName("direct_map"); + JsonSerializer.Serialize(writer, mapTest.DirectMap, jsonSerializerOptions); + } + if (mapTest.IndirectMapOption.IsSet) + { + writer.WritePropertyName("indirect_map"); + JsonSerializer.Serialize(writer, mapTest.IndirectMap, jsonSerializerOptions); + } + if (mapTest.MapMapOfStringOption.IsSet) + { + writer.WritePropertyName("map_map_of_string"); + JsonSerializer.Serialize(writer, mapTest.MapMapOfString, jsonSerializerOptions); + } + if (mapTest.MapOfEnumStringOption.IsSet) + { + writer.WritePropertyName("map_of_enum_string"); + JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs new file mode 100644 index 00000000000..441ea5dcb7d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines MapTest_map_of_enum_string_value + /// + public enum MapTestMapOfEnumStringValue + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class MapTestMapOfEnumStringValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static MapTestMapOfEnumStringValue FromString(string value) + { + if (value.Equals("UPPER")) + return MapTestMapOfEnumStringValue.UPPER; + + if (value.Equals("lower")) + return MapTestMapOfEnumStringValue.Lower; + + throw new NotImplementedException($"Could not convert value to type MapTestMapOfEnumStringValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static MapTestMapOfEnumStringValue? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return MapTestMapOfEnumStringValue.UPPER; + + if (value.Equals("lower")) + return MapTestMapOfEnumStringValue.Lower; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(MapTestMapOfEnumStringValue value) + { + if (value == MapTestMapOfEnumStringValue.UPPER) + return "UPPER"; + + if (value == MapTestMapOfEnumStringValue.Lower) + return "lower"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class MapTestMapOfEnumStringValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override MapTestMapOfEnumStringValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + MapTestMapOfEnumStringValue? result = rawValue == null + ? null + : MapTestMapOfEnumStringValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the MapTestMapOfEnumStringValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTestMapOfEnumStringValue mapTestMapOfEnumStringValue, JsonSerializerOptions options) + { + writer.WriteStringValue(mapTestMapOfEnumStringValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class MapTestMapOfEnumStringValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a MapTestMapOfEnumStringValue from the Json object + /// + /// + /// + /// + /// + public override MapTestMapOfEnumStringValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + MapTestMapOfEnumStringValue? result = rawValue == null + ? null + : MapTestMapOfEnumStringValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTestMapOfEnumStringValue? mapTestMapOfEnumStringValue, JsonSerializerOptions options) + { + writer.WriteStringValue(mapTestMapOfEnumStringValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..0f3a07debfe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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 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/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..74047904b27 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..b335b252782 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new Option(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..7b435033f6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d3cb505539d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -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 + * 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 +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + public partial class MixedPropertiesAndAdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateTime + /// map + /// uuid + /// uuidWithPattern + [JsonConstructor] + public MixedPropertiesAndAdditionalPropertiesClass(Option dateTime = default, Option> map = default, Option uuid = default, Option uuidWithPattern = default) + { + DateTimeOption = dateTime; + MapOption = map; + UuidOption = uuid; + UuidWithPatternOption = uuidWithPattern; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Map + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOption { get; private set; } + + /// + /// Gets or Sets Map + /// + [JsonPropertyName("map")] + public Dictionary Map { get { return this.MapOption; } set { this.MapOption = new Option>(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option(value); } } + + /// + /// Used to track the state of UuidWithPattern + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidWithPatternOption { get; private set; } + + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid? UuidWithPattern { get { return this.UuidWithPatternOption; } set { this.UuidWithPatternOption = 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 MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).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) + { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + + if (this.UuidWithPatternOption.Value != null &&!regexUuidWithPattern.Match(this.UuidWithPatternOption.Value.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixedPropertiesAndAdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedPropertiesAndAdditionalPropertiesClass 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 dateTime = default; + Option> map = default; + Option uuid = default; + Option uuidWithPattern = 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 "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + case "uuid_with_pattern": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map.IsSet && map.Value == null) + throw new ArgumentNullException(nameof(map), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuidWithPattern.IsSet && uuidWithPattern.Value == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.IsSet) + writer.WriteString("dateTime", mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet) + { + writer.WritePropertyName("map"); + JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); + } + if (mixedPropertiesAndAdditionalPropertiesClass.UuidOption.IsSet) + writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.UuidOption.Value.Value); + + if (mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.IsSet) + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..1af8feed0a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 00000000000..30ee980fae9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name starting with number + /// + public partial class Model200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + /// name + [JsonConstructor] + public Model200Response(Option @class = default, Option name = default) + { + ClassOption = @class; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public int? Name { get { return this.NameOption; } set { this.NameOption = 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 Model200Response {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" Name: ").Append(Name).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 Model200ResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Model200Response 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 varClass = default; + Option name = 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 "class": + varClass = new Option(utf8JsonReader.GetString()); + break; + case "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class Model200Response."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Model200Response."); + + return new Model200Response(varClass, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, model200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (model200Response.ClassOption.IsSet) + writer.WriteString("class", model200Response.Class); + + if (model200Response.NameOption.IsSet) + writer.WriteNumber("name", model200Response.NameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 00000000000..28da419bb21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ModelClient + /// + public partial class ModelClient : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varClient + [JsonConstructor] + public ModelClient(Option varClient = default) + { + VarClientOption = varClient; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarClient + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarClientOption { get; private set; } + + /// + /// Gets or Sets VarClient + /// + [JsonPropertyName("client")] + public string VarClient { get { return this.VarClientOption; } set { this.VarClientOption = 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 ModelClient {\n"); + sb.Append(" VarClient: ").Append(VarClient).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 ModelClientJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ModelClient 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 varClient = 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 "client": + varClient = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClient.IsSet && varClient.Value == null) + throw new ArgumentNullException(nameof(varClient), "Property is not nullable for class ModelClient."); + + return new ModelClient(varClient); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, modelClient, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (modelClient.VarClientOption.IsSet) + writer.WriteString("client", modelClient.VarClient); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 00000000000..f353f694fb2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,291 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name same as property name + /// + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varName + /// property + /// snakeCase + /// var123Number + [JsonConstructor] + public Name(int varName, Option property = default, Option snakeCase = default, Option var123Number = default) + { + VarName = varName; + PropertyOption = property; + SnakeCaseOption = snakeCase; + Var123NumberOption = var123Number; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets VarName + /// + [JsonPropertyName("name")] + public int VarName { get; set; } + + /// + /// Used to track the state of Property + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PropertyOption { get; private set; } + + /// + /// Gets or Sets Property + /// + [JsonPropertyName("property")] + public string Property { get { return this.PropertyOption; } set { this.PropertyOption = new Option(value); } } + + /// + /// Used to track the state of SnakeCase + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SnakeCaseOption { get; } + + /// + /// Gets or Sets SnakeCase + /// + [JsonPropertyName("snake_case")] + public int? SnakeCase { get { return this.SnakeCaseOption; } } + + /// + /// Used to track the state of Var123Number + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123NumberOption { get; } + + /// + /// Gets or Sets Var123Number + /// + [JsonPropertyName("123Number")] + public int? Var123Number { get { return this.Var123NumberOption; } } + + /// + /// 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 Name {\n"); + sb.Append(" VarName: ").Append(VarName).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Var123Number: ").Append(Var123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name 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 (SnakeCase != null) + hashCode = (hashCode * 59) + SnakeCase.GetHashCode(); + + if (Var123Number != null) + hashCode = (hashCode * 59) + Var123Number.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 NameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Name 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 varName = default; + Option property = default; + Option snakeCase = default; + Option var123Number = 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 "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varName = new Option(utf8JsonReader.GetInt32()); + break; + case "property": + property = new Option(utf8JsonReader.GetString()); + break; + case "snake_case": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = new Option(utf8JsonReader.GetInt32()); + break; + case "123Number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + var123Number = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!varName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(varName)); + + if (varName.IsSet && varName.Value == null) + throw new ArgumentNullException(nameof(varName), "Property is not nullable for class Name."); + + if (property.IsSet && property.Value == null) + throw new ArgumentNullException(nameof(property), "Property is not nullable for class Name."); + + if (snakeCase.IsSet && snakeCase.Value == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is not nullable for class Name."); + + if (var123Number.IsSet && var123Number.Value == null) + throw new ArgumentNullException(nameof(var123Number), "Property is not nullable for class Name."); + + return new Name(varName.Value.Value, property, snakeCase, var123Number); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, name, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteNumber("name", name.VarName); + + if (name.PropertyOption.IsSet) + writer.WriteString("property", name.Property); + + if (name.SnakeCaseOption.IsSet) + writer.WriteNumber("snake_case", name.SnakeCaseOption.Value.Value); + + if (name.Var123NumberOption.IsSet) + writer.WriteNumber("123Number", name.Var123NumberOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs new file mode 100644 index 00000000000..ea8abdda0d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -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 + * 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 +{ + /// + /// NotificationtestGetElementsV1ResponseMPayload + /// + public partial class NotificationtestGetElementsV1ResponseMPayload : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// aObjVariableobject + /// pkiNotificationtestID + [JsonConstructor] + public NotificationtestGetElementsV1ResponseMPayload(List> aObjVariableobject, int pkiNotificationtestID) + { + AObjVariableobject = aObjVariableobject; + PkiNotificationtestID = pkiNotificationtestID; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AObjVariableobject + /// + [JsonPropertyName("a_objVariableobject")] + public List> AObjVariableobject { get; set; } + + /// + /// Gets or Sets PkiNotificationtestID + /// + [JsonPropertyName("pkiNotificationtestID")] + public int PkiNotificationtestID { get; set; } + + /// + /// 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 NotificationtestGetElementsV1ResponseMPayload {\n"); + sb.Append(" AObjVariableobject: ").Append(AObjVariableobject).Append("\n"); + sb.Append(" PkiNotificationtestID: ").Append(PkiNotificationtestID).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 NotificationtestGetElementsV1ResponseMPayloadJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NotificationtestGetElementsV1ResponseMPayload 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>> aObjVariableobject = default; + Option pkiNotificationtestID = 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 "a_objVariableobject": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pkiNotificationtestID": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!aObjVariableobject.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(aObjVariableobject)); + + if (!pkiNotificationtestID.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(pkiNotificationtestID)); + + if (aObjVariableobject.IsSet && aObjVariableobject.Value == null) + throw new ArgumentNullException(nameof(aObjVariableobject), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + if (pkiNotificationtestID.IsSet && pkiNotificationtestID.Value == null) + throw new ArgumentNullException(nameof(pkiNotificationtestID), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + return new NotificationtestGetElementsV1ResponseMPayload(aObjVariableobject.Value, pkiNotificationtestID.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WritePropertyName("a_objVariableobject"); + JsonSerializer.Serialize(writer, notificationtestGetElementsV1ResponseMPayload.AObjVariableobject, jsonSerializerOptions); + writer.WriteNumber("pkiNotificationtestID", notificationtestGetElementsV1ResponseMPayload.PkiNotificationtestID); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 00000000000..ff026f1fbb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,496 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// NullableClass + /// + public partial class NullableClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayAndItemsNullableProp + /// arrayItemsNullable + /// arrayNullableProp + /// booleanProp + /// dateProp + /// datetimeProp + /// integerProp + /// numberProp + /// objectAndItemsNullableProp + /// objectItemsNullable + /// objectNullableProp + /// stringProp + [JsonConstructor] + public NullableClass(Option> arrayAndItemsNullableProp = default, Option> arrayItemsNullable = default, Option> arrayNullableProp = default, Option booleanProp = default, Option dateProp = default, Option datetimeProp = default, Option integerProp = default, Option numberProp = default, Option> objectAndItemsNullableProp = default, Option> objectItemsNullable = default, Option> objectNullableProp = default, Option stringProp = default) + { + ArrayAndItemsNullablePropOption = arrayAndItemsNullableProp; + ArrayItemsNullableOption = arrayItemsNullable; + ArrayNullablePropOption = arrayNullableProp; + BooleanPropOption = booleanProp; + DatePropOption = dateProp; + DatetimePropOption = datetimeProp; + IntegerPropOption = integerProp; + NumberPropOption = numberProp; + ObjectAndItemsNullablePropOption = objectAndItemsNullableProp; + ObjectItemsNullableOption = objectItemsNullable; + ObjectNullablePropOption = objectNullableProp; + StringPropOption = stringProp; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [JsonPropertyName("array_and_items_nullable_prop")] + public List ArrayAndItemsNullableProp { get { return this.ArrayAndItemsNullablePropOption; } set { this.ArrayAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [JsonPropertyName("array_items_nullable")] + public List ArrayItemsNullable { get { return this.ArrayItemsNullableOption; } set { this.ArrayItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [JsonPropertyName("array_nullable_prop")] + public List ArrayNullableProp { get { return this.ArrayNullablePropOption; } set { this.ArrayNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of BooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BooleanPropOption { get; private set; } + + /// + /// Gets or Sets BooleanProp + /// + [JsonPropertyName("boolean_prop")] + public bool? BooleanProp { get { return this.BooleanPropOption; } set { this.BooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of DateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatePropOption { get; private set; } + + /// + /// Gets or Sets DateProp + /// + [JsonPropertyName("date_prop")] + public DateTime? DateProp { get { return this.DatePropOption; } set { this.DatePropOption = new Option(value); } } + + /// + /// Used to track the state of DatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatetimePropOption { get; private set; } + + /// + /// Gets or Sets DatetimeProp + /// + [JsonPropertyName("datetime_prop")] + public DateTime? DatetimeProp { get { return this.DatetimePropOption; } set { this.DatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of IntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerPropOption { get; private set; } + + /// + /// Gets or Sets IntegerProp + /// + [JsonPropertyName("integer_prop")] + public int? IntegerProp { get { return this.IntegerPropOption; } set { this.IntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NumberProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberPropOption { get; private set; } + + /// + /// Gets or Sets NumberProp + /// + [JsonPropertyName("number_prop")] + public decimal? NumberProp { get { return this.NumberPropOption; } set { this.NumberPropOption = new Option(value); } } + + /// + /// Used to track the state of ObjectAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [JsonPropertyName("object_and_items_nullable_prop")] + public Dictionary ObjectAndItemsNullableProp { get { return this.ObjectAndItemsNullablePropOption; } set { this.ObjectAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [JsonPropertyName("object_items_nullable")] + public Dictionary ObjectItemsNullable { get { return this.ObjectItemsNullableOption; } set { this.ObjectItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [JsonPropertyName("object_nullable_prop")] + public Dictionary ObjectNullableProp { get { return this.ObjectNullablePropOption; } set { this.ObjectNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of StringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringPropOption { get; private set; } + + /// + /// Gets or Sets StringProp + /// + [JsonPropertyName("string_prop")] + public string StringProp { get { return this.StringPropOption; } set { this.StringPropOption = 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 NullableClass {\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).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 NullableClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateProp + /// + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DatetimeProp + /// + public static string DatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableClass 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> arrayAndItemsNullableProp = default; + Option> arrayItemsNullable = default; + Option> arrayNullableProp = default; + Option booleanProp = default; + Option dateProp = default; + Option datetimeProp = default; + Option integerProp = default; + Option numberProp = default; + Option> objectAndItemsNullableProp = default; + Option> objectItemsNullable = default; + Option> objectNullableProp = default; + Option stringProp = 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 "array_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "number_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + numberProp = new Option(utf8JsonReader.GetDecimal()); + break; + case "object_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "string_prop": + stringProp = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (arrayItemsNullable.IsSet && arrayItemsNullable.Value == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is not nullable for class NullableClass."); + + if (objectItemsNullable.IsSet && objectItemsNullable.Value == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is not nullable for class NullableClass."); + + return new NullableClass(arrayAndItemsNullableProp, arrayItemsNullable, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectItemsNullable, objectNullableProp, stringProp); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (nullableClass.ObjectItemsNullableOption.IsSet && nullableClass.ObjectItemsNullable == null) + throw new ArgumentNullException(nameof(nullableClass.ObjectItemsNullable), "Property is required for class NullableClass."); + + if (nullableClass.ArrayAndItemsNullablePropOption.IsSet) + if (nullableClass.ArrayAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("array_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_and_items_nullable_prop"); + if (nullableClass.ArrayItemsNullableOption.IsSet) + { + writer.WritePropertyName("array_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ArrayNullablePropOption.IsSet) + if (nullableClass.ArrayNullablePropOption.Value != null) + { + writer.WritePropertyName("array_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_nullable_prop"); + if (nullableClass.BooleanPropOption.IsSet) + if (nullableClass.BooleanPropOption.Value != null) + writer.WriteBoolean("boolean_prop", nullableClass.BooleanPropOption.Value.Value); + else + writer.WriteNull("boolean_prop"); + + if (nullableClass.DatePropOption.IsSet) + if (nullableClass.DatePropOption.Value != null) + writer.WriteString("date_prop", nullableClass.DatePropOption.Value.Value.ToString(DatePropFormat)); + else + writer.WriteNull("date_prop"); + + if (nullableClass.DatetimePropOption.IsSet) + if (nullableClass.DatetimePropOption.Value != null) + writer.WriteString("datetime_prop", nullableClass.DatetimePropOption.Value.Value.ToString(DatetimePropFormat)); + else + writer.WriteNull("datetime_prop"); + + if (nullableClass.IntegerPropOption.IsSet) + if (nullableClass.IntegerPropOption.Value != null) + writer.WriteNumber("integer_prop", nullableClass.IntegerPropOption.Value.Value); + else + writer.WriteNull("integer_prop"); + + if (nullableClass.NumberPropOption.IsSet) + if (nullableClass.NumberPropOption.Value != null) + writer.WriteNumber("number_prop", nullableClass.NumberPropOption.Value.Value); + else + writer.WriteNull("number_prop"); + + if (nullableClass.ObjectAndItemsNullablePropOption.IsSet) + if (nullableClass.ObjectAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("object_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_and_items_nullable_prop"); + if (nullableClass.ObjectItemsNullableOption.IsSet) + { + writer.WritePropertyName("object_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ObjectNullablePropOption.IsSet) + if (nullableClass.ObjectNullablePropOption.Value != null) + { + writer.WritePropertyName("object_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_nullable_prop"); + if (nullableClass.StringPropOption.IsSet) + if (nullableClass.StringPropOption.Value != null) + writer.WriteString("string_prop", nullableClass.StringProp); + else + writer.WriteNull("string_prop"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs new file mode 100644 index 00000000000..8c52be7e14a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -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 + * 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 +{ + /// + /// NullableGuidClass + /// + public partial class NullableGuidClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid + [JsonConstructor] + public NullableGuidClass(Option uuid = default) + { + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 NullableGuidClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).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 NullableGuidClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableGuidClass 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 uuid = 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 "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + return new NullableGuidClass(uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + if (nullableGuidClass.UuidOption.IsSet) + if (nullableGuidClass.UuidOption.Value != null) + writer.WriteString("uuid", nullableGuidClass.UuidOption.Value.Value); + else + writer.WriteNull("uuid"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 00000000000..9a93cb734e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + public partial class NullableShape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 NullableShape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableShape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class NullableShape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); + + if (quadrilateral != null) + return new NullableShape(quadrilateral); + + if (triangle != null) + return new NullableShape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (nullableShape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); + } + + if (nullableShape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, nullableShape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 00000000000..923180c653b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -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 + * 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 +{ + /// + /// NumberOnly + /// + public partial class NumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber + [JsonConstructor] + public NumberOnly(Option justNumber = default) + { + JustNumberOption = justNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustNumberOption { get; private set; } + + /// + /// Gets or Sets JustNumber + /// + [JsonPropertyName("JustNumber")] + public decimal? JustNumber { get { return this.JustNumberOption; } set { this.JustNumberOption = 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 NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).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 NumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NumberOnly 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 justNumber = 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 "JustNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (justNumber.IsSet && justNumber.Value == null) + throw new ArgumentNullException(nameof(justNumber), "Property is not nullable for class NumberOnly."); + + return new NumberOnly(justNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, numberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 00000000000..e25bbf00940 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ObjectWithDeprecatedFields + /// + public partial class ObjectWithDeprecatedFields : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bars + /// deprecatedRef + /// id + /// uuid + [JsonConstructor] + public ObjectWithDeprecatedFields(Option> bars = default, Option deprecatedRef = default, Option id = default, Option uuid = default) + { + BarsOption = bars; + DeprecatedRefOption = deprecatedRef; + IdOption = id; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bars + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> BarsOption { get; private set; } + + /// + /// Gets or Sets Bars + /// + [JsonPropertyName("bars")] + [Obsolete] + public List Bars { get { return this.BarsOption; } set { this.BarsOption = new Option>(value); } } + + /// + /// Used to track the state of DeprecatedRef + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeprecatedRefOption { get; private set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [JsonPropertyName("deprecatedRef")] + [Obsolete] + public DeprecatedObject DeprecatedRef { get { return this.DeprecatedRefOption; } set { this.DeprecatedRefOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + [Obsolete] + public decimal? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public string Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 ObjectWithDeprecatedFields {\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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 ObjectWithDeprecatedFieldsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ObjectWithDeprecatedFields 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> bars = default; + Option deprecatedRef = default; + Option id = default; + Option uuid = 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 "bars": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deprecatedRef": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetDecimal()); + break; + case "uuid": + uuid = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bars.IsSet && bars.Value == null) + throw new ArgumentNullException(nameof(bars), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (deprecatedRef.IsSet && deprecatedRef.Value == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class ObjectWithDeprecatedFields."); + + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet && objectWithDeprecatedFields.DeprecatedRef == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.DeprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.UuidOption.IsSet && objectWithDeprecatedFields.Uuid == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.BarsOption.IsSet) + { + writer.WritePropertyName("bars"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet) + { + writer.WritePropertyName("deprecatedRef"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.IdOption.IsSet) + writer.WriteNumber("id", objectWithDeprecatedFields.IdOption.Value.Value); + + if (objectWithDeprecatedFields.UuidOption.IsSet) + writer.WriteString("uuid", objectWithDeprecatedFields.Uuid); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs new file mode 100644 index 00000000000..c89963f55a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs @@ -0,0 +1,157 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OneOfString + /// + public partial class OneOfString : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal OneOfString(string @string) + { + String = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// 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 OneOfString {\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 OneOfStringJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OneOfString 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; + + string varString = 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) + { + default: + break; + } + } + } + + if (varString != null) + return new OneOfString(varString); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, oneOfString, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 00000000000..5d78af761d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,317 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order + /// + public partial class Order : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// complete (default to false) + /// id + /// petId + /// quantity + /// shipDate + /// status + [JsonConstructor] + public Order(Option complete = default, Option id = default, Option petId = default, Option quantity = default, Option shipDate = default, Option status = default) + { + CompleteOption = complete; + IdOption = id; + PetIdOption = petId; + QuantityOption = quantity; + ShipDateOption = shipDate; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Gets or Sets Status + /// + [JsonPropertyName("status")] + public OrderStatus? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Used to track the state of Complete + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CompleteOption { get; private set; } + + /// + /// Gets or Sets Complete + /// + [JsonPropertyName("complete")] + public bool? Complete { get { return this.CompleteOption; } set { this.CompleteOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of PetId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PetIdOption { get; private set; } + + /// + /// Gets or Sets PetId + /// + [JsonPropertyName("petId")] + public long? PetId { get { return this.PetIdOption; } set { this.PetIdOption = new Option(value); } } + + /// + /// Used to track the state of Quantity + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option QuantityOption { get; private set; } + + /// + /// Gets or Sets Quantity + /// + [JsonPropertyName("quantity")] + public int? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } + + /// + /// Used to track the state of ShipDate + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipDateOption { get; private set; } + + /// + /// Gets or Sets ShipDate + /// + /// 2020-02-02T20:20:20.000222Z + [JsonPropertyName("shipDate")] + public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = 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 Order {\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).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 OrderJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ShipDate + /// + public static string ShipDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Order 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 complete = default; + Option id = default; + Option petId = default; + Option quantity = default; + Option shipDate = default; + Option status = 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 "complete": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = new Option(utf8JsonReader.GetBoolean()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "petId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = new Option(utf8JsonReader.GetInt64()); + break; + case "quantity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = new Option(utf8JsonReader.GetInt32()); + break; + case "shipDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(OrderStatusValueConverter.FromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } + } + + if (complete.IsSet && complete.Value == null) + throw new ArgumentNullException(nameof(complete), "Property is not nullable for class Order."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Order."); + + if (petId.IsSet && petId.Value == null) + throw new ArgumentNullException(nameof(petId), "Property is not nullable for class Order."); + + if (quantity.IsSet && quantity.Value == null) + throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class Order."); + + if (shipDate.IsSet && shipDate.Value == null) + throw new ArgumentNullException(nameof(shipDate), "Property is not nullable for class Order."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Order."); + + return new Order(complete, id, petId, quantity, shipDate, status); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, order, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + if (order.CompleteOption.IsSet) + writer.WriteBoolean("complete", order.CompleteOption.Value.Value); + + if (order.IdOption.IsSet) + writer.WriteNumber("id", order.IdOption.Value.Value); + + if (order.PetIdOption.IsSet) + writer.WriteNumber("petId", order.PetIdOption.Value.Value); + + if (order.QuantityOption.IsSet) + writer.WriteNumber("quantity", order.QuantityOption.Value.Value); + + if (order.ShipDateOption.IsSet) + writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat)); + + if (order.StatusOption.IsSet) + { + var statusRawValue = OrderStatusValueConverter.ToJsonValue(order.Status.Value); + writer.WriteString("status", statusRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs new file mode 100644 index 00000000000..6566ca4aa56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order Status + /// + /// Order Status + public enum OrderStatus + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OrderStatusValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OrderStatus FromString(string value) + { + if (value.Equals("placed")) + return OrderStatus.Placed; + + if (value.Equals("approved")) + return OrderStatus.Approved; + + if (value.Equals("delivered")) + return OrderStatus.Delivered; + + throw new NotImplementedException($"Could not convert value to type OrderStatus: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OrderStatus? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OrderStatus.Placed; + + if (value.Equals("approved")) + return OrderStatus.Approved; + + if (value.Equals("delivered")) + return OrderStatus.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OrderStatus value) + { + if (value == OrderStatus.Placed) + return "placed"; + + if (value == OrderStatus.Approved) + return "approved"; + + if (value == OrderStatus.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OrderStatusJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OrderStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OrderStatus? result = rawValue == null + ? null + : OrderStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OrderStatus to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OrderStatus orderStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(orderStatus.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OrderStatusNullableJsonConverter : JsonConverter + { + /// + /// Returns a OrderStatus from the Json object + /// + /// + /// + /// + /// + public override OrderStatus? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OrderStatus? result = rawValue == null + ? null + : OrderStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OrderStatus? orderStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(orderStatus?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 00000000000..dbf262b28c3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,228 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OuterComposite + /// + public partial class OuterComposite : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myBoolean + /// myNumber + /// myString + [JsonConstructor] + public OuterComposite(Option myBoolean = default, Option myNumber = default, Option myString = default) + { + MyBooleanOption = myBoolean; + MyNumberOption = myNumber; + MyStringOption = myString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MyBoolean + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyBooleanOption { get; private set; } + + /// + /// Gets or Sets MyBoolean + /// + [JsonPropertyName("my_boolean")] + public bool? MyBoolean { get { return this.MyBooleanOption; } set { this.MyBooleanOption = new Option(value); } } + + /// + /// Used to track the state of MyNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyNumberOption { get; private set; } + + /// + /// Gets or Sets MyNumber + /// + [JsonPropertyName("my_number")] + public decimal? MyNumber { get { return this.MyNumberOption; } set { this.MyNumberOption = new Option(value); } } + + /// + /// Used to track the state of MyString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyStringOption { get; private set; } + + /// + /// Gets or Sets MyString + /// + [JsonPropertyName("my_string")] + public string MyString { get { return this.MyStringOption; } set { this.MyStringOption = 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 OuterComposite {\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).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 OuterCompositeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OuterComposite 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 myBoolean = default; + Option myNumber = default; + Option myString = 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 "my_boolean": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = new Option(utf8JsonReader.GetBoolean()); + break; + case "my_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = new Option(utf8JsonReader.GetDecimal()); + break; + case "my_string": + myString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (myBoolean.IsSet && myBoolean.Value == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is not nullable for class OuterComposite."); + + if (myNumber.IsSet && myNumber.Value == null) + throw new ArgumentNullException(nameof(myNumber), "Property is not nullable for class OuterComposite."); + + if (myString.IsSet && myString.Value == null) + throw new ArgumentNullException(nameof(myString), "Property is not nullable for class OuterComposite."); + + return new OuterComposite(myBoolean, myNumber, myString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, outerComposite, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (outerComposite.MyBooleanOption.IsSet) + writer.WriteBoolean("my_boolean", outerComposite.MyBooleanOption.Value.Value); + + if (outerComposite.MyNumberOption.IsSet) + writer.WriteNumber("my_number", outerComposite.MyNumberOption.Value.Value); + + if (outerComposite.MyStringOption.IsSet) + writer.WriteString("my_string", outerComposite.MyString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 00000000000..47bb6793c6a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnum + /// + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum FromString(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnum value) + { + if (value == OuterEnum.Placed) + return "placed"; + + if (value == OuterEnum.Approved) + return "approved"; + + if (value == OuterEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnum from the Json object + /// + /// + /// + /// + /// + public override OuterEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum? outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 00000000000..136fb4c54c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnumDefaultValue + /// + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue FromString(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnumDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumDefaultValue value) + { + if (value == OuterEnumDefaultValue.Placed) + return "placed"; + + if (value == OuterEnumDefaultValue.Approved) + return "approved"; + + if (value == OuterEnumDefaultValue.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue? outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 00000000000..2ed4f18a657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumInteger from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger? outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 00000000000..c6a470cc64d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumIntegerDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumIntegerDefaultValue value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumIntegerDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumIntegerDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs new file mode 100644 index 00000000000..a2e789f2ede --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs @@ -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 + * 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 +{ + /// + /// Defines Outer_Enum_Test + /// + public enum OuterEnumTest + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumTestValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest FromString(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumTest: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumTest value) + { + if (value == OuterEnumTest.UPPER) + return "UPPER"; + + if (value == OuterEnumTest.Lower) + return "lower"; + + if (value == OuterEnumTest.Empty) + return ""; + + if (value == OuterEnumTest.ValuewithTab) + return "Value\twith tab"; + + if (value == OuterEnumTest.ValueWithQuote) + return "Value with \" quote"; + + if (value == OuterEnumTest.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == OuterEnumTest.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == OuterEnumTest.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumTestJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumTest to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumTestNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumTest from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest? outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 00000000000..5d1cab769fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs @@ -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 + * 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 +{ + /// + /// ParentPet + /// + public partial class ParentPet : GrandparentAnimal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + 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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ParentPetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ParentPet 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ParentPet.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); + + return new ParentPet(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + writer.WriteStartObject(); + + WriteProperties(writer, parentPet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", parentPet.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 00000000000..bc209ae7cbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,317 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pet + /// + public partial class Pet : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + /// photoUrls + /// category + /// id + /// status + /// tags + [JsonConstructor] + public Pet(string name, List photoUrls, Option category = default, Option id = default, Option status = default, Option> tags = default) + { + Name = name; + PhotoUrls = photoUrls; + CategoryOption = category; + IdOption = id; + StatusOption = status; + TagsOption = tags; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Gets or Sets Status + /// + [JsonPropertyName("status")] + public PetStatus? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + /// doggie + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [JsonPropertyName("photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Used to track the state of Category + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryOption { get; private set; } + + /// + /// Gets or Sets Category + /// + [JsonPropertyName("category")] + public Category Category { get { return this.CategoryOption; } set { this.CategoryOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TagsOption { get; private set; } + + /// + /// Gets or Sets Tags + /// + [JsonPropertyName("tags")] + public List Tags { get { return this.TagsOption; } set { this.TagsOption = 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 Pet {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Tags: ").Append(Tags).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 PetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pet 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 name = default; + Option> photoUrls = default; + Option category = default; + Option id = default; + Option status = default; + Option> tags = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "photoUrls": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "category": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); + break; + case "tags": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(name)); + + if (!photoUrls.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(photoUrls)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Pet."); + + if (photoUrls.IsSet && photoUrls.Value == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is not nullable for class Pet."); + + if (category.IsSet && category.Value == null) + throw new ArgumentNullException(nameof(category), "Property is not nullable for class Pet."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Pet."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Pet."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class Pet."); + + return new Pet(name.Value, photoUrls.Value, category, id, status, tags); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, pet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (pet.PhotoUrls == null) + throw new ArgumentNullException(nameof(pet.PhotoUrls), "Property is required for class Pet."); + + if (pet.CategoryOption.IsSet && pet.Category == null) + throw new ArgumentNullException(nameof(pet.Category), "Property is required for class Pet."); + + if (pet.TagsOption.IsSet && pet.Tags == null) + throw new ArgumentNullException(nameof(pet.Tags), "Property is required for class Pet."); + + writer.WriteString("name", pet.Name); + + writer.WritePropertyName("photoUrls"); + JsonSerializer.Serialize(writer, pet.PhotoUrls, jsonSerializerOptions); + if (pet.CategoryOption.IsSet) + { + writer.WritePropertyName("category"); + JsonSerializer.Serialize(writer, pet.Category, jsonSerializerOptions); + } + if (pet.IdOption.IsSet) + writer.WriteNumber("id", pet.IdOption.Value.Value); + + if (pet.StatusOption.IsSet) + { + var statusRawValue = PetStatusValueConverter.ToJsonValue(pet.Status.Value); + writer.WriteString("status", statusRawValue); + } + if (pet.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, pet.Tags, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs new file mode 100644 index 00000000000..9e19b612bf9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// pet status in the store + /// + /// pet status in the store + public enum PetStatus + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class PetStatusValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static PetStatus FromString(string value) + { + if (value.Equals("available")) + return PetStatus.Available; + + if (value.Equals("pending")) + return PetStatus.Pending; + + if (value.Equals("sold")) + return PetStatus.Sold; + + throw new NotImplementedException($"Could not convert value to type PetStatus: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static PetStatus? FromStringOrDefault(string value) + { + if (value.Equals("available")) + return PetStatus.Available; + + if (value.Equals("pending")) + return PetStatus.Pending; + + if (value.Equals("sold")) + return PetStatus.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(PetStatus value) + { + if (value == PetStatus.Available) + return "available"; + + if (value == PetStatus.Pending) + return "pending"; + + if (value == PetStatus.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class PetStatusJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override PetStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + PetStatus? result = rawValue == null + ? null + : PetStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the PetStatus to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PetStatus petStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(petStatus.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class PetStatusNullableJsonConverter : JsonConverter + { + /// + /// Returns a PetStatus from the Json object + /// + /// + /// + /// + /// + public override PetStatus? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + PetStatus? result = rawValue == null + ? null + : PetStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PetStatus? petStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(petStatus?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 00000000000..b6f300c9440 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pig + /// + public partial class Pig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(BasquePig basquePig) + { + BasquePig = basquePig; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(DanishPig danishPig) + { + DanishPig = danishPig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets BasquePig + /// + public BasquePig BasquePig { get; set; } + + /// + /// Gets or Sets DanishPig + /// + public DanishPig DanishPig { get; set; } + + /// + /// 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 Pig {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pig 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 className = default; + + BasquePig basquePig = null; + DanishPig danishPig = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("BasquePig")) + { + Utf8JsonReader utf8JsonReaderBasquePig = utf8JsonReader; + basquePig = JsonSerializer.Deserialize(ref utf8JsonReaderBasquePig, jsonSerializerOptions); + } + if (discriminator.Equals("DanishPig")) + { + Utf8JsonReader utf8JsonReaderDanishPig = utf8JsonReader; + danishPig = JsonSerializer.Deserialize(ref utf8JsonReaderDanishPig, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Pig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); + + if (basquePig != null) + return new Pig(basquePig); + + if (danishPig != null) + return new Pig(danishPig); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (pig.BasquePig != null) + { + BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); + } + + if (pig.DanishPig != null) + { + DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); + } + + WriteProperties(writer, pig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs new file mode 100644 index 00000000000..ddea47edf40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// PolymorphicProperty + /// + public partial class PolymorphicProperty : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(Object @object) + { + Object = @object; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(List list) + { + List = list; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Object + /// + public Object Object { get; set; } + + /// + /// Gets or Sets List + /// + public List List { get; set; } + + /// + /// 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 PolymorphicProperty {\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 PolymorphicPropertyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PolymorphicProperty 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; + + bool? varBool = default; + string varString = default; + Object varObject = default; + List list = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); + + Utf8JsonReader utf8JsonReaderList = utf8JsonReader; + ClientUtils.TryDeserialize>(ref utf8JsonReaderList, jsonSerializerOptions, out list); + } + } + + 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) + { + default: + break; + } + } + } + + if (varBool != null) + return new PolymorphicProperty(varBool.Value); + + if (varString != null) + return new PolymorphicProperty(varString); + + if (varObject != null) + return new PolymorphicProperty(varObject); + + if (list != null) + return new PolymorphicProperty(list); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 00000000000..e8a2e243997 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Quadrilateral + /// + public partial class Quadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) + { + SimpleQuadrilateral = simpleQuadrilateral; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) + { + ComplexQuadrilateral = complexQuadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SimpleQuadrilateral + /// + public SimpleQuadrilateral SimpleQuadrilateral { get; set; } + + /// + /// Gets or Sets ComplexQuadrilateral + /// + public ComplexQuadrilateral ComplexQuadrilateral { get; set; } + + /// + /// 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 Quadrilateral {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Quadrilateral 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 quadrilateralType = default; + + ComplexQuadrilateral complexQuadrilateral = null; + SimpleQuadrilateral simpleQuadrilateral = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("quadrilateralType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("ComplexQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderComplexQuadrilateral = utf8JsonReader; + complexQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderComplexQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("SimpleQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderSimpleQuadrilateral = utf8JsonReader; + simpleQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderSimpleQuadrilateral, jsonSerializerOptions); + } + } + } + } + + 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class Quadrilateral.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); + + if (complexQuadrilateral != null) + return new Quadrilateral(complexQuadrilateral); + + if (simpleQuadrilateral != null) + return new Quadrilateral(simpleQuadrilateral); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (quadrilateral.SimpleQuadrilateral != null) + { + SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + } + + if (quadrilateral.ComplexQuadrilateral != null) + { + ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, quadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 00000000000..519ed66393c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// QuadrilateralInterface + /// + public partial class QuadrilateralInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + [JsonConstructor] + public QuadrilateralInterface(string quadrilateralType) + { + QuadrilateralType = quadrilateralType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// 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 QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).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 QuadrilateralInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override QuadrilateralInterface 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 quadrilateralType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class QuadrilateralInterface.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class QuadrilateralInterface."); + + return new QuadrilateralInterface(quadrilateralType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("quadrilateralType", quadrilateralInterface.QuadrilateralType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..afb58fb0e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -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 + * 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 +{ + /// + /// ReadOnlyFirst + /// + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// baz + [JsonConstructor] + public ReadOnlyFirst(Option bar = default, Option baz = default) + { + BarOption = bar; + BazOption = baz; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Baz + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BazOption { get; private set; } + + /// + /// Gets or Sets Baz + /// + [JsonPropertyName("baz")] + public string Baz { get { return this.BazOption; } set { this.BazOption = 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 ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 ReadOnlyFirstJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ReadOnlyFirst 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 bar = default; + Option baz = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "baz": + baz = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class ReadOnlyFirst."); + + if (baz.IsSet && baz.Value == null) + throw new ArgumentNullException(nameof(baz), "Property is not nullable for class ReadOnlyFirst."); + + return new ReadOnlyFirst(bar, baz); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (readOnlyFirst.BazOption.IsSet && readOnlyFirst.Baz == null) + throw new ArgumentNullException(nameof(readOnlyFirst.Baz), "Property is required for class ReadOnlyFirst."); + + if (readOnlyFirst.BarOption.IsSet) + writer.WriteString("bar", readOnlyFirst.Bar); + + if (readOnlyFirst.BazOption.IsSet) + writer.WriteString("baz", readOnlyFirst.Baz); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs new file mode 100644 index 00000000000..a60c25e0468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -0,0 +1,1335 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RequiredClass + /// + public partial class RequiredClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// requiredNotNullableDateProp + /// requiredNotnullableArrayOfString + /// requiredNotnullableBooleanProp + /// requiredNotnullableDatetimeProp + /// requiredNotnullableEnumInteger + /// requiredNotnullableEnumIntegerOnly + /// requiredNotnullableEnumString + /// requiredNotnullableOuterEnumDefaultValue + /// requiredNotnullableStringProp + /// requiredNotnullableUuid + /// requiredNotnullableintegerProp + /// notRequiredNotnullableDateProp + /// notRequiredNotnullableintegerProp + /// notRequiredNullableDateProp + /// notRequiredNullableIntegerProp + /// notrequiredNotnullableArrayOfString + /// notrequiredNotnullableBooleanProp + /// notrequiredNotnullableDatetimeProp + /// notrequiredNotnullableEnumInteger + /// notrequiredNotnullableEnumIntegerOnly + /// notrequiredNotnullableEnumString + /// notrequiredNotnullableOuterEnumDefaultValue + /// notrequiredNotnullableStringProp + /// notrequiredNotnullableUuid + /// notrequiredNullableArrayOfString + /// notrequiredNullableBooleanProp + /// notrequiredNullableDatetimeProp + /// notrequiredNullableEnumInteger + /// notrequiredNullableEnumIntegerOnly + /// notrequiredNullableEnumString + /// 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, 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, DateTime? 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; + RequiredNotnullableBooleanProp = requiredNotnullableBooleanProp; + RequiredNotnullableDatetimeProp = requiredNotnullableDatetimeProp; + RequiredNotnullableEnumInteger = requiredNotnullableEnumInteger; + RequiredNotnullableEnumIntegerOnly = requiredNotnullableEnumIntegerOnly; + RequiredNotnullableEnumString = requiredNotnullableEnumString; + RequiredNotnullableOuterEnumDefaultValue = requiredNotnullableOuterEnumDefaultValue; + RequiredNotnullableStringProp = requiredNotnullableStringProp; + RequiredNotnullableUuid = requiredNotnullableUuid; + RequiredNotnullableintegerProp = requiredNotnullableintegerProp; + NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; + NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; + NotRequiredNullableDatePropOption = notRequiredNullableDateProp; + NotRequiredNullableIntegerPropOption = notRequiredNullableIntegerProp; + NotrequiredNotnullableArrayOfStringOption = notrequiredNotnullableArrayOfString; + NotrequiredNotnullableBooleanPropOption = notrequiredNotnullableBooleanProp; + NotrequiredNotnullableDatetimePropOption = notrequiredNotnullableDatetimeProp; + NotrequiredNotnullableEnumIntegerOption = notrequiredNotnullableEnumInteger; + NotrequiredNotnullableEnumIntegerOnlyOption = notrequiredNotnullableEnumIntegerOnly; + NotrequiredNotnullableEnumStringOption = notrequiredNotnullableEnumString; + NotrequiredNotnullableOuterEnumDefaultValueOption = notrequiredNotnullableOuterEnumDefaultValue; + NotrequiredNotnullableStringPropOption = notrequiredNotnullableStringProp; + NotrequiredNotnullableUuidOption = notrequiredNotnullableUuid; + NotrequiredNullableArrayOfStringOption = notrequiredNullableArrayOfString; + NotrequiredNullableBooleanPropOption = notrequiredNullableBooleanProp; + NotrequiredNullableDatetimePropOption = notrequiredNullableDatetimeProp; + NotrequiredNullableEnumIntegerOption = notrequiredNullableEnumInteger; + NotrequiredNullableEnumIntegerOnlyOption = notrequiredNullableEnumIntegerOnly; + NotrequiredNullableEnumStringOption = notrequiredNullableEnumString; + 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(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets RequiredNotnullableEnumInteger + /// + [JsonPropertyName("required_notnullable_enum_integer")] + public RequiredClassRequiredNotnullableEnumInteger RequiredNotnullableEnumInteger { get; set; } + + /// + /// Gets or Sets RequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("required_notnullable_enum_integer_only")] + public RequiredClassRequiredNotnullableEnumIntegerOnly RequiredNotnullableEnumIntegerOnly { get; set; } + + /// + /// Gets or Sets RequiredNotnullableEnumString + /// + [JsonPropertyName("required_notnullable_enum_string")] + public RequiredClassRequiredNotnullableEnumString RequiredNotnullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } + + /// + /// Used to track the state of NotrequiredNotnullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumInteger + /// + [JsonPropertyName("notrequired_notnullable_enum_integer")] + public RequiredClassRequiredNotnullableEnumInteger? NotrequiredNotnullableEnumInteger { get { return this.NotrequiredNotnullableEnumIntegerOption; } set { this.NotrequiredNotnullableEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_notnullable_enum_integer_only")] + public RequiredClassRequiredNotnullableEnumIntegerOnly? NotrequiredNotnullableEnumIntegerOnly { get { return this.NotrequiredNotnullableEnumIntegerOnlyOption; } set { this.NotrequiredNotnullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumString + /// + [JsonPropertyName("notrequired_notnullable_enum_string")] + public RequiredClassRequiredNotnullableEnumString? NotrequiredNotnullableEnumString { get { return this.NotrequiredNotnullableEnumStringOption; } set { this.NotrequiredNotnullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNotnullableOuterEnumDefaultValue { get { return this.NotrequiredNotnullableOuterEnumDefaultValueOption; } set { this.NotrequiredNotnullableOuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumInteger + /// + [JsonPropertyName("notrequired_nullable_enum_integer")] + public RequiredClassRequiredNullableEnumInteger? NotrequiredNullableEnumInteger { get { return this.NotrequiredNullableEnumIntegerOption; } set { this.NotrequiredNullableEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_nullable_enum_integer_only")] + public RequiredClassRequiredNullableEnumIntegerOnly? NotrequiredNullableEnumIntegerOnly { get { return this.NotrequiredNullableEnumIntegerOnlyOption; } set { this.NotrequiredNullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumString + /// + [JsonPropertyName("notrequired_nullable_enum_string")] + public RequiredClassRequiredNullableEnumString? NotrequiredNullableEnumString { get { return this.NotrequiredNullableEnumStringOption; } set { this.NotrequiredNullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new Option(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 + /// + [JsonPropertyName("required_not_nullable_date_prop")] + public DateTime RequiredNotNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableArrayOfString + /// + [JsonPropertyName("required_notnullable_array_of_string")] + public List RequiredNotnullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableBooleanProp + /// + [JsonPropertyName("required_notnullable_boolean_prop")] + public bool RequiredNotnullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableDatetimeProp + /// + [JsonPropertyName("required_notnullable_datetime_prop")] + public DateTime RequiredNotnullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableStringProp + /// + [JsonPropertyName("required_notnullable_string_prop")] + public string RequiredNotnullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_notnullable_uuid")] + public Guid RequiredNotnullableUuid { get; set; } + + /// + /// Gets or Sets RequiredNotnullableintegerProp + /// + [JsonPropertyName("required_notnullableinteger_prop")] + public int RequiredNotnullableintegerProp { get; set; } + + /// + /// Used to track the state of NotRequiredNotnullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableDateProp + /// + [JsonPropertyName("not_required_notnullable_date_prop")] + public DateTime? NotRequiredNotnullableDateProp { get { return this.NotRequiredNotnullableDatePropOption; } set { this.NotRequiredNotnullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNotnullableintegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableintegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableintegerProp + /// + [JsonPropertyName("not_required_notnullableinteger_prop")] + public int? NotRequiredNotnullableintegerProp { get { return this.NotRequiredNotnullableintegerPropOption; } set { this.NotRequiredNotnullableintegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableDateProp + /// + [JsonPropertyName("not_required_nullable_date_prop")] + public DateTime? NotRequiredNullableDateProp { get { return this.NotRequiredNullableDatePropOption; } set { this.NotRequiredNullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableIntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableIntegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableIntegerProp + /// + [JsonPropertyName("not_required_nullable_integer_prop")] + public int? NotRequiredNullableIntegerProp { get { return this.NotRequiredNullableIntegerPropOption; } set { this.NotRequiredNullableIntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNotnullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableArrayOfString + /// + [JsonPropertyName("notrequired_notnullable_array_of_string")] + public List NotrequiredNotnullableArrayOfString { get { return this.NotrequiredNotnullableArrayOfStringOption; } set { this.NotrequiredNotnullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableBooleanProp + /// + [JsonPropertyName("notrequired_notnullable_boolean_prop")] + public bool? NotrequiredNotnullableBooleanProp { get { return this.NotrequiredNotnullableBooleanPropOption; } set { this.NotrequiredNotnullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableDatetimeProp + /// + [JsonPropertyName("notrequired_notnullable_datetime_prop")] + public DateTime? NotrequiredNotnullableDatetimeProp { get { return this.NotrequiredNotnullableDatetimePropOption; } set { this.NotrequiredNotnullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableStringProp + /// + [JsonPropertyName("notrequired_notnullable_string_prop")] + public string NotrequiredNotnullableStringProp { get { return this.NotrequiredNotnullableStringPropOption; } set { this.NotrequiredNotnullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("notrequired_notnullable_uuid")] + public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableArrayOfString + /// + [JsonPropertyName("notrequired_nullable_array_of_string")] + public List NotrequiredNullableArrayOfString { get { return this.NotrequiredNullableArrayOfStringOption; } set { this.NotrequiredNullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableBooleanProp + /// + [JsonPropertyName("notrequired_nullable_boolean_prop")] + public bool? NotrequiredNullableBooleanProp { get { return this.NotrequiredNullableBooleanPropOption; } set { this.NotrequiredNullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableDatetimeProp + /// + [JsonPropertyName("notrequired_nullable_datetime_prop")] + public DateTime? NotrequiredNullableDatetimeProp { get { return this.NotrequiredNullableDatetimePropOption; } set { this.NotrequiredNullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableStringProp + /// + [JsonPropertyName("notrequired_nullable_string_prop")] + public string NotrequiredNullableStringProp { get { return this.NotrequiredNullableStringPropOption; } set { this.NotrequiredNullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [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 + /// + [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 RequiredClass {\n"); + sb.Append(" RequiredNotNullableDateProp: ").Append(RequiredNotNullableDateProp).Append("\n"); + sb.Append(" RequiredNotnullableArrayOfString: ").Append(RequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" RequiredNotnullableBooleanProp: ").Append(RequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" RequiredNotnullableDatetimeProp: ").Append(RequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNotnullableEnumInteger: ").Append(RequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" RequiredNotnullableEnumIntegerOnly: ").Append(RequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNotnullableEnumString: ").Append(RequiredNotnullableEnumString).Append("\n"); + sb.Append(" RequiredNotnullableOuterEnumDefaultValue: ").Append(RequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); + sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); + sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); + sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); + sb.Append(" NotRequiredNullableIntegerProp: ").Append(NotRequiredNullableIntegerProp).Append("\n"); + sb.Append(" NotrequiredNotnullableArrayOfString: ").Append(NotrequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNotnullableBooleanProp: ").Append(NotrequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNotnullableDatetimeProp: ").Append(NotrequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumInteger: ").Append(NotrequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumIntegerOnly: ").Append(NotrequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumString: ").Append(NotrequiredNotnullableEnumString).Append("\n"); + sb.Append(" NotrequiredNotnullableOuterEnumDefaultValue: ").Append(NotrequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" NotrequiredNotnullableStringProp: ").Append(NotrequiredNotnullableStringProp).Append("\n"); + sb.Append(" NotrequiredNotnullableUuid: ").Append(NotrequiredNotnullableUuid).Append("\n"); + sb.Append(" NotrequiredNullableArrayOfString: ").Append(NotrequiredNullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNullableBooleanProp: ").Append(NotrequiredNullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNullableDatetimeProp: ").Append(NotrequiredNullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNullableEnumInteger: ").Append(NotrequiredNullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNullableEnumIntegerOnly: ").Append(NotrequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNullableEnumString: ").Append(NotrequiredNullableEnumString).Append("\n"); + 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(); + } + + /// + /// 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 RequiredClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize RequiredNotNullableDateProp + /// + public static string RequiredNotNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNotnullableDatetimeProp + /// + public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotRequiredNotnullableDateProp + /// + public static string NotRequiredNotnullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotRequiredNullableDateProp + /// + public static string NotRequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotrequiredNotnullableDatetimeProp + /// + public static string NotrequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotrequiredNullableDatetimeProp + /// + 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 + /// + /// + /// + /// + /// + /// + public override RequiredClass 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 requiredNotNullableDateProp = default; + Option> requiredNotnullableArrayOfString = default; + Option requiredNotnullableBooleanProp = default; + Option requiredNotnullableDatetimeProp = default; + Option requiredNotnullableEnumInteger = default; + Option requiredNotnullableEnumIntegerOnly = default; + Option requiredNotnullableEnumString = default; + Option requiredNotnullableOuterEnumDefaultValue = default; + Option requiredNotnullableStringProp = default; + Option requiredNotnullableUuid = default; + Option requiredNotnullableintegerProp = 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; + 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()) + { + 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 "required_not_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_enum_integer": + string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumIntegerRawValue != null) + requiredNotnullableEnumInteger = new Option(RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(requiredNotnullableEnumIntegerRawValue)); + break; + case "required_notnullable_enum_integer_only": + string requiredNotnullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumIntegerOnlyRawValue != null) + requiredNotnullableEnumIntegerOnly = new Option(RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(requiredNotnullableEnumIntegerOnlyRawValue)); + break; + case "required_notnullable_enum_string": + string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumStringRawValue != null) + requiredNotnullableEnumString = new Option(RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(requiredNotnullableEnumStringRawValue)); + break; + case "required_notnullable_outerEnumDefaultValue": + string requiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableOuterEnumDefaultValueRawValue != null) + requiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "required_notnullable_string_prop": + requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_notnullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_enum_integer": + string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumIntegerRawValue != null) + notrequiredNotnullableEnumInteger = new Option(RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(notrequiredNotnullableEnumIntegerRawValue)); + break; + case "notrequired_notnullable_enum_integer_only": + string notrequiredNotnullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumIntegerOnlyRawValue != null) + notrequiredNotnullableEnumIntegerOnly = new Option(RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(notrequiredNotnullableEnumIntegerOnlyRawValue)); + break; + case "notrequired_notnullable_enum_string": + string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumStringRawValue != null) + notrequiredNotnullableEnumString = new Option(RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(notrequiredNotnullableEnumStringRawValue)); + break; + case "notrequired_notnullable_outerEnumDefaultValue": + string notrequiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableOuterEnumDefaultValueRawValue != null) + notrequiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_notnullable_string_prop": + notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "notrequired_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_enum_integer": + string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumIntegerRawValue != null) + notrequiredNullableEnumInteger = new Option(RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(notrequiredNullableEnumIntegerRawValue)); + break; + case "notrequired_nullable_enum_integer_only": + string notrequiredNullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumIntegerOnlyRawValue != null) + notrequiredNullableEnumIntegerOnly = new Option(RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(notrequiredNullableEnumIntegerOnlyRawValue)); + break; + case "notrequired_nullable_enum_string": + string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumStringRawValue != null) + notrequiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(notrequiredNullableEnumStringRawValue)); + break; + case "notrequired_nullable_outerEnumDefaultValue": + string notrequiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableOuterEnumDefaultValueRawValue != null) + notrequiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_nullable_string_prop": + notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_nullable_uuid": + 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; + } + } + } + + if (!requiredNotNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotNullableDateProp)); + + if (!requiredNotnullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableArrayOfString)); + + if (!requiredNotnullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableBooleanProp)); + + if (!requiredNotnullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableDatetimeProp)); + + if (!requiredNotnullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumInteger)); + + if (!requiredNotnullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumIntegerOnly)); + + if (!requiredNotnullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumString)); + + if (!requiredNotnullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableOuterEnumDefaultValue)); + + if (!requiredNotnullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableStringProp)); + + if (!requiredNotnullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableUuid)); + + if (!requiredNotnullableintegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableintegerProp)); + + if (!requiredNullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableArrayOfString)); + + if (!requiredNullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableBooleanProp)); + + if (!requiredNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDateProp)); + + if (!requiredNullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDatetimeProp)); + + if (!requiredNullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumInteger)); + + if (!requiredNullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumIntegerOnly)); + + if (!requiredNullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumString)); + + if (!requiredNullableIntegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableIntegerProp)); + + if (!requiredNullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableOuterEnumDefaultValue)); + + if (!requiredNullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableStringProp)); + + if (!requiredNullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableUuid)); + + if (requiredNotNullableDateProp.IsSet && requiredNotNullableDateProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotNullableDateProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableArrayOfString.IsSet && requiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableBooleanProp.IsSet && requiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableDatetimeProp.IsSet && requiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumInteger.IsSet && requiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumIntegerOnly.IsSet && requiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumString.IsSet && requiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableOuterEnumDefaultValue.IsSet && requiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableStringProp.IsSet && requiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableUuid.IsSet && requiredNotnullableUuid.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableUuid), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableintegerProp.IsSet && requiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableDateProp.IsSet && notRequiredNotnullableDateProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableDateProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableintegerProp.IsSet && notRequiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableArrayOfString.IsSet && notrequiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableBooleanProp.IsSet && notrequiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableDatetimeProp.IsSet && notrequiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumInteger.IsSet && notrequiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumIntegerOnly.IsSet && notrequiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumString.IsSet && notrequiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableOuterEnumDefaultValue.IsSet && notrequiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableStringProp.IsSet && notrequiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + 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, 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); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, requiredClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (requiredClass.RequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet && requiredClass.NotrequiredNotnullableArrayOfString == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet && requiredClass.NotrequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + writer.WriteString("required_not_nullable_date_prop", requiredClass.RequiredNotNullableDateProp.ToString(RequiredNotNullableDatePropFormat)); + + writer.WritePropertyName("required_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNotnullableArrayOfString, jsonSerializerOptions); + writer.WriteBoolean("required_notnullable_boolean_prop", requiredClass.RequiredNotnullableBooleanProp); + + writer.WriteString("required_notnullable_datetime_prop", requiredClass.RequiredNotnullableDatetimeProp.ToString(RequiredNotnullableDatetimePropFormat)); + + var requiredNotnullableEnumIntegerRawValue = RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumInteger); + writer.WriteNumber("required_notnullable_enum_integer", requiredNotnullableEnumIntegerRawValue); + + var requiredNotnullableEnumIntegerOnlyRawValue = RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly); + writer.WriteNumber("required_notnullable_enum_integer_only", requiredNotnullableEnumIntegerOnlyRawValue); + + var requiredNotnullableEnumStringRawValue = RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumString); + writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue); + + var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue); + writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue); + + writer.WriteString("required_notnullable_string_prop", requiredClass.RequiredNotnullableStringProp); + + writer.WriteString("required_notnullable_uuid", requiredClass.RequiredNotnullableUuid); + + writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); + + if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) + writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); + + if (requiredClass.NotRequiredNotnullableintegerPropOption.IsSet) + writer.WriteNumber("not_required_notnullableinteger_prop", requiredClass.NotRequiredNotnullableintegerPropOption.Value.Value); + + if (requiredClass.NotRequiredNullableDatePropOption.IsSet) + if (requiredClass.NotRequiredNullableDatePropOption.Value != null) + writer.WriteString("not_required_nullable_date_prop", requiredClass.NotRequiredNullableDatePropOption.Value.Value.ToString(NotRequiredNullableDatePropFormat)); + else + writer.WriteNull("not_required_nullable_date_prop"); + + if (requiredClass.NotRequiredNullableIntegerPropOption.IsSet) + if (requiredClass.NotRequiredNullableIntegerPropOption.Value != null) + writer.WriteNumber("not_required_nullable_integer_prop", requiredClass.NotRequiredNullableIntegerPropOption.Value.Value); + else + writer.WriteNull("not_required_nullable_integer_prop"); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet) + { + writer.WritePropertyName("notrequired_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNotnullableArrayOfString, jsonSerializerOptions); + } + if (requiredClass.NotrequiredNotnullableBooleanPropOption.IsSet) + writer.WriteBoolean("notrequired_notnullable_boolean_prop", requiredClass.NotrequiredNotnullableBooleanPropOption.Value.Value); + + if (requiredClass.NotrequiredNotnullableDatetimePropOption.IsSet) + writer.WriteString("notrequired_notnullable_datetime_prop", requiredClass.NotrequiredNotnullableDatetimePropOption.Value.Value.ToString(NotrequiredNotnullableDatetimePropFormat)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOption.IsSet) + { + var notrequiredNotnullableEnumIntegerRawValue = RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumInteger.Value); + writer.WriteNumber("notrequired_notnullable_enum_integer", notrequiredNotnullableEnumIntegerRawValue); + } + if (requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.IsSet) + { + var notrequiredNotnullableEnumIntegerOnlyRawValue = RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnly.Value); + writer.WriteNumber("notrequired_notnullable_enum_integer_only", notrequiredNotnullableEnumIntegerOnlyRawValue); + } + if (requiredClass.NotrequiredNotnullableEnumStringOption.IsSet) + { + var notrequiredNotnullableEnumStringRawValue = RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumString.Value); + writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue); + } + if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet) + { + var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value); + writer.WriteString("notrequired_notnullable_outerEnumDefaultValue", notrequiredNotnullableOuterEnumDefaultValueRawValue); + } + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet) + writer.WriteString("notrequired_notnullable_string_prop", requiredClass.NotrequiredNotnullableStringProp); + + if (requiredClass.NotrequiredNotnullableUuidOption.IsSet) + writer.WriteString("notrequired_notnullable_uuid", requiredClass.NotrequiredNotnullableUuidOption.Value.Value); + + if (requiredClass.NotrequiredNullableArrayOfStringOption.IsSet) + if (requiredClass.NotrequiredNullableArrayOfStringOption.Value != null) + { + writer.WritePropertyName("notrequired_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("notrequired_nullable_array_of_string"); + if (requiredClass.NotrequiredNullableBooleanPropOption.IsSet) + if (requiredClass.NotrequiredNullableBooleanPropOption.Value != null) + writer.WriteBoolean("notrequired_nullable_boolean_prop", requiredClass.NotrequiredNullableBooleanPropOption.Value.Value); + else + writer.WriteNull("notrequired_nullable_boolean_prop"); + + if (requiredClass.NotrequiredNullableDatetimePropOption.IsSet) + if (requiredClass.NotrequiredNullableDatetimePropOption.Value != null) + writer.WriteString("notrequired_nullable_datetime_prop", requiredClass.NotrequiredNullableDatetimePropOption.Value.Value.ToString(NotrequiredNullableDatetimePropFormat)); + else + writer.WriteNull("notrequired_nullable_datetime_prop"); + + if (requiredClass.NotrequiredNullableEnumIntegerOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOption.Value != null) + { + var notrequiredNullableEnumIntegerRawValue = RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOption.Value.Value); + writer.WriteNumber("notrequired_nullable_enum_integer", notrequiredNullableEnumIntegerRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_integer"); + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value != null) + { + var notrequiredNullableEnumIntegerOnlyRawValue = RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value.Value); + writer.WriteNumber("notrequired_nullable_enum_integer_only", notrequiredNullableEnumIntegerOnlyRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_integer_only"); + if (requiredClass.NotrequiredNullableEnumStringOption.IsSet) + if (requiredClass.NotrequiredNullableEnumStringOption.Value != null) + { + var notrequiredNullableEnumStringRawValue = RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumStringOption.Value.Value); + writer.WriteString("notrequired_nullable_enum_string", notrequiredNullableEnumStringRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_string"); + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.IsSet) + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value != null) + { + var notrequiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value.Value); + writer.WriteString("notrequired_nullable_outerEnumDefaultValue", notrequiredNullableOuterEnumDefaultValueRawValue); + } + else + writer.WriteNull("notrequired_nullable_outerEnumDefaultValue"); + if (requiredClass.NotrequiredNullableStringPropOption.IsSet) + if (requiredClass.NotrequiredNullableStringPropOption.Value != null) + writer.WriteString("notrequired_nullable_string_prop", requiredClass.NotrequiredNullableStringProp); + else + writer.WriteNull("notrequired_nullable_string_prop"); + + if (requiredClass.NotrequiredNullableUuidOption.IsSet) + if (requiredClass.NotrequiredNullableUuidOption.Value != null) + 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/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs new file mode 100644 index 00000000000..04988ef3ee9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_integer + /// + public enum RequiredClassRequiredNotnullableEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNotnullableEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumInteger requiredClassRequiredNotnullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumInteger from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumInteger? requiredClassRequiredNotnullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs new file mode 100644 index 00000000000..775aba4f6af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_integer_only + /// + public enum RequiredClassRequiredNotnullableEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNotnullableEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumIntegerOnly requiredClassRequiredNotnullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumIntegerOnly? requiredClassRequiredNotnullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs new file mode 100644 index 00000000000..5b4f29294ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_string + /// + public enum RequiredClassRequiredNotnullableEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNotnullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNotnullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNotnullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNotnullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNotnullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNotnullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNotnullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNotnullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(RequiredClassRequiredNotnullableEnumString value) + { + if (value == RequiredClassRequiredNotnullableEnumString.UPPER) + return "UPPER"; + + if (value == RequiredClassRequiredNotnullableEnumString.Lower) + return "lower"; + + if (value == RequiredClassRequiredNotnullableEnumString.Empty) + return ""; + + if (value == RequiredClassRequiredNotnullableEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredClassRequiredNotnullableEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredClassRequiredNotnullableEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredClassRequiredNotnullableEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumString requiredClassRequiredNotnullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumString from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumString? requiredClassRequiredNotnullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs new file mode 100644 index 00000000000..365504a241b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_integer + /// + public enum RequiredClassRequiredNullableEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNullableEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumInteger requiredClassRequiredNullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumInteger from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumInteger? requiredClassRequiredNullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs new file mode 100644 index 00000000000..4c5f2c56ba5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_integer_only + /// + public enum RequiredClassRequiredNullableEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNullableEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumIntegerOnly requiredClassRequiredNullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumIntegerOnly? requiredClassRequiredNullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs new file mode 100644 index 00000000000..36bcb148131 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_string + /// + public enum RequiredClassRequiredNullableEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(RequiredClassRequiredNullableEnumString value) + { + if (value == RequiredClassRequiredNullableEnumString.UPPER) + return "UPPER"; + + if (value == RequiredClassRequiredNullableEnumString.Lower) + return "lower"; + + if (value == RequiredClassRequiredNullableEnumString.Empty) + return ""; + + if (value == RequiredClassRequiredNullableEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredClassRequiredNullableEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredClassRequiredNullableEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredClassRequiredNullableEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumString requiredClassRequiredNullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumString from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumString? requiredClassRequiredNullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 00000000000..25b3b73e9c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,246 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing reserved words + /// + public partial class Return : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lock + /// abstract + /// varReturn + /// unsafe + [JsonConstructor] + public Return(string @lock, string @abstract = default, Option varReturn = default, Option @unsafe = default) + { + Lock = @lock; + Abstract = @abstract; + VarReturnOption = varReturn; + UnsafeOption = @unsafe; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Lock + /// + [JsonPropertyName("lock")] + public string Lock { get; set; } + + /// + /// Gets or Sets Abstract + /// + [JsonPropertyName("abstract")] + public string Abstract { get; set; } + + /// + /// Used to track the state of VarReturn + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarReturnOption { get; private set; } + + /// + /// Gets or Sets VarReturn + /// + [JsonPropertyName("return")] + public int? VarReturn { get { return this.VarReturnOption; } set { this.VarReturnOption = new Option(value); } } + + /// + /// Used to track the state of Unsafe + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsafeOption { get; private set; } + + /// + /// Gets or Sets Unsafe + /// + [JsonPropertyName("unsafe")] + public string Unsafe { get { return this.UnsafeOption; } set { this.UnsafeOption = 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 Return {\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); + sb.Append(" Abstract: ").Append(Abstract).Append("\n"); + sb.Append(" VarReturn: ").Append(VarReturn).Append("\n"); + sb.Append(" Unsafe: ").Append(Unsafe).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 ReturnJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Return 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 varLock = default; + Option varAbstract = default; + Option varReturn = default; + Option varUnsafe = 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 "lock": + varLock = new Option(utf8JsonReader.GetString()); + break; + case "abstract": + varAbstract = new Option(utf8JsonReader.GetString()); + break; + case "return": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varReturn = new Option(utf8JsonReader.GetInt32()); + break; + case "unsafe": + varUnsafe = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!varLock.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varLock)); + + if (!varAbstract.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varAbstract)); + + if (varLock.IsSet && varLock.Value == null) + throw new ArgumentNullException(nameof(varLock), "Property is not nullable for class Return."); + + if (varReturn.IsSet && varReturn.Value == null) + throw new ArgumentNullException(nameof(varReturn), "Property is not nullable for class Return."); + + if (varUnsafe.IsSet && varUnsafe.Value == null) + throw new ArgumentNullException(nameof(varUnsafe), "Property is not nullable for class Return."); + + return new Return(varLock.Value, varAbstract.Value, varReturn, varUnsafe); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, varReturn, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (varReturn.UnsafeOption.IsSet && varReturn.Unsafe == null) + throw new ArgumentNullException(nameof(varReturn.Unsafe), "Property is required for class Return."); + + writer.WriteString("lock", varReturn.Lock); + + if (varReturn.Abstract != null) + writer.WriteString("abstract", varReturn.Abstract); + else + writer.WriteNull("abstract"); + + if (varReturn.VarReturnOption.IsSet) + writer.WriteNumber("return", varReturn.VarReturnOption.Value.Value); + + if (varReturn.UnsafeOption.IsSet) + writer.WriteString("unsafe", varReturn.Unsafe); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..1adc0bbf76b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,204 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(Option role = default, Option roleUuid = default) + { + RoleOption = role; + RoleUuidOption = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Role + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleOption { get; private set; } + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get { return this.RoleOption; } set { this.RoleOption = new Option(value); } } + + /// + /// Used to track the state of RoleUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleUuidOption { get; private set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid? RoleUuid { get { return this.RoleUuidOption; } set { this.RoleUuidOption = 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 RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).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 RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash 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 role = default; + Option roleUuid = 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 "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (role.IsSet && role.Value == null) + throw new ArgumentNullException(nameof(role), "Property is not nullable for class RolesReportsHash."); + + if (roleUuid.IsSet && roleUuid.Value == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is not nullable for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHash.RoleOption.IsSet) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + } + if (rolesReportsHash.RoleUuidOption.IsSet) + writer.WriteString("role_uuid", rolesReportsHash.RoleUuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..866b9fa4871 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).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 RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHashRole.NameOption.IsSet) + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 00000000000..5c960eb5474 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -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 + * 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 +{ + /// + /// ScaleneTriangle + /// + public partial class ScaleneTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public ScaleneTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 ScaleneTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ScaleneTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ScaleneTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class ScaleneTriangle."); + + return new ScaleneTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (scaleneTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(scaleneTriangle.TriangleType), "Property is required for class ScaleneTriangle."); + + writer.WriteString("shapeType", scaleneTriangle.ShapeType); + + writer.WriteString("triangleType", scaleneTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 00000000000..c651ac7d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Shape + /// + public partial class Shape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 Shape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Shape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class Shape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); + + if (quadrilateral != null) + return new Shape(quadrilateral); + + if (triangle != null) + return new Shape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); + } + + if (shape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 00000000000..37db5df6490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ShapeInterface + /// + public partial class ShapeInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + [JsonConstructor] + public ShapeInterface(string shapeType) + { + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ShapeInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeInterface 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 shapeType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeInterface.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeInterface."); + + return new ShapeInterface(shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, shapeInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("shapeType", shapeInterface.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 00000000000..1f0b2203007 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + public partial class ShapeOrNull : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 ShapeOrNull {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeOrNull 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeOrNull.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); + + if (quadrilateral != null) + return new ShapeOrNull(quadrilateral); + + if (triangle != null) + return new ShapeOrNull(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shapeOrNull.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); + } + + if (shapeOrNull.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 00000000000..ffa68d1e75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// SimpleQuadrilateral + /// + public partial class SimpleQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public SimpleQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 SimpleQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 SimpleQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SimpleQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class SimpleQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class SimpleQuadrilateral."); + + return new SimpleQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (simpleQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(simpleQuadrilateral.ShapeType), "Property is required for class SimpleQuadrilateral."); + + writer.WriteString("quadrilateralType", simpleQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", simpleQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 00000000000..8f3593c5f41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// SpecialModelName + /// + public partial class SpecialModelName : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varSpecialModelName + /// specialPropertyName + [JsonConstructor] + public SpecialModelName(Option varSpecialModelName = default, Option specialPropertyName = default) + { + VarSpecialModelNameOption = varSpecialModelName; + SpecialPropertyNameOption = specialPropertyName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarSpecialModelName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarSpecialModelNameOption { get; private set; } + + /// + /// Gets or Sets VarSpecialModelName + /// + [JsonPropertyName("_special_model.name_")] + public string VarSpecialModelName { get { return this.VarSpecialModelNameOption; } set { this.VarSpecialModelNameOption = new Option(value); } } + + /// + /// Used to track the state of SpecialPropertyName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SpecialPropertyNameOption { get; private set; } + + /// + /// Gets or Sets SpecialPropertyName + /// + [JsonPropertyName("$special[property.name]")] + public long? SpecialPropertyName { get { return this.SpecialPropertyNameOption; } set { this.SpecialPropertyNameOption = 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 SpecialModelName {\n"); + sb.Append(" VarSpecialModelName: ").Append(VarSpecialModelName).Append("\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).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 SpecialModelNameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SpecialModelName 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 varSpecialModelName = default; + Option specialPropertyName = 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 "_special_model.name_": + varSpecialModelName = new Option(utf8JsonReader.GetString()); + break; + case "$special[property.name]": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (varSpecialModelName.IsSet && varSpecialModelName.Value == null) + throw new ArgumentNullException(nameof(varSpecialModelName), "Property is not nullable for class SpecialModelName."); + + if (specialPropertyName.IsSet && specialPropertyName.Value == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is not nullable for class SpecialModelName."); + + return new SpecialModelName(varSpecialModelName, specialPropertyName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, specialModelName, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (specialModelName.VarSpecialModelNameOption.IsSet) + writer.WriteString("_special_model.name_", specialModelName.VarSpecialModelName); + + if (specialModelName.SpecialPropertyNameOption.IsSet) + writer.WriteNumber("$special[property.name]", specialModelName.SpecialPropertyNameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 00000000000..e1678abe491 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Tag + /// + public partial class Tag : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name + [JsonConstructor] + public Tag(Option id = default, Option name = default) + { + IdOption = id; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 TagJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Tag 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Tag."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Tag."); + + return new Tag(id, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, tag, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (tag.IdOption.IsSet) + writer.WriteNumber("id", tag.IdOption.Value.Value); + + if (tag.NameOption.IsSet) + writer.WriteString("name", tag.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..f4fca096217 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(Option value = default) + { + ValueOption = value; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = 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 TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).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 TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList 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 value = 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 "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class TestCollectionEndingWithWordList."); + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordList.ValueOption.IsSet) + writer.WriteString("value", testCollectionEndingWithWordList.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..6c324e6ef4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -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 + * 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 +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(Option> testCollectionEndingWithWordList = default) + { + TestCollectionEndingWithWordListOption = testCollectionEndingWithWordList; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of TestCollectionEndingWithWordList + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TestCollectionEndingWithWordListOption { get; private set; } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get { return this.TestCollectionEndingWithWordListOption; } set { this.TestCollectionEndingWithWordListOption = 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 TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).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 TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject 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> testCollectionEndingWithWordList = 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 "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (testCollectionEndingWithWordList.IsSet && testCollectionEndingWithWordList.Value == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is not nullable for class TestCollectionEndingWithWordListObject."); + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet) + { + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs new file mode 100644 index 00000000000..ccb446b0250 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_header_string_parameter + /// + public enum TestEnumParametersEnumHeaderStringParameter + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumHeaderStringParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumHeaderStringParameter FromString(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersEnumHeaderStringParameter.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersEnumHeaderStringParameter.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersEnumHeaderStringParameter.Xyz; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumHeaderStringParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumHeaderStringParameter? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersEnumHeaderStringParameter.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersEnumHeaderStringParameter.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersEnumHeaderStringParameter.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersEnumHeaderStringParameter value) + { + if (value == TestEnumParametersEnumHeaderStringParameter.Abc) + return "_abc"; + + if (value == TestEnumParametersEnumHeaderStringParameter.Efg) + return "-efg"; + + if (value == TestEnumParametersEnumHeaderStringParameter.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumHeaderStringParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumHeaderStringParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumHeaderStringParameter? result = rawValue == null + ? null + : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumHeaderStringParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumHeaderStringParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumHeaderStringParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumHeaderStringParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumHeaderStringParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumHeaderStringParameter? result = rawValue == null + ? null + : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter? testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumHeaderStringParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs new file mode 100644 index 00000000000..ec14b39944d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_query_double_parameter + /// + public enum TestEnumParametersEnumQueryDoubleParameter + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumQueryDoubleParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryDoubleParameter FromString(string value) + { + if (value.Equals("1.1")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_MINUS_1_DOT_2; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumQueryDoubleParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryDoubleParameter? FromStringOrDefault(string value) + { + if (value.Equals("1.1")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_MINUS_1_DOT_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static double ToJsonValue(TestEnumParametersEnumQueryDoubleParameter value) + { + return (double) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumQueryDoubleParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryDoubleParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryDoubleParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumQueryDoubleParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryDoubleParameter testEnumParametersEnumQueryDoubleParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryDoubleParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumQueryDoubleParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumQueryDoubleParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryDoubleParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryDoubleParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryDoubleParameter? testEnumParametersEnumQueryDoubleParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryDoubleParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs new file mode 100644 index 00000000000..33ff2ce2cc2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_query_integer_parameter + /// + public enum TestEnumParametersEnumQueryIntegerParameter + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumQueryIntegerParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryIntegerParameter FromString(string value) + { + if (value.Equals((1).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_1; + + if (value.Equals((-2).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumQueryIntegerParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryIntegerParameter? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_1; + + if (value.Equals((-2).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(TestEnumParametersEnumQueryIntegerParameter value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumQueryIntegerParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryIntegerParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryIntegerParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryIntegerParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumQueryIntegerParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryIntegerParameter testEnumParametersEnumQueryIntegerParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryIntegerParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumQueryIntegerParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumQueryIntegerParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryIntegerParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryIntegerParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryIntegerParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryIntegerParameter? testEnumParametersEnumQueryIntegerParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryIntegerParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs new file mode 100644 index 00000000000..d86b48d4a9b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + public enum TestEnumParametersRequestEnumFormString + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersRequestEnumFormStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormString FromString(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersRequestEnumFormString.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersRequestEnumFormString.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersRequestEnumFormString.Xyz; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersRequestEnumFormString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormString? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersRequestEnumFormString.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersRequestEnumFormString.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersRequestEnumFormString.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersRequestEnumFormString value) + { + if (value == TestEnumParametersRequestEnumFormString.Abc) + return "_abc"; + + if (value == TestEnumParametersRequestEnumFormString.Efg) + return "-efg"; + + if (value == TestEnumParametersRequestEnumFormString.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersRequestEnumFormStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormString? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersRequestEnumFormString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormString testEnumParametersRequestEnumFormString, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersRequestEnumFormStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersRequestEnumFormString from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormString? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormString? testEnumParametersRequestEnumFormString, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs new file mode 100644 index 00000000000..4f1c9c53c60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_request_enum_form_string_array_inner + /// + public enum TestEnumParametersRequestEnumFormStringArrayInner + { + /// + /// Enum GreaterThan for value: > + /// + GreaterThan = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersRequestEnumFormStringArrayInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormStringArrayInner FromString(string value) + { + if (value.Equals(">")) + return TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan; + + if (value.Equals("$")) + return TestEnumParametersRequestEnumFormStringArrayInner.Dollar; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersRequestEnumFormStringArrayInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormStringArrayInner? FromStringOrDefault(string value) + { + if (value.Equals(">")) + return TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan; + + if (value.Equals("$")) + return TestEnumParametersRequestEnumFormStringArrayInner.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersRequestEnumFormStringArrayInner value) + { + if (value == TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan) + return ">"; + + if (value == TestEnumParametersRequestEnumFormStringArrayInner.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormStringArrayInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormStringArrayInner? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersRequestEnumFormStringArrayInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormStringArrayInner testEnumParametersRequestEnumFormStringArrayInner, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormStringArrayInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersRequestEnumFormStringArrayInner from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormStringArrayInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormStringArrayInner? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormStringArrayInner? testEnumParametersRequestEnumFormStringArrayInner, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormStringArrayInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..3bf95d67c57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(Option someProperty = default) + { + SomePropertyOption = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SomeProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomePropertyOption { get; private set; } + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get { return this.SomePropertyOption; } set { this.SomePropertyOption = 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 TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).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 TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest 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 someProperty = 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 "someProperty": + someProperty = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (someProperty.IsSet && someProperty.Value == null) + throw new ArgumentNullException(nameof(someProperty), "Property is not nullable for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet) + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 00000000000..cf22051519a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Triangle + /// + public partial class Triangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(EquilateralTriangle equilateralTriangle) + { + EquilateralTriangle = equilateralTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(IsoscelesTriangle isoscelesTriangle) + { + IsoscelesTriangle = isoscelesTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(ScaleneTriangle scaleneTriangle) + { + ScaleneTriangle = scaleneTriangle; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EquilateralTriangle + /// + public EquilateralTriangle EquilateralTriangle { get; set; } + + /// + /// Gets or Sets IsoscelesTriangle + /// + public IsoscelesTriangle IsoscelesTriangle { get; set; } + + /// + /// Gets or Sets ScaleneTriangle + /// + public ScaleneTriangle ScaleneTriangle { get; set; } + + /// + /// 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 Triangle {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Triangle 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 triangleType = default; + + EquilateralTriangle equilateralTriangle = null; + IsoscelesTriangle isoscelesTriangle = null; + ScaleneTriangle scaleneTriangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("triangleType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("EquilateralTriangle")) + { + Utf8JsonReader utf8JsonReaderEquilateralTriangle = utf8JsonReader; + equilateralTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderEquilateralTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("IsoscelesTriangle")) + { + Utf8JsonReader utf8JsonReaderIsoscelesTriangle = utf8JsonReader; + isoscelesTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderIsoscelesTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("ScaleneTriangle")) + { + Utf8JsonReader utf8JsonReaderScaleneTriangle = utf8JsonReader; + scaleneTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderScaleneTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class Triangle.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); + + if (equilateralTriangle != null) + return new Triangle(equilateralTriangle); + + if (isoscelesTriangle != null) + return new Triangle(isoscelesTriangle); + + if (scaleneTriangle != null) + return new Triangle(scaleneTriangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (triangle.EquilateralTriangle != null) + { + EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); + } + + if (triangle.IsoscelesTriangle != null) + { + IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + } + + if (triangle.ScaleneTriangle != null) + { + ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); + } + + WriteProperties(writer, triangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 00000000000..0f13b0e7745 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TriangleInterface + /// + public partial class TriangleInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// triangleType + [JsonConstructor] + public TriangleInterface(string triangleType) + { + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 TriangleInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TriangleInterface 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 triangleType = 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class TriangleInterface.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class TriangleInterface."); + + return new TriangleInterface(triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, triangleInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("triangleType", triangleInterface.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 00000000000..21eff6d47a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,497 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// User + /// + public partial class User : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// email + /// firstName + /// id + /// lastName + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// password + /// phone + /// User Status + /// username + [JsonConstructor] + public User(Option anyTypeProp = default, Option anyTypePropNullable = default, Option email = default, Option firstName = default, Option id = default, Option lastName = default, Option objectWithNoDeclaredProps = default, Option objectWithNoDeclaredPropsNullable = default, Option password = default, Option phone = default, Option userStatus = default, Option username = default) + { + AnyTypePropOption = anyTypeProp; + AnyTypePropNullableOption = anyTypePropNullable; + EmailOption = email; + FirstNameOption = firstName; + IdOption = id; + LastNameOption = lastName; + ObjectWithNoDeclaredPropsOption = objectWithNoDeclaredProps; + ObjectWithNoDeclaredPropsNullableOption = objectWithNoDeclaredPropsNullable; + PasswordOption = password; + PhoneOption = phone; + UserStatusOption = userStatus; + UsernameOption = username; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AnyTypeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [JsonPropertyName("anyTypeProp")] + public Object AnyTypeProp { get { return this.AnyTypePropOption; } set { this.AnyTypePropOption = new Option(value); } } + + /// + /// Used to track the state of AnyTypePropNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropNullableOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [JsonPropertyName("anyTypePropNullable")] + public Object AnyTypePropNullable { get { return this.AnyTypePropNullableOption; } set { this.AnyTypePropNullableOption = new Option(value); } } + + /// + /// Used to track the state of Email + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailOption { get; private set; } + + /// + /// Gets or Sets Email + /// + [JsonPropertyName("email")] + public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredProps + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsOption { get; private set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [JsonPropertyName("objectWithNoDeclaredProps")] + public Object ObjectWithNoDeclaredProps { get { return this.ObjectWithNoDeclaredPropsOption; } set { this.ObjectWithNoDeclaredPropsOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredPropsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsNullableOption { get; private set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [JsonPropertyName("objectWithNoDeclaredPropsNullable")] + public Object ObjectWithNoDeclaredPropsNullable { get { return this.ObjectWithNoDeclaredPropsNullableOption; } set { this.ObjectWithNoDeclaredPropsNullableOption = new Option(value); } } + + /// + /// Used to track the state of Password + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordOption { get; private set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get { return this.PasswordOption; } set { this.PasswordOption = new Option(value); } } + + /// + /// Used to track the state of Phone + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneOption { get; private set; } + + /// + /// Gets or Sets Phone + /// + [JsonPropertyName("phone")] + public string Phone { get { return this.PhoneOption; } set { this.PhoneOption = new Option(value); } } + + /// + /// Used to track the state of UserStatus + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UserStatusOption { get; private set; } + + /// + /// User Status + /// + /// User Status + [JsonPropertyName("userStatus")] + public int? UserStatus { get { return this.UserStatusOption; } set { this.UserStatusOption = new Option(value); } } + + /// + /// Used to track the state of Username + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UsernameOption { get; private set; } + + /// + /// Gets or Sets Username + /// + [JsonPropertyName("username")] + public string Username { get { return this.UsernameOption; } set { this.UsernameOption = 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 User {\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" Username: ").Append(Username).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 UserJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override User 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 anyTypeProp = default; + Option anyTypePropNullable = default; + Option email = default; + Option firstName = default; + Option id = default; + Option lastName = default; + Option objectWithNoDeclaredProps = default; + Option objectWithNoDeclaredPropsNullable = default; + Option password = default; + Option phone = default; + Option userStatus = default; + Option username = 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 "anyTypeProp": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "anyTypePropNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "email": + email = new Option(utf8JsonReader.GetString()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "objectWithNoDeclaredProps": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "objectWithNoDeclaredPropsNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "phone": + phone = new Option(utf8JsonReader.GetString()); + break; + case "userStatus": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = new Option(utf8JsonReader.GetInt32()); + break; + case "username": + username = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (email.IsSet && email.Value == null) + throw new ArgumentNullException(nameof(email), "Property is not nullable for class User."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class User."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class User."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class User."); + + if (objectWithNoDeclaredProps.IsSet && objectWithNoDeclaredProps.Value == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is not nullable for class User."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class User."); + + if (phone.IsSet && phone.Value == null) + throw new ArgumentNullException(nameof(phone), "Property is not nullable for class User."); + + if (userStatus.IsSet && userStatus.Value == null) + throw new ArgumentNullException(nameof(userStatus), "Property is not nullable for class User."); + + if (username.IsSet && username.Value == null) + throw new ArgumentNullException(nameof(username), "Property is not nullable for class User."); + + return new User(anyTypeProp, anyTypePropNullable, email, firstName, id, lastName, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, password, phone, userStatus, username); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, user, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (user.FirstNameOption.IsSet && user.FirstName == null) + throw new ArgumentNullException(nameof(user.FirstName), "Property is required for class User."); + + if (user.LastNameOption.IsSet && user.LastName == null) + throw new ArgumentNullException(nameof(user.LastName), "Property is required for class User."); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet && user.ObjectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(user.ObjectWithNoDeclaredProps), "Property is required for class User."); + + if (user.PasswordOption.IsSet && user.Password == null) + throw new ArgumentNullException(nameof(user.Password), "Property is required for class User."); + + if (user.PhoneOption.IsSet && user.Phone == null) + throw new ArgumentNullException(nameof(user.Phone), "Property is required for class User."); + + if (user.UsernameOption.IsSet && user.Username == null) + throw new ArgumentNullException(nameof(user.Username), "Property is required for class User."); + + if (user.AnyTypePropOption.IsSet) + if (user.AnyTypePropOption.Value != null) + { + writer.WritePropertyName("anyTypeProp"); + JsonSerializer.Serialize(writer, user.AnyTypeProp, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypeProp"); + if (user.AnyTypePropNullableOption.IsSet) + if (user.AnyTypePropNullableOption.Value != null) + { + writer.WritePropertyName("anyTypePropNullable"); + JsonSerializer.Serialize(writer, user.AnyTypePropNullable, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypePropNullable"); + if (user.EmailOption.IsSet) + writer.WriteString("email", user.Email); + + if (user.FirstNameOption.IsSet) + writer.WriteString("firstName", user.FirstName); + + if (user.IdOption.IsSet) + writer.WriteNumber("id", user.IdOption.Value.Value); + + if (user.LastNameOption.IsSet) + writer.WriteString("lastName", user.LastName); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet) + { + writer.WritePropertyName("objectWithNoDeclaredProps"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, jsonSerializerOptions); + } + if (user.ObjectWithNoDeclaredPropsNullableOption.IsSet) + if (user.ObjectWithNoDeclaredPropsNullableOption.Value != null) + { + writer.WritePropertyName("objectWithNoDeclaredPropsNullable"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, jsonSerializerOptions); + } + else + writer.WriteNull("objectWithNoDeclaredPropsNullable"); + if (user.PasswordOption.IsSet) + writer.WriteString("password", user.Password); + + if (user.PhoneOption.IsSet) + writer.WriteString("phone", user.Phone); + + if (user.UserStatusOption.IsSet) + writer.WriteNumber("userStatus", user.UserStatusOption.Value.Value); + + if (user.UsernameOption.IsSet) + writer.WriteString("username", user.Username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 00000000000..6d1afa8b592 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Whale + /// + public partial class Whale : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// hasBaleen + /// hasTeeth + [JsonConstructor] + public Whale(string className, Option hasBaleen = default, Option hasTeeth = default) + { + ClassName = className; + HasBaleenOption = hasBaleen; + HasTeethOption = hasTeeth; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// Used to track the state of HasBaleen + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasBaleenOption { get; private set; } + + /// + /// Gets or Sets HasBaleen + /// + [JsonPropertyName("hasBaleen")] + public bool? HasBaleen { get { return this.HasBaleenOption; } set { this.HasBaleenOption = new Option(value); } } + + /// + /// Used to track the state of HasTeeth + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasTeethOption { get; private set; } + + /// + /// Gets or Sets HasTeeth + /// + [JsonPropertyName("hasTeeth")] + public bool? HasTeeth { get { return this.HasTeethOption; } set { this.HasTeethOption = 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 Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).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 WhaleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Whale 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 className = default; + Option hasBaleen = default; + Option hasTeeth = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "hasBaleen": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = new Option(utf8JsonReader.GetBoolean()); + break; + case "hasTeeth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Whale.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Whale."); + + if (hasBaleen.IsSet && hasBaleen.Value == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is not nullable for class Whale."); + + if (hasTeeth.IsSet && hasTeeth.Value == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is not nullable for class Whale."); + + return new Whale(className.Value, hasBaleen, hasTeeth); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, whale, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", whale.ClassName); + + if (whale.HasBaleenOption.IsSet) + writer.WriteBoolean("hasBaleen", whale.HasBaleenOption.Value.Value); + + if (whale.HasTeethOption.IsSet) + writer.WriteBoolean("hasTeeth", whale.HasTeethOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 00000000000..65c93ce8316 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Zebra.cs @@ -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 + * 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 +{ + /// + /// Zebra + /// + public partial class Zebra : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// type + [JsonConstructor] + public Zebra(string className, Option type = default) + { + ClassName = className; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// Gets or Sets Type + /// + [JsonPropertyName("type")] + public ZebraType? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 Zebra {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ZebraJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Zebra 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 className = default; + Option type = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(ZebraTypeValueConverter.FromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Zebra.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Zebra."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Zebra."); + + return new Zebra(className.Value, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zebra, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", zebra.ClassName); + + if (zebra.TypeOption.IsSet) + { + var typeRawValue = ZebraTypeValueConverter.ToJsonValue(zebra.Type.Value); + writer.WriteString("type", typeRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs new file mode 100644 index 00000000000..4a54f2a265a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines zebra_type + /// + public enum ZebraType + { + /// + /// Enum Plains for value: plains + /// + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + Grevys = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class ZebraTypeValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZebraType FromString(string value) + { + if (value.Equals("plains")) + return ZebraType.Plains; + + if (value.Equals("mountain")) + return ZebraType.Mountain; + + if (value.Equals("grevys")) + return ZebraType.Grevys; + + throw new NotImplementedException($"Could not convert value to type ZebraType: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZebraType? FromStringOrDefault(string value) + { + if (value.Equals("plains")) + return ZebraType.Plains; + + if (value.Equals("mountain")) + return ZebraType.Mountain; + + if (value.Equals("grevys")) + return ZebraType.Grevys; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZebraType value) + { + if (value == ZebraType.Plains) + return "plains"; + + if (value == ZebraType.Mountain) + return "mountain"; + + if (value == ZebraType.Grevys) + return "grevys"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZebraTypeJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZebraType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZebraType? result = rawValue == null + ? null + : ZebraTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZebraType to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZebraType zebraType, JsonSerializerOptions options) + { + writer.WriteStringValue(zebraType.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZebraTypeNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZebraType from the Json object + /// + /// + /// + /// + /// + public override ZebraType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZebraType? result = rawValue == null + ? null + : ZebraTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZebraType? zebraType, JsonSerializerOptions options) + { + writer.WriteStringValue(zebraType?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs new file mode 100644 index 00000000000..34a044fb8b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnum value) + { + if (value == ZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum? zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs new file mode 100644 index 00000000000..9596f0b9bff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -0,0 +1,176 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ZeroBasedEnumClass + /// + public partial class ZeroBasedEnumClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// zeroBasedEnum + [JsonConstructor] + public ZeroBasedEnumClass(Option zeroBasedEnum = default) + { + ZeroBasedEnumOption = zeroBasedEnum; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ZeroBasedEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ZeroBasedEnumOption { get; private set; } + + /// + /// Gets or Sets ZeroBasedEnum + /// + [JsonPropertyName("ZeroBasedEnum")] + public ZeroBasedEnumClassZeroBasedEnum? ZeroBasedEnum { get { return this.ZeroBasedEnumOption; } set { this.ZeroBasedEnumOption = 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 ZeroBasedEnumClass {\n"); + sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 ZeroBasedEnumClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ZeroBasedEnumClass 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 zeroBasedEnum = 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 "ZeroBasedEnum": + string zeroBasedEnumRawValue = utf8JsonReader.GetString(); + if (zeroBasedEnumRawValue != null) + zeroBasedEnum = new Option(ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(zeroBasedEnumRawValue)); + break; + default: + break; + } + } + } + + if (zeroBasedEnum.IsSet && zeroBasedEnum.Value == null) + throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is not nullable for class ZeroBasedEnumClass."); + + return new ZeroBasedEnumClass(zeroBasedEnum); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + if (zeroBasedEnumClass.ZeroBasedEnumOption.IsSet) + { + var zeroBasedEnumRawValue = ZeroBasedEnumClassZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnumClass.ZeroBasedEnum.Value); + writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs new file mode 100644 index 00000000000..2b062a550ab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnumClass_ZeroBasedEnum + /// + public enum ZeroBasedEnumClassZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumClassZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnumClassZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumClassZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumClassZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumClassZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnumClassZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumClassZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumClassZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnumClassZeroBasedEnum value) + { + if (value == ZeroBasedEnumClassZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnumClassZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumClassZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnumClassZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnumClassZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnumClassZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClassZeroBasedEnum zeroBasedEnumClassZeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnumClassZeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumClassZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnumClassZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnumClassZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnumClassZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClassZeroBasedEnum? zeroBasedEnumClassZeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnumClassZeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c6529e05402 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..39ca4a5b875 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/README.md @@ -0,0 +1,223 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo"); + ModelClient model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## 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**: Bearer Authentication + + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.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/csharp/generichost/net4.7/OneOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/OneOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/OneOf/api/openapi.yaml new file mode 100644 index 00000000000..06fd58be740 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/api/openapi.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + example: + color: color + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + title: fruit + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/OneOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.7/OneOf/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.7/OneOf/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/OneOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..91e5f4c09c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..b8a2dfc1dc6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,174 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..e7289665b3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,172 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/OneOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..cbfa563798a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,225 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c6529e05402 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..01afdb93332 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.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/csharp/generichost/net4.7/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator/FILES new file mode 100644 index 00000000000..0bf16fb19b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator/FILES @@ -0,0 +1,244 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DateOnlyClass.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FooGetDefaultResponse.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/LiteralStringClass.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NotificationtestGetElementsV1ResponseMPayload.md +docs/models/NullableClass.md +docs/models/NullableGuidClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/OneOfString.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/OuterEnumTest.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/PolymorphicProperty.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/RequiredClass.md +docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/models/ZeroBasedEnum.md +docs/models/ZeroBasedEnumClass.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/OneOfString.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumTest.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/RequiredClass.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/RolesReportsHash.cs +src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Model/ZeroBasedEnum.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/Petstore/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml new file mode 100644 index 00000000000..f772773afef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml @@ -0,0 +1,3066 @@ +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_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /roles/report: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/RolesReport' + type: array + description: returns report + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - 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 + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - 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: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - 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: [] + - api_key_query: [] + summary: Find pet by ID + tags: + - 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: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - 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 + /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 + /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 + /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 + 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 + /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 + /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 + /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 + /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: + 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 + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - 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 + 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 + "598": + description: Not a real HTTP status code + "599": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Not a real HTTP status code with a return object + summary: Get user by user name + tags: + - 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 + /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#$%^ + /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 + 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 + 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 + 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 + 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 + /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 + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + 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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - 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: requiredNotNullable + required: true + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: requiredNullable + required: true + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: notRequiredNotNullable + required: false + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: notRequiredNullable + required: false + schema: + nullable: true + type: string + style: form + responses: + "200": + description: Success + tags: + - 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' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - 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 + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK + /test: + get: + operationId: Test + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload' + description: Successful response + summary: Retrieve an existing Notificationtest's Elements +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + 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: + RolesReport: + description: Roles report + items: + $ref: '#/components/schemas/RolesReportsHash' + type: array + RolesReportsHash: + description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + role_uuid: + format: uuid + type: string + role: + $ref: '#/components/schemas/RolesReportsHash_role' + type: object + 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: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + 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 + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + 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 + 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 + lock: + type: string + abstract: + nullable: true + type: string + unsafe: + type: string + required: + - abstract + - lock + 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' + - $ref: '#/components/schemas/Address' + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + 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 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + 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: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_backslash: + description: None + pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ + /([0-9]|[1-2][0-9]|3[0-2]))$" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Outer_Enum_Test: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + 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 + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + 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 + 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 + x-cls-compliant: true + x-com-visible: true + 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 + 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 + 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 + _special_model.name_: + type: string + 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 + RequiredClass: + properties: + required_nullable_integer_prop: + nullable: true + type: integer + required_notnullableinteger_prop: + nullable: false + type: integer + not_required_nullable_integer_prop: + nullable: true + type: integer + not_required_notnullableinteger_prop: + nullable: false + type: integer + required_nullable_string_prop: + nullable: true + type: string + required_notnullable_string_prop: + nullable: false + type: string + notrequired_nullable_string_prop: + nullable: true + type: string + notrequired_notnullable_string_prop: + nullable: false + type: string + required_nullable_boolean_prop: + nullable: true + type: boolean + required_notnullable_boolean_prop: + nullable: false + type: boolean + notrequired_nullable_boolean_prop: + nullable: true + type: boolean + notrequired_notnullable_boolean_prop: + nullable: false + type: boolean + required_nullable_date_prop: + format: date + nullable: true + type: string + required_not_nullable_date_prop: + format: date + nullable: false + type: string + not_required_nullable_date_prop: + format: date + nullable: true + type: string + not_required_notnullable_date_prop: + format: date + nullable: false + type: string + required_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + required_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + notrequired_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + notrequired_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + required_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + required_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + notrequired_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + notrequired_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + required_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + required_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + notrequired_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + notrequired_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + required_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + required_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + notrequired_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + notrequired_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + required_nullable_array_of_string: + items: + type: string + nullable: true + type: array + required_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + notrequired_nullable_array_of_string: + items: + type: string + nullable: true + type: array + notrequired_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + required: + - required_not_nullable_date_prop + - required_notnullable_array_of_string + - required_notnullable_boolean_prop + - required_notnullable_datetime_prop + - required_notnullable_enum_integer + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_notnullable_outerEnumDefaultValue + - required_notnullable_string_prop + - required_notnullable_uuid + - required_notnullableinteger_prop + - required_nullable_array_of_string + - required_nullable_boolean_prop + - required_nullable_date_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_nullable_enum_integer_only + - required_nullable_enum_string + - required_nullable_integer_prop + - required_nullable_outerEnumDefaultValue + - required_nullable_string_prop + - required_nullable_uuid + 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 + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + color_code: + pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + required: + - pet_type + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + 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 + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + OneOfString: + oneOf: + - pattern: ^a + type: string + - pattern: ^b + type: string + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + ZeroBasedEnumClass: + properties: + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + type: object + Custom-Variableobject-Response: + additionalProperties: true + description: A Variable object without predefined property names + type: object + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + example: + a_objVariableobject: + - null + - null + pkiNotificationtestID: 0 + properties: + pkiNotificationtestID: + type: integer + a_objVariableobject: + items: + $ref: '#/components/schemas/Custom-Variableobject-Response' + type: array + required: + - a_objVariableobject + - pkiNotificationtestID + type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string + 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: + 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: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + 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 + 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 + getCountry_request: + allOf: + - properties: + country: + type: string + required: + - country + type: object + RolesReportsHash_role: + example: + name: name + properties: + name: + type: string + type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing + 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/csharp/generichost/net4.7/Petstore/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/Petstore/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md new file mode 100644 index 00000000000..36948898657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/AnotherFakeApi.md @@ -0,0 +1,99 @@ +# Org.OpenAPITools.Api.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** +> ModelClient Call123TestSpecialTags (ModelClient modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the Call123TestSpecialTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test special tags + ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..0bdfd6af347 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/DefaultApi.md @@ -0,0 +1,429 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | +| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | +| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | | +| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements | + + +# **FooGet** +> FooGetDefaultResponse FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + FooGetDefaultResponse result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FooGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FooGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetCountry** +> void GetCountry (string country) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + var country = "country_example"; // string | + + try + { + apiInstance.GetCountry(country); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.GetCountryWithHttpInfo(country); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | | | + +### Return type + +void (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** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **RolesReportGet** +> List<List<RolesReportsHash>> RolesReportGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RolesReportGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + List> result = apiInstance.RolesReportGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RolesReportGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns report | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Test** +> NotificationtestGetElementsV1ResponseMPayload Test () + +Retrieve an existing Notificationtest's Elements + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Retrieve an existing Notificationtest's Elements + NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Test: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve an existing Notificationtest's Elements + ApiResponse response = apiInstance.TestWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md new file mode 100644 index 00000000000..959c6b75e78 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeApi.md @@ -0,0 +1,1830 @@ +# Org.OpenAPITools.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**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 | | +| [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | +| [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + +# **FakeHealthGet** +> HealthCheckResult FakeHealthGet () + +Health check endpoint + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeHealthGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Health check endpoint + ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeHealthGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterBooleanSerialize** +> bool FakeOuterBooleanSerialize (bool body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterBooleanSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **bool** | Input boolean as post body | [optional] | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterCompositeSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterNumberSerialize** +> decimal FakeOuterNumberSerialize (decimal body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterNumberSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **decimal** | Input number as post body | [optional] | + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterStringSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | +| **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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetArrayOfEnumsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Array of Enums + ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestAdditionalPropertiesReference** +> void TestAdditionalPropertiesReference (Dictionary requestBody) + +test referenced additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestAdditionalPropertiesReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, Object>**](Object.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithFileSchema** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithFileSchemaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User user, string query) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var user = new User(); // User | + var query = "query_example"; // string | + + try + { + apiInstance.TestBodyWithQueryParams(user, query); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithQueryParamsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithQueryParamsWithHttpInfo(user, query); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | | | +| **query** | **string** | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClientModelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test \"client\" model + ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestClientModelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, DateTime date = null, System.IO.Stream binary = null, float varFloat = null, int integer = null, int int32 = null, long int64 = null, string varString = null, string password = null, string callback = null, DateTime dateTime = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var number = 8.14D; // decimal | None + var varDouble = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var varFloat = 3.4F; // float | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789L; // long | None (optional) + var varString = "varString_example"; // string | None (optional) + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEndpointParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParametersWithHttpInfo(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **varByte** | **byte[]** | None | | +| **number** | **decimal** | None | | +| **varDouble** | **double** | None | | +| **patternWithoutDelimiter** | **string** | None | | +| **date** | **DateTime** | None | [optional] | +| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] | +| **varFloat** | **float** | None | [optional] | +| **integer** | **int** | None | [optional] | +| **int32** | **int** | None | [optional] | +| **int64** | **long** | None | [optional] | +| **varString** | **string** | None | [optional] | +| **password** | **string** | None | [optional] | +| **callback** | **string** | None | [optional] | +| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumHeaderStringArray = null, List enumQueryStringArray = null, double enumQueryDouble = null, int enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumQueryDouble = 1.1D; // double | Query parameter enum test (double) (optional) + var enumQueryInteger = 1; // int | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEnumParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test enum parameters + apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **enumHeaderStringArray** | [**List<string>**](string.md) | Header parameter enum test (string array) | [optional] | +| **enumQueryStringArray** | [**List<string>**](string.md) | Query parameter enum test (string array) | [optional] | +| **enumQueryDouble** | **double** | Query parameter enum test (double) | [optional] | +| **enumQueryInteger** | **int** | Query parameter enum test (double) | [optional] | +| **enumFormStringArray** | [**List<string>**](string.md) | Form parameter enum test (string array) | [optional] [default to $] | +| **enumHeaderString** | **string** | Header parameter enum test (string) | [optional] [default to -efg] | +| **enumQueryString** | **string** | Query parameter enum test (string) | [optional] [default to -efg] | +| **enumFormString** | **string** | Form parameter enum test (string) | [optional] [default to -efg] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestGroupParameters** +> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool booleanGroup = null, int stringGroup = null, long int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var stringGroup = 56; // int | String in group parameters (optional) + var int64Group = 789L; // long | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestGroupParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | | +| **requiredStringGroup** | **int** | Required String in group parameters | | +| **requiredInt64Group** | **long** | Required Integer in group parameters | | +| **booleanGroup** | **bool** | Boolean in group parameters | [optional] | +| **stringGroup** | **int** | String in group parameters | [optional] | +| **int64Group** | **long** | Integer in group parameters | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline additionalProperties + apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestJsonFormDataWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test json serialization of form data + apiInstance.TestJsonFormDataWithHttpInfo(param, param2); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **param** | **string** | field1 | | +| **param2** | **string** | field2 | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestQueryParameterCollectionFormat** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = null, string notRequiredNullable = null) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + var requiredNotNullable = "requiredNotNullable_example"; // string | + var requiredNullable = "requiredNullable_example"; // string | + var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional) + var notRequiredNullable = "notRequiredNullable_example"; // string | (optional) + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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) | | | +| **requiredNotNullable** | **string** | | | +| **requiredNullable** | **string** | | | +| **notRequiredNotNullable** | **string** | | [optional] | +| **notRequiredNullable** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..dfe1adefd0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,104 @@ +# Org.OpenAPITools.Api.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** +> ModelClient TestClassname (ModelClient modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClassnameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test class name in snake case + ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md new file mode 100644 index 00000000000..407fb30dccb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/PetApi.md @@ -0,0 +1,860 @@ +# Org.OpenAPITools.Api.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 pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<string>**](string.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md new file mode 100644 index 00000000000..4a1cd29ada7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.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 (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md new file mode 100644 index 00000000000..ee189c866ec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/apis/UserApi.md @@ -0,0 +1,715 @@ +# Org.OpenAPITools.Api.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 user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | +| **598** | Not a real HTTP status code | - | +| **599** | Not a real HTTP status code with a return object | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdateUser** +> void UpdateUser (User user, string username) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Updated user object + var username = "username_example"; // string | name that need to be deleted + + try + { + // Updated user + apiInstance.UpdateUser(user, username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(user, username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Updated user object | | +| **username** | **string** | name that need to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Activity.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [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/net4.7/Petstore/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ActivityOutputElementRepresentation.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ActivityOutputElementRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | [optional] +**Prop2** | **Object** | | [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/net4.7/Petstore/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..2bbe882fcfc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Anytype1** | **Object** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [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/net4.7/Petstore/docs/models/Animal.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Animal.md new file mode 100644 index 00000000000..1a1760bd869 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/ApiResponse.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ApiResponse.md new file mode 100644 index 00000000000..d89ed1a25dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Message** | **string** | | [optional] +**Type** | **string** | | [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/net4.7/Petstore/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Apple.md new file mode 100644 index 00000000000..9ad1da8cd68 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Apple.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ColorCode** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [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/net4.7/Petstore/docs/models/AppleReq.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/AppleReq.md new file mode 100644 index 00000000000..325521123f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [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/net4.7/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..a23ba59e609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [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/net4.7/Petstore/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..10b8413439b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [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/net4.7/Petstore/docs/models/ArrayTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayTest.md new file mode 100644 index 00000000000..ed572120cd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] +**ArrayOfString** | **List<string>** | | [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/net4.7/Petstore/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Banana.md new file mode 100644 index 00000000000..d32e90cf298 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [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/net4.7/Petstore/docs/models/BananaReq.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/BananaReq.md new file mode 100644 index 00000000000..c8372b73c5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/net4.7/Petstore/docs/models/BasquePig.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/BasquePig.md new file mode 100644 index 00000000000..db4f7a36226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/Petstore/docs/models/Capitalization.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Capitalization.md new file mode 100644 index 00000000000..9e225c17232 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ATT_NAME** | **string** | Name of the pet | [optional] +**CapitalCamel** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**SmallCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [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/net4.7/Petstore/docs/models/Cat.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Cat.md new file mode 100644 index 00000000000..310a5e6575e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [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/net4.7/Petstore/docs/models/Category.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Category.md new file mode 100644 index 00000000000..6eb0a2e13ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/ChildCat.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ChildCat.md new file mode 100644 index 00000000000..88fe8f7a7fd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/ClassModel.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ClassModel.md new file mode 100644 index 00000000000..bb35816c914 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [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/net4.7/Petstore/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ComplexQuadrilateral.md new file mode 100644 index 00000000000..fb00d4ebf08 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/DanishPig.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DanishPig.md new file mode 100644 index 00000000000..4d6ec1400a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/Petstore/docs/models/DateOnlyClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DateOnlyClass.md new file mode 100644 index 00000000000..5dd63b313cc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DateOnlyClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DateOnlyClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateOnlyProperty** | **DateTime** | | [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/net4.7/Petstore/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DeprecatedObject.md new file mode 100644 index 00000000000..e90c59555a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.7/Petstore/docs/models/Dog.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Dog.md new file mode 100644 index 00000000000..70cdc80e83e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [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/net4.7/Petstore/docs/models/Drawing.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Drawing.md new file mode 100644 index 00000000000..95f49b2ed60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [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/net4.7/Petstore/docs/models/EnumArrays.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumArrays.md new file mode 100644 index 00000000000..7467f67978c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayEnum** | **List<EnumArrays.ArrayEnumEnum>** | | [optional] +**JustSymbol** | **string** | | [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/net4.7/Petstore/docs/models/EnumClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumClass.md new file mode 100644 index 00000000000..d259f0f4696 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/EnumTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumTest.md new file mode 100644 index 00000000000..ebd7ccf2c86 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**EnumString** | **string** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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/net4.7/Petstore/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EquilateralTriangle.md new file mode 100644 index 00000000000..8360b5c16a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/Petstore/docs/models/File.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/File.md new file mode 100644 index 00000000000..58b9c2fc369 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [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/net4.7/Petstore/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FileSchemaTestClass.md new file mode 100644 index 00000000000..a47efad77d8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [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/net4.7/Petstore/docs/models/Foo.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Foo.md new file mode 100644 index 00000000000..b9e7d261736 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/FooGetDefaultResponse.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FooGetDefaultResponse.md new file mode 100644 index 00000000000..47e50daca3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FooGetDefaultResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FooGetDefaultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [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/net4.7/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md new file mode 100644 index 00000000000..0983002c5da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md @@ -0,0 +1,28 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Number** | **decimal** | | +**Password** | **string** | | +**Binary** | **System.IO.Stream** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Decimal** | **decimal** | | [optional] +**Double** | **double** | | [optional] +**Float** | **float** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Integer** | **int** | | [optional] +**PatternWithBackslash** | **string** | None | [optional] +**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] +**String** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] +**Uuid** | **Guid** | | [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/net4.7/Petstore/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/Petstore/docs/models/FruitReq.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FruitReq.md new file mode 100644 index 00000000000..38ab0c1a6ca --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FruitReq.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/GmFruit.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/GmFruit.md new file mode 100644 index 00000000000..584c4fd323d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/GmFruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.7/Petstore/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/GrandparentAnimal.md new file mode 100644 index 00000000000..eca96162b6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.7/Petstore/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/HasOnlyReadOnly.md new file mode 100644 index 00000000000..060a614a698 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/HealthCheckResult.md new file mode 100644 index 00000000000..682cfc50e3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.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] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/IsoscelesTriangle.md new file mode 100644 index 00000000000..07c62ac9338 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/Petstore/docs/models/List.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/List.md new file mode 100644 index 00000000000..0b54858ac24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | **string** | | [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/net4.7/Petstore/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/Mammal.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Mammal.md new file mode 100644 index 00000000000..ac14f00c0ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Mammal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/Petstore/docs/models/MapTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MapTest.md new file mode 100644 index 00000000000..5dd27228bb0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, MapTest.InnerEnum>** | | [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/net4.7/Petstore/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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/net4.7/Petstore/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/net4.7/Petstore/docs/models/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/net4.7/Petstore/docs/models/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..1bc0740add9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] +**Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [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/net4.7/Petstore/docs/models/MixedSubId.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/net4.7/Petstore/docs/models/Model200Response.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Model200Response.md new file mode 100644 index 00000000000..2752a0d87c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] +**Name** | **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/generichost/net4.7/Petstore/docs/models/ModelClient.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ModelClient.md new file mode 100644 index 00000000000..c658e84ef57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarClient** | **string** | | [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/net4.7/Petstore/docs/models/Name.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Name.md new file mode 100644 index 00000000000..ffe61a31d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarName** | **int** | | +**Property** | **string** | | [optional] +**SnakeCase** | **int** | | [optional] [readonly] +**Var123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md new file mode 100644 index 00000000000..25f223a8360 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AObjVariableobject** | **List<Dictionary<string, Object>>** | | +**PkiNotificationtestID** | **int** | | + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/NullableClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableClass.md new file mode 100644 index 00000000000..5d9965f55c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**BooleanProp** | **bool** | | [optional] +**DateProp** | **DateTime** | | [optional] +**DatetimeProp** | **DateTime** | | [optional] +**IntegerProp** | **int** | | [optional] +**NumberProp** | **decimal** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**StringProp** | **string** | | [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/net4.7/Petstore/docs/models/NullableGuidClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableGuidClass.md new file mode 100644 index 00000000000..8d939afe998 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableGuidClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NullableGuidClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [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/net4.7/Petstore/docs/models/NullableShape.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableShape.md new file mode 100644 index 00000000000..2720167ccaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NullableShape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/NumberOnly.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NumberOnly.md new file mode 100644 index 00000000000..1b83cce764d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [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/net4.7/Petstore/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..9f44c24d19a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bars** | **List<string>** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Id** | **decimal** | | [optional] +**Uuid** | **string** | | [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/net4.7/Petstore/docs/models/OneOfString.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OneOfString.md new file mode 100644 index 00000000000..54caf618776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OneOfString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OneOfString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/Order.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Order.md new file mode 100644 index 00000000000..f7d6827ed5c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Complete** | **bool** | | [optional] [default to false] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [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/net4.7/Petstore/docs/models/OuterComposite.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterComposite.md new file mode 100644 index 00000000000..8985c59d094 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyBoolean** | **bool** | | [optional] +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [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/net4.7/Petstore/docs/models/OuterEnum.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnum.md new file mode 100644 index 00000000000..36844bc4b17 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..351383f0aea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumInteger.md new file mode 100644 index 00000000000..1013b5b1956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..55e314e3102 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/OuterEnumTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumTest.md new file mode 100644 index 00000000000..b99d27c2c2e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/OuterEnumTest.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/ParentPet.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ParentPet.md new file mode 100644 index 00000000000..bdf57005637 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.7/Petstore/docs/models/Pet.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Pet.md new file mode 100644 index 00000000000..4f019b613bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Category** | [**Category**](Category.md) | | [optional] +**Id** | **long** | | [optional] +**Status** | **string** | pet status in the store | [optional] +**Tags** | [**List<Tag>**](Tag.md) | | [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/net4.7/Petstore/docs/models/Pig.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Pig.md new file mode 100644 index 00000000000..fd7bb9359ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.7/Petstore/docs/models/PolymorphicProperty.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/PolymorphicProperty.md new file mode 100644 index 00000000000..4507ec41cd5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/PolymorphicProperty.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PolymorphicProperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/Quadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Quadrilateral.md new file mode 100644 index 00000000000..fbbf4f81cec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Quadrilateral.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.7/Petstore/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/QuadrilateralInterface.md new file mode 100644 index 00000000000..756ba09c6dd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.7/Petstore/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ReadOnlyFirst.md new file mode 100644 index 00000000000..afaf2ee4fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [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/net4.7/Petstore/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RequiredClass.md new file mode 100644 index 00000000000..7460783c91d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RequiredClass.md @@ -0,0 +1,53 @@ +# Org.OpenAPITools.Model.RequiredClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequiredNotNullableDateProp** | **DateTime** | | +**RequiredNotnullableArrayOfString** | **List<string>** | | +**RequiredNotnullableBooleanProp** | **bool** | | +**RequiredNotnullableDatetimeProp** | **DateTime** | | +**RequiredNotnullableEnumInteger** | **int** | | +**RequiredNotnullableEnumIntegerOnly** | **int** | | +**RequiredNotnullableEnumString** | **string** | | +**RequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNotnullableStringProp** | **string** | | +**RequiredNotnullableUuid** | **Guid** | | +**RequiredNotnullableintegerProp** | **int** | | +**NotRequiredNotnullableDateProp** | **DateTime** | | [optional] +**NotRequiredNotnullableintegerProp** | **int** | | [optional] +**NotRequiredNullableDateProp** | **DateTime** | | [optional] +**NotRequiredNullableIntegerProp** | **int** | | [optional] +**NotrequiredNotnullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNotnullableBooleanProp** | **bool** | | [optional] +**NotrequiredNotnullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNotnullableEnumInteger** | **int** | | [optional] +**NotrequiredNotnullableEnumIntegerOnly** | **int** | | [optional] +**NotrequiredNotnullableEnumString** | **string** | | [optional] +**NotrequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNotnullableStringProp** | **string** | | [optional] +**NotrequiredNotnullableUuid** | **Guid** | | [optional] +**NotrequiredNullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNullableBooleanProp** | **bool** | | [optional] +**NotrequiredNullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNullableEnumInteger** | **int** | | [optional] +**NotrequiredNullableEnumIntegerOnly** | **int** | | [optional] +**NotrequiredNullableEnumString** | **string** | | [optional] +**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/net4.7/Petstore/docs/models/Return.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Return.md new file mode 100644 index 00000000000..ad96a170bbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Return.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lock** | **string** | | +**Abstract** | **string** | | +**VarReturn** | **int** | | [optional] +**Unsafe** | **string** | | [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/net4.7/Petstore/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **Guid** | | [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/net4.7/Petstore/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/RolesReportsHashRole.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.RolesReportsHashRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.7/Petstore/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ScaleneTriangle.md new file mode 100644 index 00000000000..d3f15354bcc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.7/Petstore/docs/models/Shape.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Shape.md new file mode 100644 index 00000000000..ae75c592540 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Shape.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/ShapeInterface.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ShapeInterface.md new file mode 100644 index 00000000000..882d3186830 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ShapeOrNull.md new file mode 100644 index 00000000000..7fcd31a3a5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ShapeOrNull.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/SimpleQuadrilateral.md new file mode 100644 index 00000000000..a9c7f93b67a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.7/Petstore/docs/models/SpecialModelName.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/SpecialModelName.md new file mode 100644 index 00000000000..890bcd923de --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarSpecialModelName** | **string** | | [optional] +**SpecialPropertyName** | **long** | | [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/net4.7/Petstore/docs/models/Tag.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Tag.md new file mode 100644 index 00000000000..2b2d9674d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [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/net4.7/Petstore/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **string** | | [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/net4.7/Petstore/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.md) | | [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/net4.7/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [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/net4.7/Petstore/docs/models/Triangle.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Triangle.md new file mode 100644 index 00000000000..e1510991195 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Triangle.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.7/Petstore/docs/models/TriangleInterface.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TriangleInterface.md new file mode 100644 index 00000000000..4127c08b14f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.7/Petstore/docs/models/User.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/User.md new file mode 100644 index 00000000000..b5700f1c75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**Email** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**Id** | **long** | | [optional] +**LastName** | **string** | | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**Username** | **string** | | [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/net4.7/Petstore/docs/models/Whale.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Whale.md new file mode 100644 index 00000000000..1c633fdce61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [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/net4.7/Petstore/docs/models/Zebra.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Zebra.md new file mode 100644 index 00000000000..aef3866b92c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Type** | **string** | | [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/net4.7/Petstore/docs/models/ZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ZeroBasedEnum.md new file mode 100644 index 00000000000..cb71966c4c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.7/Petstore/docs/models/ZeroBasedEnumClass.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ZeroBasedEnumClass.md new file mode 100644 index 00000000000..614d00cbe87 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/ZeroBasedEnumClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ZeroBasedEnum** | **string** | | [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/net4.7/Petstore/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..cf82a3e39bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..c178aac4eab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + string apiKeyTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken1 = new ApiKeyToken(apiKeyTokenValue1, ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + string apiKeyTokenValue2 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken2 = new ApiKeyToken(apiKeyTokenValue2, ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + string bearerTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken1 = new BearerToken(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + string basicTokenUsername1 = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword1 = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken1 = new BasicToken(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + string oauthTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken1 = new OAuthToken(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..88cf05ba9ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + var model = response.Default(); + Assert.IsType(model); + } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test RolesReportGet + /// + [Fact (Skip = "not implemented")] + public async Task RolesReportGetAsyncTest() + { + var response = await _instance.RolesReportGetAsync(); + var model = response.Ok(); + Assert.IsType>>(model); + } + + /// + /// Test Test + /// + [Fact (Skip = "not implemented")] + public async Task TestAsyncTest() + { + var response = await _instance.TestAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..bbccd77b29c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,243 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..0cabe51ed28 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + Client.Option outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + Guid requiredStringUuid = default; + Client.Option body = default; + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + User user = default; + string query = default; + await _instance.TestBodyWithQueryParamsAsync(user, query); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + byte[] varByte = default; + decimal number = default; + double varDouble = default; + string patternWithoutDelimiter = default; + Client.Option date = default; + Client.Option binary = default; + Client.Option varFloat = default; + Client.Option integer = default; + Client.Option int32 = default; + Client.Option int64 = default; + Client.Option varString = default; + Client.Option password = default; + Client.Option callback = default; + Client.Option dateTime = default; + await _instance.TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + Client.Option> enumHeaderStringArray = default; + Client.Option> enumQueryStringArray = default; + Client.Option enumQueryDouble = default; + Client.Option enumQueryInteger = default; + Client.Option> enumFormStringArray = default; + Client.Option enumHeaderString = default; + Client.Option enumQueryString = default; + Client.Option enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + bool requiredBooleanGroup = default; + int requiredStringGroup = default; + long requiredInt64Group = default; + Client.Option booleanGroup = default; + Client.Option stringGroup = default; + Client.Option int64Group = default; + await _instance.TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestInlineFreeformAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineFreeformAdditionalPropertiesAsyncTest() + { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default; + await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + string requiredNotNullable = default; + string requiredNullable = default; + Client.Option notRequiredNotNullable = default; + 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/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..5964bf6e51d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..c5e6e7e2f9d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + Client.Option apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + Client.Option name = default; + Client.Option status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + Client.Option file = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileAsync(petId, file, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + System.IO.Stream requiredFile = default; + long petId = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..1b75e341700 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..38ee1125438 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + User user = default; + string username = default; + await _instance.UpdateUserAsync(user, username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..adbf639fd72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -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 + * 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 ActivityOutputElementRepresentation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityOutputElementRepresentationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation + //private ActivityOutputElementRepresentation instance; + + public ActivityOutputElementRepresentationTests() + { + // TODO uncomment below to create an instance of ActivityOutputElementRepresentation + //instance = new ActivityOutputElementRepresentation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ActivityOutputElementRepresentation + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..6cc2927eaaf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -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 + * 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 Activity + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Activity + //private Activity instance; + + public ActivityTests() + { + // TODO uncomment below to create an instance of Activity + //instance = new Activity(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Activity + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..e157b477193 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -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 + * 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 AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..1db9725afb8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -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 + * 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 Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..c296a82116a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -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 + * 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 ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 00000000000..d698ee44504 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -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 + * 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 AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..c7c8ccd47c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -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 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'ColorCode' + /// + [Fact] + public void ColorCodeTest() + { + // TODO unit test for the property 'ColorCode' + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..29fe9cfb1d4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..2b0956c0b98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..3b01d0b7abb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -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 + * 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 ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 00000000000..1e54c1f3e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -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 + * 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 BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5a88e9dabbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -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 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 00000000000..4ffd6c2c0c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -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 + * 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 BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..d0391fb47f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -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 + * 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 Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 00000000000..a5d4bf43bbf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -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 + * 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 Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..7fe8f333c81 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -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 + * 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 Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 00000000000..2c02364a9f7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -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 + * 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 ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..a866bfbe242 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -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 + * 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 ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 00000000000..a7a864154ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -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 + * 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 ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 00000000000..e7c505b5136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -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 + * 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 DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs new file mode 100644 index 00000000000..83a4185e53d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -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 + * 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 DateOnlyClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DateOnlyClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DateOnlyClass + //private DateOnlyClass instance; + + public DateOnlyClassTests() + { + // TODO uncomment below to create an instance of DateOnlyClass + //instance = new DateOnlyClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DateOnlyClass + /// + [Fact] + public void DateOnlyClassInstanceTest() + { + // TODO uncomment below to test "IsType" DateOnlyClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateOnlyProperty' + /// + [Fact] + public void DateOnlyPropertyTest() + { + // TODO unit test for the property 'DateOnlyProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 00000000000..95e56f782da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -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 + * 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 DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 00000000000..b8e8bca0538 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -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 + * 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 Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 00000000000..a2de4a1b97b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..c6fee27690b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -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 + * 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 EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..44dbbe4d324 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -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 + * 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 EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..3781eebbfcf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -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 + * 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 EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 00000000000..f8d3daec3fe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -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 + * 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 EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 00000000000..e2685848d5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -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 + * 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 FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 00000000000..c305c5356b0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -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 + * 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 File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs new file mode 100644 index 00000000000..55086a7cf24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -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 + * 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 FooGetDefaultResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooGetDefaultResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FooGetDefaultResponse + //private FooGetDefaultResponse instance; + + public FooGetDefaultResponseTests() + { + // TODO uncomment below to create an instance of FooGetDefaultResponse + //instance = new FooGetDefaultResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FooGetDefaultResponse + /// + [Fact] + public void FooGetDefaultResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FooGetDefaultResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 00000000000..871506eeaac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -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 + * 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 Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..b658f317f1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + + /// + /// Test the property 'PatternWithBackslash' + /// + [Fact] + public void PatternWithBackslashTest() + { + // TODO unit test for the property 'PatternWithBackslash' + } + + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 00000000000..a33c55ae487 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -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 + * 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 FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..46448efc62f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -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 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 00000000000..7e79cd06792 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -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 + * 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 GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 00000000000..5f0e8672ed5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -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 + * 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 GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..134a7d515eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -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 + * 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 HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 00000000000..18bb8672e98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -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 + * 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 HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 00000000000..464750233cd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -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 + * 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 IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 00000000000..d95303d9751 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -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 + * 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 List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + /// + /// Test the property 'Var123List' + /// + [Fact] + public void Var123ListTest() + { + // TODO unit test for the property 'Var123List' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..31d21de5b60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * 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 LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 00000000000..64bd9e89034 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -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 + * 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 Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..2dc6d8d8e04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..d3689c15f40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..3b5e94c5f8f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -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 + * 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 Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..5a986cfdc6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -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 + * 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 ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarClient' + /// + [Fact] + public void VarClientTest() + { + // TODO unit test for the property 'VarClient' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 00000000000..3aac92ae468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarName' + /// + [Fact] + public void VarNameTest() + { + // TODO unit test for the property 'VarName' + } + + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + + /// + /// Test the property 'Var123Number' + /// + [Fact] + public void Var123NumberTest() + { + // TODO unit test for the property 'Var123Number' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs new file mode 100644 index 00000000000..dd3b74e3306 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs @@ -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 + * 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 NotificationtestGetElementsV1ResponseMPayload + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NotificationtestGetElementsV1ResponseMPayloadTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NotificationtestGetElementsV1ResponseMPayload + //private NotificationtestGetElementsV1ResponseMPayload instance; + + public NotificationtestGetElementsV1ResponseMPayloadTests() + { + // TODO uncomment below to create an instance of NotificationtestGetElementsV1ResponseMPayload + //instance = new NotificationtestGetElementsV1ResponseMPayload(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NotificationtestGetElementsV1ResponseMPayload + /// + [Fact] + public void NotificationtestGetElementsV1ResponseMPayloadInstanceTest() + { + // TODO uncomment below to test "IsType" NotificationtestGetElementsV1ResponseMPayload + //Assert.IsType(instance); + } + + /// + /// Test the property 'AObjVariableobject' + /// + [Fact] + public void AObjVariableobjectTest() + { + // TODO unit test for the property 'AObjVariableobject' + } + + /// + /// Test the property 'PkiNotificationtestID' + /// + [Fact] + public void PkiNotificationtestIDTest() + { + // TODO unit test for the property 'PkiNotificationtestID' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 00000000000..1e19aa6b823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs new file mode 100644 index 00000000000..db8c9aa0956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -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 + * 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 NullableGuidClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableGuidClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableGuidClass + //private NullableGuidClass instance; + + public NullableGuidClassTests() + { + // TODO uncomment below to create an instance of NullableGuidClass + //instance = new NullableGuidClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableGuidClass + /// + [Fact] + public void NullableGuidClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableGuidClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 00000000000..e65ba44efa2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -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 + * 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 NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..2b88fb1a609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -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 + * 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 NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 00000000000..078655aaba7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs new file mode 100644 index 00000000000..8ef411a15eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs @@ -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 + * 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 OneOfString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OneOfStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OneOfString + //private OneOfString instance; + + public OneOfStringTests() + { + // TODO uncomment below to create an instance of OneOfString + //instance = new OneOfString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OneOfString + /// + [Fact] + public void OneOfStringInstanceTest() + { + // TODO uncomment below to test "IsType" OneOfString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..e7187bbdc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -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 + * 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 Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..0bb8ce5e5d9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -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 + * 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 OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 00000000000..a1d1e152777 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -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 + * 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 OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 00000000000..030326d7579 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -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 + * 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 OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 00000000000..1f3bfe459e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -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 + * 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 OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs new file mode 100644 index 00000000000..c4cb8eeecee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs @@ -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 + * 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 OuterEnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumTest + //private OuterEnumTest instance; + + public OuterEnumTestTests() + { + // TODO uncomment below to create an instance of OuterEnumTest + //instance = new OuterEnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumTest + /// + [Fact] + public void OuterEnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumTest + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..2859494010b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -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 + * 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 OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 00000000000..b0ebddd374f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -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 + * 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 ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 00000000000..8485d1213ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -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 + * 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 Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 00000000000..bd052bc705b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -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 + * 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 Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs new file mode 100644 index 00000000000..23120ba7bdf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -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 + * 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 PolymorphicProperty + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PolymorphicPropertyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PolymorphicProperty + //private PolymorphicProperty instance; + + public PolymorphicPropertyTests() + { + // TODO uncomment below to create an instance of PolymorphicProperty + //instance = new PolymorphicProperty(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PolymorphicProperty + /// + [Fact] + public void PolymorphicPropertyInstanceTest() + { + // TODO uncomment below to test "IsType" PolymorphicProperty + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 00000000000..2ddd31cfcbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -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 + * 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 QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 00000000000..65673847d75 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -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 + * 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 Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..a4c91cf44a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -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 + * 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 ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs new file mode 100644 index 00000000000..d1da68281ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -0,0 +1,452 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 RequiredClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClass + //private RequiredClass instance; + + public RequiredClassTests() + { + // TODO uncomment below to create an instance of RequiredClass + //instance = new RequiredClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClass + /// + [Fact] + public void RequiredClassInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'RequiredNotNullableDateProp' + /// + [Fact] + public void RequiredNotNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNotNullableDateProp' + } + + /// + /// Test the property 'RequiredNotnullableArrayOfString' + /// + [Fact] + public void RequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'RequiredNotnullableBooleanProp' + /// + [Fact] + public void RequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'RequiredNotnullableDatetimeProp' + /// + [Fact] + public void RequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNotnullableEnumInteger' + /// + [Fact] + public void RequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'RequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNotnullableEnumString' + /// + [Fact] + public void RequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumString' + } + + /// + /// Test the property 'RequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNotnullableStringProp' + /// + [Fact] + public void RequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'RequiredNotnullableStringProp' + } + + /// + /// Test the property 'RequiredNotnullableUuid' + /// + [Fact] + public void RequiredNotnullableUuidTest() + { + // TODO unit test for the property 'RequiredNotnullableUuid' + } + + /// + /// Test the property 'RequiredNotnullableintegerProp' + /// + [Fact] + public void RequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'RequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNotnullableDateProp' + /// + [Fact] + public void NotRequiredNotnullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableDateProp' + } + + /// + /// Test the property 'NotRequiredNotnullableintegerProp' + /// + [Fact] + public void NotRequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNullableDateProp' + /// + [Fact] + public void NotRequiredNullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNullableDateProp' + } + + /// + /// Test the property 'NotRequiredNullableIntegerProp' + /// + [Fact] + public void NotRequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'NotRequiredNullableIntegerProp' + } + + /// + /// Test the property 'NotrequiredNotnullableArrayOfString' + /// + [Fact] + public void NotrequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNotnullableBooleanProp' + /// + [Fact] + public void NotrequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNotnullableDatetimeProp' + /// + [Fact] + public void NotrequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumInteger' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumString' + /// + [Fact] + public void NotrequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumString' + } + + /// + /// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNotnullableStringProp' + /// + [Fact] + public void NotrequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableStringProp' + } + + /// + /// Test the property 'NotrequiredNotnullableUuid' + /// + [Fact] + public void NotrequiredNotnullableUuidTest() + { + // TODO unit test for the property 'NotrequiredNotnullableUuid' + } + + /// + /// Test the property 'NotrequiredNullableArrayOfString' + /// + [Fact] + public void NotrequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNullableBooleanProp' + /// + [Fact] + public void NotrequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNullableDatetimeProp' + /// + [Fact] + public void NotrequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNullableEnumInteger' + /// + [Fact] + public void NotrequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNullableEnumString' + /// + [Fact] + public void NotrequiredNullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumString' + } + + /// + /// Test the property 'NotrequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNullableStringProp' + /// + [Fact] + public void NotrequiredNullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNullableStringProp' + } + + /// + /// Test the property 'NotrequiredNullableUuid' + /// + [Fact] + public void NotrequiredNullableUuidTest() + { + // 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/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..bbea79ed951 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //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' + /// + [Fact] + public void VarReturnTest() + { + // 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/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 + * 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 RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashRoleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHashRole + //private RolesReportsHashRole instance; + + public RolesReportsHashRoleTests() + { + // TODO uncomment below to create an instance of RolesReportsHashRole + //instance = new RolesReportsHashRole(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 + * 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 RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHash + //private RolesReportsHash instance; + + public RolesReportsHashTests() + { + // TODO uncomment below to create an instance of RolesReportsHash + //instance = new RolesReportsHash(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 00000000000..085d3e550a1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -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 + * 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 ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 00000000000..62d6d69ff72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -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 + * 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 ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 00000000000..dc6970b16f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -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 + * 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 ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 00000000000..dbdf012c5ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -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 + * 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 Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 00000000000..baa6e1e9f6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -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 + * 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 SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..23763d9c3af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -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 + * 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 SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarSpecialModelName' + /// + [Fact] + public void VarSpecialModelNameTest() + { + // TODO unit test for the property 'VarSpecialModelName' + } + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 00000000000..fe7f3d82bab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -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 + * 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 Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..eca020ce1fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -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 + * 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 TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e3c86aefabe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -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 + * 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 TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -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 + * 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 TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 00000000000..1293a2b212e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -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 + * 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 TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 00000000000..4cb53522348 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -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 + * 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 Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 00000000000..6415f8561f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 00000000000..7d05cc5e59a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -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 + * 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 Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 00000000000..cd0d1c1c361 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -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 + * 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 Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs new file mode 100644 index 00000000000..b432edb28c2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs @@ -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 + * 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 ZeroBasedEnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClass + //private ZeroBasedEnumClass instance; + + public ZeroBasedEnumClassTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClass + //instance = new ZeroBasedEnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClass + /// + [Fact] + public void ZeroBasedEnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ZeroBasedEnum' + /// + [Fact] + public void ZeroBasedEnumTest() + { + // TODO unit test for the property 'ZeroBasedEnum' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs new file mode 100644 index 00000000000..3689a873c34 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnum + //private ZeroBasedEnum instance; + + public ZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnum + //instance = new ZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..c629057faad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,402 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IAnotherFakeApi : IApi + { + /// + /// The class containing the events + /// + AnotherFakeApiEvents Events { get; } + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICall123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class AnotherFakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCall123TestSpecialTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCall123TestSpecialTags; + + internal void ExecuteOnCall123TestSpecialTags(AnotherFakeApi.Call123TestSpecialTagsApiResponse apiResponse) + { + OnCall123TestSpecialTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCall123TestSpecialTags(Exception exception) + { + OnErrorCall123TestSpecialTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class AnotherFakeApi : IAnotherFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public AnotherFakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, AnotherFakeApiEvents anotherFakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = anotherFakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCall123TestSpecialTags(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCall123TestSpecialTags(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCall123TestSpecialTagsDefaultImplementation(ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterCall123TestSpecialTags(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCall123TestSpecialTags(ref bool suppressDefaultLog, ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorCall123TestSpecialTags(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await Call123TestSpecialTagsAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCall123TestSpecialTags(modelClient); + + FormatCall123TestSpecialTags(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + Call123TestSpecialTagsApiResponse apiResponseLocalVar = new Call123TestSpecialTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/another-fake/dummy", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCall123TestSpecialTagsDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnCall123TestSpecialTags(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCall123TestSpecialTagsDefaultImplementation(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorCall123TestSpecialTags(e); + throw; + } + } + + /// + /// The + /// + public partial class Call123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, ICall123TestSpecialTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public Call123TestSpecialTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..d58e3391473 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,1352 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task HelloAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Cancellation Token to cancel the request. + /// <> + Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task TestAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFooGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IDefault + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IGetCountryApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IHelloApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFooGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFooGet; + + internal void ExecuteOnFooGet(DefaultApi.FooGetApiResponse apiResponse) + { + OnFooGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFooGet(Exception exception) + { + OnErrorFooGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetCountry; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetCountry; + + internal void ExecuteOnGetCountry(DefaultApi.GetCountryApiResponse apiResponse) + { + OnGetCountry?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetCountry(Exception exception) + { + OnErrorGetCountry?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnHello; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorHello; + + internal void ExecuteOnHello(DefaultApi.HelloApiResponse apiResponse) + { + OnHello?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorHello(Exception exception) + { + OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(DefaultApi.RolesReportGetApiResponse apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTest; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTest; + + internal void ExecuteOnTest(DefaultApi.TestApiResponse apiResponse) + { + OnTest?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTest(Exception exception) + { + OnErrorTest?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFooGetDefaultImplementation(IFooGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFooGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFooGet(ref bool suppressDefaultLog, IFooGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFooGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFooGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFooGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FooGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FooGetApiResponse apiResponseLocalVar = new FooGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/foo", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFooGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFooGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFooGetDefaultImplementation(e, "/foo", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFooGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FooGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFooGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + /// + /// Deserializes the response if the response is 0 Default + /// + /// + public Org.OpenAPITools.Model.FooGetDefaultResponse Default() + { + // This logic may be modified with the AsModel.mustache template + return IsDefault + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 0 Default and the deserialized response is not null + /// + /// + /// + public bool TryDefault(out Org.OpenAPITools.Model.FooGetDefaultResponse result) + { + result = null; + + try + { + result = Default(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)0); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetCountry(ref string country); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetCountry(string country) + { + if (country == null) + throw new ArgumentNullException(nameof(country)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetCountryDefaultImplementation(IGetCountryApiResponse apiResponseLocalVar, string country) + { + bool suppressDefaultLog = false; + AfterGetCountry(ref suppressDefaultLog, apiResponseLocalVar, country); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetCountry(ref bool suppressDefaultLog, IGetCountryApiResponse apiResponseLocalVar, string country); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetCountryDefaultImplementation(Exception exception, string pathFormat, string path, string country) + { + bool suppressDefaultLog = false; + OnErrorGetCountry(ref suppressDefaultLog, exception, pathFormat, path, country); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetCountry(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string country); + + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetCountryAsync(country, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetCountry(country); + + FormatGetCountry(ref country); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetCountryApiResponse apiResponseLocalVar = new GetCountryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/country", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetCountryDefaultImplementation(apiResponseLocalVar, country); + + Events.ExecuteOnGetCountry(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetCountryDefaultImplementation(e, "/country", uriBuilderLocalVar.Path, country); + Events.ExecuteOnErrorGetCountry(e); + throw; + } + } + + /// + /// The + /// + public partial class GetCountryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetCountryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetCountryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterHelloDefaultImplementation(IHelloApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterHello(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterHello(ref bool suppressDefaultLog, IHelloApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorHelloDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorHello(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorHello(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Hello Hello + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await HelloAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + HelloApiResponse apiResponseLocalVar = new HelloApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/hello", requestedAtLocalVar, _jsonSerializerOptions); + + AfterHelloDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnHello(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHelloDefaultImplementation(e, "/hello", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorHello(e); + throw; + } + } + + /// + /// The + /// + public partial class HelloApiResponse : Org.OpenAPITools.Client.ApiResponse, IHelloApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(IRolesReportGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, IRolesReportGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RolesReportGetApiResponse apiResponseLocalVar = new RolesReportGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RolesReportGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRolesReportGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RolesReportGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterTestDefaultImplementation(ITestApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterTest(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterTest(ref bool suppressDefaultLog, ITestApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorTestDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorTest(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorTest(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/test"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestApiResponse apiResponseLocalVar = new TestApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnTest(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestDefaultImplementation(e, "/test", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorTest(e); + throw; + } + } + + /// + /// The + /// + public partial class TestApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 00000000000..f0ab0b4ca0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,5685 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeApi : IApi + { + /// + /// The class containing the events + /// + FakeApiEvents Events { get; } + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFakeHealthGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestClientModelApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestEndpointParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestEnumParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestGroupParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ITestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestJsonFormDataApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeHealthGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeHealthGet; + + internal void ExecuteOnFakeHealthGet(FakeApi.FakeHealthGetApiResponse apiResponse) + { + OnFakeHealthGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeHealthGet(Exception exception) + { + OnErrorFakeHealthGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterBooleanSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterBooleanSerialize; + + internal void ExecuteOnFakeOuterBooleanSerialize(FakeApi.FakeOuterBooleanSerializeApiResponse apiResponse) + { + OnFakeOuterBooleanSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterBooleanSerialize(Exception exception) + { + OnErrorFakeOuterBooleanSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterCompositeSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterCompositeSerialize; + + internal void ExecuteOnFakeOuterCompositeSerialize(FakeApi.FakeOuterCompositeSerializeApiResponse apiResponse) + { + OnFakeOuterCompositeSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterCompositeSerialize(Exception exception) + { + OnErrorFakeOuterCompositeSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterNumberSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterNumberSerialize; + + internal void ExecuteOnFakeOuterNumberSerialize(FakeApi.FakeOuterNumberSerializeApiResponse apiResponse) + { + OnFakeOuterNumberSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterNumberSerialize(Exception exception) + { + OnErrorFakeOuterNumberSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterStringSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterStringSerialize; + + internal void ExecuteOnFakeOuterStringSerialize(FakeApi.FakeOuterStringSerializeApiResponse apiResponse) + { + OnFakeOuterStringSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterStringSerialize(Exception exception) + { + OnErrorFakeOuterStringSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetArrayOfEnums; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetArrayOfEnums; + + internal void ExecuteOnGetArrayOfEnums(FakeApi.GetArrayOfEnumsApiResponse apiResponse) + { + OnGetArrayOfEnums?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetArrayOfEnums(Exception exception) + { + OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestAdditionalPropertiesReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestAdditionalPropertiesReference; + + internal void ExecuteOnTestAdditionalPropertiesReference(FakeApi.TestAdditionalPropertiesReferenceApiResponse apiResponse) + { + OnTestAdditionalPropertiesReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestAdditionalPropertiesReference(Exception exception) + { + OnErrorTestAdditionalPropertiesReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithFileSchema; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithFileSchema; + + internal void ExecuteOnTestBodyWithFileSchema(FakeApi.TestBodyWithFileSchemaApiResponse apiResponse) + { + OnTestBodyWithFileSchema?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithFileSchema(Exception exception) + { + OnErrorTestBodyWithFileSchema?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithQueryParams; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithQueryParams; + + internal void ExecuteOnTestBodyWithQueryParams(FakeApi.TestBodyWithQueryParamsApiResponse apiResponse) + { + OnTestBodyWithQueryParams?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithQueryParams(Exception exception) + { + OnErrorTestBodyWithQueryParams?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClientModel; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClientModel; + + internal void ExecuteOnTestClientModel(FakeApi.TestClientModelApiResponse apiResponse) + { + OnTestClientModel?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClientModel(Exception exception) + { + OnErrorTestClientModel?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEndpointParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEndpointParameters; + + internal void ExecuteOnTestEndpointParameters(FakeApi.TestEndpointParametersApiResponse apiResponse) + { + OnTestEndpointParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEndpointParameters(Exception exception) + { + OnErrorTestEndpointParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEnumParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEnumParameters; + + internal void ExecuteOnTestEnumParameters(FakeApi.TestEnumParametersApiResponse apiResponse) + { + OnTestEnumParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEnumParameters(Exception exception) + { + OnErrorTestEnumParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestGroupParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestGroupParameters; + + internal void ExecuteOnTestGroupParameters(FakeApi.TestGroupParametersApiResponse apiResponse) + { + OnTestGroupParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestGroupParameters(Exception exception) + { + OnErrorTestGroupParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineAdditionalProperties; + + internal void ExecuteOnTestInlineAdditionalProperties(FakeApi.TestInlineAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineAdditionalProperties(Exception exception) + { + OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(FakeApi.TestInlineFreeformAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestJsonFormData; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestJsonFormData; + + internal void ExecuteOnTestJsonFormData(FakeApi.TestJsonFormDataApiResponse apiResponse) + { + OnTestJsonFormData?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestJsonFormData(Exception exception) + { + OnErrorTestJsonFormData?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestQueryParameterCollectionFormat; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestQueryParameterCollectionFormat; + + internal void ExecuteOnTestQueryParameterCollectionFormat(FakeApi.TestQueryParameterCollectionFormatApiResponse apiResponse) + { + OnTestQueryParameterCollectionFormat?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception exception) + { + OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeApi : IFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeApiEvents fakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFakeHealthGetDefaultImplementation(IFakeHealthGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFakeHealthGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFakeHealthGet(ref bool suppressDefaultLog, IFakeHealthGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFakeHealthGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFakeHealthGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFakeHealthGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Health check endpoint + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeHealthGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeHealthGetApiResponse apiResponseLocalVar = new FakeHealthGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/health", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeHealthGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFakeHealthGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeHealthGetDefaultImplementation(e, "/fake/health", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFakeHealthGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeHealthGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeHealthGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.HealthCheckResult Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.HealthCheckResult result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterBooleanSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterBooleanSerializeDefaultImplementation(IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterBooleanSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterBooleanSerialize(ref bool suppressDefaultLog, IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterBooleanSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterBooleanSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterBooleanSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterBooleanSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterBooleanSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterBooleanSerializeApiResponse apiResponseLocalVar = new FakeOuterBooleanSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/boolean", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterBooleanSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterBooleanSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterBooleanSerializeDefaultImplementation(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterBooleanSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterBooleanSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public bool? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out bool? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterCompositeSerialize(Option outerComposite); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterCompositeSerialize(Option outerComposite) + { + if (outerComposite.IsSet && outerComposite.Value == null) + throw new ArgumentNullException(nameof(outerComposite)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterCompositeSerializeDefaultImplementation(IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite) + { + bool suppressDefaultLog = false; + AfterFakeOuterCompositeSerialize(ref suppressDefaultLog, apiResponseLocalVar, outerComposite); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterCompositeSerialize(ref bool suppressDefaultLog, IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterCompositeSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option outerComposite) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterCompositeSerialize(ref suppressDefaultLog, exception, pathFormat, path, outerComposite); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterCompositeSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option outerComposite); + + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterCompositeSerializeAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterCompositeSerialize(outerComposite); + + FormatFakeOuterCompositeSerialize(outerComposite); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if (outerComposite.IsSet) + httpRequestMessageLocalVar.Content = (outerComposite.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterCompositeSerializeApiResponse apiResponseLocalVar = new FakeOuterCompositeSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/composite", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterCompositeSerializeDefaultImplementation(apiResponseLocalVar, outerComposite); + + Events.ExecuteOnFakeOuterCompositeSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterCompositeSerializeDefaultImplementation(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); + Events.ExecuteOnErrorFakeOuterCompositeSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterCompositeSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.OuterComposite Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.OuterComposite result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterNumberSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterNumberSerializeDefaultImplementation(IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterNumberSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterNumberSerialize(ref bool suppressDefaultLog, IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterNumberSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterNumberSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterNumberSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterNumberSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterNumberSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterNumberSerializeApiResponse apiResponseLocalVar = new FakeOuterNumberSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/number", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterNumberSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterNumberSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterNumberSerializeDefaultImplementation(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterNumberSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterNumberSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public decimal? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out decimal? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterStringSerialize(ref Guid requiredStringUuid, ref Option body); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterStringSerialize(Option body) + { + if (body.IsSet && body.Value == null) + throw new ArgumentNullException(nameof(body)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterFakeOuterStringSerializeDefaultImplementation(IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterStringSerialize(ref suppressDefaultLog, apiResponseLocalVar, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterFakeOuterStringSerialize(ref bool suppressDefaultLog, IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorFakeOuterStringSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterStringSerialize(ref suppressDefaultLog, exception, pathFormat, path, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterStringSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body); + + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterStringSerializeAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterStringSerialize(body); + + FormatFakeOuterStringSerialize(ref requiredStringUuid, ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_uuid"] = ClientUtils.ParameterToString(requiredStringUuid); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterStringSerializeApiResponse apiResponseLocalVar = new FakeOuterStringSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/string", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterStringSerializeDefaultImplementation(apiResponseLocalVar, requiredStringUuid, body); + + Events.ExecuteOnFakeOuterStringSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterStringSerializeDefaultImplementation(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); + Events.ExecuteOnErrorFakeOuterStringSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterStringSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetArrayOfEnumsDefaultImplementation(IGetArrayOfEnumsApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetArrayOfEnums(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetArrayOfEnums(ref bool suppressDefaultLog, IGetArrayOfEnumsApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetArrayOfEnumsDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetArrayOfEnums(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetArrayOfEnums(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Array of Enums + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetArrayOfEnumsAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetArrayOfEnumsApiResponse apiResponseLocalVar = new GetArrayOfEnumsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/array-of-enums", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetArrayOfEnumsDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetArrayOfEnums(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetArrayOfEnumsDefaultImplementation(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetArrayOfEnums(e); + throw; + } + } + + /// + /// The + /// + public partial class GetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetArrayOfEnumsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new GetMixedAnyOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new GetMixedOneOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestAdditionalPropertiesReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestAdditionalPropertiesReferenceDefaultImplementation(ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestAdditionalPropertiesReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestAdditionalPropertiesReference(ref bool suppressDefaultLog, ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestAdditionalPropertiesReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestAdditionalPropertiesReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAdditionalPropertiesReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestAdditionalPropertiesReference(requestBody); + + FormatTestAdditionalPropertiesReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/additionalProperties-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar = new TestAdditionalPropertiesReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/additionalProperties-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestAdditionalPropertiesReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestAdditionalPropertiesReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(e, "/fake/additionalProperties-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestAdditionalPropertiesReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestAdditionalPropertiesReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestAdditionalPropertiesReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + { + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestBodyWithFileSchemaDefaultImplementation(ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + AfterTestBodyWithFileSchema(ref suppressDefaultLog, apiResponseLocalVar, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestBodyWithFileSchema(ref bool suppressDefaultLog, ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithFileSchemaDefaultImplementation(Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithFileSchema(ref suppressDefaultLog, exception, pathFormat, path, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithFileSchema(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass); + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithFileSchemaAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithFileSchema(fileSchemaTestClass); + + FormatTestBodyWithFileSchema(fileSchemaTestClass); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithFileSchemaApiResponse apiResponseLocalVar = new TestBodyWithFileSchemaApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-file-schema", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithFileSchemaDefaultImplementation(apiResponseLocalVar, fileSchemaTestClass); + + Events.ExecuteOnTestBodyWithFileSchema(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithFileSchemaDefaultImplementation(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); + Events.ExecuteOnErrorTestBodyWithFileSchema(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithFileSchemaApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithFileSchemaApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithQueryParams(User user, ref string query); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestBodyWithQueryParams(User user, string query) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (query == null) + throw new ArgumentNullException(nameof(query)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query) + { + bool suppressDefaultLog = false; + AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, user, query); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, User user, string query) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, user, query); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string query); + + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithQueryParamsAsync(user, query, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithQueryParams(user, query); + + FormatTestBodyWithQueryParams(user, ref query); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["query"] = ClientUtils.ParameterToString(query); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithQueryParamsApiResponse apiResponseLocalVar = new TestBodyWithQueryParamsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-query-params", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, user, query); + + Events.ExecuteOnTestBodyWithQueryParams(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); + Events.ExecuteOnErrorTestBodyWithQueryParams(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithQueryParamsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithQueryParamsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestClientModel(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClientModel(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClientModelDefaultImplementation(ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClientModel(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClientModel(ref bool suppressDefaultLog, ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClientModelDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClientModel(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClientModel(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test \"client\" model To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClientModelAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClientModel(modelClient); + + FormatTestClientModel(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClientModelApiResponse apiResponseLocalVar = new TestClientModelApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClientModelDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClientModel(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClientModelDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClientModel(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClientModelApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClientModelApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEndpointParameters(ref byte[] varByte, ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref Option date, ref Option binary, ref Option varFloat, ref Option integer, ref Option int32, ref Option int64, ref Option varString, ref Option password, ref Option callback, ref Option dateTime); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + { + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary)); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString)); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); + + if (callback.IsSet && callback.Value == null) + throw new ArgumentNullException(nameof(callback)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + + FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(varByte))); + + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(varDouble))); + + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + if (date.IsSet) + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date.Value))); + + if (binary.IsSet) + multipartContentLocalVar.Add(new StreamContent(binary.Value)); + + if (varFloat.IsSet) + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(varFloat.Value))); + + if (integer.IsSet) + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer.Value))); + + if (int32.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32.Value))); + + if (int64.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64.Value))); + + if (varString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(varString.Value))); + + if (password.IsSet) + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password.Value))); + + if (callback.IsSet) + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback.Value))); + + if (dateTime.IsSet) + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEndpointParametersApiResponse apiResponseLocalVar = new TestEndpointParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEndpointParametersDefaultImplementation(apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + + Events.ExecuteOnTestEndpointParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEndpointParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + Events.ExecuteOnErrorTestEndpointParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEndpointParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEndpointParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEndpointParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, Option> enumFormStringArray, ref Option enumHeaderString, ref Option enumQueryString, ref Option enumFormString); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); + + if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) + throw new ArgumentNullException(nameof(enumQueryStringArray)); + + if (enumFormStringArray.IsSet && enumFormStringArray.Value == null) + throw new ArgumentNullException(nameof(enumFormStringArray)); + + if (enumHeaderString.IsSet && enumHeaderString.Value == null) + throw new ArgumentNullException(nameof(enumHeaderString)); + + if (enumQueryString.IsSet && enumQueryString.Value == null) + throw new ArgumentNullException(nameof(enumQueryString)); + + if (enumFormString.IsSet && enumFormString.Value == null) + throw new ArgumentNullException(nameof(enumFormString)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + bool suppressDefaultLog = false; + AfterTestEnumParameters(ref suppressDefaultLog, apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEnumParametersDefaultImplementation(Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + bool suppressDefaultLog = false; + OnErrorTestEnumParameters(ref suppressDefaultLog, exception, pathFormat, path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEnumParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString); + + /// + /// To test enum parameters To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + + FormatTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, ref enumQueryDouble, ref enumQueryInteger, enumFormStringArray, ref enumHeaderString, ref enumQueryString, ref enumFormString); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if (enumQueryStringArray.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); + + if (enumQueryDouble.IsSet) + // here too + parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); + + if (enumQueryInteger.IsSet) + // here too + parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); + + if (enumQueryString.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (enumHeaderStringArray.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray.Value)); + + if (enumHeaderString.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString.Value)); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray.Value))); + + if (enumFormString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString.Value))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEnumParametersApiResponse apiResponseLocalVar = new TestEnumParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEnumParametersDefaultImplementation(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + + Events.ExecuteOnTestEnumParameters(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEnumParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + Events.ExecuteOnErrorTestEnumParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEnumParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEnumParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEnumParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestGroupParameters(ref bool requiredBooleanGroup, ref int requiredStringGroup, ref long requiredInt64Group, ref Option booleanGroup, ref Option stringGroup, ref Option int64Group); + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestGroupParametersDefaultImplementation(ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + AfterTestGroupParameters(ref suppressDefaultLog, apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestGroupParameters(ref bool suppressDefaultLog, ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestGroupParametersDefaultImplementation(Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + OnErrorTestGroupParameters(ref suppressDefaultLog, exception, pathFormat, path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestGroupParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatTestGroupParameters(ref requiredBooleanGroup, ref requiredStringGroup, ref requiredInt64Group, ref booleanGroup, ref stringGroup, ref int64Group); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_group"] = ClientUtils.ParameterToString(requiredStringGroup); + parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); + + if (stringGroup.IsSet) + // here too + parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); + + if (int64Group.IsSet) + // here too + parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup.IsSet) + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestGroupParametersApiResponse apiResponseLocalVar = new TestGroupParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestGroupParametersDefaultImplementation(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + + Events.ExecuteOnTestGroupParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestGroupParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + Events.ExecuteOnErrorTestGroupParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestGroupParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestGroupParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestGroupParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineAdditionalProperties(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineAdditionalProperties(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineAdditionalPropertiesDefaultImplementation(ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestInlineAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineAdditionalProperties(ref bool suppressDefaultLog, ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestInlineAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test inline additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineAdditionalPropertiesAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineAdditionalProperties(requestBody); + + FormatTestInlineAdditionalProperties(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestInlineAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineAdditionalPropertiesDefaultImplementation(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestInlineAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineFreeformAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineFreeformAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineFreeformAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestJsonFormData(ref string param, ref string param2); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestJsonFormData(string param, string param2) + { + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestJsonFormDataDefaultImplementation(ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2) + { + bool suppressDefaultLog = false; + AfterTestJsonFormData(ref suppressDefaultLog, apiResponseLocalVar, param, param2); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestJsonFormData(ref bool suppressDefaultLog, ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestJsonFormDataDefaultImplementation(Exception exception, string pathFormat, string path, string param, string param2) + { + bool suppressDefaultLog = false; + OnErrorTestJsonFormData(ref suppressDefaultLog, exception, pathFormat, path, param, param2); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestJsonFormData(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string param, string param2); + + /// + /// test json serialization of form data + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestJsonFormDataAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestJsonFormData(param, param2); + + FormatTestJsonFormData(ref param, ref param2); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestJsonFormDataApiResponse apiResponseLocalVar = new TestJsonFormDataApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/jsonFormData", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestJsonFormDataDefaultImplementation(apiResponseLocalVar, param, param2); + + Events.ExecuteOnTestJsonFormData(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestJsonFormDataDefaultImplementation(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); + Events.ExecuteOnErrorTestJsonFormData(e); + throw; + } + } + + /// + /// The + /// + public partial class TestJsonFormDataApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestJsonFormDataApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestJsonFormDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ref string requiredNotNullable, ref string requiredNullable, ref Option notRequiredNotNullable, ref Option notRequiredNullable); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + { + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + if (requiredNotNullable == null) + throw new ArgumentNullException(nameof(requiredNotNullable)); + + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestQueryParameterCollectionFormatDefaultImplementation(ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + AfterTestQueryParameterCollectionFormat(ref suppressDefaultLog, apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestQueryParameterCollectionFormatDefaultImplementation(Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + OnErrorTestQueryParameterCollectionFormat(ref suppressDefaultLog, exception, pathFormat, path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + + FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["pipe"] = ClientUtils.ParameterToString(pipe); + parseQueryStringLocalVar["ioutil"] = ClientUtils.ParameterToString(ioutil); + parseQueryStringLocalVar["http"] = ClientUtils.ParameterToString(http); + parseQueryStringLocalVar["url"] = ClientUtils.ParameterToString(url); + parseQueryStringLocalVar["context"] = ClientUtils.ParameterToString(context); + parseQueryStringLocalVar["requiredNotNullable"] = ClientUtils.ParameterToString(requiredNotNullable); + parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); + + if (notRequiredNotNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); + + if (notRequiredNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestQueryParameterCollectionFormatApiResponse apiResponseLocalVar = new TestQueryParameterCollectionFormatApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/test-query-parameters", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestQueryParameterCollectionFormatDefaultImplementation(apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + + Events.ExecuteOnTestQueryParameterCollectionFormat(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestQueryParameterCollectionFormatDefaultImplementation(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + Events.ExecuteOnErrorTestQueryParameterCollectionFormat(e); + throw; + } + } + + /// + /// The + /// + public partial class TestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestQueryParameterCollectionFormatApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestQueryParameterCollectionFormatApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new TestStringMapReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..1d5bd38c527 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,415 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// The class containing the events + /// + FakeClassnameTags123ApiEvents Events { get; } + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ITestClassnameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeClassnameTags123ApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClassname; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClassname; + + internal void ExecuteOnTestClassname(FakeClassnameTags123Api.TestClassnameApiResponse apiResponse) + { + OnTestClassname?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClassname(Exception exception) + { + OnErrorTestClassname?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeClassnameTags123ApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeClassnameTags123ApiEvents fakeClassnameTags123ApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeClassnameTags123ApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatTestClassname(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClassname(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClassnameDefaultImplementation(ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClassname(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClassname(ref bool suppressDefaultLog, ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClassnameDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClassname(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClassname(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test class name in snake case To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClassnameAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClassname(modelClient); + + FormatTestClassname(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + + apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClassnameApiResponse apiResponseLocalVar = new TestClassnameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake_classname_test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClassnameDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClassname(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClassnameDefaultImplementation(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClassname(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClassnameApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClassnameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClassnameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 00000000000..9693c8ffacd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2784 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IPetApi : IApi + { + /// + /// The class containing the events + /// + PetApiEvents Events { get; } + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IAddPetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IDeletePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByStatusApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IGetPetByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IUpdatePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUpdatePetWithFormApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUploadFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IUploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PetApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnAddPet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorAddPet; + + internal void ExecuteOnAddPet(PetApi.AddPetApiResponse apiResponse) + { + OnAddPet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorAddPet(Exception exception) + { + OnErrorAddPet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeletePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeletePet; + + internal void ExecuteOnDeletePet(PetApi.DeletePetApiResponse apiResponse) + { + OnDeletePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeletePet(Exception exception) + { + OnErrorDeletePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByStatus; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByStatus; + + internal void ExecuteOnFindPetsByStatus(PetApi.FindPetsByStatusApiResponse apiResponse) + { + OnFindPetsByStatus?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByStatus(Exception exception) + { + OnErrorFindPetsByStatus?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByTags; + + internal void ExecuteOnFindPetsByTags(PetApi.FindPetsByTagsApiResponse apiResponse) + { + OnFindPetsByTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByTags(Exception exception) + { + OnErrorFindPetsByTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetPetById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetPetById; + + internal void ExecuteOnGetPetById(PetApi.GetPetByIdApiResponse apiResponse) + { + OnGetPetById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetPetById(Exception exception) + { + OnErrorGetPetById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePet; + + internal void ExecuteOnUpdatePet(PetApi.UpdatePetApiResponse apiResponse) + { + OnUpdatePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePet(Exception exception) + { + OnErrorUpdatePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePetWithForm; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePetWithForm; + + internal void ExecuteOnUpdatePetWithForm(PetApi.UpdatePetWithFormApiResponse apiResponse) + { + OnUpdatePetWithForm?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePetWithForm(Exception exception) + { + OnErrorUpdatePetWithForm?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFile; + + internal void ExecuteOnUploadFile(PetApi.UploadFileApiResponse apiResponse) + { + OnUploadFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFile(Exception exception) + { + OnErrorUploadFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFileWithRequiredFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFileWithRequiredFile; + + internal void ExecuteOnUploadFileWithRequiredFile(PetApi.UploadFileWithRequiredFileApiResponse apiResponse) + { + OnUploadFileWithRequiredFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFileWithRequiredFile(Exception exception) + { + OnErrorUploadFileWithRequiredFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class PetApi : IPetApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PetApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PetApiEvents petApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = petApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatAddPet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateAddPet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterAddPetDefaultImplementation(IAddPetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterAddPet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterAddPet(ref bool suppressDefaultLog, IAddPetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorAddPetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorAddPet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorAddPet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await AddPetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateAddPet(pet); + + FormatAddPet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + AddPetApiResponse apiResponseLocalVar = new AddPetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterAddPetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnAddPet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorAddPetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorAddPet(e); + throw; + } + } + + /// + /// The + /// + public partial class AddPetApiResponse : Org.OpenAPITools.Client.ApiResponse, IAddPetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public AddPetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeletePet(ref long petId, ref Option apiKey); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeletePet(Option apiKey) + { + if (apiKey.IsSet && apiKey.Value == null) + throw new ArgumentNullException(nameof(apiKey)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDeletePetDefaultImplementation(IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + AfterDeletePet(ref suppressDefaultLog, apiResponseLocalVar, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDeletePet(ref bool suppressDefaultLog, IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDeletePetDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + OnErrorDeletePet(ref suppressDefaultLog, exception, pathFormat, path, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDeletePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option apiKey); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeletePetAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeletePet(apiKey); + + FormatDeletePet(ref petId, ref apiKey); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeletePetApiResponse apiResponseLocalVar = new DeletePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeletePetDefaultImplementation(apiResponseLocalVar, petId, apiKey); + + Events.ExecuteOnDeletePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeletePetDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); + Events.ExecuteOnErrorDeletePet(e); + throw; + } + } + + /// + /// The + /// + public partial class DeletePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeletePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeletePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByStatus(List status); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByStatus(List status) + { + if (status == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByStatusDefaultImplementation(IFindPetsByStatusApiResponse apiResponseLocalVar, List status) + { + bool suppressDefaultLog = false; + AfterFindPetsByStatus(ref suppressDefaultLog, apiResponseLocalVar, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByStatus(ref bool suppressDefaultLog, IFindPetsByStatusApiResponse apiResponseLocalVar, List status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByStatusDefaultImplementation(Exception exception, string pathFormat, string path, List status) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByStatus(ref suppressDefaultLog, exception, pathFormat, path, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByStatus(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List status); + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByStatusAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByStatus(status); + + FormatFindPetsByStatus(status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["status"] = ClientUtils.ParameterToString(status); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByStatusApiResponse apiResponseLocalVar = new FindPetsByStatusApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByStatus", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByStatusDefaultImplementation(apiResponseLocalVar, status); + + Events.ExecuteOnFindPetsByStatus(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByStatusDefaultImplementation(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); + Events.ExecuteOnErrorFindPetsByStatus(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByStatusApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByStatusApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByTags(List tags); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByTags(List tags) + { + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByTagsDefaultImplementation(IFindPetsByTagsApiResponse apiResponseLocalVar, List tags) + { + bool suppressDefaultLog = false; + AfterFindPetsByTags(ref suppressDefaultLog, apiResponseLocalVar, tags); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByTags(ref bool suppressDefaultLog, IFindPetsByTagsApiResponse apiResponseLocalVar, List tags); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByTagsDefaultImplementation(Exception exception, string pathFormat, string path, List tags) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByTags(ref suppressDefaultLog, exception, pathFormat, path, tags); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List tags); + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByTagsAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByTags(tags); + + FormatFindPetsByTags(tags); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["tags"] = ClientUtils.ParameterToString(tags); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByTagsApiResponse apiResponseLocalVar = new FindPetsByTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByTags", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByTagsDefaultImplementation(apiResponseLocalVar, tags); + + Events.ExecuteOnFindPetsByTags(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByTagsDefaultImplementation(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); + Events.ExecuteOnErrorFindPetsByTags(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetPetById(ref long petId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetPetByIdDefaultImplementation(IGetPetByIdApiResponse apiResponseLocalVar, long petId) + { + bool suppressDefaultLog = false; + AfterGetPetById(ref suppressDefaultLog, apiResponseLocalVar, petId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetPetById(ref bool suppressDefaultLog, IGetPetByIdApiResponse apiResponseLocalVar, long petId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetPetByIdDefaultImplementation(Exception exception, string pathFormat, string path, long petId) + { + bool suppressDefaultLog = false; + OnErrorGetPetById(ref suppressDefaultLog, exception, pathFormat, path, petId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetPetById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId); + + /// + /// Find pet by ID Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetPetByIdAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetPetById(ref petId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + + apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetPetByIdApiResponse apiResponseLocalVar = new GetPetByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetPetByIdDefaultImplementation(apiResponseLocalVar, petId); + + Events.ExecuteOnGetPetById(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetPetByIdDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); + Events.ExecuteOnErrorGetPetById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetPetByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetPetByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Pet Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Pet result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateUpdatePet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterUpdatePetDefaultImplementation(IUpdatePetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterUpdatePet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterUpdatePet(ref bool suppressDefaultLog, IUpdatePetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorUpdatePetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorUpdatePet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePet(pet); + + FormatUpdatePet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetApiResponse apiResponseLocalVar = new UpdatePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnUpdatePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorUpdatePet(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePetWithForm(ref long petId, ref Option name, ref Option status); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatePetWithForm(Option name, Option status) + { + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUpdatePetWithFormDefaultImplementation(IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + AfterUpdatePetWithForm(ref suppressDefaultLog, apiResponseLocalVar, petId, name, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUpdatePetWithForm(ref bool suppressDefaultLog, IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatePetWithFormDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + OnErrorUpdatePetWithForm(ref suppressDefaultLog, exception, pathFormat, path, petId, name, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePetWithForm(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option name, Option status); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetWithFormAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePetWithForm(name, status); + + FormatUpdatePetWithForm(ref petId, ref name, ref status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name.IsSet) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name.Value))); + + if (status.IsSet) + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetWithFormApiResponse apiResponseLocalVar = new UpdatePetWithFormApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetWithFormDefaultImplementation(apiResponseLocalVar, petId, name, status); + + Events.ExecuteOnUpdatePetWithForm(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetWithFormDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); + Events.ExecuteOnErrorUpdatePetWithForm(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetWithFormApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetWithFormApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetWithFormApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFile(ref long petId, ref Option file, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFile(Option file, Option additionalMetadata) + { + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileDefaultImplementation(IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFile(ref suppressDefaultLog, apiResponseLocalVar, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFile(ref bool suppressDefaultLog, IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFile(ref suppressDefaultLog, exception, pathFormat, path, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata); + + /// + /// uploads an image + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFile(file, additionalMetadata); + + FormatUploadFile(ref petId, ref file, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file.IsSet) + multipartContentLocalVar.Add(new StreamContent(file.Value)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileApiResponse apiResponseLocalVar = new UploadFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}/uploadImage", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileDefaultImplementation(apiResponseLocalVar, petId, file, additionalMetadata); + + Events.ExecuteOnUploadFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileDefaultImplementation(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); + Events.ExecuteOnErrorUploadFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFileWithRequiredFile(ref System.IO.Stream requiredFile, ref long petId, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFileWithRequiredFile(System.IO.Stream requiredFile, Option additionalMetadata) + { + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileWithRequiredFileDefaultImplementation(IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFileWithRequiredFile(ref suppressDefaultLog, apiResponseLocalVar, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFileWithRequiredFile(ref bool suppressDefaultLog, IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileWithRequiredFileDefaultImplementation(Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFileWithRequiredFile(ref suppressDefaultLog, exception, pathFormat, path, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFileWithRequiredFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// uploads an image (required) + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFileWithRequiredFile(requiredFile, additionalMetadata); + + FormatUploadFileWithRequiredFile(ref requiredFile, ref petId, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileWithRequiredFileApiResponse apiResponseLocalVar = new UploadFileWithRequiredFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/{petId}/uploadImageWithRequiredFile", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileWithRequiredFileDefaultImplementation(apiResponseLocalVar, requiredFile, petId, additionalMetadata); + + Events.ExecuteOnUploadFileWithRequiredFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileWithRequiredFileDefaultImplementation(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); + Events.ExecuteOnErrorUploadFileWithRequiredFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileWithRequiredFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 00000000000..4e9980c869e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,1197 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IStoreApi : IApi + { + /// + /// The class containing the events + /// + StoreApiEvents Events { get; } + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteOrderApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetInventoryApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetOrderByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IPlaceOrderApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class StoreApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteOrder; + + internal void ExecuteOnDeleteOrder(StoreApi.DeleteOrderApiResponse apiResponse) + { + OnDeleteOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteOrder(Exception exception) + { + OnErrorDeleteOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetInventory; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetInventory; + + internal void ExecuteOnGetInventory(StoreApi.GetInventoryApiResponse apiResponse) + { + OnGetInventory?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetInventory(Exception exception) + { + OnErrorGetInventory?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetOrderById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetOrderById; + + internal void ExecuteOnGetOrderById(StoreApi.GetOrderByIdApiResponse apiResponse) + { + OnGetOrderById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetOrderById(Exception exception) + { + OnErrorGetOrderById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPlaceOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPlaceOrder; + + internal void ExecuteOnPlaceOrder(StoreApi.PlaceOrderApiResponse apiResponse) + { + OnPlaceOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPlaceOrder(Exception exception) + { + OnErrorPlaceOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class StoreApi : IStoreApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public StoreApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, StoreApiEvents storeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = storeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatDeleteOrder(ref string orderId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteOrder(string orderId) + { + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteOrderDefaultImplementation(IDeleteOrderApiResponse apiResponseLocalVar, string orderId) + { + bool suppressDefaultLog = false; + AfterDeleteOrder(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteOrder(ref bool suppressDefaultLog, IDeleteOrderApiResponse apiResponseLocalVar, string orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteOrderDefaultImplementation(Exception exception, string pathFormat, string path, string orderId) + { + bool suppressDefaultLog = false; + OnErrorDeleteOrder(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteOrderAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteOrder(orderId); + + FormatDeleteOrder(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteOrderApiResponse apiResponseLocalVar = new DeleteOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteOrderDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnDeleteOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteOrderDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorDeleteOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetInventoryDefaultImplementation(IGetInventoryApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetInventory(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetInventory(ref bool suppressDefaultLog, IGetInventoryApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetInventoryDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetInventory(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetInventory(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetInventoryAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetInventoryApiResponse apiResponseLocalVar = new GetInventoryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/inventory", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetInventoryDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetInventory(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetInventoryDefaultImplementation(e, "/store/inventory", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetInventory(e); + throw; + } + } + + /// + /// The + /// + public partial class GetInventoryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetInventoryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Dictionary Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Dictionary result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetOrderById(ref long orderId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetOrderByIdDefaultImplementation(IGetOrderByIdApiResponse apiResponseLocalVar, long orderId) + { + bool suppressDefaultLog = false; + AfterGetOrderById(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetOrderById(ref bool suppressDefaultLog, IGetOrderByIdApiResponse apiResponseLocalVar, long orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetOrderByIdDefaultImplementation(Exception exception, string pathFormat, string path, long orderId) + { + bool suppressDefaultLog = false; + OnErrorGetOrderById(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetOrderById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetOrderByIdAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetOrderById(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetOrderByIdApiResponse apiResponseLocalVar = new GetOrderByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetOrderByIdDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnGetOrderById(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetOrderByIdDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorGetOrderById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetOrderByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetOrderByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPlaceOrder(Order order); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidatePlaceOrder(Order order) + { + if (order == null) + throw new ArgumentNullException(nameof(order)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterPlaceOrderDefaultImplementation(IPlaceOrderApiResponse apiResponseLocalVar, Order order) + { + bool suppressDefaultLog = false; + AfterPlaceOrder(ref suppressDefaultLog, apiResponseLocalVar, order); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterPlaceOrder(ref bool suppressDefaultLog, IPlaceOrderApiResponse apiResponseLocalVar, Order order); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorPlaceOrderDefaultImplementation(Exception exception, string pathFormat, string path, Order order) + { + bool suppressDefaultLog = false; + OnErrorPlaceOrder(ref suppressDefaultLog, exception, pathFormat, path, order); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorPlaceOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Order order); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PlaceOrderAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePlaceOrder(order); + + FormatPlaceOrder(order); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PlaceOrderApiResponse apiResponseLocalVar = new PlaceOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPlaceOrderDefaultImplementation(apiResponseLocalVar, order); + + Events.ExecuteOnPlaceOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPlaceOrderDefaultImplementation(e, "/store/order", uriBuilderLocalVar.Path, order); + Events.ExecuteOnErrorPlaceOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class PlaceOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IPlaceOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 00000000000..721984089ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,2223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IUserApi : IApi + { + /// + /// The class containing the events + /// + UserApiEvents Events { get; } + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICreateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IDeleteUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetUserByNameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk, ICustomHttpStatusCode599 + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + bool IsCustomHttpStatusCode598 { get; } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + bool IsCustomHttpStatusCode599 { get; } + } + + /// + /// The + /// + public interface ILoginUserApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ILogoutUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IUpdateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UserApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUser; + + internal void ExecuteOnCreateUser(UserApi.CreateUserApiResponse apiResponse) + { + OnCreateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUser(Exception exception) + { + OnErrorCreateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithArrayInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithArrayInput; + + internal void ExecuteOnCreateUsersWithArrayInput(UserApi.CreateUsersWithArrayInputApiResponse apiResponse) + { + OnCreateUsersWithArrayInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithArrayInput(Exception exception) + { + OnErrorCreateUsersWithArrayInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithListInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithListInput; + + internal void ExecuteOnCreateUsersWithListInput(UserApi.CreateUsersWithListInputApiResponse apiResponse) + { + OnCreateUsersWithListInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithListInput(Exception exception) + { + OnErrorCreateUsersWithListInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteUser; + + internal void ExecuteOnDeleteUser(UserApi.DeleteUserApiResponse apiResponse) + { + OnDeleteUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteUser(Exception exception) + { + OnErrorDeleteUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetUserByName; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetUserByName; + + internal void ExecuteOnGetUserByName(UserApi.GetUserByNameApiResponse apiResponse) + { + OnGetUserByName?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetUserByName(Exception exception) + { + OnErrorGetUserByName?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLoginUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLoginUser; + + internal void ExecuteOnLoginUser(UserApi.LoginUserApiResponse apiResponse) + { + OnLoginUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLoginUser(Exception exception) + { + OnErrorLoginUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLogoutUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLogoutUser; + + internal void ExecuteOnLogoutUser(UserApi.LogoutUserApiResponse apiResponse) + { + OnLogoutUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLogoutUser(Exception exception) + { + OnErrorLogoutUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateUser; + + internal void ExecuteOnUpdateUser(UserApi.UpdateUserApiResponse apiResponse) + { + OnUpdateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdateUser(Exception exception) + { + OnErrorUpdateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class UserApi : IUserApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public UserApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UserApiEvents userApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = userApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCreateUser(User user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUser(User user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUserDefaultImplementation(ICreateUserApiResponse apiResponseLocalVar, User user) + { + bool suppressDefaultLog = false; + AfterCreateUser(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUser(ref bool suppressDefaultLog, ICreateUserApiResponse apiResponseLocalVar, User user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user) + { + bool suppressDefaultLog = false; + OnErrorCreateUser(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user); + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUserAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUser(user); + + FormatCreateUser(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUserApiResponse apiResponseLocalVar = new CreateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUserDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUserDefaultImplementation(e, "/user", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithArrayInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithArrayInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithArrayInputDefaultImplementation(ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithArrayInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithArrayInput(ref bool suppressDefaultLog, ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithArrayInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithArrayInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithArrayInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithArrayInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithArrayInput(user); + + FormatCreateUsersWithArrayInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithArrayInputApiResponse apiResponseLocalVar = new CreateUsersWithArrayInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithArray", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithArrayInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithArrayInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithArrayInputDefaultImplementation(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithArrayInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithArrayInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithArrayInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithListInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithListInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithListInputDefaultImplementation(ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithListInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithListInput(ref bool suppressDefaultLog, ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithListInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithListInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithListInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithListInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithListInput(user); + + FormatCreateUsersWithListInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithListInputApiResponse apiResponseLocalVar = new CreateUsersWithListInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithList", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithListInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithListInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithListInputDefaultImplementation(e, "/user/createWithList", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithListInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithListInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithListInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeleteUser(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteUser(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteUserDefaultImplementation(IDeleteUserApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterDeleteUser(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteUser(ref bool suppressDefaultLog, IDeleteUserApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteUserDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorDeleteUser(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteUserAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteUser(username); + + FormatDeleteUser(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteUserApiResponse apiResponseLocalVar = new DeleteUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteUserDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnDeleteUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorDeleteUser(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetUserByName(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetUserByName(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetUserByNameDefaultImplementation(IGetUserByNameApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterGetUserByName(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetUserByName(ref bool suppressDefaultLog, IGetUserByNameApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetUserByNameDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorGetUserByName(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetUserByName(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetUserByNameAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetUserByName(username); + + FormatGetUserByName(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetUserByNameApiResponse apiResponseLocalVar = new GetUserByNameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetUserByNameDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnGetUserByName(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetUserByNameDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorGetUserByName(e); + throw; + } + } + + /// + /// The + /// + public partial class GetUserByNameApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetUserByNameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.User Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + public bool IsCustomHttpStatusCode598 => 598 == (int)StatusCode; + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + public bool IsCustomHttpStatusCode599 => 599 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 599 CustomHttpStatusCode599 + /// + /// + public Org.OpenAPITools.Model.User CustomHttpStatusCode599() + { + // This logic may be modified with the AsModel.mustache template + return IsCustomHttpStatusCode599 + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + public bool TryCustomHttpStatusCode599(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = CustomHttpStatusCode599(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)599); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatLoginUser(ref string username, ref string password); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateLoginUser(string username, string password) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterLoginUserDefaultImplementation(ILoginUserApiResponse apiResponseLocalVar, string username, string password) + { + bool suppressDefaultLog = false; + AfterLoginUser(ref suppressDefaultLog, apiResponseLocalVar, username, password); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterLoginUser(ref bool suppressDefaultLog, ILoginUserApiResponse apiResponseLocalVar, string username, string password); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorLoginUserDefaultImplementation(Exception exception, string pathFormat, string path, string username, string password) + { + bool suppressDefaultLog = false; + OnErrorLoginUser(ref suppressDefaultLog, exception, pathFormat, path, username, password); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorLoginUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username, string password); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LoginUserAsync(username, password, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateLoginUser(username, password); + + FormatLoginUser(ref username, ref password); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["username"] = ClientUtils.ParameterToString(username); + parseQueryStringLocalVar["password"] = ClientUtils.ParameterToString(password); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LoginUserApiResponse apiResponseLocalVar = new LoginUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/login", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLoginUserDefaultImplementation(apiResponseLocalVar, username, password); + + Events.ExecuteOnLoginUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLoginUserDefaultImplementation(e, "/user/login", uriBuilderLocalVar.Path, username, password); + Events.ExecuteOnErrorLoginUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LoginUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILoginUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterLogoutUserDefaultImplementation(ILogoutUserApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterLogoutUser(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterLogoutUser(ref bool suppressDefaultLog, ILogoutUserApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorLogoutUserDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorLogoutUser(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorLogoutUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Logs out current logged in user session + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LogoutUserAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LogoutUserApiResponse apiResponseLocalVar = new LogoutUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/logout", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLogoutUserDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnLogoutUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLogoutUserDefaultImplementation(e, "/user/logout", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorLogoutUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LogoutUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILogoutUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LogoutUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateUser(User user, ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdateUser(User user, string username) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdateUserDefaultImplementation(IUpdateUserApiResponse apiResponseLocalVar, User user, string username) + { + bool suppressDefaultLog = false; + AfterUpdateUser(ref suppressDefaultLog, apiResponseLocalVar, user, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdateUser(ref bool suppressDefaultLog, IUpdateUserApiResponse apiResponseLocalVar, User user, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user, string username) + { + bool suppressDefaultLog = false; + OnErrorUpdateUser(ref suppressDefaultLog, exception, pathFormat, path, user, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string username); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateUserAsync(user, username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateUser(user, username); + + FormatUpdateUser(user, ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdateUserApiResponse apiResponseLocalVar = new UpdateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdateUserDefaultImplementation(apiResponseLocalVar, user, username); + + Events.ExecuteOnUpdateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdateUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); + Events.ExecuteOnErrorUpdateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..fdd11dd19c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiException.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 00000000000..b8bdf9964ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..63c4e7c4bc3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICustomHttpStatusCode599 : IApiResponse + { + /// + /// Deserializes the response if the response is CustomHttpStatusCode599 + /// + /// + TType CustomHttpStatusCode599(); + + /// + /// Returns true if the response is CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + bool TryCustomHttpStatusCode599(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IDefault : IApiResponse + { + /// + /// Deserializes the response if the response is Default + /// + /// + TType Default(); + + /// + /// Returns true if the response is Default and the deserialized response is not null + /// + /// + /// + bool TryDefault(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 00000000000..c58c0563231 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 00000000000..df5c2310bac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..9cb9620cc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,427 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + /// + /// The api_key header + /// + Api_key, + /// + /// The api_key_query header + /// + Api_key_query + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) + { + switch(value) + { + case ApiKeyHeader.Api_key: + return "api_key"; + case ApiKeyHeader.Api_key_query: + return "api_key_query"; + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ChildCat.PetTypeEnum childCatPetTypeEnum) + return ChildCat.PetTypeEnumToJsonValue(childCatPetTypeEnum); + if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum) + return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum); + if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum) + return EnumArrays.JustSymbolEnumToJsonValue(enumArraysJustSymbolEnum); + if (obj is EnumClass enumClass) + return EnumClassValueConverter.ToJsonValue(enumClass); + if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum) + return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum); + if (obj is EnumTest.EnumIntegerEnum enumTestEnumIntegerEnum) + return EnumTest.EnumIntegerEnumToJsonValue(enumTestEnumIntegerEnum).ToString(); + if (obj is EnumTest.EnumIntegerOnlyEnum enumTestEnumIntegerOnlyEnum) + return EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTestEnumIntegerOnlyEnum).ToString(); + if (obj is EnumTest.EnumNumberEnum enumTestEnumNumberEnum) + return EnumTest.EnumNumberEnumToJsonValue(enumTestEnumNumberEnum).ToString(); + if (obj is EnumTest.EnumStringEnum enumTestEnumStringEnum) + return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum); + if (obj is MapTest.InnerEnum mapTestInnerEnum) + return MapTest.InnerEnumToJsonValue(mapTestInnerEnum); + if (obj is Order.StatusEnum orderStatusEnum) + return Order.StatusEnumToJsonValue(orderStatusEnum); + if (obj is OuterEnum outerEnum) + return OuterEnumValueConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerValueConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is OuterEnumTest outerEnumTest) + return OuterEnumTestValueConverter.ToJsonValue(outerEnumTest); + if (obj is Pet.StatusEnum petStatusEnum) + return Pet.StatusEnumToJsonValue(petStatusEnum); + if (obj is RequiredClass.RequiredNotnullableEnumIntegerEnum requiredClassRequiredNotnullableEnumIntegerEnum) + return RequiredClass.RequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum requiredClassRequiredNotnullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) + return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); + if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) + return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) + return RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.NotrequiredNotnullableEnumStringEnum requiredClassNotrequiredNotnullableEnumStringEnum) + return RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClassNotrequiredNotnullableEnumStringEnum); + if (obj is RequiredClass.NotrequiredNullableEnumIntegerEnum requiredClassNotrequiredNullableEnumIntegerEnum) + return RequiredClass.NotrequiredNullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum requiredClassNotrequiredNullableEnumIntegerOnlyEnum) + 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) + return ZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnum); + if (obj is ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnumClassZeroBasedEnumEnum) + return ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClassZeroBasedEnumEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..973f9e9d4e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..b491c61f07f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..e12f1ae9779 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,249 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ActivityJsonConverter()); + _jsonOptions.Converters.Add(new ActivityOutputElementRepresentationJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new AnimalJsonConverter()); + _jsonOptions.Converters.Add(new ApiResponseJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new AppleReqJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayTestJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new BananaReqJsonConverter()); + _jsonOptions.Converters.Add(new BasquePigJsonConverter()); + _jsonOptions.Converters.Add(new CapitalizationJsonConverter()); + _jsonOptions.Converters.Add(new CatJsonConverter()); + _jsonOptions.Converters.Add(new CategoryJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatJsonConverter()); + _jsonOptions.Converters.Add(new ClassModelJsonConverter()); + _jsonOptions.Converters.Add(new ComplexQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new DanishPigJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyClassJsonConverter()); + _jsonOptions.Converters.Add(new DeprecatedObjectJsonConverter()); + _jsonOptions.Converters.Add(new DogJsonConverter()); + _jsonOptions.Converters.Add(new DrawingJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestJsonConverter()); + _jsonOptions.Converters.Add(new EquilateralTriangleJsonConverter()); + _jsonOptions.Converters.Add(new FileJsonConverter()); + _jsonOptions.Converters.Add(new FileSchemaTestClassJsonConverter()); + _jsonOptions.Converters.Add(new FooJsonConverter()); + _jsonOptions.Converters.Add(new FooGetDefaultResponseJsonConverter()); + _jsonOptions.Converters.Add(new FormatTestJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + _jsonOptions.Converters.Add(new FruitReqJsonConverter()); + _jsonOptions.Converters.Add(new GmFruitJsonConverter()); + _jsonOptions.Converters.Add(new GrandparentAnimalJsonConverter()); + _jsonOptions.Converters.Add(new HasOnlyReadOnlyJsonConverter()); + _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); + _jsonOptions.Converters.Add(new MammalJsonConverter()); + _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); + _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); + _jsonOptions.Converters.Add(new ModelClientJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new NotificationtestGetElementsV1ResponseMPayloadJsonConverter()); + _jsonOptions.Converters.Add(new NullableClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableGuidClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableShapeJsonConverter()); + _jsonOptions.Converters.Add(new NumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ObjectWithDeprecatedFieldsJsonConverter()); + _jsonOptions.Converters.Add(new OneOfStringJsonConverter()); + _jsonOptions.Converters.Add(new OrderJsonConverter()); + _jsonOptions.Converters.Add(new OuterCompositeJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestNullableJsonConverter()); + _jsonOptions.Converters.Add(new ParentPetJsonConverter()); + _jsonOptions.Converters.Add(new PetJsonConverter()); + _jsonOptions.Converters.Add(new PigJsonConverter()); + _jsonOptions.Converters.Add(new PolymorphicPropertyJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassJsonConverter()); + _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); + _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ShapeJsonConverter()); + _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ShapeOrNullJsonConverter()); + _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); + _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); + _jsonOptions.Converters.Add(new TriangleJsonConverter()); + _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new UserJsonConverter()); + _jsonOptions.Converters.Add(new WhaleJsonConverter()); + _jsonOptions.Converters.Add(new ZebraJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 00000000000..53f435c05f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,641 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPhrase = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 format + return null; + } + + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 00000000000..b6301dc17c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,41 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 00000000000..ec4d08e9c99 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..8cf79a713b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/Option.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..534f27a8cc5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, Channel.CreateBounded(options)); + } + } + else + { + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + } + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..36d7dad03e2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..dce7b971eaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..40eeffc9676 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..c82fea7a865 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..428d69dd8ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -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 + * 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 +{ + /// + /// test map of maps + /// + public partial class Activity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + [JsonConstructor] + public Activity(Option>> activityOutputs = default) + { + ActivityOutputsOption = activityOutputs; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ActivityOutputs + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ActivityOutputsOption { get; private set; } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get { return this.ActivityOutputsOption; } set { this.ActivityOutputsOption = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 ActivityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Activity 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>> activityOutputs = 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 "activity_outputs": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (activityOutputs.IsSet && activityOutputs.Value == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is not nullable for class Activity."); + + return new Activity(activityOutputs); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activity.ActivityOutputsOption.IsSet) + { + writer.WritePropertyName("activity_outputs"); + JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs new file mode 100644 index 00000000000..8ae65f50c23 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,207 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + [JsonConstructor] + public ActivityOutputElementRepresentation(Option prop1 = default, Option prop2 = default) + { + Prop1Option = prop1; + Prop2Option = prop2; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Prop1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop1Option { get; private set; } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get { return this.Prop1Option; } set { this.Prop1Option = new Option(value); } } + + /// + /// Used to track the state of Prop2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop2Option { get; private set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get { return this.Prop2Option; } set { this.Prop2Option = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ActivityOutputElementRepresentation 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 prop1 = default; + Option prop2 = 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 "prop1": + prop1 = new Option(utf8JsonReader.GetString()); + break; + case "prop2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (prop1.IsSet && prop1.Value == null) + throw new ArgumentNullException(nameof(prop1), "Property is not nullable for class ActivityOutputElementRepresentation."); + + if (prop2.IsSet && prop2.Value == null) + throw new ArgumentNullException(nameof(prop2), "Property is not nullable for class ActivityOutputElementRepresentation."); + + return new ActivityOutputElementRepresentation(prop1, prop2); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activityOutputElementRepresentation.Prop2Option.IsSet && activityOutputElementRepresentation.Prop2 == null) + throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop2), "Property is required for class ActivityOutputElementRepresentation."); + + if (activityOutputElementRepresentation.Prop1Option.IsSet) + writer.WriteString("prop1", activityOutputElementRepresentation.Prop1); + + if (activityOutputElementRepresentation.Prop2Option.IsSet) + { + writer.WritePropertyName("prop2"); + JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d7857e4aad8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,400 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AdditionalPropertiesClass + /// + public partial class AdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// anytype1 + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// mapOfMapProperty + /// mapProperty + /// mapWithUndeclaredPropertiesAnytype1 + /// mapWithUndeclaredPropertiesAnytype2 + /// mapWithUndeclaredPropertiesAnytype3 + /// mapWithUndeclaredPropertiesString + [JsonConstructor] + public AdditionalPropertiesClass(Option anytype1 = default, Option emptyMap = default, Option>> mapOfMapProperty = default, Option> mapProperty = default, Option mapWithUndeclaredPropertiesAnytype1 = default, Option mapWithUndeclaredPropertiesAnytype2 = default, Option> mapWithUndeclaredPropertiesAnytype3 = default, Option> mapWithUndeclaredPropertiesString = default) + { + Anytype1Option = anytype1; + EmptyMapOption = emptyMap; + MapOfMapPropertyOption = mapOfMapProperty; + MapPropertyOption = mapProperty; + MapWithUndeclaredPropertiesAnytype1Option = mapWithUndeclaredPropertiesAnytype1; + MapWithUndeclaredPropertiesAnytype2Option = mapWithUndeclaredPropertiesAnytype2; + MapWithUndeclaredPropertiesAnytype3Option = mapWithUndeclaredPropertiesAnytype3; + MapWithUndeclaredPropertiesStringOption = mapWithUndeclaredPropertiesString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Anytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Anytype1Option { get; private set; } + + /// + /// Gets or Sets Anytype1 + /// + [JsonPropertyName("anytype_1")] + public Object Anytype1 { get { return this.Anytype1Option; } set { this.Anytype1Option = new Option(value); } } + + /// + /// Used to track the state of EmptyMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmptyMapOption { get; private set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [JsonPropertyName("empty_map")] + public Object EmptyMap { get { return this.EmptyMapOption; } set { this.EmptyMapOption = new Option(value); } } + + /// + /// Used to track the state of MapOfMapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapOfMapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [JsonPropertyName("map_of_map_property")] + public Dictionary> MapOfMapProperty { get { return this.MapOfMapPropertyOption; } set { this.MapOfMapPropertyOption = new Option>>(value); } } + + /// + /// Used to track the state of MapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapProperty + /// + [JsonPropertyName("map_property")] + public Dictionary MapProperty { get { return this.MapPropertyOption; } set { this.MapPropertyOption = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype1Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_1")] + public Object MapWithUndeclaredPropertiesAnytype1 { get { return this.MapWithUndeclaredPropertiesAnytype1Option; } set { this.MapWithUndeclaredPropertiesAnytype1Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype2Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_2")] + public Object MapWithUndeclaredPropertiesAnytype2 { get { return this.MapWithUndeclaredPropertiesAnytype2Option; } set { this.MapWithUndeclaredPropertiesAnytype2Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype3 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesAnytype3Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_3")] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get { return this.MapWithUndeclaredPropertiesAnytype3Option; } set { this.MapWithUndeclaredPropertiesAnytype3Option = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesStringOption { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [JsonPropertyName("map_with_undeclared_properties_string")] + public Dictionary MapWithUndeclaredPropertiesString { get { return this.MapWithUndeclaredPropertiesStringOption; } set { this.MapWithUndeclaredPropertiesStringOption = 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 AdditionalPropertiesClass {\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).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 AdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AdditionalPropertiesClass 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 anytype1 = default; + Option emptyMap = default; + Option>> mapOfMapProperty = default; + Option> mapProperty = default; + Option mapWithUndeclaredPropertiesAnytype1 = default; + Option mapWithUndeclaredPropertiesAnytype2 = default; + Option> mapWithUndeclaredPropertiesAnytype3 = default; + Option> mapWithUndeclaredPropertiesString = 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 "anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "empty_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_3": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (emptyMap.IsSet && emptyMap.Value == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapOfMapProperty.IsSet && mapOfMapProperty.Value == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapProperty.IsSet && mapProperty.Value == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1.IsSet && mapWithUndeclaredPropertiesAnytype1.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2.IsSet && mapWithUndeclaredPropertiesAnytype2.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3.IsSet && mapWithUndeclaredPropertiesAnytype3.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString.IsSet && mapWithUndeclaredPropertiesString.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is not nullable for class AdditionalPropertiesClass."); + + return new AdditionalPropertiesClass(anytype1, emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet && additionalPropertiesClass.MapOfMapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapPropertyOption.IsSet && additionalPropertiesClass.MapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.Anytype1Option.IsSet) + if (additionalPropertiesClass.Anytype1Option.Value != null) + { + writer.WritePropertyName("anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions); + } + else + writer.WriteNull("anytype_1"); + if (additionalPropertiesClass.EmptyMapOption.IsSet) + { + writer.WritePropertyName("empty_map"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet) + { + writer.WritePropertyName("map_of_map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapPropertyOption.IsSet) + { + writer.WritePropertyName("map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_2"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_3"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_string"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 00000000000..6abbd41a281 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Animal + /// + public partial class Animal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + [JsonConstructor] + public Animal(Option color = default) + { + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Animal {\n"); + sb.Append(" Color: ").Append(Color).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Animal 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 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) + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Animal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Animal."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); + + return new Animal(color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, animal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + { + if (animal.ColorOption.IsSet && animal.Color == null) + throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); + + writer.WriteString("className", animal.ClassName); + + if (animal.ColorOption.IsSet) + writer.WriteString("color", animal.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 00000000000..f6fa613cbbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,230 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ApiResponse + /// + public partial class ApiResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code + /// message + /// type + [JsonConstructor] + public ApiResponse(Option code = default, Option message = default, Option type = default) + { + CodeOption = code; + MessageOption = message; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } + + /// + /// Gets or Sets Code + /// + [JsonPropertyName("code")] + public int? Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of Message + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageOption { get; private set; } + + /// + /// Gets or Sets Message + /// + [JsonPropertyName("message")] + public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [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 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 ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ApiResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ApiResponse 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 code = default; + Option message = default; + Option type = 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 "code": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = new Option(utf8JsonReader.GetInt32()); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class ApiResponse."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class ApiResponse."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApiResponse."); + + return new ApiResponse(code, message, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apiResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apiResponse.TypeOption.IsSet && apiResponse.Type == null) + throw new ArgumentNullException(nameof(apiResponse.Type), "Property is required for class ApiResponse."); + + if (apiResponse.CodeOption.IsSet) + writer.WriteNumber("code", apiResponse.CodeOption.Value.Value); + + if (apiResponse.MessageOption.IsSet) + writer.WriteString("message", apiResponse.Message); + + if (apiResponse.TypeOption.IsSet) + writer.WriteString("type", apiResponse.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..e0c09dbf5f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// colorCode + /// cultivar + /// origin + [JsonConstructor] + public Apple(Option colorCode = default, Option cultivar = default, Option origin = default) + { + ColorCodeOption = colorCode; + CultivarOption = cultivar; + OriginOption = origin; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ColorCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorCodeOption { get; private set; } + + /// + /// Gets or Sets ColorCode + /// + [JsonPropertyName("color_code")] + public string ColorCode { get { return this.ColorCodeOption; } set { this.ColorCodeOption = new Option(value); } } + + /// + /// Used to track the state of Cultivar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CultivarOption { get; private set; } + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get { return this.CultivarOption; } set { this.CultivarOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } + + /// + /// Gets or Sets Origin + /// + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = 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 Apple {\n"); + sb.Append(" ColorCode: ").Append(ColorCode).Append("\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).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) + { + if (this.ColorCodeOption.Value != null) { + // ColorCode (string) pattern + Regex regexColorCode = new Regex(@"^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$", RegexOptions.CultureInvariant); + + if (this.ColorCodeOption.Value != null &&!regexColorCode.Match(this.ColorCodeOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ColorCode, must match a pattern of " + regexColorCode, new [] { "ColorCode" }); + } + } + + if (this.CultivarOption.Value != null) { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); + + if (this.CultivarOption.Value != null &&!regexCultivar.Match(this.CultivarOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + } + + if (this.OriginOption.Value != null) { + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.OriginOption.Value != null &&!regexOrigin.Match(this.OriginOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 colorCode = default; + Option cultivar = default; + Option origin = 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 "color_code": + colorCode = new Option(utf8JsonReader.GetString()); + break; + case "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (colorCode.IsSet && colorCode.Value == null) + throw new ArgumentNullException(nameof(colorCode), "Property is not nullable for class Apple."); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class Apple."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class Apple."); + + return new Apple(colorCode, cultivar, origin); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.CultivarOption.IsSet && apple.Cultivar == null) + throw new ArgumentNullException(nameof(apple.Cultivar), "Property is required for class Apple."); + + if (apple.OriginOption.IsSet && apple.Origin == null) + throw new ArgumentNullException(nameof(apple.Origin), "Property is required for class Apple."); + + if (apple.ColorCodeOption.IsSet) + writer.WriteString("color_code", apple.ColorCode); + + if (apple.CultivarOption.IsSet) + writer.WriteString("cultivar", apple.Cultivar); + + if (apple.OriginOption.IsSet) + writer.WriteString("origin", apple.Origin); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 00000000000..7f69b627038 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AppleReq + /// + public partial class AppleReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar + /// mealy + [JsonConstructor] + public AppleReq(string cultivar, Option mealy = default) + { + Cultivar = cultivar; + MealyOption = mealy; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get; set; } + + /// + /// Used to track the state of Mealy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MealyOption { get; private set; } + + /// + /// Gets or Sets Mealy + /// + [JsonPropertyName("mealy")] + public bool? Mealy { get { return this.MealyOption; } set { this.MealyOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).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 AppleReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AppleReq 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 cultivar = default; + Option mealy = 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 "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "mealy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!cultivar.IsSet) + throw new ArgumentException("Property is required for class AppleReq.", nameof(cultivar)); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class AppleReq."); + + if (mealy.IsSet && mealy.Value == null) + throw new ArgumentNullException(nameof(mealy), "Property is not nullable for class AppleReq."); + + return new AppleReq(cultivar.Value, mealy); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, appleReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("cultivar", appleReq.Cultivar); + + if (appleReq.MealyOption.IsSet) + writer.WriteBoolean("mealy", appleReq.MealyOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..9f6f55f4bc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + public partial class ArrayOfArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber + [JsonConstructor] + public ArrayOfArrayOfNumberOnly(Option>> arrayArrayNumber = default) + { + ArrayArrayNumberOption = arrayArrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [JsonPropertyName("ArrayArrayNumber")] + public List> ArrayArrayNumber { get { return this.ArrayArrayNumberOption; } set { this.ArrayArrayNumberOption = 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 ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).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 ArrayOfArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfArrayOfNumberOnly 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>> arrayArrayNumber = 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 "ArrayArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayNumber.IsSet && arrayArrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is not nullable for class ArrayOfArrayOfNumberOnly."); + + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..3e38c89877d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfNumberOnly + /// + public partial class ArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber + [JsonConstructor] + public ArrayOfNumberOnly(Option> arrayNumber = default) + { + ArrayNumberOption = arrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayNumber + /// + [JsonPropertyName("ArrayNumber")] + public List ArrayNumber { get { return this.ArrayNumberOption; } set { this.ArrayNumberOption = 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 ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).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 ArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfNumberOnly 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> arrayNumber = 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 "ArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayNumber.IsSet && arrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is not nullable for class ArrayOfNumberOnly."); + + return new ArrayOfNumberOnly(arrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfNumberOnly.ArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 00000000000..8ddbe4d6309 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,242 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ArrayTest + /// + public partial class ArrayTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayOfInteger + /// arrayArrayOfModel + /// arrayOfString + [JsonConstructor] + public ArrayTest(Option>> arrayArrayOfInteger = default, Option>> arrayArrayOfModel = default, Option> arrayOfString = default) + { + ArrayArrayOfIntegerOption = arrayArrayOfInteger; + ArrayArrayOfModelOption = arrayArrayOfModel; + ArrayOfStringOption = arrayOfString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayOfInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfIntegerOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [JsonPropertyName("array_array_of_integer")] + public List> ArrayArrayOfInteger { get { return this.ArrayArrayOfIntegerOption; } set { this.ArrayArrayOfIntegerOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayArrayOfModel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfModelOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [JsonPropertyName("array_array_of_model")] + public List> ArrayArrayOfModel { get { return this.ArrayArrayOfModelOption; } set { this.ArrayArrayOfModelOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets ArrayOfString + /// + [JsonPropertyName("array_of_string")] + public List ArrayOfString { get { return this.ArrayOfStringOption; } set { this.ArrayOfStringOption = 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 ArrayTest {\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).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 ArrayTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayTest 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>> arrayArrayOfInteger = default; + Option>> arrayArrayOfModel = default; + Option> arrayOfString = 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 "array_array_of_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_array_of_model": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayOfInteger.IsSet && arrayArrayOfInteger.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is not nullable for class ArrayTest."); + + if (arrayArrayOfModel.IsSet && arrayArrayOfModel.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is not nullable for class ArrayTest."); + + if (arrayOfString.IsSet && arrayOfString.Value == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is not nullable for class ArrayTest."); + + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayTest.ArrayArrayOfModelOption.IsSet && arrayTest.ArrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfModel), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayOfStringOption.IsSet && arrayTest.ArrayOfString == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayOfString), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayArrayOfIntegerOption.IsSet) + { + writer.WritePropertyName("array_array_of_integer"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions); + } + if (arrayTest.ArrayArrayOfModelOption.IsSet) + { + writer.WritePropertyName("array_array_of_model"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions); + } + if (arrayTest.ArrayOfStringOption.IsSet) + { + writer.WritePropertyName("array_of_string"); + JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..8fc9c71c574 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -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 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + [JsonConstructor] + public Banana(Option lengthCm = default) + { + LengthCmOption = lengthCm; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of LengthCm + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LengthCmOption { get; private set; } + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal? LengthCm { get { return this.LengthCmOption; } set { this.LengthCmOption = 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 Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 lengthCm = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class Banana."); + + return new Banana(lengthCm); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 00000000000..e4a3a99aafa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,187 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BananaReq + /// + public partial class BananaReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + /// sweet + [JsonConstructor] + public BananaReq(decimal lengthCm, Option sweet = default) + { + LengthCm = lengthCm; + SweetOption = sweet; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal LengthCm { get; set; } + + /// + /// Used to track the state of Sweet + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SweetOption { get; private set; } + + /// + /// Gets or Sets Sweet + /// + [JsonPropertyName("sweet")] + public bool? Sweet { get { return this.SweetOption; } set { this.SweetOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).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 BananaReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BananaReq 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 lengthCm = default; + Option sweet = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + case "sweet": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!lengthCm.IsSet) + throw new ArgumentException("Property is required for class BananaReq.", nameof(lengthCm)); + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class BananaReq."); + + if (sweet.IsSet && sweet.Value == null) + throw new ArgumentNullException(nameof(sweet), "Property is not nullable for class BananaReq."); + + return new BananaReq(lengthCm.Value.Value, sweet); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, bananaReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteNumber("lengthCm", bananaReq.LengthCm); + + if (bananaReq.SweetOption.IsSet) + writer.WriteBoolean("sweet", bananaReq.SweetOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 00000000000..9938d89e008 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BasquePig + /// + public partial class BasquePig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public BasquePig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 BasquePigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BasquePig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class BasquePig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class BasquePig."); + + return new BasquePig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, basquePig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", basquePig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 00000000000..ddf4f67e04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -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 + * 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 +{ + /// + /// Capitalization + /// + public partial class Capitalization : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the pet + /// capitalCamel + /// capitalSnake + /// sCAETHFlowPoints + /// smallCamel + /// smallSnake + [JsonConstructor] + public Capitalization(Option aTTNAME = default, Option capitalCamel = default, Option capitalSnake = default, Option sCAETHFlowPoints = default, Option smallCamel = default, Option smallSnake = default) + { + ATT_NAMEOption = aTTNAME; + CapitalCamelOption = capitalCamel; + CapitalSnakeOption = capitalSnake; + SCAETHFlowPointsOption = sCAETHFlowPoints; + SmallCamelOption = smallCamel; + SmallSnakeOption = smallSnake; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ATT_NAME + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ATT_NAMEOption { get; private set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [JsonPropertyName("ATT_NAME")] + public string ATT_NAME { get { return this.ATT_NAMEOption; } set { this.ATT_NAMEOption = new Option(value); } } + + /// + /// Used to track the state of CapitalCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalCamelOption { get; private set; } + + /// + /// Gets or Sets CapitalCamel + /// + [JsonPropertyName("CapitalCamel")] + public string CapitalCamel { get { return this.CapitalCamelOption; } set { this.CapitalCamelOption = new Option(value); } } + + /// + /// Used to track the state of CapitalSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalSnakeOption { get; private set; } + + /// + /// Gets or Sets CapitalSnake + /// + [JsonPropertyName("Capital_Snake")] + public string CapitalSnake { get { return this.CapitalSnakeOption; } set { this.CapitalSnakeOption = new Option(value); } } + + /// + /// Used to track the state of SCAETHFlowPoints + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SCAETHFlowPointsOption { get; private set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [JsonPropertyName("SCA_ETH_Flow_Points")] + public string SCAETHFlowPoints { get { return this.SCAETHFlowPointsOption; } set { this.SCAETHFlowPointsOption = new Option(value); } } + + /// + /// Used to track the state of SmallCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallCamelOption { get; private set; } + + /// + /// Gets or Sets SmallCamel + /// + [JsonPropertyName("smallCamel")] + public string SmallCamel { get { return this.SmallCamelOption; } set { this.SmallCamelOption = new Option(value); } } + + /// + /// Used to track the state of SmallSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallSnakeOption { get; private set; } + + /// + /// Gets or Sets SmallSnake + /// + [JsonPropertyName("small_Snake")] + public string SmallSnake { get { return this.SmallSnakeOption; } set { this.SmallSnakeOption = 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 Capitalization {\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).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 CapitalizationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Capitalization 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 aTTNAME = default; + Option capitalCamel = default; + Option capitalSnake = default; + Option sCAETHFlowPoints = default; + Option smallCamel = default; + Option smallSnake = 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 "ATT_NAME": + aTTNAME = new Option(utf8JsonReader.GetString()); + break; + case "CapitalCamel": + capitalCamel = new Option(utf8JsonReader.GetString()); + break; + case "Capital_Snake": + capitalSnake = new Option(utf8JsonReader.GetString()); + break; + case "SCA_ETH_Flow_Points": + sCAETHFlowPoints = new Option(utf8JsonReader.GetString()); + break; + case "smallCamel": + smallCamel = new Option(utf8JsonReader.GetString()); + break; + case "small_Snake": + smallSnake = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (aTTNAME.IsSet && aTTNAME.Value == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization."); + + if (capitalCamel.IsSet && capitalCamel.Value == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization."); + + if (capitalSnake.IsSet && capitalSnake.Value == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization."); + + if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization."); + + if (smallCamel.IsSet && smallCamel.Value == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization."); + + if (smallSnake.IsSet && smallSnake.Value == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization."); + + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, capitalization, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (capitalization.CapitalCamelOption.IsSet && capitalization.CapitalCamel == null) + throw new ArgumentNullException(nameof(capitalization.CapitalCamel), "Property is required for class Capitalization."); + + if (capitalization.CapitalSnakeOption.IsSet && capitalization.CapitalSnake == null) + throw new ArgumentNullException(nameof(capitalization.CapitalSnake), "Property is required for class Capitalization."); + + if (capitalization.SCAETHFlowPointsOption.IsSet && capitalization.SCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(capitalization.SCAETHFlowPoints), "Property is required for class Capitalization."); + + if (capitalization.SmallCamelOption.IsSet && capitalization.SmallCamel == null) + throw new ArgumentNullException(nameof(capitalization.SmallCamel), "Property is required for class Capitalization."); + + if (capitalization.SmallSnakeOption.IsSet && capitalization.SmallSnake == null) + throw new ArgumentNullException(nameof(capitalization.SmallSnake), "Property is required for class Capitalization."); + + if (capitalization.ATT_NAMEOption.IsSet) + writer.WriteString("ATT_NAME", capitalization.ATT_NAME); + + if (capitalization.CapitalCamelOption.IsSet) + writer.WriteString("CapitalCamel", capitalization.CapitalCamel); + + if (capitalization.CapitalSnakeOption.IsSet) + writer.WriteString("Capital_Snake", capitalization.CapitalSnake); + + if (capitalization.SCAETHFlowPointsOption.IsSet) + writer.WriteString("SCA_ETH_Flow_Points", capitalization.SCAETHFlowPoints); + + if (capitalization.SmallCamelOption.IsSet) + writer.WriteString("smallCamel", capitalization.SmallCamel); + + if (capitalization.SmallSnakeOption.IsSet) + writer.WriteString("small_Snake", capitalization.SmallSnake); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 00000000000..d11d16c855e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Cat + /// + public partial class Cat : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + /// declawed + [JsonConstructor] + public Cat(Option color = default, Option declawed = default) : base(color) + { + DeclawedOption = declawed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeclawedOption { get; private set; } + + /// + /// Gets or Sets Declawed + /// + [JsonPropertyName("declawed")] + public bool? Declawed { get { return this.DeclawedOption; } set { this.DeclawedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Cat 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 className = default; + Option color = default; + Option declawed = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "declawed": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Cat.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Cat."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Cat."); + + if (declawed.IsSet && declawed.Value == null) + throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); + + return new Cat(color, declawed); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + if (cat.ColorOption.IsSet && cat.Color == null) + throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); + + writer.WriteString("className", cat.ClassName); + + if (cat.ColorOption.IsSet) + writer.WriteString("color", cat.Color); + + if (cat.DeclawedOption.IsSet) + writer.WriteBoolean("declawed", cat.DeclawedOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 00000000000..1708429172a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,196 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Category + /// + public partial class Category : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name (default to "default-name") + [JsonConstructor] + public Category(Option id = default, string name = @"default-name") + { + IdOption = id; + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// 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 Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 CategoryJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Category 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Category.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Category."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Category."); + + return new Category(id, name.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, category, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (category.IdOption.IsSet) + writer.WriteNumber("id", category.IdOption.Value.Value); + + writer.WriteString("name", category.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 00000000000..a2785447497 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -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 + * 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 +{ + /// + /// ChildCat + /// + public partial class ChildCat : ParentPet, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public ChildCat(Option name = default) : base() + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines PetType + /// + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + ChildCat = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PetTypeEnum PetTypeEnumFromString(string value) + { + if (value.Equals("ChildCat")) + return PetTypeEnum.ChildCat; + + throw new NotImplementedException($"Could not convert value to type PetTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static PetTypeEnum? PetTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ChildCat")) + return PetTypeEnum.ChildCat; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PetTypeEnumToJsonValue(PetTypeEnum value) + { + if (value == PetTypeEnum.ChildCat) + return "ChildCat"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ChildCat 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 name = default; + Option petType = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "pet_type": + string petTypeRawValue = utf8JsonReader.GetString(); + if (petTypeRawValue != null) + petType = new Option(ChildCat.PetTypeEnumFromStringOrDefault(petTypeRawValue)); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ChildCat.", nameof(petType)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat."); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); + + return new ChildCat(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, childCat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (childCat.NameOption.IsSet) + writer.WriteString("name", childCat.Name); + + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 00000000000..cf37657bf45 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model with \"_class\" property + /// + public partial class ClassModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + [JsonConstructor] + public ClassModel(Option @class = default) + { + ClassOption = @class; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("_class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = 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 ClassModel {\n"); + sb.Append(" Class: ").Append(Class).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 ClassModelJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ClassModel 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 varClass = 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 "_class": + varClass = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class ClassModel."); + + return new ClassModel(varClass); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, classModel, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (classModel.ClassOption.IsSet) + writer.WriteString("_class", classModel.Class); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 00000000000..3023a45610e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// ComplexQuadrilateral + /// + public partial class ComplexQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public ComplexQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ComplexQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ComplexQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ComplexQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class ComplexQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ComplexQuadrilateral."); + + return new ComplexQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (complexQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(complexQuadrilateral.ShapeType), "Property is required for class ComplexQuadrilateral."); + + writer.WriteString("quadrilateralType", complexQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", complexQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 00000000000..14b2ed3b153 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DanishPig + /// + public partial class DanishPig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public DanishPig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 DanishPigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DanishPig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class DanishPig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class DanishPig."); + + return new DanishPig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, danishPig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", danishPig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs new file mode 100644 index 00000000000..62bd07a9513 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -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 + * 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 +{ + /// + /// DateOnlyClass + /// + public partial class DateOnlyClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateOnlyProperty + [JsonConstructor] + public DateOnlyClass(Option dateOnlyProperty = default) + { + DateOnlyPropertyOption = dateOnlyProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateOnlyProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOnlyPropertyOption { get; private set; } + + /// + /// Gets or Sets DateOnlyProperty + /// + /// Fri Jul 21 00:00:00 UTC 2017 + [JsonPropertyName("dateOnlyProperty")] + public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = 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 DateOnlyClass {\n"); + sb.Append(" DateOnlyProperty: ").Append(DateOnlyProperty).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 DateOnlyClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOnlyProperty + /// + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DateOnlyClass 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 dateOnlyProperty = 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 "dateOnlyProperty": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (dateOnlyProperty.IsSet && dateOnlyProperty.Value == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is not nullable for class DateOnlyClass."); + + return new DateOnlyClass(dateOnlyProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 00000000000..661b1e7c2c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DeprecatedObject + /// + public partial class DeprecatedObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public DeprecatedObject(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).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 DeprecatedObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DeprecatedObject 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class DeprecatedObject."); + + return new DeprecatedObject(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (deprecatedObject.NameOption.IsSet) + writer.WriteString("name", deprecatedObject.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 00000000000..75a60416f90 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -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 + * 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 +{ + /// + /// Dog + /// + public partial class Dog : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed + /// color (default to "red") + [JsonConstructor] + public Dog(Option breed = default, Option color = default) : base(color) + { + BreedOption = breed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BreedOption { get; private set; } + + /// + /// Gets or Sets Breed + /// + [JsonPropertyName("breed")] + public string Breed { get { return this.BreedOption; } set { this.BreedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DogJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Dog 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 className = default; + Option breed = default; + Option color = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "breed": + breed = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Dog.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Dog."); + + if (breed.IsSet && breed.Value == null) + throw new ArgumentNullException(nameof(breed), "Property is not nullable for class Dog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); + + return new Dog(breed, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + if (dog.BreedOption.IsSet && dog.Breed == null) + throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); + + if (dog.ColorOption.IsSet && dog.Color == null) + throw new ArgumentNullException(nameof(dog.Color), "Property is required for class Dog."); + + writer.WriteString("className", dog.ClassName); + + if (dog.BreedOption.IsSet) + writer.WriteString("breed", dog.Breed); + + if (dog.ColorOption.IsSet) + writer.WriteString("color", dog.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 00000000000..70ff3517f49 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Drawing + /// + public partial class Drawing : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape + /// nullableShape + /// shapeOrNull + /// shapes + [JsonConstructor] + public Drawing(Option mainShape = default, Option nullableShape = default, Option shapeOrNull = default, Option> shapes = default) + { + MainShapeOption = mainShape; + NullableShapeOption = nullableShape; + ShapeOrNullOption = shapeOrNull; + ShapesOption = shapes; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MainShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MainShapeOption { get; private set; } + + /// + /// Gets or Sets MainShape + /// + [JsonPropertyName("mainShape")] + public Shape MainShape { get { return this.MainShapeOption; } set { this.MainShapeOption = new Option(value); } } + + /// + /// Used to track the state of NullableShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableShapeOption { get; private set; } + + /// + /// Gets or Sets NullableShape + /// + [JsonPropertyName("nullableShape")] + public NullableShape NullableShape { get { return this.NullableShapeOption; } set { this.NullableShapeOption = new Option(value); } } + + /// + /// Used to track the state of ShapeOrNull + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShapeOrNullOption { get; private set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [JsonPropertyName("shapeOrNull")] + public ShapeOrNull ShapeOrNull { get { return this.ShapeOrNullOption; } set { this.ShapeOrNullOption = new Option(value); } } + + /// + /// Used to track the state of Shapes + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ShapesOption { get; private set; } + + /// + /// Gets or Sets Shapes + /// + [JsonPropertyName("shapes")] + public List Shapes { get { return this.ShapesOption; } set { this.ShapesOption = 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 Drawing {\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).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 DrawingJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Drawing 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 mainShape = default; + Option nullableShape = default; + Option shapeOrNull = default; + Option> shapes = 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 "mainShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "nullableShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapeOrNull": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapes": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (mainShape.IsSet && mainShape.Value == null) + throw new ArgumentNullException(nameof(mainShape), "Property is not nullable for class Drawing."); + + if (shapes.IsSet && shapes.Value == null) + throw new ArgumentNullException(nameof(shapes), "Property is not nullable for class Drawing."); + + return new Drawing(mainShape, nullableShape, shapeOrNull, shapes); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, drawing, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (drawing.ShapesOption.IsSet && drawing.Shapes == null) + throw new ArgumentNullException(nameof(drawing.Shapes), "Property is required for class Drawing."); + + if (drawing.MainShapeOption.IsSet) + { + writer.WritePropertyName("mainShape"); + JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions); + } + if (drawing.NullableShapeOption.IsSet) + if (drawing.NullableShapeOption.Value != null) + { + writer.WritePropertyName("nullableShape"); + JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions); + } + else + writer.WriteNull("nullableShape"); + if (drawing.ShapeOrNullOption.IsSet) + if (drawing.ShapeOrNullOption.Value != null) + { + writer.WritePropertyName("shapeOrNull"); + JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions); + } + else + writer.WriteNull("shapeOrNull"); + if (drawing.ShapesOption.IsSet) + { + writer.WritePropertyName("shapes"); + JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 00000000000..1e0b0d1c226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,337 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumArrays + /// + public partial class EnumArrays : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayEnum + /// justSymbol + [JsonConstructor] + public EnumArrays(Option> arrayEnum = default, Option justSymbol = default) + { + ArrayEnumOption = arrayEnum; + JustSymbolOption = justSymbol; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines ArrayEnum + /// + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + Crab = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ArrayEnumEnum ArrayEnumEnumFromString(string value) + { + if (value.Equals("fish")) + return ArrayEnumEnum.Fish; + + if (value.Equals("crab")) + return ArrayEnumEnum.Crab; + + throw new NotImplementedException($"Could not convert value to type ArrayEnumEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ArrayEnumEnum? ArrayEnumEnumFromStringOrDefault(string value) + { + if (value.Equals("fish")) + return ArrayEnumEnum.Fish; + + if (value.Equals("crab")) + return ArrayEnumEnum.Crab; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ArrayEnumEnumToJsonValue(ArrayEnumEnum value) + { + if (value == ArrayEnumEnum.Fish) + return "fish"; + + if (value == ArrayEnumEnum.Crab) + return "crab"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Defines JustSymbol + /// + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static JustSymbolEnum JustSymbolEnumFromString(string value) + { + if (value.Equals(">=")) + return JustSymbolEnum.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return JustSymbolEnum.Dollar; + + throw new NotImplementedException($"Could not convert value to type JustSymbolEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static JustSymbolEnum? JustSymbolEnumFromStringOrDefault(string value) + { + if (value.Equals(">=")) + return JustSymbolEnum.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return JustSymbolEnum.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string JustSymbolEnumToJsonValue(JustSymbolEnum? value) + { + if (value == JustSymbolEnum.GreaterThanOrEqualTo) + return ">="; + + if (value == JustSymbolEnum.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of JustSymbol + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustSymbolOption { get; private set; } + + /// + /// Gets or Sets JustSymbol + /// + [JsonPropertyName("just_symbol")] + public JustSymbolEnum? JustSymbol { get { return this.JustSymbolOption; } set { this.JustSymbolOption = new Option(value); } } + + /// + /// Used to track the state of ArrayEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayEnumOption { get; private set; } + + /// + /// Gets or Sets ArrayEnum + /// + [JsonPropertyName("array_enum")] + public List ArrayEnum { get { return this.ArrayEnumOption; } set { this.ArrayEnumOption = 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 EnumArrays {\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).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 EnumArraysJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumArrays 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> arrayEnum = default; + Option justSymbol = 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 "array_enum": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "just_symbol": + string justSymbolRawValue = utf8JsonReader.GetString(); + if (justSymbolRawValue != null) + justSymbol = new Option(EnumArrays.JustSymbolEnumFromStringOrDefault(justSymbolRawValue)); + break; + default: + break; + } + } + } + + if (arrayEnum.IsSet && arrayEnum.Value == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is not nullable for class EnumArrays."); + + if (justSymbol.IsSet && justSymbol.Value == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is not nullable for class EnumArrays."); + + return new EnumArrays(arrayEnum, justSymbol); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumArrays, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (enumArrays.ArrayEnumOption.IsSet) + { + writer.WritePropertyName("array_enum"); + JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions); + } + var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value.Value); + writer.WriteString("just_symbol", justSymbolRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 00000000000..b1aff0adf0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumClass + /// + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumClassValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass FromString(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + throw new NotImplementedException($"Could not convert value to type EnumClass: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumClass value) + { + if (value == EnumClass.Abc) + return "_abc"; + + if (value == EnumClass.Efg) + return "-efg"; + + if (value == EnumClass.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumClassJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumClass to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumClassNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumClass from the Json object + /// + /// + /// + /// + /// + public override EnumClass? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass? enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 00000000000..0d657779fdc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,881 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumTest + /// + public partial class EnumTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// enumStringRequired + /// enumInteger + /// enumIntegerOnly + /// enumNumber + /// enumString + /// outerEnum + /// outerEnumDefaultValue + /// outerEnumInteger + /// outerEnumIntegerDefaultValue + [JsonConstructor] + public EnumTest(EnumStringRequiredEnum enumStringRequired, Option enumInteger = default, Option enumIntegerOnly = default, Option enumNumber = default, Option enumString = default, Option outerEnum = default, Option outerEnumDefaultValue = default, Option outerEnumInteger = default, Option outerEnumIntegerDefaultValue = default) + { + EnumStringRequired = enumStringRequired; + EnumIntegerOption = enumInteger; + EnumIntegerOnlyOption = enumIntegerOnly; + EnumNumberOption = enumNumber; + EnumStringOption = enumString; + OuterEnumOption = outerEnum; + OuterEnumDefaultValueOption = outerEnumDefaultValue; + OuterEnumIntegerOption = outerEnumInteger; + OuterEnumIntegerDefaultValueOption = outerEnumIntegerDefaultValue; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines EnumStringRequired + /// + public enum EnumStringRequiredEnum + { + /// + /// 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 EnumStringRequiredEnum EnumStringRequiredEnumFromString(string value) + { + if (value.Equals("UPPER")) + return EnumStringRequiredEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringRequiredEnum.Lower; + + if (value.Equals("")) + return EnumStringRequiredEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringRequiredEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringRequiredEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringRequiredEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumStringRequiredEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumStringRequiredEnum? EnumStringRequiredEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumStringRequiredEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringRequiredEnum.Lower; + + if (value.Equals("")) + return EnumStringRequiredEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringRequiredEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringRequiredEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringRequiredEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string EnumStringRequiredEnumToJsonValue(EnumStringRequiredEnum value) + { + if (value == EnumStringRequiredEnum.UPPER) + return "UPPER"; + + if (value == EnumStringRequiredEnum.Lower) + return "lower"; + + if (value == EnumStringRequiredEnum.Empty) + return ""; + + if (value == EnumStringRequiredEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumStringRequiredEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumStringRequiredEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumStringRequiredEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumStringRequiredEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets EnumStringRequired + /// + [JsonPropertyName("enum_string_required")] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumIntegerEnum EnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return EnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type EnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumIntegerEnum? EnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return EnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int EnumIntegerEnumToJsonValue(EnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of EnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOption { get; private set; } + + /// + /// Gets or Sets EnumInteger + /// + [JsonPropertyName("enum_integer")] + public EnumIntegerEnum? EnumInteger { get { return this.EnumIntegerOption; } set { this.EnumIntegerOption = new Option(value); } } + + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumIntegerOnlyEnum EnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type EnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumIntegerOnlyEnum? EnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int EnumIntegerOnlyEnumToJsonValue(EnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of EnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets EnumIntegerOnly + /// + [JsonPropertyName("enum_integer_only")] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get { return this.EnumIntegerOnlyOption; } set { this.EnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines EnumNumber + /// + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumNumberEnum EnumNumberEnumFromString(string value) + { + if (value.Equals("1.1")) + return EnumNumberEnum.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return EnumNumberEnum.NUMBER_MINUS_1_DOT_2; + + throw new NotImplementedException($"Could not convert value to type EnumNumberEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumNumberEnum? EnumNumberEnumFromStringOrDefault(string value) + { + if (value.Equals("1.1")) + return EnumNumberEnum.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return EnumNumberEnum.NUMBER_MINUS_1_DOT_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static double EnumNumberEnumToJsonValue(EnumNumberEnum? value) + { + if (value == EnumNumberEnum.NUMBER_1_DOT_1) + return 1.1; + + if (value == EnumNumberEnum.NUMBER_MINUS_1_DOT_2) + return -1.2; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of EnumNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumNumberOption { get; private set; } + + /// + /// Gets or Sets EnumNumber + /// + [JsonPropertyName("enum_number")] + public EnumNumberEnum? EnumNumber { get { return this.EnumNumberOption; } set { this.EnumNumberOption = new Option(value); } } + + /// + /// Defines EnumString + /// + public enum EnumStringEnum + { + /// + /// 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 EnumStringEnum EnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return EnumStringEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringEnum.Lower; + + if (value.Equals("")) + return EnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumStringEnum? EnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumStringEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringEnum.Lower; + + if (value.Equals("")) + return EnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string EnumStringEnumToJsonValue(EnumStringEnum? value) + { + if (value == EnumStringEnum.UPPER) + return "UPPER"; + + if (value == EnumStringEnum.Lower) + return "lower"; + + if (value == EnumStringEnum.Empty) + return ""; + + if (value == EnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of EnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumStringOption { get; private set; } + + /// + /// Gets or Sets EnumString + /// + [JsonPropertyName("enum_string")] + public EnumStringEnum? EnumString { get { return this.EnumStringOption; } set { this.EnumStringOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumOption { get; private set; } + + /// + /// Gets or Sets OuterEnum + /// + [JsonPropertyName("outerEnum")] + public OuterEnum? OuterEnum { get { return this.OuterEnumOption; } set { this.OuterEnumOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [JsonPropertyName("outerEnumDefaultValue")] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get { return this.OuterEnumDefaultValueOption; } set { this.OuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [JsonPropertyName("outerEnumInteger")] + public OuterEnumInteger? OuterEnumInteger { get { return this.OuterEnumIntegerOption; } set { this.OuterEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumIntegerDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [JsonPropertyName("outerEnumIntegerDefaultValue")] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get { return this.OuterEnumIntegerDefaultValueOption; } set { this.OuterEnumIntegerDefaultValueOption = 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 EnumTest {\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).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 EnumTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumTest 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 enumStringRequired = default; + Option enumInteger = default; + Option enumIntegerOnly = default; + Option enumNumber = default; + Option enumString = default; + Option outerEnum = default; + Option outerEnumDefaultValue = default; + Option outerEnumInteger = default; + Option outerEnumIntegerDefaultValue = 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 "enum_string_required": + string enumStringRequiredRawValue = utf8JsonReader.GetString(); + if (enumStringRequiredRawValue != null) + enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); + break; + case "enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "enum_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + break; + case "enum_string": + string enumStringRawValue = utf8JsonReader.GetString(); + if (enumStringRawValue != null) + enumString = new Option(EnumTest.EnumStringEnumFromStringOrDefault(enumStringRawValue)); + break; + case "outerEnum": + string outerEnumRawValue = utf8JsonReader.GetString(); + if (outerEnumRawValue != null) + outerEnum = new Option(OuterEnumValueConverter.FromStringOrDefault(outerEnumRawValue)); + break; + case "outerEnumDefaultValue": + string outerEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumDefaultValueRawValue != null) + outerEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(outerEnumDefaultValueRawValue)); + break; + case "outerEnumInteger": + string outerEnumIntegerRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerRawValue != null) + outerEnumInteger = new Option(OuterEnumIntegerValueConverter.FromStringOrDefault(outerEnumIntegerRawValue)); + break; + case "outerEnumIntegerDefaultValue": + string outerEnumIntegerDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerDefaultValueRawValue != null) + outerEnumIntegerDefaultValue = new Option(OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(outerEnumIntegerDefaultValueRawValue)); + break; + default: + break; + } + } + } + + if (!enumStringRequired.IsSet) + throw new ArgumentException("Property is required for class EnumTest.", nameof(enumStringRequired)); + + if (enumStringRequired.IsSet && enumStringRequired.Value == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is not nullable for class EnumTest."); + + if (enumInteger.IsSet && enumInteger.Value == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is not nullable for class EnumTest."); + + if (enumIntegerOnly.IsSet && enumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is not nullable for class EnumTest."); + + if (enumNumber.IsSet && enumNumber.Value == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is not nullable for class EnumTest."); + + if (enumString.IsSet && enumString.Value == null) + throw new ArgumentNullException(nameof(enumString), "Property is not nullable for class EnumTest."); + + if (outerEnumDefaultValue.IsSet && outerEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is not nullable for class EnumTest."); + + if (outerEnumInteger.IsSet && outerEnumInteger.Value == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is not nullable for class EnumTest."); + + if (outerEnumIntegerDefaultValue.IsSet && outerEnumIntegerDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is not nullable for class EnumTest."); + + return new EnumTest(enumStringRequired.Value.Value, enumInteger, enumIntegerOnly, enumNumber, enumString, outerEnum, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); + writer.WriteString("enum_string_required", enumStringRequiredRawValue); + if (enumTest.EnumIntegerOption.IsSet) + writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value.Value)); + + if (enumTest.EnumIntegerOnlyOption.IsSet) + writer.WriteNumber("enum_integer_only", EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTest.EnumIntegerOnlyOption.Value.Value)); + + if (enumTest.EnumNumberOption.IsSet) + writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value.Value)); + + var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value.Value); + writer.WriteString("enum_string", enumStringRawValue); + if (enumTest.OuterEnumOption.IsSet) + if (enumTest.OuterEnumOption.Value != null) + { + var outerEnumRawValue = OuterEnumValueConverter.ToJsonValue(enumTest.OuterEnumOption.Value.Value); + writer.WriteString("outerEnum", outerEnumRawValue); + } + else + writer.WriteNull("outerEnum"); + if (enumTest.OuterEnumDefaultValueOption.IsSet) + { + var outerEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumDefaultValue.Value); + writer.WriteString("outerEnumDefaultValue", outerEnumDefaultValueRawValue); + } + if (enumTest.OuterEnumIntegerOption.IsSet) + { + var outerEnumIntegerRawValue = OuterEnumIntegerValueConverter.ToJsonValue(enumTest.OuterEnumInteger.Value); + writer.WriteNumber("outerEnumInteger", outerEnumIntegerRawValue); + } + if (enumTest.OuterEnumIntegerDefaultValueOption.IsSet) + { + var outerEnumIntegerDefaultValueRawValue = OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumIntegerDefaultValue.Value); + writer.WriteNumber("outerEnumIntegerDefaultValue", outerEnumIntegerDefaultValueRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 00000000000..d65c7740e5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -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 + * 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 +{ + /// + /// EquilateralTriangle + /// + public partial class EquilateralTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public EquilateralTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 EquilateralTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EquilateralTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class EquilateralTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class EquilateralTriangle."); + + return new EquilateralTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (equilateralTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(equilateralTriangle.TriangleType), "Property is required for class EquilateralTriangle."); + + writer.WriteString("shapeType", equilateralTriangle.ShapeType); + + writer.WriteString("triangleType", equilateralTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..8d88c790110 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,175 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Must be named `File` for test. + /// + public partial class File : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization + [JsonConstructor] + public File(Option sourceURI = default) + { + SourceURIOption = sourceURI; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SourceURI + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SourceURIOption { get; private set; } + + /// + /// Test capitalization + /// + /// Test capitalization + [JsonPropertyName("sourceURI")] + public string SourceURI { get { return this.SourceURIOption; } set { this.SourceURIOption = 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 File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).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 FileJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override File 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 sourceURI = 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 "sourceURI": + sourceURI = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (sourceURI.IsSet && sourceURI.Value == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is not nullable for class File."); + + return new File(sourceURI); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, file, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (file.SourceURIOption.IsSet) + writer.WriteString("sourceURI", file.SourceURI); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..8610cbae21d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FileSchemaTestClass + /// + public partial class FileSchemaTestClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file + /// files + [JsonConstructor] + public FileSchemaTestClass(Option file = default, Option> files = default) + { + FileOption = file; + FilesOption = files; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of File + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FileOption { get; private set; } + + /// + /// Gets or Sets File + /// + [JsonPropertyName("file")] + public File File { get { return this.FileOption; } set { this.FileOption = new Option(value); } } + + /// + /// Used to track the state of Files + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> FilesOption { get; private set; } + + /// + /// Gets or Sets Files + /// + [JsonPropertyName("files")] + public List Files { get { return this.FilesOption; } set { this.FilesOption = 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 FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).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 FileSchemaTestClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FileSchemaTestClass 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 file = default; + Option> files = 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 "file": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "files": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file), "Property is not nullable for class FileSchemaTestClass."); + + if (files.IsSet && files.Value == null) + throw new ArgumentNullException(nameof(files), "Property is not nullable for class FileSchemaTestClass."); + + return new FileSchemaTestClass(file, files); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fileSchemaTestClass.FilesOption.IsSet && fileSchemaTestClass.Files == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass.Files), "Property is required for class FileSchemaTestClass."); + + if (fileSchemaTestClass.FileOption.IsSet) + { + writer.WritePropertyName("file"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.File, jsonSerializerOptions); + } + if (fileSchemaTestClass.FilesOption.IsSet) + { + writer.WritePropertyName("files"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 00000000000..659b93c0913 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Foo + /// + public partial class Foo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar") + [JsonConstructor] + public Foo(Option bar = default) + { + BarOption = bar; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; private set; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } set { this.BarOption = 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 FooJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Foo 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 bar = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class Foo."); + + return new Foo(bar); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, foo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (foo.BarOption.IsSet) + writer.WriteString("bar", foo.Bar); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs new file mode 100644 index 00000000000..205b2f3f897 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -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 + * 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 +{ + /// + /// FooGetDefaultResponse + /// + public partial class FooGetDefaultResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// string + [JsonConstructor] + public FooGetDefaultResponse(Option @string = default) + { + StringOption = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public Foo String { get { return this.StringOption; } set { this.StringOption = 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 FooGetDefaultResponse {\n"); + sb.Append(" String: ").Append(String).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 FooGetDefaultResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FooGetDefaultResponse 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 varString = 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 "string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FooGetDefaultResponse."); + + return new FooGetDefaultResponse(varString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fooGetDefaultResponse.StringOption.IsSet) + { + writer.WritePropertyName("string"); + JsonSerializer.Serialize(writer, fooGetDefaultResponse.String, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 00000000000..3fc88d4d403 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,798 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FormatTest + /// + public partial class FormatTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// byte + /// date + /// number + /// password + /// binary + /// dateTime + /// decimal + /// double + /// float + /// int32 + /// int64 + /// integer + /// None + /// A string that is a 10 digit number. Can have leading zeros. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// string + /// unsignedInteger + /// unsignedLong + /// uuid + [JsonConstructor] + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int64 = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + { + Byte = @byte; + Date = date; + Number = number; + Password = password; + BinaryOption = binary; + DateTimeOption = dateTime; + DecimalOption = @decimal; + DoubleOption = @double; + FloatOption = @float; + Int32Option = int32; + Int64Option = int64; + IntegerOption = integer; + PatternWithBackslashOption = patternWithBackslash; + PatternWithDigitsOption = patternWithDigits; + PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; + StringOption = @string; + UnsignedIntegerOption = unsignedInteger; + UnsignedLongOption = unsignedLong; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Byte + /// + [JsonPropertyName("byte")] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + /// Sun Feb 02 00:00:00 UTC 2020 + [JsonPropertyName("date")] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Number + /// + [JsonPropertyName("number")] + public decimal Number { get; set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get; set; } + + /// + /// Used to track the state of Binary + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BinaryOption { get; private set; } + + /// + /// Gets or Sets Binary + /// + [JsonPropertyName("binary")] + public System.IO.Stream Binary { get { return this.BinaryOption; } set { this.BinaryOption = new Option(value); } } + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + /// 2007-12-03T10:15:30+01:00 + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + [JsonPropertyName("decimal")] + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of Double + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DoubleOption { get; private set; } + + /// + /// Gets or Sets Double + /// + [JsonPropertyName("double")] + public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + + /// + /// Used to track the state of Float + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FloatOption { get; private set; } + + /// + /// Gets or Sets Float + /// + [JsonPropertyName("float")] + public float? Float { get { return this.FloatOption; } set { this.FloatOption = new Option(value); } } + + /// + /// Used to track the state of Int32 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32Option { get; private set; } + + /// + /// Gets or Sets Int32 + /// + [JsonPropertyName("int32")] + public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + + /// + /// Used to track the state of Int64 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64Option { get; private set; } + + /// + /// Gets or Sets Int64 + /// + [JsonPropertyName("int64")] + public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + + /// + /// Used to track the state of Integer + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerOption { get; private set; } + + /// + /// Gets or Sets Integer + /// + [JsonPropertyName("integer")] + public int? Integer { get { return this.IntegerOption; } set { this.IntegerOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithBackslash + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithBackslashOption { get; private set; } + + /// + /// None + /// + /// None + [JsonPropertyName("pattern_with_backslash")] + public string PatternWithBackslash { get { return this.PatternWithBackslashOption; } set { this.PatternWithBackslashOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigits + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsOption { get; private set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [JsonPropertyName("pattern_with_digits")] + public string PatternWithDigits { get { return this.PatternWithDigitsOption; } set { this.PatternWithDigitsOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigitsAndDelimiter + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsAndDelimiterOption { get; private set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [JsonPropertyName("pattern_with_digits_and_delimiter")] + public string PatternWithDigitsAndDelimiter { get { return this.PatternWithDigitsAndDelimiterOption; } set { this.PatternWithDigitsAndDelimiterOption = new Option(value); } } + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedIntegerOption { get; private set; } + + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint? UnsignedInteger { get { return this.UnsignedIntegerOption; } set { this.UnsignedIntegerOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedLong + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedLongOption { get; private set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong? UnsignedLong { get { return this.UnsignedLongOption; } set { this.UnsignedLongOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 FormatTest {\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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) + { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // Double (double) maximum + if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) + { + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) + { + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // Float (float) maximum + if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) + { + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) + { + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Int32 (int) maximum + if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) + { + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) + { + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Integer (int) maximum + if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) + { + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) + { + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + if (this.PatternWithBackslashOption.Value != null) { + // PatternWithBackslash (string) pattern + Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); + + if (this.PatternWithBackslashOption.Value != null &&!regexPatternWithBackslash.Match(this.PatternWithBackslashOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); + } + } + + if (this.PatternWithDigitsOption.Value != null) { + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); + + if (this.PatternWithDigitsOption.Value != null &&!regexPatternWithDigits.Match(this.PatternWithDigitsOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + } + + if (this.PatternWithDigitsAndDelimiterOption.Value != null) { + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.PatternWithDigitsAndDelimiterOption.Value != null &&!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiterOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + } + + if (this.StringOption.Value != null) { + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.StringOption.Value != null &&!regexString.Match(this.StringOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + } + + // UnsignedInteger (uint) maximum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class FormatTestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Date + /// + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FormatTest 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 varByte = default; + Option date = default; + Option number = default; + Option password = default; + Option binary = default; + Option dateTime = default; + Option varDecimal = default; + Option varDouble = default; + Option varFloat = default; + Option int32 = default; + Option int64 = default; + Option integer = default; + Option patternWithBackslash = default; + Option patternWithDigits = default; + Option patternWithDigitsAndDelimiter = default; + Option varString = default; + Option unsignedInteger = default; + Option unsignedLong = default; + Option uuid = 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 "byte": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "date": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = new Option(utf8JsonReader.GetDecimal()); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "binary": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "decimal": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "double": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDouble = new Option(utf8JsonReader.GetDouble()); + break; + case "float": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varFloat = new Option((float)utf8JsonReader.GetDouble()); + break; + case "int32": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = new Option(utf8JsonReader.GetInt32()); + break; + case "int64": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = new Option(utf8JsonReader.GetInt64()); + break; + case "integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = new Option(utf8JsonReader.GetInt32()); + break; + case "pattern_with_backslash": + patternWithBackslash = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits": + patternWithDigits = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits_and_delimiter": + patternWithDigitsAndDelimiter = new Option(utf8JsonReader.GetString()); + break; + case "string": + varString = new Option(utf8JsonReader.GetString()); + break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = new Option(utf8JsonReader.GetUInt64()); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (!varByte.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(varByte)); + + if (!date.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(date)); + + if (!number.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(number)); + + if (!password.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + + if (varByte.IsSet && varByte.Value == null) + throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); + + if (date.IsSet && date.Value == null) + throw new ArgumentNullException(nameof(date), "Property is not nullable for class FormatTest."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class FormatTest."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class FormatTest."); + + if (varDecimal.IsSet && varDecimal.Value == null) + throw new ArgumentNullException(nameof(varDecimal), "Property is not nullable for class FormatTest."); + + if (varDouble.IsSet && varDouble.Value == null) + throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + + if (varFloat.IsSet && varFloat.Value == null) + throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); + + if (int32.IsSet && int32.Value == null) + throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + + if (int64.IsSet && int64.Value == null) + throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + + if (integer.IsSet && integer.Value == null) + throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); + + if (patternWithBackslash.IsSet && patternWithBackslash.Value == null) + throw new ArgumentNullException(nameof(patternWithBackslash), "Property is not nullable for class FormatTest."); + + if (patternWithDigits.IsSet && patternWithDigits.Value == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is not nullable for class FormatTest."); + + if (patternWithDigitsAndDelimiter.IsSet && patternWithDigitsAndDelimiter.Value == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is not nullable for class FormatTest."); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + + if (unsignedInteger.IsSet && unsignedInteger.Value == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); + + if (unsignedLong.IsSet && unsignedLong.Value == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is not nullable for class FormatTest."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); + + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, formatTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (formatTest.Password == null) + throw new ArgumentNullException(nameof(formatTest.Password), "Property is required for class FormatTest."); + + if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) + throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsOption.IsSet && formatTest.PatternWithDigits == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigits), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet && formatTest.PatternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + + if (formatTest.StringOption.IsSet && formatTest.String == null) + throw new ArgumentNullException(nameof(formatTest.String), "Property is required for class FormatTest."); + + writer.WritePropertyName("byte"); + JsonSerializer.Serialize(writer, formatTest.Byte, jsonSerializerOptions); + writer.WriteString("date", formatTest.Date.ToString(DateFormat)); + + writer.WriteNumber("number", formatTest.Number); + + writer.WriteString("password", formatTest.Password); + + if (formatTest.BinaryOption.IsSet) + { + writer.WritePropertyName("binary"); + JsonSerializer.Serialize(writer, formatTest.Binary, jsonSerializerOptions); + } + if (formatTest.DateTimeOption.IsSet) + writer.WriteString("dateTime", formatTest.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (formatTest.DecimalOption.IsSet) + { + writer.WritePropertyName("decimal"); + JsonSerializer.Serialize(writer, formatTest.Decimal, jsonSerializerOptions); + } + if (formatTest.DoubleOption.IsSet) + writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + + if (formatTest.FloatOption.IsSet) + writer.WriteNumber("float", formatTest.FloatOption.Value.Value); + + if (formatTest.Int32Option.IsSet) + writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + + if (formatTest.Int64Option.IsSet) + writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + + if (formatTest.IntegerOption.IsSet) + writer.WriteNumber("integer", formatTest.IntegerOption.Value.Value); + + if (formatTest.PatternWithBackslashOption.IsSet) + writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash); + + if (formatTest.PatternWithDigitsOption.IsSet) + writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet) + writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); + + if (formatTest.StringOption.IsSet) + writer.WriteString("string", formatTest.String); + + if (formatTest.UnsignedIntegerOption.IsSet) + writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); + + if (formatTest.UnsignedLongOption.IsSet) + writer.WriteNumber("unsigned_long", formatTest.UnsignedLongOption.Value.Value); + + if (formatTest.UuidOption.IsSet) + writer.WriteString("uuid", formatTest.UuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..0302533cd2f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -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 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 00000000000..1e72875d4d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FruitReq + /// + public partial class FruitReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(AppleReq appleReq) + { + AppleReq = appleReq; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(BananaReq bananaReq) + { + BananaReq = bananaReq; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AppleReq + /// + public AppleReq AppleReq { get; set; } + + /// + /// Gets or Sets BananaReq + /// + public BananaReq BananaReq { 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 FruitReq {\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 FruitReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FruitReq 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; + + AppleReq appleReq = default; + BananaReq bananaReq = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderAppleReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAppleReq, jsonSerializerOptions, out appleReq); + + Utf8JsonReader utf8JsonReaderBananaReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBananaReq, jsonSerializerOptions, out bananaReq); + } + } + + 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) + { + default: + break; + } + } + } + + if (appleReq != null) + return new FruitReq(appleReq); + + if (bananaReq != null) + return new FruitReq(bananaReq); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruitReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 00000000000..e2eb2c897a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,235 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// GmFruit + /// + public partial class GmFruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public GmFruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" Color: ").Append(Color).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 GmFruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GmFruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class GmFruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new GmFruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); + 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(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, gmFruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (gmFruit.ColorOption.IsSet) + writer.WriteString("color", gmFruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 00000000000..838cae14f98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -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 + * 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 +{ + /// + /// GrandparentAnimal + /// + public partial class GrandparentAnimal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + public GrandparentAnimal() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; + + /// + /// 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 GrandparentAnimal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GrandparentAnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GrandparentAnimal 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class GrandparentAnimal.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); + + return new GrandparentAnimal(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, grandparentAnimal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", grandparentAnimal.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..680ead387fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,244 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// HasOnlyReadOnly + /// + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// foo + [JsonConstructor] + internal HasOnlyReadOnly(Option bar = default, Option foo = default) + { + BarOption = bar; + FooOption = foo; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Foo + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FooOption { get; } + + /// + /// Gets or Sets Foo + /// + [JsonPropertyName("foo")] + public string Foo { get { return this.FooOption; } } + + /// + /// 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 HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + if (Foo != null) + hashCode = (hashCode * 59) + Foo.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 HasOnlyReadOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HasOnlyReadOnly 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 bar = default; + Option foo = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "foo": + foo = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class HasOnlyReadOnly."); + + if (foo.IsSet && foo.Value == null) + throw new ArgumentNullException(nameof(foo), "Property is not nullable for class HasOnlyReadOnly."); + + return new HasOnlyReadOnly(bar, foo); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (hasOnlyReadOnly.FooOption.IsSet && hasOnlyReadOnly.Foo == null) + throw new ArgumentNullException(nameof(hasOnlyReadOnly.Foo), "Property is required for class HasOnlyReadOnly."); + + if (hasOnlyReadOnly.BarOption.IsSet) + writer.WriteString("bar", hasOnlyReadOnly.Bar); + + if (hasOnlyReadOnly.FooOption.IsSet) + writer.WriteString("foo", hasOnlyReadOnly.Foo); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 00000000000..112f55c9ab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -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 + * 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 +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + public partial class HealthCheckResult : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage + [JsonConstructor] + public HealthCheckResult(Option nullableMessage = default) + { + NullableMessageOption = nullableMessage; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of NullableMessage + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableMessageOption { get; private set; } + + /// + /// Gets or Sets NullableMessage + /// + [JsonPropertyName("NullableMessage")] + public string NullableMessage { get { return this.NullableMessageOption; } set { this.NullableMessageOption = 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HealthCheckResult 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 nullableMessage = 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 "NullableMessage": + nullableMessage = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + return new HealthCheckResult(nullableMessage); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + if (healthCheckResult.NullableMessageOption.IsSet) + if (healthCheckResult.NullableMessageOption.Value != null) + writer.WriteString("NullableMessage", healthCheckResult.NullableMessage); + else + writer.WriteNull("NullableMessage"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 00000000000..cce85952411 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -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 + * 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 +{ + /// + /// IsoscelesTriangle + /// + public partial class IsoscelesTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public IsoscelesTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { 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 IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 IsoscelesTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IsoscelesTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class IsoscelesTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class IsoscelesTriangle."); + + return new IsoscelesTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (isoscelesTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(isoscelesTriangle.TriangleType), "Property is required for class IsoscelesTriangle."); + + writer.WriteString("shapeType", isoscelesTriangle.ShapeType); + + writer.WriteString("triangleType", isoscelesTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 00000000000..acadb2f2842 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// List + /// + public partial class List : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// var123List + [JsonConstructor] + public List(Option var123List = default) + { + Var123ListOption = var123List; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Var123List + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123ListOption { get; private set; } + + /// + /// Gets or Sets Var123List + /// + [JsonPropertyName("123-list")] + public string Var123List { get { return this.Var123ListOption; } set { this.Var123ListOption = 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 List {\n"); + sb.Append(" Var123List: ").Append(Var123List).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 ListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override List 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 var123List = 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 "123-list": + var123List = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (var123List.IsSet && var123List.Value == null) + throw new ArgumentNullException(nameof(var123List), "Property is not nullable for class List."); + + return new List(var123List); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, list, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (list.Var123ListOption.IsSet) + writer.WriteString("123-list", list.Var123List); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..bfcbb4465fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,203 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(Option escapedLiteralString = default, Option unescapedLiteralString = default) + { + EscapedLiteralStringOption = escapedLiteralString; + UnescapedLiteralStringOption = unescapedLiteralString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of EscapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EscapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get { return this.EscapedLiteralStringOption; } set { this.EscapedLiteralStringOption = new Option(value); } } + + /// + /// Used to track the state of UnescapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnescapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get { return this.UnescapedLiteralStringOption; } set { this.UnescapedLiteralStringOption = 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 LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).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 LiteralStringClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override LiteralStringClass 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 escapedLiteralString = default; + Option unescapedLiteralString = 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 "escapedLiteralString": + escapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + case "unescapedLiteralString": + unescapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (escapedLiteralString.IsSet && escapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + if (unescapedLiteralString.IsSet && unescapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, literalStringClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet && literalStringClass.UnescapedLiteralString == null) + throw new ArgumentNullException(nameof(literalStringClass.UnescapedLiteralString), "Property is required for class LiteralStringClass."); + + if (literalStringClass.EscapedLiteralStringOption.IsSet) + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet) + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 00000000000..267ac8769d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mammal + /// + public partial class Mammal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Whale whale) + { + Whale = whale; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Zebra zebra) + { + Zebra = zebra; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Pig pig) + { + Pig = pig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Whale + /// + public Whale Whale { get; set; } + + /// + /// Gets or Sets Zebra + /// + public Zebra Zebra { get; set; } + + /// + /// Gets or Sets Pig + /// + public Pig Pig { get; set; } + + /// + /// 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 Mammal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Mammal 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 className = default; + + Pig pig = null; + Whale whale = null; + Zebra zebra = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Pig")) + { + Utf8JsonReader utf8JsonReaderPig = utf8JsonReader; + pig = JsonSerializer.Deserialize(ref utf8JsonReaderPig, jsonSerializerOptions); + } + if (discriminator.Equals("whale")) + { + Utf8JsonReader utf8JsonReaderWhale = utf8JsonReader; + whale = JsonSerializer.Deserialize(ref utf8JsonReaderWhale, jsonSerializerOptions); + } + if (discriminator.Equals("zebra")) + { + Utf8JsonReader utf8JsonReaderZebra = utf8JsonReader; + zebra = JsonSerializer.Deserialize(ref utf8JsonReaderZebra, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Mammal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); + + if (pig != null) + return new Mammal(pig); + + if (whale != null) + return new Mammal(whale); + + if (zebra != null) + return new Mammal(zebra); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mammal.Whale != null) + { + WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); + } + + if (mammal.Zebra != null) + { + ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); + } + + if (mammal.Pig != null) + { + PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); + } + + WriteProperties(writer, mammal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 00000000000..3ea97b6d839 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,340 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MapTest + /// + public partial class MapTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// directMap + /// indirectMap + /// mapMapOfString + /// mapOfEnumString + [JsonConstructor] + public MapTest(Option> directMap = default, Option> indirectMap = default, Option>> mapMapOfString = default, Option> mapOfEnumString = default) + { + DirectMapOption = directMap; + IndirectMapOption = indirectMap; + MapMapOfStringOption = mapMapOfString; + MapOfEnumStringOption = mapOfEnumString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines Inner + /// + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static InnerEnum InnerEnumFromString(string value) + { + if (value.Equals("UPPER")) + return InnerEnum.UPPER; + + if (value.Equals("lower")) + return InnerEnum.Lower; + + throw new NotImplementedException($"Could not convert value to type InnerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static InnerEnum? InnerEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return InnerEnum.UPPER; + + if (value.Equals("lower")) + return InnerEnum.Lower; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string InnerEnumToJsonValue(InnerEnum value) + { + if (value == InnerEnum.UPPER) + return "UPPER"; + + if (value == InnerEnum.Lower) + return "lower"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> DirectMapOption { get; private set; } + + /// + /// Gets or Sets DirectMap + /// + [JsonPropertyName("direct_map")] + public Dictionary DirectMap { get { return this.DirectMapOption; } set { this.DirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of IndirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> IndirectMapOption { get; private set; } + + /// + /// Gets or Sets IndirectMap + /// + [JsonPropertyName("indirect_map")] + public Dictionary IndirectMap { get { return this.IndirectMapOption; } set { this.IndirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of MapMapOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapMapOfStringOption { get; private set; } + + /// + /// Gets or Sets MapMapOfString + /// + [JsonPropertyName("map_map_of_string")] + public Dictionary> MapMapOfString { get { return this.MapMapOfStringOption; } set { this.MapMapOfStringOption = new Option>>(value); } } + + /// + /// Used to track the state of MapOfEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOfEnumStringOption { get; private set; } + + /// + /// Gets or Sets MapOfEnumString + /// + [JsonPropertyName("map_of_enum_string")] + public Dictionary MapOfEnumString { get { return this.MapOfEnumStringOption; } set { this.MapOfEnumStringOption = 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 MapTest {\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).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 MapTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MapTest 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> directMap = default; + Option> indirectMap = default; + Option>> mapMapOfString = default; + Option> mapOfEnumString = 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 "direct_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "indirect_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_map_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_enum_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (directMap.IsSet && directMap.Value == null) + throw new ArgumentNullException(nameof(directMap), "Property is not nullable for class MapTest."); + + if (indirectMap.IsSet && indirectMap.Value == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is not nullable for class MapTest."); + + if (mapMapOfString.IsSet && mapMapOfString.Value == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is not nullable for class MapTest."); + + if (mapOfEnumString.IsSet && mapOfEnumString.Value == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is not nullable for class MapTest."); + + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mapTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mapTest.IndirectMapOption.IsSet && mapTest.IndirectMap == null) + throw new ArgumentNullException(nameof(mapTest.IndirectMap), "Property is required for class MapTest."); + + if (mapTest.MapMapOfStringOption.IsSet && mapTest.MapMapOfString == null) + throw new ArgumentNullException(nameof(mapTest.MapMapOfString), "Property is required for class MapTest."); + + if (mapTest.MapOfEnumStringOption.IsSet && mapTest.MapOfEnumString == null) + throw new ArgumentNullException(nameof(mapTest.MapOfEnumString), "Property is required for class MapTest."); + + if (mapTest.DirectMapOption.IsSet) + { + writer.WritePropertyName("direct_map"); + JsonSerializer.Serialize(writer, mapTest.DirectMap, jsonSerializerOptions); + } + if (mapTest.IndirectMapOption.IsSet) + { + writer.WritePropertyName("indirect_map"); + JsonSerializer.Serialize(writer, mapTest.IndirectMap, jsonSerializerOptions); + } + if (mapTest.MapMapOfStringOption.IsSet) + { + writer.WritePropertyName("map_map_of_string"); + JsonSerializer.Serialize(writer, mapTest.MapMapOfString, jsonSerializerOptions); + } + if (mapTest.MapOfEnumStringOption.IsSet) + { + writer.WritePropertyName("map_of_enum_string"); + JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..0f3a07debfe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/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/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..74047904b27 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..b335b252782 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new Option(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..7b435033f6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d3cb505539d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -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 + * 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 +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + public partial class MixedPropertiesAndAdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateTime + /// map + /// uuid + /// uuidWithPattern + [JsonConstructor] + public MixedPropertiesAndAdditionalPropertiesClass(Option dateTime = default, Option> map = default, Option uuid = default, Option uuidWithPattern = default) + { + DateTimeOption = dateTime; + MapOption = map; + UuidOption = uuid; + UuidWithPatternOption = uuidWithPattern; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Map + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOption { get; private set; } + + /// + /// Gets or Sets Map + /// + [JsonPropertyName("map")] + public Dictionary Map { get { return this.MapOption; } set { this.MapOption = new Option>(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option(value); } } + + /// + /// Used to track the state of UuidWithPattern + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidWithPatternOption { get; private set; } + + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid? UuidWithPattern { get { return this.UuidWithPatternOption; } set { this.UuidWithPatternOption = 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 MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).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) + { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + + if (this.UuidWithPatternOption.Value != null &&!regexUuidWithPattern.Match(this.UuidWithPatternOption.Value.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixedPropertiesAndAdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedPropertiesAndAdditionalPropertiesClass 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 dateTime = default; + Option> map = default; + Option uuid = default; + Option uuidWithPattern = 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 "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + case "uuid_with_pattern": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map.IsSet && map.Value == null) + throw new ArgumentNullException(nameof(map), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuidWithPattern.IsSet && uuidWithPattern.Value == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.IsSet) + writer.WriteString("dateTime", mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet) + { + writer.WritePropertyName("map"); + JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); + } + if (mixedPropertiesAndAdditionalPropertiesClass.UuidOption.IsSet) + writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.UuidOption.Value.Value); + + if (mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.IsSet) + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..1af8feed0a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 00000000000..30ee980fae9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name starting with number + /// + public partial class Model200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + /// name + [JsonConstructor] + public Model200Response(Option @class = default, Option name = default) + { + ClassOption = @class; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public int? Name { get { return this.NameOption; } set { this.NameOption = 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 Model200Response {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" Name: ").Append(Name).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 Model200ResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Model200Response 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 varClass = default; + Option name = 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 "class": + varClass = new Option(utf8JsonReader.GetString()); + break; + case "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class Model200Response."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Model200Response."); + + return new Model200Response(varClass, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, model200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (model200Response.ClassOption.IsSet) + writer.WriteString("class", model200Response.Class); + + if (model200Response.NameOption.IsSet) + writer.WriteNumber("name", model200Response.NameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 00000000000..28da419bb21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ModelClient + /// + public partial class ModelClient : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varClient + [JsonConstructor] + public ModelClient(Option varClient = default) + { + VarClientOption = varClient; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarClient + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarClientOption { get; private set; } + + /// + /// Gets or Sets VarClient + /// + [JsonPropertyName("client")] + public string VarClient { get { return this.VarClientOption; } set { this.VarClientOption = 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 ModelClient {\n"); + sb.Append(" VarClient: ").Append(VarClient).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 ModelClientJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ModelClient 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 varClient = 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 "client": + varClient = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClient.IsSet && varClient.Value == null) + throw new ArgumentNullException(nameof(varClient), "Property is not nullable for class ModelClient."); + + return new ModelClient(varClient); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, modelClient, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (modelClient.VarClientOption.IsSet) + writer.WriteString("client", modelClient.VarClient); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 00000000000..f353f694fb2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,291 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name same as property name + /// + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varName + /// property + /// snakeCase + /// var123Number + [JsonConstructor] + public Name(int varName, Option property = default, Option snakeCase = default, Option var123Number = default) + { + VarName = varName; + PropertyOption = property; + SnakeCaseOption = snakeCase; + Var123NumberOption = var123Number; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets VarName + /// + [JsonPropertyName("name")] + public int VarName { get; set; } + + /// + /// Used to track the state of Property + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PropertyOption { get; private set; } + + /// + /// Gets or Sets Property + /// + [JsonPropertyName("property")] + public string Property { get { return this.PropertyOption; } set { this.PropertyOption = new Option(value); } } + + /// + /// Used to track the state of SnakeCase + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SnakeCaseOption { get; } + + /// + /// Gets or Sets SnakeCase + /// + [JsonPropertyName("snake_case")] + public int? SnakeCase { get { return this.SnakeCaseOption; } } + + /// + /// Used to track the state of Var123Number + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123NumberOption { get; } + + /// + /// Gets or Sets Var123Number + /// + [JsonPropertyName("123Number")] + public int? Var123Number { get { return this.Var123NumberOption; } } + + /// + /// 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 Name {\n"); + sb.Append(" VarName: ").Append(VarName).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Var123Number: ").Append(Var123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name 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 (SnakeCase != null) + hashCode = (hashCode * 59) + SnakeCase.GetHashCode(); + + if (Var123Number != null) + hashCode = (hashCode * 59) + Var123Number.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 NameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Name 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 varName = default; + Option property = default; + Option snakeCase = default; + Option var123Number = 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 "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varName = new Option(utf8JsonReader.GetInt32()); + break; + case "property": + property = new Option(utf8JsonReader.GetString()); + break; + case "snake_case": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = new Option(utf8JsonReader.GetInt32()); + break; + case "123Number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + var123Number = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!varName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(varName)); + + if (varName.IsSet && varName.Value == null) + throw new ArgumentNullException(nameof(varName), "Property is not nullable for class Name."); + + if (property.IsSet && property.Value == null) + throw new ArgumentNullException(nameof(property), "Property is not nullable for class Name."); + + if (snakeCase.IsSet && snakeCase.Value == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is not nullable for class Name."); + + if (var123Number.IsSet && var123Number.Value == null) + throw new ArgumentNullException(nameof(var123Number), "Property is not nullable for class Name."); + + return new Name(varName.Value.Value, property, snakeCase, var123Number); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, name, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteNumber("name", name.VarName); + + if (name.PropertyOption.IsSet) + writer.WriteString("property", name.Property); + + if (name.SnakeCaseOption.IsSet) + writer.WriteNumber("snake_case", name.SnakeCaseOption.Value.Value); + + if (name.Var123NumberOption.IsSet) + writer.WriteNumber("123Number", name.Var123NumberOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs new file mode 100644 index 00000000000..ea8abdda0d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -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 + * 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 +{ + /// + /// NotificationtestGetElementsV1ResponseMPayload + /// + public partial class NotificationtestGetElementsV1ResponseMPayload : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// aObjVariableobject + /// pkiNotificationtestID + [JsonConstructor] + public NotificationtestGetElementsV1ResponseMPayload(List> aObjVariableobject, int pkiNotificationtestID) + { + AObjVariableobject = aObjVariableobject; + PkiNotificationtestID = pkiNotificationtestID; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AObjVariableobject + /// + [JsonPropertyName("a_objVariableobject")] + public List> AObjVariableobject { get; set; } + + /// + /// Gets or Sets PkiNotificationtestID + /// + [JsonPropertyName("pkiNotificationtestID")] + public int PkiNotificationtestID { get; set; } + + /// + /// 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 NotificationtestGetElementsV1ResponseMPayload {\n"); + sb.Append(" AObjVariableobject: ").Append(AObjVariableobject).Append("\n"); + sb.Append(" PkiNotificationtestID: ").Append(PkiNotificationtestID).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 NotificationtestGetElementsV1ResponseMPayloadJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NotificationtestGetElementsV1ResponseMPayload 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>> aObjVariableobject = default; + Option pkiNotificationtestID = 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 "a_objVariableobject": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pkiNotificationtestID": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!aObjVariableobject.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(aObjVariableobject)); + + if (!pkiNotificationtestID.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(pkiNotificationtestID)); + + if (aObjVariableobject.IsSet && aObjVariableobject.Value == null) + throw new ArgumentNullException(nameof(aObjVariableobject), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + if (pkiNotificationtestID.IsSet && pkiNotificationtestID.Value == null) + throw new ArgumentNullException(nameof(pkiNotificationtestID), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + return new NotificationtestGetElementsV1ResponseMPayload(aObjVariableobject.Value, pkiNotificationtestID.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WritePropertyName("a_objVariableobject"); + JsonSerializer.Serialize(writer, notificationtestGetElementsV1ResponseMPayload.AObjVariableobject, jsonSerializerOptions); + writer.WriteNumber("pkiNotificationtestID", notificationtestGetElementsV1ResponseMPayload.PkiNotificationtestID); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 00000000000..ff026f1fbb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,496 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// NullableClass + /// + public partial class NullableClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayAndItemsNullableProp + /// arrayItemsNullable + /// arrayNullableProp + /// booleanProp + /// dateProp + /// datetimeProp + /// integerProp + /// numberProp + /// objectAndItemsNullableProp + /// objectItemsNullable + /// objectNullableProp + /// stringProp + [JsonConstructor] + public NullableClass(Option> arrayAndItemsNullableProp = default, Option> arrayItemsNullable = default, Option> arrayNullableProp = default, Option booleanProp = default, Option dateProp = default, Option datetimeProp = default, Option integerProp = default, Option numberProp = default, Option> objectAndItemsNullableProp = default, Option> objectItemsNullable = default, Option> objectNullableProp = default, Option stringProp = default) + { + ArrayAndItemsNullablePropOption = arrayAndItemsNullableProp; + ArrayItemsNullableOption = arrayItemsNullable; + ArrayNullablePropOption = arrayNullableProp; + BooleanPropOption = booleanProp; + DatePropOption = dateProp; + DatetimePropOption = datetimeProp; + IntegerPropOption = integerProp; + NumberPropOption = numberProp; + ObjectAndItemsNullablePropOption = objectAndItemsNullableProp; + ObjectItemsNullableOption = objectItemsNullable; + ObjectNullablePropOption = objectNullableProp; + StringPropOption = stringProp; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [JsonPropertyName("array_and_items_nullable_prop")] + public List ArrayAndItemsNullableProp { get { return this.ArrayAndItemsNullablePropOption; } set { this.ArrayAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [JsonPropertyName("array_items_nullable")] + public List ArrayItemsNullable { get { return this.ArrayItemsNullableOption; } set { this.ArrayItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [JsonPropertyName("array_nullable_prop")] + public List ArrayNullableProp { get { return this.ArrayNullablePropOption; } set { this.ArrayNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of BooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BooleanPropOption { get; private set; } + + /// + /// Gets or Sets BooleanProp + /// + [JsonPropertyName("boolean_prop")] + public bool? BooleanProp { get { return this.BooleanPropOption; } set { this.BooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of DateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatePropOption { get; private set; } + + /// + /// Gets or Sets DateProp + /// + [JsonPropertyName("date_prop")] + public DateTime? DateProp { get { return this.DatePropOption; } set { this.DatePropOption = new Option(value); } } + + /// + /// Used to track the state of DatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatetimePropOption { get; private set; } + + /// + /// Gets or Sets DatetimeProp + /// + [JsonPropertyName("datetime_prop")] + public DateTime? DatetimeProp { get { return this.DatetimePropOption; } set { this.DatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of IntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerPropOption { get; private set; } + + /// + /// Gets or Sets IntegerProp + /// + [JsonPropertyName("integer_prop")] + public int? IntegerProp { get { return this.IntegerPropOption; } set { this.IntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NumberProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberPropOption { get; private set; } + + /// + /// Gets or Sets NumberProp + /// + [JsonPropertyName("number_prop")] + public decimal? NumberProp { get { return this.NumberPropOption; } set { this.NumberPropOption = new Option(value); } } + + /// + /// Used to track the state of ObjectAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [JsonPropertyName("object_and_items_nullable_prop")] + public Dictionary ObjectAndItemsNullableProp { get { return this.ObjectAndItemsNullablePropOption; } set { this.ObjectAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [JsonPropertyName("object_items_nullable")] + public Dictionary ObjectItemsNullable { get { return this.ObjectItemsNullableOption; } set { this.ObjectItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [JsonPropertyName("object_nullable_prop")] + public Dictionary ObjectNullableProp { get { return this.ObjectNullablePropOption; } set { this.ObjectNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of StringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringPropOption { get; private set; } + + /// + /// Gets or Sets StringProp + /// + [JsonPropertyName("string_prop")] + public string StringProp { get { return this.StringPropOption; } set { this.StringPropOption = 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 NullableClass {\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).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 NullableClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateProp + /// + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DatetimeProp + /// + public static string DatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableClass 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> arrayAndItemsNullableProp = default; + Option> arrayItemsNullable = default; + Option> arrayNullableProp = default; + Option booleanProp = default; + Option dateProp = default; + Option datetimeProp = default; + Option integerProp = default; + Option numberProp = default; + Option> objectAndItemsNullableProp = default; + Option> objectItemsNullable = default; + Option> objectNullableProp = default; + Option stringProp = 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 "array_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "number_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + numberProp = new Option(utf8JsonReader.GetDecimal()); + break; + case "object_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "string_prop": + stringProp = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (arrayItemsNullable.IsSet && arrayItemsNullable.Value == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is not nullable for class NullableClass."); + + if (objectItemsNullable.IsSet && objectItemsNullable.Value == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is not nullable for class NullableClass."); + + return new NullableClass(arrayAndItemsNullableProp, arrayItemsNullable, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectItemsNullable, objectNullableProp, stringProp); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (nullableClass.ObjectItemsNullableOption.IsSet && nullableClass.ObjectItemsNullable == null) + throw new ArgumentNullException(nameof(nullableClass.ObjectItemsNullable), "Property is required for class NullableClass."); + + if (nullableClass.ArrayAndItemsNullablePropOption.IsSet) + if (nullableClass.ArrayAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("array_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_and_items_nullable_prop"); + if (nullableClass.ArrayItemsNullableOption.IsSet) + { + writer.WritePropertyName("array_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ArrayNullablePropOption.IsSet) + if (nullableClass.ArrayNullablePropOption.Value != null) + { + writer.WritePropertyName("array_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_nullable_prop"); + if (nullableClass.BooleanPropOption.IsSet) + if (nullableClass.BooleanPropOption.Value != null) + writer.WriteBoolean("boolean_prop", nullableClass.BooleanPropOption.Value.Value); + else + writer.WriteNull("boolean_prop"); + + if (nullableClass.DatePropOption.IsSet) + if (nullableClass.DatePropOption.Value != null) + writer.WriteString("date_prop", nullableClass.DatePropOption.Value.Value.ToString(DatePropFormat)); + else + writer.WriteNull("date_prop"); + + if (nullableClass.DatetimePropOption.IsSet) + if (nullableClass.DatetimePropOption.Value != null) + writer.WriteString("datetime_prop", nullableClass.DatetimePropOption.Value.Value.ToString(DatetimePropFormat)); + else + writer.WriteNull("datetime_prop"); + + if (nullableClass.IntegerPropOption.IsSet) + if (nullableClass.IntegerPropOption.Value != null) + writer.WriteNumber("integer_prop", nullableClass.IntegerPropOption.Value.Value); + else + writer.WriteNull("integer_prop"); + + if (nullableClass.NumberPropOption.IsSet) + if (nullableClass.NumberPropOption.Value != null) + writer.WriteNumber("number_prop", nullableClass.NumberPropOption.Value.Value); + else + writer.WriteNull("number_prop"); + + if (nullableClass.ObjectAndItemsNullablePropOption.IsSet) + if (nullableClass.ObjectAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("object_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_and_items_nullable_prop"); + if (nullableClass.ObjectItemsNullableOption.IsSet) + { + writer.WritePropertyName("object_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ObjectNullablePropOption.IsSet) + if (nullableClass.ObjectNullablePropOption.Value != null) + { + writer.WritePropertyName("object_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_nullable_prop"); + if (nullableClass.StringPropOption.IsSet) + if (nullableClass.StringPropOption.Value != null) + writer.WriteString("string_prop", nullableClass.StringProp); + else + writer.WriteNull("string_prop"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs new file mode 100644 index 00000000000..8c52be7e14a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -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 + * 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 +{ + /// + /// NullableGuidClass + /// + public partial class NullableGuidClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid + [JsonConstructor] + public NullableGuidClass(Option uuid = default) + { + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 NullableGuidClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).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 NullableGuidClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableGuidClass 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 uuid = 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 "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + return new NullableGuidClass(uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + if (nullableGuidClass.UuidOption.IsSet) + if (nullableGuidClass.UuidOption.Value != null) + writer.WriteString("uuid", nullableGuidClass.UuidOption.Value.Value); + else + writer.WriteNull("uuid"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 00000000000..9a93cb734e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + public partial class NullableShape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 NullableShape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableShape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class NullableShape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); + + if (quadrilateral != null) + return new NullableShape(quadrilateral); + + if (triangle != null) + return new NullableShape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (nullableShape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); + } + + if (nullableShape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, nullableShape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 00000000000..923180c653b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -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 + * 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 +{ + /// + /// NumberOnly + /// + public partial class NumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber + [JsonConstructor] + public NumberOnly(Option justNumber = default) + { + JustNumberOption = justNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustNumberOption { get; private set; } + + /// + /// Gets or Sets JustNumber + /// + [JsonPropertyName("JustNumber")] + public decimal? JustNumber { get { return this.JustNumberOption; } set { this.JustNumberOption = 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 NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).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 NumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NumberOnly 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 justNumber = 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 "JustNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (justNumber.IsSet && justNumber.Value == null) + throw new ArgumentNullException(nameof(justNumber), "Property is not nullable for class NumberOnly."); + + return new NumberOnly(justNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, numberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 00000000000..e25bbf00940 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ObjectWithDeprecatedFields + /// + public partial class ObjectWithDeprecatedFields : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bars + /// deprecatedRef + /// id + /// uuid + [JsonConstructor] + public ObjectWithDeprecatedFields(Option> bars = default, Option deprecatedRef = default, Option id = default, Option uuid = default) + { + BarsOption = bars; + DeprecatedRefOption = deprecatedRef; + IdOption = id; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bars + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> BarsOption { get; private set; } + + /// + /// Gets or Sets Bars + /// + [JsonPropertyName("bars")] + [Obsolete] + public List Bars { get { return this.BarsOption; } set { this.BarsOption = new Option>(value); } } + + /// + /// Used to track the state of DeprecatedRef + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeprecatedRefOption { get; private set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [JsonPropertyName("deprecatedRef")] + [Obsolete] + public DeprecatedObject DeprecatedRef { get { return this.DeprecatedRefOption; } set { this.DeprecatedRefOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + [Obsolete] + public decimal? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public string Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 ObjectWithDeprecatedFields {\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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 ObjectWithDeprecatedFieldsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ObjectWithDeprecatedFields 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> bars = default; + Option deprecatedRef = default; + Option id = default; + Option uuid = 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 "bars": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deprecatedRef": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetDecimal()); + break; + case "uuid": + uuid = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bars.IsSet && bars.Value == null) + throw new ArgumentNullException(nameof(bars), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (deprecatedRef.IsSet && deprecatedRef.Value == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class ObjectWithDeprecatedFields."); + + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet && objectWithDeprecatedFields.DeprecatedRef == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.DeprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.UuidOption.IsSet && objectWithDeprecatedFields.Uuid == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.BarsOption.IsSet) + { + writer.WritePropertyName("bars"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet) + { + writer.WritePropertyName("deprecatedRef"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.IdOption.IsSet) + writer.WriteNumber("id", objectWithDeprecatedFields.IdOption.Value.Value); + + if (objectWithDeprecatedFields.UuidOption.IsSet) + writer.WriteString("uuid", objectWithDeprecatedFields.Uuid); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs new file mode 100644 index 00000000000..c89963f55a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -0,0 +1,157 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OneOfString + /// + public partial class OneOfString : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal OneOfString(string @string) + { + String = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// 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 OneOfString {\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 OneOfStringJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OneOfString 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; + + string varString = 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) + { + default: + break; + } + } + } + + if (varString != null) + return new OneOfString(varString); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, oneOfString, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 00000000000..f12f2affef3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,396 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order + /// + public partial class Order : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// complete (default to false) + /// id + /// petId + /// quantity + /// shipDate + /// Order Status + [JsonConstructor] + public Order(Option complete = default, Option id = default, Option petId = default, Option quantity = default, Option shipDate = default, Option status = default) + { + CompleteOption = complete; + IdOption = id; + PetIdOption = petId; + QuantityOption = quantity; + ShipDateOption = shipDate; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Order Status + /// + /// Order Status + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("placed")) + return StatusEnum.Placed; + + if (value.Equals("approved")) + return StatusEnum.Approved; + + if (value.Equals("delivered")) + return StatusEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("placed")) + return StatusEnum.Placed; + + if (value.Equals("approved")) + return StatusEnum.Approved; + + if (value.Equals("delivered")) + return StatusEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Placed) + return "placed"; + + if (value == StatusEnum.Approved) + return "approved"; + + if (value == StatusEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Order Status + /// + /// Order Status + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Used to track the state of Complete + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CompleteOption { get; private set; } + + /// + /// Gets or Sets Complete + /// + [JsonPropertyName("complete")] + public bool? Complete { get { return this.CompleteOption; } set { this.CompleteOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of PetId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PetIdOption { get; private set; } + + /// + /// Gets or Sets PetId + /// + [JsonPropertyName("petId")] + public long? PetId { get { return this.PetIdOption; } set { this.PetIdOption = new Option(value); } } + + /// + /// Used to track the state of Quantity + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option QuantityOption { get; private set; } + + /// + /// Gets or Sets Quantity + /// + [JsonPropertyName("quantity")] + public int? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } + + /// + /// Used to track the state of ShipDate + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipDateOption { get; private set; } + + /// + /// Gets or Sets ShipDate + /// + /// 2020-02-02T20:20:20.000222Z + [JsonPropertyName("shipDate")] + public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = 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 Order {\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).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 OrderJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ShipDate + /// + public static string ShipDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Order 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 complete = default; + Option id = default; + Option petId = default; + Option quantity = default; + Option shipDate = default; + Option status = 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 "complete": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = new Option(utf8JsonReader.GetBoolean()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "petId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = new Option(utf8JsonReader.GetInt64()); + break; + case "quantity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = new Option(utf8JsonReader.GetInt32()); + break; + case "shipDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(Order.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } + } + + if (complete.IsSet && complete.Value == null) + throw new ArgumentNullException(nameof(complete), "Property is not nullable for class Order."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Order."); + + if (petId.IsSet && petId.Value == null) + throw new ArgumentNullException(nameof(petId), "Property is not nullable for class Order."); + + if (quantity.IsSet && quantity.Value == null) + throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class Order."); + + if (shipDate.IsSet && shipDate.Value == null) + throw new ArgumentNullException(nameof(shipDate), "Property is not nullable for class Order."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Order."); + + return new Order(complete, id, petId, quantity, shipDate, status); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, order, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + if (order.CompleteOption.IsSet) + writer.WriteBoolean("complete", order.CompleteOption.Value.Value); + + if (order.IdOption.IsSet) + writer.WriteNumber("id", order.IdOption.Value.Value); + + if (order.PetIdOption.IsSet) + writer.WriteNumber("petId", order.PetIdOption.Value.Value); + + if (order.QuantityOption.IsSet) + writer.WriteNumber("quantity", order.QuantityOption.Value.Value); + + if (order.ShipDateOption.IsSet) + writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat)); + + var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 00000000000..dbf262b28c3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,228 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OuterComposite + /// + public partial class OuterComposite : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myBoolean + /// myNumber + /// myString + [JsonConstructor] + public OuterComposite(Option myBoolean = default, Option myNumber = default, Option myString = default) + { + MyBooleanOption = myBoolean; + MyNumberOption = myNumber; + MyStringOption = myString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MyBoolean + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyBooleanOption { get; private set; } + + /// + /// Gets or Sets MyBoolean + /// + [JsonPropertyName("my_boolean")] + public bool? MyBoolean { get { return this.MyBooleanOption; } set { this.MyBooleanOption = new Option(value); } } + + /// + /// Used to track the state of MyNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyNumberOption { get; private set; } + + /// + /// Gets or Sets MyNumber + /// + [JsonPropertyName("my_number")] + public decimal? MyNumber { get { return this.MyNumberOption; } set { this.MyNumberOption = new Option(value); } } + + /// + /// Used to track the state of MyString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyStringOption { get; private set; } + + /// + /// Gets or Sets MyString + /// + [JsonPropertyName("my_string")] + public string MyString { get { return this.MyStringOption; } set { this.MyStringOption = 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 OuterComposite {\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).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 OuterCompositeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OuterComposite 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 myBoolean = default; + Option myNumber = default; + Option myString = 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 "my_boolean": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = new Option(utf8JsonReader.GetBoolean()); + break; + case "my_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = new Option(utf8JsonReader.GetDecimal()); + break; + case "my_string": + myString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (myBoolean.IsSet && myBoolean.Value == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is not nullable for class OuterComposite."); + + if (myNumber.IsSet && myNumber.Value == null) + throw new ArgumentNullException(nameof(myNumber), "Property is not nullable for class OuterComposite."); + + if (myString.IsSet && myString.Value == null) + throw new ArgumentNullException(nameof(myString), "Property is not nullable for class OuterComposite."); + + return new OuterComposite(myBoolean, myNumber, myString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, outerComposite, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (outerComposite.MyBooleanOption.IsSet) + writer.WriteBoolean("my_boolean", outerComposite.MyBooleanOption.Value.Value); + + if (outerComposite.MyNumberOption.IsSet) + writer.WriteNumber("my_number", outerComposite.MyNumberOption.Value.Value); + + if (outerComposite.MyStringOption.IsSet) + writer.WriteString("my_string", outerComposite.MyString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 00000000000..47bb6793c6a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnum + /// + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum FromString(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnum value) + { + if (value == OuterEnum.Placed) + return "placed"; + + if (value == OuterEnum.Approved) + return "approved"; + + if (value == OuterEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnum from the Json object + /// + /// + /// + /// + /// + public override OuterEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum? outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 00000000000..136fb4c54c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnumDefaultValue + /// + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue FromString(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnumDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumDefaultValue value) + { + if (value == OuterEnumDefaultValue.Placed) + return "placed"; + + if (value == OuterEnumDefaultValue.Approved) + return "approved"; + + if (value == OuterEnumDefaultValue.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue? outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 00000000000..2ed4f18a657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumInteger from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger? outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 00000000000..c6a470cc64d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumIntegerDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumIntegerDefaultValue value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumIntegerDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumIntegerDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs new file mode 100644 index 00000000000..a2e789f2ede --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs @@ -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 + * 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 +{ + /// + /// Defines Outer_Enum_Test + /// + public enum OuterEnumTest + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumTestValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest FromString(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumTest: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumTest value) + { + if (value == OuterEnumTest.UPPER) + return "UPPER"; + + if (value == OuterEnumTest.Lower) + return "lower"; + + if (value == OuterEnumTest.Empty) + return ""; + + if (value == OuterEnumTest.ValuewithTab) + return "Value\twith tab"; + + if (value == OuterEnumTest.ValueWithQuote) + return "Value with \" quote"; + + if (value == OuterEnumTest.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == OuterEnumTest.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == OuterEnumTest.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumTestJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumTest to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumTestNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumTest from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest? outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 00000000000..5d1cab769fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -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 + * 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 +{ + /// + /// ParentPet + /// + public partial class ParentPet : GrandparentAnimal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + 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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ParentPetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ParentPet 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ParentPet.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); + + return new ParentPet(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + writer.WriteStartObject(); + + WriteProperties(writer, parentPet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", parentPet.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 00000000000..ef5f3c898b6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,396 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pet + /// + public partial class Pet : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + /// photoUrls + /// category + /// id + /// pet status in the store + /// tags + [JsonConstructor] + public Pet(string name, List photoUrls, Option category = default, Option id = default, Option status = default, Option> tags = default) + { + Name = name; + PhotoUrls = photoUrls; + CategoryOption = category; + IdOption = id; + StatusOption = status; + TagsOption = tags; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// pet status in the store + /// + /// pet status in the store + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("available")) + return StatusEnum.Available; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("sold")) + return StatusEnum.Sold; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("available")) + return StatusEnum.Available; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("sold")) + return StatusEnum.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Available) + return "available"; + + if (value == StatusEnum.Pending) + return "pending"; + + if (value == StatusEnum.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// pet status in the store + /// + /// pet status in the store + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + /// doggie + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [JsonPropertyName("photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Used to track the state of Category + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryOption { get; private set; } + + /// + /// Gets or Sets Category + /// + [JsonPropertyName("category")] + public Category Category { get { return this.CategoryOption; } set { this.CategoryOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TagsOption { get; private set; } + + /// + /// Gets or Sets Tags + /// + [JsonPropertyName("tags")] + public List Tags { get { return this.TagsOption; } set { this.TagsOption = 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 Pet {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Tags: ").Append(Tags).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 PetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pet 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 name = default; + Option> photoUrls = default; + Option category = default; + Option id = default; + Option status = default; + Option> tags = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "photoUrls": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "category": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "tags": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(name)); + + if (!photoUrls.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(photoUrls)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Pet."); + + if (photoUrls.IsSet && photoUrls.Value == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is not nullable for class Pet."); + + if (category.IsSet && category.Value == null) + throw new ArgumentNullException(nameof(category), "Property is not nullable for class Pet."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Pet."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Pet."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class Pet."); + + return new Pet(name.Value, photoUrls.Value, category, id, status, tags); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, pet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (pet.PhotoUrls == null) + throw new ArgumentNullException(nameof(pet.PhotoUrls), "Property is required for class Pet."); + + if (pet.CategoryOption.IsSet && pet.Category == null) + throw new ArgumentNullException(nameof(pet.Category), "Property is required for class Pet."); + + if (pet.TagsOption.IsSet && pet.Tags == null) + throw new ArgumentNullException(nameof(pet.Tags), "Property is required for class Pet."); + + writer.WriteString("name", pet.Name); + + writer.WritePropertyName("photoUrls"); + JsonSerializer.Serialize(writer, pet.PhotoUrls, jsonSerializerOptions); + if (pet.CategoryOption.IsSet) + { + writer.WritePropertyName("category"); + JsonSerializer.Serialize(writer, pet.Category, jsonSerializerOptions); + } + if (pet.IdOption.IsSet) + writer.WriteNumber("id", pet.IdOption.Value.Value); + + var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); + if (pet.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, pet.Tags, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 00000000000..b6f300c9440 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pig + /// + public partial class Pig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(BasquePig basquePig) + { + BasquePig = basquePig; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(DanishPig danishPig) + { + DanishPig = danishPig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets BasquePig + /// + public BasquePig BasquePig { get; set; } + + /// + /// Gets or Sets DanishPig + /// + public DanishPig DanishPig { get; set; } + + /// + /// 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 Pig {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pig 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 className = default; + + BasquePig basquePig = null; + DanishPig danishPig = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("BasquePig")) + { + Utf8JsonReader utf8JsonReaderBasquePig = utf8JsonReader; + basquePig = JsonSerializer.Deserialize(ref utf8JsonReaderBasquePig, jsonSerializerOptions); + } + if (discriminator.Equals("DanishPig")) + { + Utf8JsonReader utf8JsonReaderDanishPig = utf8JsonReader; + danishPig = JsonSerializer.Deserialize(ref utf8JsonReaderDanishPig, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Pig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); + + if (basquePig != null) + return new Pig(basquePig); + + if (danishPig != null) + return new Pig(danishPig); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (pig.BasquePig != null) + { + BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); + } + + if (pig.DanishPig != null) + { + DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); + } + + WriteProperties(writer, pig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs new file mode 100644 index 00000000000..ddea47edf40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// PolymorphicProperty + /// + public partial class PolymorphicProperty : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(Object @object) + { + Object = @object; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(List list) + { + List = list; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Object + /// + public Object Object { get; set; } + + /// + /// Gets or Sets List + /// + public List List { get; set; } + + /// + /// 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 PolymorphicProperty {\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 PolymorphicPropertyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PolymorphicProperty 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; + + bool? varBool = default; + string varString = default; + Object varObject = default; + List list = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); + + Utf8JsonReader utf8JsonReaderList = utf8JsonReader; + ClientUtils.TryDeserialize>(ref utf8JsonReaderList, jsonSerializerOptions, out list); + } + } + + 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) + { + default: + break; + } + } + } + + if (varBool != null) + return new PolymorphicProperty(varBool.Value); + + if (varString != null) + return new PolymorphicProperty(varString); + + if (varObject != null) + return new PolymorphicProperty(varObject); + + if (list != null) + return new PolymorphicProperty(list); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 00000000000..e8a2e243997 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Quadrilateral + /// + public partial class Quadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) + { + SimpleQuadrilateral = simpleQuadrilateral; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) + { + ComplexQuadrilateral = complexQuadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SimpleQuadrilateral + /// + public SimpleQuadrilateral SimpleQuadrilateral { get; set; } + + /// + /// Gets or Sets ComplexQuadrilateral + /// + public ComplexQuadrilateral ComplexQuadrilateral { get; set; } + + /// + /// 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 Quadrilateral {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Quadrilateral 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 quadrilateralType = default; + + ComplexQuadrilateral complexQuadrilateral = null; + SimpleQuadrilateral simpleQuadrilateral = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("quadrilateralType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("ComplexQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderComplexQuadrilateral = utf8JsonReader; + complexQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderComplexQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("SimpleQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderSimpleQuadrilateral = utf8JsonReader; + simpleQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderSimpleQuadrilateral, jsonSerializerOptions); + } + } + } + } + + 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class Quadrilateral.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); + + if (complexQuadrilateral != null) + return new Quadrilateral(complexQuadrilateral); + + if (simpleQuadrilateral != null) + return new Quadrilateral(simpleQuadrilateral); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (quadrilateral.SimpleQuadrilateral != null) + { + SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + } + + if (quadrilateral.ComplexQuadrilateral != null) + { + ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, quadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 00000000000..519ed66393c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// QuadrilateralInterface + /// + public partial class QuadrilateralInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + [JsonConstructor] + public QuadrilateralInterface(string quadrilateralType) + { + QuadrilateralType = quadrilateralType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// 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 QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).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 QuadrilateralInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override QuadrilateralInterface 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 quadrilateralType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class QuadrilateralInterface.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class QuadrilateralInterface."); + + return new QuadrilateralInterface(quadrilateralType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("quadrilateralType", quadrilateralInterface.QuadrilateralType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..afb58fb0e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -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 + * 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 +{ + /// + /// ReadOnlyFirst + /// + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// baz + [JsonConstructor] + public ReadOnlyFirst(Option bar = default, Option baz = default) + { + BarOption = bar; + BazOption = baz; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Baz + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BazOption { get; private set; } + + /// + /// Gets or Sets Baz + /// + [JsonPropertyName("baz")] + public string Baz { get { return this.BazOption; } set { this.BazOption = 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 ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 ReadOnlyFirstJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ReadOnlyFirst 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 bar = default; + Option baz = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "baz": + baz = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class ReadOnlyFirst."); + + if (baz.IsSet && baz.Value == null) + throw new ArgumentNullException(nameof(baz), "Property is not nullable for class ReadOnlyFirst."); + + return new ReadOnlyFirst(bar, baz); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (readOnlyFirst.BazOption.IsSet && readOnlyFirst.Baz == null) + throw new ArgumentNullException(nameof(readOnlyFirst.Baz), "Property is required for class ReadOnlyFirst."); + + if (readOnlyFirst.BarOption.IsSet) + writer.WriteString("bar", readOnlyFirst.Bar); + + if (readOnlyFirst.BazOption.IsSet) + writer.WriteString("baz", readOnlyFirst.Baz); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs new file mode 100644 index 00000000000..fdc63ca701d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -0,0 +1,2378 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RequiredClass + /// + public partial class RequiredClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// requiredNotNullableDateProp + /// requiredNotnullableArrayOfString + /// requiredNotnullableBooleanProp + /// requiredNotnullableDatetimeProp + /// requiredNotnullableEnumInteger + /// requiredNotnullableEnumIntegerOnly + /// requiredNotnullableEnumString + /// requiredNotnullableOuterEnumDefaultValue + /// requiredNotnullableStringProp + /// requiredNotnullableUuid + /// requiredNotnullableintegerProp + /// notRequiredNotnullableDateProp + /// notRequiredNotnullableintegerProp + /// notRequiredNullableDateProp + /// notRequiredNullableIntegerProp + /// notrequiredNotnullableArrayOfString + /// notrequiredNotnullableBooleanProp + /// notrequiredNotnullableDatetimeProp + /// notrequiredNotnullableEnumInteger + /// notrequiredNotnullableEnumIntegerOnly + /// notrequiredNotnullableEnumString + /// notrequiredNotnullableOuterEnumDefaultValue + /// notrequiredNotnullableStringProp + /// notrequiredNotnullableUuid + /// notrequiredNullableArrayOfString + /// notrequiredNullableBooleanProp + /// notrequiredNullableDatetimeProp + /// notrequiredNullableEnumInteger + /// notrequiredNullableEnumIntegerOnly + /// notrequiredNullableEnumString + /// 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, 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; + RequiredNotnullableBooleanProp = requiredNotnullableBooleanProp; + RequiredNotnullableDatetimeProp = requiredNotnullableDatetimeProp; + RequiredNotnullableEnumInteger = requiredNotnullableEnumInteger; + RequiredNotnullableEnumIntegerOnly = requiredNotnullableEnumIntegerOnly; + RequiredNotnullableEnumString = requiredNotnullableEnumString; + RequiredNotnullableOuterEnumDefaultValue = requiredNotnullableOuterEnumDefaultValue; + RequiredNotnullableStringProp = requiredNotnullableStringProp; + RequiredNotnullableUuid = requiredNotnullableUuid; + RequiredNotnullableintegerProp = requiredNotnullableintegerProp; + NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; + NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; + NotRequiredNullableDatePropOption = notRequiredNullableDateProp; + NotRequiredNullableIntegerPropOption = notRequiredNullableIntegerProp; + NotrequiredNotnullableArrayOfStringOption = notrequiredNotnullableArrayOfString; + NotrequiredNotnullableBooleanPropOption = notrequiredNotnullableBooleanProp; + NotrequiredNotnullableDatetimePropOption = notrequiredNotnullableDatetimeProp; + NotrequiredNotnullableEnumIntegerOption = notrequiredNotnullableEnumInteger; + NotrequiredNotnullableEnumIntegerOnlyOption = notrequiredNotnullableEnumIntegerOnly; + NotrequiredNotnullableEnumStringOption = notrequiredNotnullableEnumString; + NotrequiredNotnullableOuterEnumDefaultValueOption = notrequiredNotnullableOuterEnumDefaultValue; + NotrequiredNotnullableStringPropOption = notrequiredNotnullableStringProp; + NotrequiredNotnullableUuidOption = notrequiredNotnullableUuid; + NotrequiredNullableArrayOfStringOption = notrequiredNullableArrayOfString; + NotrequiredNullableBooleanPropOption = notrequiredNullableBooleanProp; + NotrequiredNullableDatetimePropOption = notrequiredNullableDatetimeProp; + NotrequiredNullableEnumIntegerOption = notrequiredNullableEnumInteger; + NotrequiredNullableEnumIntegerOnlyOption = notrequiredNullableEnumIntegerOnly; + NotrequiredNullableEnumStringOption = notrequiredNullableEnumString; + 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(); + } + + partial void OnCreated(); + + /// + /// Defines RequiredNotnullableEnumInteger + /// + public enum RequiredNotnullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNotnullableEnumIntegerEnum RequiredNotnullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumIntegerEnum? RequiredNotnullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNotnullableEnumIntegerEnumToJsonValue(RequiredNotnullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNotnullableEnumInteger + /// + [JsonPropertyName("required_notnullable_enum_integer")] + public RequiredNotnullableEnumIntegerEnum RequiredNotnullableEnumInteger { get; set; } + + /// + /// Defines RequiredNotnullableEnumIntegerOnly + /// + public enum RequiredNotnullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNotnullableEnumIntegerOnlyEnum RequiredNotnullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumIntegerOnlyEnum? RequiredNotnullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(RequiredNotnullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("required_notnullable_enum_integer_only")] + public RequiredNotnullableEnumIntegerOnlyEnum RequiredNotnullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNotnullableEnumString + /// + public enum RequiredNotnullableEnumStringEnum + { + /// + /// 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 RequiredNotnullableEnumStringEnum RequiredNotnullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumStringEnum? RequiredNotnullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RequiredNotnullableEnumStringEnumToJsonValue(RequiredNotnullableEnumStringEnum value) + { + if (value == RequiredNotnullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNotnullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNotnullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNotnullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNotnullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNotnullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNotnullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNotnullableEnumString + /// + [JsonPropertyName("required_notnullable_enum_string")] + public RequiredNotnullableEnumStringEnum RequiredNotnullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } + + /// + /// Defines NotrequiredNotnullableEnumInteger + /// + public enum NotrequiredNotnullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerEnum NotrequiredNotnullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerEnum? NotrequiredNotnullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNotnullableEnumIntegerEnumToJsonValue(NotrequiredNotnullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumInteger + /// + [JsonPropertyName("notrequired_notnullable_enum_integer")] + public NotrequiredNotnullableEnumIntegerEnum? NotrequiredNotnullableEnumInteger { get { return this.NotrequiredNotnullableEnumIntegerOption; } set { this.NotrequiredNotnullableEnumIntegerOption = new Option(value); } } + + /// + /// Defines NotrequiredNotnullableEnumIntegerOnly + /// + public enum NotrequiredNotnullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerOnlyEnum NotrequiredNotnullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerOnlyEnum? NotrequiredNotnullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(NotrequiredNotnullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_notnullable_enum_integer_only")] + public NotrequiredNotnullableEnumIntegerOnlyEnum? NotrequiredNotnullableEnumIntegerOnly { get { return this.NotrequiredNotnullableEnumIntegerOnlyOption; } set { this.NotrequiredNotnullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines NotrequiredNotnullableEnumString + /// + public enum NotrequiredNotnullableEnumStringEnum + { + /// + /// 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 NotrequiredNotnullableEnumStringEnum NotrequiredNotnullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumStringEnum? NotrequiredNotnullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string NotrequiredNotnullableEnumStringEnumToJsonValue(NotrequiredNotnullableEnumStringEnum? value) + { + if (value == NotrequiredNotnullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == NotrequiredNotnullableEnumStringEnum.Lower) + return "lower"; + + if (value == NotrequiredNotnullableEnumStringEnum.Empty) + return ""; + + if (value == NotrequiredNotnullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == NotrequiredNotnullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == NotrequiredNotnullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == NotrequiredNotnullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumString + /// + [JsonPropertyName("notrequired_notnullable_enum_string")] + public NotrequiredNotnullableEnumStringEnum? NotrequiredNotnullableEnumString { get { return this.NotrequiredNotnullableEnumStringOption; } set { this.NotrequiredNotnullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNotnullableOuterEnumDefaultValue { get { return this.NotrequiredNotnullableOuterEnumDefaultValueOption; } set { this.NotrequiredNotnullableOuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumInteger + /// + public enum NotrequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNullableEnumIntegerEnum NotrequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumIntegerEnum? NotrequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNullableEnumIntegerEnumToJsonValue(NotrequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumInteger + /// + [JsonPropertyName("notrequired_nullable_enum_integer")] + public NotrequiredNullableEnumIntegerEnum? NotrequiredNullableEnumInteger { get { return this.NotrequiredNullableEnumIntegerOption; } set { this.NotrequiredNullableEnumIntegerOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumIntegerOnly + /// + public enum NotrequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNullableEnumIntegerOnlyEnum NotrequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumIntegerOnlyEnum? NotrequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(NotrequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_nullable_enum_integer_only")] + public NotrequiredNullableEnumIntegerOnlyEnum? NotrequiredNullableEnumIntegerOnly { get { return this.NotrequiredNullableEnumIntegerOnlyOption; } set { this.NotrequiredNullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumString + /// + public enum NotrequiredNullableEnumStringEnum + { + /// + /// 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 NotrequiredNullableEnumStringEnum NotrequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumStringEnum? NotrequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string NotrequiredNullableEnumStringEnumToJsonValue(NotrequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == NotrequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == NotrequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == NotrequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == NotrequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == NotrequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == NotrequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == NotrequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of NotrequiredNullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumString + /// + [JsonPropertyName("notrequired_nullable_enum_string")] + public NotrequiredNullableEnumStringEnum? NotrequiredNullableEnumString { get { return this.NotrequiredNullableEnumStringOption; } set { this.NotrequiredNullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableOuterEnumDefaultValue + /// + [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 + /// + [JsonPropertyName("required_not_nullable_date_prop")] + public DateTime RequiredNotNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableArrayOfString + /// + [JsonPropertyName("required_notnullable_array_of_string")] + public List RequiredNotnullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableBooleanProp + /// + [JsonPropertyName("required_notnullable_boolean_prop")] + public bool RequiredNotnullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableDatetimeProp + /// + [JsonPropertyName("required_notnullable_datetime_prop")] + public DateTime RequiredNotnullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableStringProp + /// + [JsonPropertyName("required_notnullable_string_prop")] + public string RequiredNotnullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_notnullable_uuid")] + public Guid RequiredNotnullableUuid { get; set; } + + /// + /// Gets or Sets RequiredNotnullableintegerProp + /// + [JsonPropertyName("required_notnullableinteger_prop")] + public int RequiredNotnullableintegerProp { get; set; } + + /// + /// Used to track the state of NotRequiredNotnullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableDateProp + /// + [JsonPropertyName("not_required_notnullable_date_prop")] + public DateTime? NotRequiredNotnullableDateProp { get { return this.NotRequiredNotnullableDatePropOption; } set { this.NotRequiredNotnullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNotnullableintegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableintegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableintegerProp + /// + [JsonPropertyName("not_required_notnullableinteger_prop")] + public int? NotRequiredNotnullableintegerProp { get { return this.NotRequiredNotnullableintegerPropOption; } set { this.NotRequiredNotnullableintegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableDateProp + /// + [JsonPropertyName("not_required_nullable_date_prop")] + public DateTime? NotRequiredNullableDateProp { get { return this.NotRequiredNullableDatePropOption; } set { this.NotRequiredNullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableIntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableIntegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableIntegerProp + /// + [JsonPropertyName("not_required_nullable_integer_prop")] + public int? NotRequiredNullableIntegerProp { get { return this.NotRequiredNullableIntegerPropOption; } set { this.NotRequiredNullableIntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNotnullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableArrayOfString + /// + [JsonPropertyName("notrequired_notnullable_array_of_string")] + public List NotrequiredNotnullableArrayOfString { get { return this.NotrequiredNotnullableArrayOfStringOption; } set { this.NotrequiredNotnullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableBooleanProp + /// + [JsonPropertyName("notrequired_notnullable_boolean_prop")] + public bool? NotrequiredNotnullableBooleanProp { get { return this.NotrequiredNotnullableBooleanPropOption; } set { this.NotrequiredNotnullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableDatetimeProp + /// + [JsonPropertyName("notrequired_notnullable_datetime_prop")] + public DateTime? NotrequiredNotnullableDatetimeProp { get { return this.NotrequiredNotnullableDatetimePropOption; } set { this.NotrequiredNotnullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableStringProp + /// + [JsonPropertyName("notrequired_notnullable_string_prop")] + public string NotrequiredNotnullableStringProp { get { return this.NotrequiredNotnullableStringPropOption; } set { this.NotrequiredNotnullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("notrequired_notnullable_uuid")] + public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableArrayOfString + /// + [JsonPropertyName("notrequired_nullable_array_of_string")] + public List NotrequiredNullableArrayOfString { get { return this.NotrequiredNullableArrayOfStringOption; } set { this.NotrequiredNullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableBooleanProp + /// + [JsonPropertyName("notrequired_nullable_boolean_prop")] + public bool? NotrequiredNullableBooleanProp { get { return this.NotrequiredNullableBooleanPropOption; } set { this.NotrequiredNullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableDatetimeProp + /// + [JsonPropertyName("notrequired_nullable_datetime_prop")] + public DateTime? NotrequiredNullableDatetimeProp { get { return this.NotrequiredNullableDatetimePropOption; } set { this.NotrequiredNullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableStringProp + /// + [JsonPropertyName("notrequired_nullable_string_prop")] + public string NotrequiredNullableStringProp { get { return this.NotrequiredNullableStringPropOption; } set { this.NotrequiredNullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [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 + /// + [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 RequiredClass {\n"); + sb.Append(" RequiredNotNullableDateProp: ").Append(RequiredNotNullableDateProp).Append("\n"); + sb.Append(" RequiredNotnullableArrayOfString: ").Append(RequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" RequiredNotnullableBooleanProp: ").Append(RequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" RequiredNotnullableDatetimeProp: ").Append(RequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNotnullableEnumInteger: ").Append(RequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" RequiredNotnullableEnumIntegerOnly: ").Append(RequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNotnullableEnumString: ").Append(RequiredNotnullableEnumString).Append("\n"); + sb.Append(" RequiredNotnullableOuterEnumDefaultValue: ").Append(RequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); + sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); + sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); + sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); + sb.Append(" NotRequiredNullableIntegerProp: ").Append(NotRequiredNullableIntegerProp).Append("\n"); + sb.Append(" NotrequiredNotnullableArrayOfString: ").Append(NotrequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNotnullableBooleanProp: ").Append(NotrequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNotnullableDatetimeProp: ").Append(NotrequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumInteger: ").Append(NotrequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumIntegerOnly: ").Append(NotrequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumString: ").Append(NotrequiredNotnullableEnumString).Append("\n"); + sb.Append(" NotrequiredNotnullableOuterEnumDefaultValue: ").Append(NotrequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" NotrequiredNotnullableStringProp: ").Append(NotrequiredNotnullableStringProp).Append("\n"); + sb.Append(" NotrequiredNotnullableUuid: ").Append(NotrequiredNotnullableUuid).Append("\n"); + sb.Append(" NotrequiredNullableArrayOfString: ").Append(NotrequiredNullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNullableBooleanProp: ").Append(NotrequiredNullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNullableDatetimeProp: ").Append(NotrequiredNullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNullableEnumInteger: ").Append(NotrequiredNullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNullableEnumIntegerOnly: ").Append(NotrequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNullableEnumString: ").Append(NotrequiredNullableEnumString).Append("\n"); + 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(); + } + + /// + /// 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 RequiredClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize RequiredNotNullableDateProp + /// + public static string RequiredNotNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNotnullableDatetimeProp + /// + public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotRequiredNotnullableDateProp + /// + public static string NotRequiredNotnullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotRequiredNullableDateProp + /// + public static string NotRequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotrequiredNotnullableDatetimeProp + /// + public static string NotrequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotrequiredNullableDatetimeProp + /// + 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 + /// + /// + /// + /// + /// + /// + public override RequiredClass 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 requiredNotNullableDateProp = default; + Option> requiredNotnullableArrayOfString = default; + Option requiredNotnullableBooleanProp = default; + Option requiredNotnullableDatetimeProp = default; + Option requiredNotnullableEnumInteger = default; + Option requiredNotnullableEnumIntegerOnly = default; + Option requiredNotnullableEnumString = default; + Option requiredNotnullableOuterEnumDefaultValue = default; + Option requiredNotnullableStringProp = default; + Option requiredNotnullableUuid = default; + Option requiredNotnullableintegerProp = 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; + 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()) + { + 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 "required_not_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_notnullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_notnullable_enum_string": + string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumStringRawValue != null) + requiredNotnullableEnumString = new Option(RequiredClass.RequiredNotnullableEnumStringEnumFromStringOrDefault(requiredNotnullableEnumStringRawValue)); + break; + case "required_notnullable_outerEnumDefaultValue": + string requiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableOuterEnumDefaultValueRawValue != null) + requiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "required_notnullable_string_prop": + requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_notnullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_enum_string": + string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumStringRawValue != null) + notrequiredNotnullableEnumString = new Option(RequiredClass.NotrequiredNotnullableEnumStringEnumFromStringOrDefault(notrequiredNotnullableEnumStringRawValue)); + break; + case "notrequired_notnullable_outerEnumDefaultValue": + string notrequiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableOuterEnumDefaultValueRawValue != null) + notrequiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_notnullable_string_prop": + notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "notrequired_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_nullable_enum_string": + string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumStringRawValue != null) + notrequiredNullableEnumString = new Option(RequiredClass.NotrequiredNullableEnumStringEnumFromStringOrDefault(notrequiredNullableEnumStringRawValue)); + break; + case "notrequired_nullable_outerEnumDefaultValue": + string notrequiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableOuterEnumDefaultValueRawValue != null) + notrequiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_nullable_string_prop": + notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_nullable_uuid": + 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; + } + } + } + + if (!requiredNotNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotNullableDateProp)); + + if (!requiredNotnullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableArrayOfString)); + + if (!requiredNotnullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableBooleanProp)); + + if (!requiredNotnullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableDatetimeProp)); + + if (!requiredNotnullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumInteger)); + + if (!requiredNotnullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumIntegerOnly)); + + if (!requiredNotnullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumString)); + + if (!requiredNotnullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableOuterEnumDefaultValue)); + + if (!requiredNotnullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableStringProp)); + + if (!requiredNotnullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableUuid)); + + if (!requiredNotnullableintegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableintegerProp)); + + if (!requiredNullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableArrayOfString)); + + if (!requiredNullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableBooleanProp)); + + if (!requiredNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDateProp)); + + if (!requiredNullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDatetimeProp)); + + if (!requiredNullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumInteger)); + + if (!requiredNullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumIntegerOnly)); + + if (!requiredNullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumString)); + + if (!requiredNullableIntegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableIntegerProp)); + + if (!requiredNullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableOuterEnumDefaultValue)); + + if (!requiredNullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableStringProp)); + + if (!requiredNullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableUuid)); + + if (requiredNotNullableDateProp.IsSet && requiredNotNullableDateProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotNullableDateProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableArrayOfString.IsSet && requiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableBooleanProp.IsSet && requiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableDatetimeProp.IsSet && requiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumInteger.IsSet && requiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumIntegerOnly.IsSet && requiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumString.IsSet && requiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableOuterEnumDefaultValue.IsSet && requiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableStringProp.IsSet && requiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableUuid.IsSet && requiredNotnullableUuid.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableUuid), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableintegerProp.IsSet && requiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableDateProp.IsSet && notRequiredNotnullableDateProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableDateProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableintegerProp.IsSet && notRequiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableArrayOfString.IsSet && notrequiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableBooleanProp.IsSet && notrequiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableDatetimeProp.IsSet && notrequiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumInteger.IsSet && notrequiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumIntegerOnly.IsSet && notrequiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumString.IsSet && notrequiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableOuterEnumDefaultValue.IsSet && notrequiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableStringProp.IsSet && notrequiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + 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, 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); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, requiredClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (requiredClass.RequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet && requiredClass.NotrequiredNotnullableArrayOfString == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet && requiredClass.NotrequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + writer.WriteString("required_not_nullable_date_prop", requiredClass.RequiredNotNullableDateProp.ToString(RequiredNotNullableDatePropFormat)); + + writer.WritePropertyName("required_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNotnullableArrayOfString, jsonSerializerOptions); + writer.WriteBoolean("required_notnullable_boolean_prop", requiredClass.RequiredNotnullableBooleanProp); + + writer.WriteString("required_notnullable_datetime_prop", requiredClass.RequiredNotnullableDatetimeProp.ToString(RequiredNotnullableDatetimePropFormat)); + + writer.WriteNumber("required_notnullable_enum_integer", RequiredClass.RequiredNotnullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNotnullableEnumInteger)); + + writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly)); + + var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString); + writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue); + var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue); + writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue); + + writer.WriteString("required_notnullable_string_prop", requiredClass.RequiredNotnullableStringProp); + + writer.WriteString("required_notnullable_uuid", requiredClass.RequiredNotnullableUuid); + + writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); + + if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) + writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); + + if (requiredClass.NotRequiredNotnullableintegerPropOption.IsSet) + writer.WriteNumber("not_required_notnullableinteger_prop", requiredClass.NotRequiredNotnullableintegerPropOption.Value.Value); + + if (requiredClass.NotRequiredNullableDatePropOption.IsSet) + if (requiredClass.NotRequiredNullableDatePropOption.Value != null) + writer.WriteString("not_required_nullable_date_prop", requiredClass.NotRequiredNullableDatePropOption.Value.Value.ToString(NotRequiredNullableDatePropFormat)); + else + writer.WriteNull("not_required_nullable_date_prop"); + + if (requiredClass.NotRequiredNullableIntegerPropOption.IsSet) + if (requiredClass.NotRequiredNullableIntegerPropOption.Value != null) + writer.WriteNumber("not_required_nullable_integer_prop", requiredClass.NotRequiredNullableIntegerPropOption.Value.Value); + else + writer.WriteNull("not_required_nullable_integer_prop"); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet) + { + writer.WritePropertyName("notrequired_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNotnullableArrayOfString, jsonSerializerOptions); + } + if (requiredClass.NotrequiredNotnullableBooleanPropOption.IsSet) + writer.WriteBoolean("notrequired_notnullable_boolean_prop", requiredClass.NotrequiredNotnullableBooleanPropOption.Value.Value); + + if (requiredClass.NotrequiredNotnullableDatetimePropOption.IsSet) + writer.WriteString("notrequired_notnullable_datetime_prop", requiredClass.NotrequiredNotnullableDatetimePropOption.Value.Value.ToString(NotrequiredNotnullableDatetimePropFormat)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOption.IsSet) + writer.WriteNumber("notrequired_notnullable_enum_integer", RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOption.Value.Value)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.IsSet) + writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value.Value)); + + var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value.Value); + writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue); + if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet) + { + var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value); + writer.WriteString("notrequired_notnullable_outerEnumDefaultValue", notrequiredNotnullableOuterEnumDefaultValueRawValue); + } + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet) + writer.WriteString("notrequired_notnullable_string_prop", requiredClass.NotrequiredNotnullableStringProp); + + if (requiredClass.NotrequiredNotnullableUuidOption.IsSet) + writer.WriteString("notrequired_notnullable_uuid", requiredClass.NotrequiredNotnullableUuidOption.Value.Value); + + if (requiredClass.NotrequiredNullableArrayOfStringOption.IsSet) + if (requiredClass.NotrequiredNullableArrayOfStringOption.Value != null) + { + writer.WritePropertyName("notrequired_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("notrequired_nullable_array_of_string"); + if (requiredClass.NotrequiredNullableBooleanPropOption.IsSet) + if (requiredClass.NotrequiredNullableBooleanPropOption.Value != null) + writer.WriteBoolean("notrequired_nullable_boolean_prop", requiredClass.NotrequiredNullableBooleanPropOption.Value.Value); + else + writer.WriteNull("notrequired_nullable_boolean_prop"); + + if (requiredClass.NotrequiredNullableDatetimePropOption.IsSet) + if (requiredClass.NotrequiredNullableDatetimePropOption.Value != null) + writer.WriteString("notrequired_nullable_datetime_prop", requiredClass.NotrequiredNullableDatetimePropOption.Value.Value.ToString(NotrequiredNullableDatetimePropFormat)); + else + writer.WriteNull("notrequired_nullable_datetime_prop"); + + if (requiredClass.NotrequiredNullableEnumIntegerOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOption.Value != null) + writer.WriteNumber("notrequired_nullable_enum_integer", RequiredClass.NotrequiredNullableEnumIntegerEnumToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOption.Value.Value)); + else + writer.WriteNull("notrequired_nullable_enum_integer"); + + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value != null) + writer.WriteNumber("notrequired_nullable_enum_integer_only", RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value.Value)); + else + writer.WriteNull("notrequired_nullable_enum_integer_only"); + + var notrequiredNullableEnumStringRawValue = RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNullableEnumStringOption.Value.Value); + if (notrequiredNullableEnumStringRawValue != null) + writer.WriteString("notrequired_nullable_enum_string", notrequiredNullableEnumStringRawValue); + else + writer.WriteNull("notrequired_nullable_enum_string"); + + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.IsSet) + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value != null) + { + var notrequiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value.Value); + writer.WriteString("notrequired_nullable_outerEnumDefaultValue", notrequiredNullableOuterEnumDefaultValueRawValue); + } + else + writer.WriteNull("notrequired_nullable_outerEnumDefaultValue"); + if (requiredClass.NotrequiredNullableStringPropOption.IsSet) + if (requiredClass.NotrequiredNullableStringPropOption.Value != null) + writer.WriteString("notrequired_nullable_string_prop", requiredClass.NotrequiredNullableStringProp); + else + writer.WriteNull("notrequired_nullable_string_prop"); + + if (requiredClass.NotrequiredNullableUuidOption.IsSet) + if (requiredClass.NotrequiredNullableUuidOption.Value != null) + 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/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 00000000000..25b3b73e9c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,246 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing reserved words + /// + public partial class Return : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lock + /// abstract + /// varReturn + /// unsafe + [JsonConstructor] + public Return(string @lock, string @abstract = default, Option varReturn = default, Option @unsafe = default) + { + Lock = @lock; + Abstract = @abstract; + VarReturnOption = varReturn; + UnsafeOption = @unsafe; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Lock + /// + [JsonPropertyName("lock")] + public string Lock { get; set; } + + /// + /// Gets or Sets Abstract + /// + [JsonPropertyName("abstract")] + public string Abstract { get; set; } + + /// + /// Used to track the state of VarReturn + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarReturnOption { get; private set; } + + /// + /// Gets or Sets VarReturn + /// + [JsonPropertyName("return")] + public int? VarReturn { get { return this.VarReturnOption; } set { this.VarReturnOption = new Option(value); } } + + /// + /// Used to track the state of Unsafe + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsafeOption { get; private set; } + + /// + /// Gets or Sets Unsafe + /// + [JsonPropertyName("unsafe")] + public string Unsafe { get { return this.UnsafeOption; } set { this.UnsafeOption = 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 Return {\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); + sb.Append(" Abstract: ").Append(Abstract).Append("\n"); + sb.Append(" VarReturn: ").Append(VarReturn).Append("\n"); + sb.Append(" Unsafe: ").Append(Unsafe).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 ReturnJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Return 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 varLock = default; + Option varAbstract = default; + Option varReturn = default; + Option varUnsafe = 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 "lock": + varLock = new Option(utf8JsonReader.GetString()); + break; + case "abstract": + varAbstract = new Option(utf8JsonReader.GetString()); + break; + case "return": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varReturn = new Option(utf8JsonReader.GetInt32()); + break; + case "unsafe": + varUnsafe = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!varLock.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varLock)); + + if (!varAbstract.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varAbstract)); + + if (varLock.IsSet && varLock.Value == null) + throw new ArgumentNullException(nameof(varLock), "Property is not nullable for class Return."); + + if (varReturn.IsSet && varReturn.Value == null) + throw new ArgumentNullException(nameof(varReturn), "Property is not nullable for class Return."); + + if (varUnsafe.IsSet && varUnsafe.Value == null) + throw new ArgumentNullException(nameof(varUnsafe), "Property is not nullable for class Return."); + + return new Return(varLock.Value, varAbstract.Value, varReturn, varUnsafe); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, varReturn, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (varReturn.UnsafeOption.IsSet && varReturn.Unsafe == null) + throw new ArgumentNullException(nameof(varReturn.Unsafe), "Property is required for class Return."); + + writer.WriteString("lock", varReturn.Lock); + + if (varReturn.Abstract != null) + writer.WriteString("abstract", varReturn.Abstract); + else + writer.WriteNull("abstract"); + + if (varReturn.VarReturnOption.IsSet) + writer.WriteNumber("return", varReturn.VarReturnOption.Value.Value); + + if (varReturn.UnsafeOption.IsSet) + writer.WriteString("unsafe", varReturn.Unsafe); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..1adc0bbf76b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,204 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(Option role = default, Option roleUuid = default) + { + RoleOption = role; + RoleUuidOption = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Role + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleOption { get; private set; } + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get { return this.RoleOption; } set { this.RoleOption = new Option(value); } } + + /// + /// Used to track the state of RoleUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleUuidOption { get; private set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid? RoleUuid { get { return this.RoleUuidOption; } set { this.RoleUuidOption = 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 RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).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 RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash 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 role = default; + Option roleUuid = 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 "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (role.IsSet && role.Value == null) + throw new ArgumentNullException(nameof(role), "Property is not nullable for class RolesReportsHash."); + + if (roleUuid.IsSet && roleUuid.Value == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is not nullable for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHash.RoleOption.IsSet) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + } + if (rolesReportsHash.RoleUuidOption.IsSet) + writer.WriteString("role_uuid", rolesReportsHash.RoleUuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..866b9fa4871 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).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 RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHashRole.NameOption.IsSet) + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 00000000000..5c960eb5474 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -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 + * 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 +{ + /// + /// ScaleneTriangle + /// + public partial class ScaleneTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public ScaleneTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 ScaleneTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ScaleneTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ScaleneTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class ScaleneTriangle."); + + return new ScaleneTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (scaleneTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(scaleneTriangle.TriangleType), "Property is required for class ScaleneTriangle."); + + writer.WriteString("shapeType", scaleneTriangle.ShapeType); + + writer.WriteString("triangleType", scaleneTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 00000000000..c651ac7d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Shape + /// + public partial class Shape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 Shape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Shape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class Shape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); + + if (quadrilateral != null) + return new Shape(quadrilateral); + + if (triangle != null) + return new Shape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); + } + + if (shape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 00000000000..37db5df6490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ShapeInterface + /// + public partial class ShapeInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + [JsonConstructor] + public ShapeInterface(string shapeType) + { + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ShapeInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeInterface 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 shapeType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeInterface.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeInterface."); + + return new ShapeInterface(shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, shapeInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("shapeType", shapeInterface.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 00000000000..1f0b2203007 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + public partial class ShapeOrNull : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 ShapeOrNull {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeOrNull 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeOrNull.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); + + if (quadrilateral != null) + return new ShapeOrNull(quadrilateral); + + if (triangle != null) + return new ShapeOrNull(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shapeOrNull.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); + } + + if (shapeOrNull.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 00000000000..ffa68d1e75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// SimpleQuadrilateral + /// + public partial class SimpleQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public SimpleQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 SimpleQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 SimpleQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SimpleQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class SimpleQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class SimpleQuadrilateral."); + + return new SimpleQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (simpleQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(simpleQuadrilateral.ShapeType), "Property is required for class SimpleQuadrilateral."); + + writer.WriteString("quadrilateralType", simpleQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", simpleQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 00000000000..8f3593c5f41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// SpecialModelName + /// + public partial class SpecialModelName : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varSpecialModelName + /// specialPropertyName + [JsonConstructor] + public SpecialModelName(Option varSpecialModelName = default, Option specialPropertyName = default) + { + VarSpecialModelNameOption = varSpecialModelName; + SpecialPropertyNameOption = specialPropertyName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarSpecialModelName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarSpecialModelNameOption { get; private set; } + + /// + /// Gets or Sets VarSpecialModelName + /// + [JsonPropertyName("_special_model.name_")] + public string VarSpecialModelName { get { return this.VarSpecialModelNameOption; } set { this.VarSpecialModelNameOption = new Option(value); } } + + /// + /// Used to track the state of SpecialPropertyName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SpecialPropertyNameOption { get; private set; } + + /// + /// Gets or Sets SpecialPropertyName + /// + [JsonPropertyName("$special[property.name]")] + public long? SpecialPropertyName { get { return this.SpecialPropertyNameOption; } set { this.SpecialPropertyNameOption = 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 SpecialModelName {\n"); + sb.Append(" VarSpecialModelName: ").Append(VarSpecialModelName).Append("\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).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 SpecialModelNameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SpecialModelName 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 varSpecialModelName = default; + Option specialPropertyName = 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 "_special_model.name_": + varSpecialModelName = new Option(utf8JsonReader.GetString()); + break; + case "$special[property.name]": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (varSpecialModelName.IsSet && varSpecialModelName.Value == null) + throw new ArgumentNullException(nameof(varSpecialModelName), "Property is not nullable for class SpecialModelName."); + + if (specialPropertyName.IsSet && specialPropertyName.Value == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is not nullable for class SpecialModelName."); + + return new SpecialModelName(varSpecialModelName, specialPropertyName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, specialModelName, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (specialModelName.VarSpecialModelNameOption.IsSet) + writer.WriteString("_special_model.name_", specialModelName.VarSpecialModelName); + + if (specialModelName.SpecialPropertyNameOption.IsSet) + writer.WriteNumber("$special[property.name]", specialModelName.SpecialPropertyNameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 00000000000..e1678abe491 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Tag + /// + public partial class Tag : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name + [JsonConstructor] + public Tag(Option id = default, Option name = default) + { + IdOption = id; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 TagJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Tag 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Tag."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Tag."); + + return new Tag(id, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, tag, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (tag.IdOption.IsSet) + writer.WriteNumber("id", tag.IdOption.Value.Value); + + if (tag.NameOption.IsSet) + writer.WriteString("name", tag.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..f4fca096217 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(Option value = default) + { + ValueOption = value; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = 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 TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).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 TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList 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 value = 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 "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class TestCollectionEndingWithWordList."); + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordList.ValueOption.IsSet) + writer.WriteString("value", testCollectionEndingWithWordList.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..6c324e6ef4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -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 + * 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 +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(Option> testCollectionEndingWithWordList = default) + { + TestCollectionEndingWithWordListOption = testCollectionEndingWithWordList; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of TestCollectionEndingWithWordList + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TestCollectionEndingWithWordListOption { get; private set; } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get { return this.TestCollectionEndingWithWordListOption; } set { this.TestCollectionEndingWithWordListOption = 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 TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).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 TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject 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> testCollectionEndingWithWordList = 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 "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (testCollectionEndingWithWordList.IsSet && testCollectionEndingWithWordList.Value == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is not nullable for class TestCollectionEndingWithWordListObject."); + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet) + { + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..3bf95d67c57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(Option someProperty = default) + { + SomePropertyOption = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SomeProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomePropertyOption { get; private set; } + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get { return this.SomePropertyOption; } set { this.SomePropertyOption = 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 TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).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 TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest 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 someProperty = 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 "someProperty": + someProperty = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (someProperty.IsSet && someProperty.Value == null) + throw new ArgumentNullException(nameof(someProperty), "Property is not nullable for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet) + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 00000000000..cf22051519a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Triangle + /// + public partial class Triangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(EquilateralTriangle equilateralTriangle) + { + EquilateralTriangle = equilateralTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(IsoscelesTriangle isoscelesTriangle) + { + IsoscelesTriangle = isoscelesTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(ScaleneTriangle scaleneTriangle) + { + ScaleneTriangle = scaleneTriangle; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EquilateralTriangle + /// + public EquilateralTriangle EquilateralTriangle { get; set; } + + /// + /// Gets or Sets IsoscelesTriangle + /// + public IsoscelesTriangle IsoscelesTriangle { get; set; } + + /// + /// Gets or Sets ScaleneTriangle + /// + public ScaleneTriangle ScaleneTriangle { get; set; } + + /// + /// 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 Triangle {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Triangle 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 triangleType = default; + + EquilateralTriangle equilateralTriangle = null; + IsoscelesTriangle isoscelesTriangle = null; + ScaleneTriangle scaleneTriangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("triangleType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("EquilateralTriangle")) + { + Utf8JsonReader utf8JsonReaderEquilateralTriangle = utf8JsonReader; + equilateralTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderEquilateralTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("IsoscelesTriangle")) + { + Utf8JsonReader utf8JsonReaderIsoscelesTriangle = utf8JsonReader; + isoscelesTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderIsoscelesTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("ScaleneTriangle")) + { + Utf8JsonReader utf8JsonReaderScaleneTriangle = utf8JsonReader; + scaleneTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderScaleneTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class Triangle.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); + + if (equilateralTriangle != null) + return new Triangle(equilateralTriangle); + + if (isoscelesTriangle != null) + return new Triangle(isoscelesTriangle); + + if (scaleneTriangle != null) + return new Triangle(scaleneTriangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (triangle.EquilateralTriangle != null) + { + EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); + } + + if (triangle.IsoscelesTriangle != null) + { + IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + } + + if (triangle.ScaleneTriangle != null) + { + ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); + } + + WriteProperties(writer, triangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 00000000000..0f13b0e7745 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TriangleInterface + /// + public partial class TriangleInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// triangleType + [JsonConstructor] + public TriangleInterface(string triangleType) + { + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 TriangleInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TriangleInterface 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 triangleType = 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class TriangleInterface.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class TriangleInterface."); + + return new TriangleInterface(triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, triangleInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("triangleType", triangleInterface.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 00000000000..21eff6d47a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,497 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// User + /// + public partial class User : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// email + /// firstName + /// id + /// lastName + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// password + /// phone + /// User Status + /// username + [JsonConstructor] + public User(Option anyTypeProp = default, Option anyTypePropNullable = default, Option email = default, Option firstName = default, Option id = default, Option lastName = default, Option objectWithNoDeclaredProps = default, Option objectWithNoDeclaredPropsNullable = default, Option password = default, Option phone = default, Option userStatus = default, Option username = default) + { + AnyTypePropOption = anyTypeProp; + AnyTypePropNullableOption = anyTypePropNullable; + EmailOption = email; + FirstNameOption = firstName; + IdOption = id; + LastNameOption = lastName; + ObjectWithNoDeclaredPropsOption = objectWithNoDeclaredProps; + ObjectWithNoDeclaredPropsNullableOption = objectWithNoDeclaredPropsNullable; + PasswordOption = password; + PhoneOption = phone; + UserStatusOption = userStatus; + UsernameOption = username; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AnyTypeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [JsonPropertyName("anyTypeProp")] + public Object AnyTypeProp { get { return this.AnyTypePropOption; } set { this.AnyTypePropOption = new Option(value); } } + + /// + /// Used to track the state of AnyTypePropNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropNullableOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [JsonPropertyName("anyTypePropNullable")] + public Object AnyTypePropNullable { get { return this.AnyTypePropNullableOption; } set { this.AnyTypePropNullableOption = new Option(value); } } + + /// + /// Used to track the state of Email + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailOption { get; private set; } + + /// + /// Gets or Sets Email + /// + [JsonPropertyName("email")] + public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredProps + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsOption { get; private set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [JsonPropertyName("objectWithNoDeclaredProps")] + public Object ObjectWithNoDeclaredProps { get { return this.ObjectWithNoDeclaredPropsOption; } set { this.ObjectWithNoDeclaredPropsOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredPropsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsNullableOption { get; private set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [JsonPropertyName("objectWithNoDeclaredPropsNullable")] + public Object ObjectWithNoDeclaredPropsNullable { get { return this.ObjectWithNoDeclaredPropsNullableOption; } set { this.ObjectWithNoDeclaredPropsNullableOption = new Option(value); } } + + /// + /// Used to track the state of Password + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordOption { get; private set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get { return this.PasswordOption; } set { this.PasswordOption = new Option(value); } } + + /// + /// Used to track the state of Phone + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneOption { get; private set; } + + /// + /// Gets or Sets Phone + /// + [JsonPropertyName("phone")] + public string Phone { get { return this.PhoneOption; } set { this.PhoneOption = new Option(value); } } + + /// + /// Used to track the state of UserStatus + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UserStatusOption { get; private set; } + + /// + /// User Status + /// + /// User Status + [JsonPropertyName("userStatus")] + public int? UserStatus { get { return this.UserStatusOption; } set { this.UserStatusOption = new Option(value); } } + + /// + /// Used to track the state of Username + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UsernameOption { get; private set; } + + /// + /// Gets or Sets Username + /// + [JsonPropertyName("username")] + public string Username { get { return this.UsernameOption; } set { this.UsernameOption = 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 User {\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" Username: ").Append(Username).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 UserJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override User 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 anyTypeProp = default; + Option anyTypePropNullable = default; + Option email = default; + Option firstName = default; + Option id = default; + Option lastName = default; + Option objectWithNoDeclaredProps = default; + Option objectWithNoDeclaredPropsNullable = default; + Option password = default; + Option phone = default; + Option userStatus = default; + Option username = 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 "anyTypeProp": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "anyTypePropNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "email": + email = new Option(utf8JsonReader.GetString()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "objectWithNoDeclaredProps": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "objectWithNoDeclaredPropsNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "phone": + phone = new Option(utf8JsonReader.GetString()); + break; + case "userStatus": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = new Option(utf8JsonReader.GetInt32()); + break; + case "username": + username = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (email.IsSet && email.Value == null) + throw new ArgumentNullException(nameof(email), "Property is not nullable for class User."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class User."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class User."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class User."); + + if (objectWithNoDeclaredProps.IsSet && objectWithNoDeclaredProps.Value == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is not nullable for class User."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class User."); + + if (phone.IsSet && phone.Value == null) + throw new ArgumentNullException(nameof(phone), "Property is not nullable for class User."); + + if (userStatus.IsSet && userStatus.Value == null) + throw new ArgumentNullException(nameof(userStatus), "Property is not nullable for class User."); + + if (username.IsSet && username.Value == null) + throw new ArgumentNullException(nameof(username), "Property is not nullable for class User."); + + return new User(anyTypeProp, anyTypePropNullable, email, firstName, id, lastName, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, password, phone, userStatus, username); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, user, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (user.FirstNameOption.IsSet && user.FirstName == null) + throw new ArgumentNullException(nameof(user.FirstName), "Property is required for class User."); + + if (user.LastNameOption.IsSet && user.LastName == null) + throw new ArgumentNullException(nameof(user.LastName), "Property is required for class User."); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet && user.ObjectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(user.ObjectWithNoDeclaredProps), "Property is required for class User."); + + if (user.PasswordOption.IsSet && user.Password == null) + throw new ArgumentNullException(nameof(user.Password), "Property is required for class User."); + + if (user.PhoneOption.IsSet && user.Phone == null) + throw new ArgumentNullException(nameof(user.Phone), "Property is required for class User."); + + if (user.UsernameOption.IsSet && user.Username == null) + throw new ArgumentNullException(nameof(user.Username), "Property is required for class User."); + + if (user.AnyTypePropOption.IsSet) + if (user.AnyTypePropOption.Value != null) + { + writer.WritePropertyName("anyTypeProp"); + JsonSerializer.Serialize(writer, user.AnyTypeProp, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypeProp"); + if (user.AnyTypePropNullableOption.IsSet) + if (user.AnyTypePropNullableOption.Value != null) + { + writer.WritePropertyName("anyTypePropNullable"); + JsonSerializer.Serialize(writer, user.AnyTypePropNullable, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypePropNullable"); + if (user.EmailOption.IsSet) + writer.WriteString("email", user.Email); + + if (user.FirstNameOption.IsSet) + writer.WriteString("firstName", user.FirstName); + + if (user.IdOption.IsSet) + writer.WriteNumber("id", user.IdOption.Value.Value); + + if (user.LastNameOption.IsSet) + writer.WriteString("lastName", user.LastName); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet) + { + writer.WritePropertyName("objectWithNoDeclaredProps"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, jsonSerializerOptions); + } + if (user.ObjectWithNoDeclaredPropsNullableOption.IsSet) + if (user.ObjectWithNoDeclaredPropsNullableOption.Value != null) + { + writer.WritePropertyName("objectWithNoDeclaredPropsNullable"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, jsonSerializerOptions); + } + else + writer.WriteNull("objectWithNoDeclaredPropsNullable"); + if (user.PasswordOption.IsSet) + writer.WriteString("password", user.Password); + + if (user.PhoneOption.IsSet) + writer.WriteString("phone", user.Phone); + + if (user.UserStatusOption.IsSet) + writer.WriteNumber("userStatus", user.UserStatusOption.Value.Value); + + if (user.UsernameOption.IsSet) + writer.WriteString("username", user.Username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 00000000000..6d1afa8b592 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Whale + /// + public partial class Whale : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// hasBaleen + /// hasTeeth + [JsonConstructor] + public Whale(string className, Option hasBaleen = default, Option hasTeeth = default) + { + ClassName = className; + HasBaleenOption = hasBaleen; + HasTeethOption = hasTeeth; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// Used to track the state of HasBaleen + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasBaleenOption { get; private set; } + + /// + /// Gets or Sets HasBaleen + /// + [JsonPropertyName("hasBaleen")] + public bool? HasBaleen { get { return this.HasBaleenOption; } set { this.HasBaleenOption = new Option(value); } } + + /// + /// Used to track the state of HasTeeth + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasTeethOption { get; private set; } + + /// + /// Gets or Sets HasTeeth + /// + [JsonPropertyName("hasTeeth")] + public bool? HasTeeth { get { return this.HasTeethOption; } set { this.HasTeethOption = 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 Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).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 WhaleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Whale 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 className = default; + Option hasBaleen = default; + Option hasTeeth = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "hasBaleen": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = new Option(utf8JsonReader.GetBoolean()); + break; + case "hasTeeth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Whale.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Whale."); + + if (hasBaleen.IsSet && hasBaleen.Value == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is not nullable for class Whale."); + + if (hasTeeth.IsSet && hasTeeth.Value == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is not nullable for class Whale."); + + return new Whale(className.Value, hasBaleen, hasTeeth); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, whale, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", whale.ClassName); + + if (whale.HasBaleenOption.IsSet) + writer.WriteBoolean("hasBaleen", whale.HasBaleenOption.Value.Value); + + if (whale.HasTeethOption.IsSet) + writer.WriteBoolean("hasTeeth", whale.HasTeethOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 00000000000..5463ed953c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -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 + * 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 +{ + /// + /// Zebra + /// + public partial class Zebra : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// type + [JsonConstructor] + public Zebra(string className, Option type = default) + { + ClassName = className; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines Type + /// + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + Grevys = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("plains")) + return TypeEnum.Plains; + + if (value.Equals("mountain")) + return TypeEnum.Mountain; + + if (value.Equals("grevys")) + return TypeEnum.Grevys; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("plains")) + return TypeEnum.Plains; + + if (value.Equals("mountain")) + return TypeEnum.Mountain; + + if (value.Equals("grevys")) + return TypeEnum.Grevys; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Plains) + return "plains"; + + if (value == TypeEnum.Mountain) + return "mountain"; + + if (value == TypeEnum.Grevys) + return "grevys"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// Gets or Sets Type + /// + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 Zebra {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ZebraJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Zebra 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 className = default; + Option type = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(Zebra.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Zebra.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Zebra."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Zebra."); + + return new Zebra(className.Value, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zebra, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", zebra.ClassName); + + var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs new file mode 100644 index 00000000000..34a044fb8b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnum value) + { + if (value == ZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum? zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs new file mode 100644 index 00000000000..e7431416064 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ZeroBasedEnumClass + /// + public partial class ZeroBasedEnumClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// zeroBasedEnum + [JsonConstructor] + public ZeroBasedEnumClass(Option zeroBasedEnum = default) + { + ZeroBasedEnumOption = zeroBasedEnum; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnumEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Returns a + /// + /// + /// + /// + public static ZeroBasedEnumEnum ZeroBasedEnumEnumFromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ZeroBasedEnumEnum? ZeroBasedEnumEnumFromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ZeroBasedEnumEnumToJsonValue(ZeroBasedEnumEnum? value) + { + if (value == ZeroBasedEnumEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnumEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ZeroBasedEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ZeroBasedEnumOption { get; private set; } + + /// + /// Gets or Sets ZeroBasedEnum + /// + [JsonPropertyName("ZeroBasedEnum")] + public ZeroBasedEnumEnum? ZeroBasedEnum { get { return this.ZeroBasedEnumOption; } set { this.ZeroBasedEnumOption = 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 ZeroBasedEnumClass {\n"); + sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 ZeroBasedEnumClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ZeroBasedEnumClass 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 zeroBasedEnum = 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 "ZeroBasedEnum": + string zeroBasedEnumRawValue = utf8JsonReader.GetString(); + if (zeroBasedEnumRawValue != null) + zeroBasedEnum = new Option(ZeroBasedEnumClass.ZeroBasedEnumEnumFromStringOrDefault(zeroBasedEnumRawValue)); + break; + default: + break; + } + } + } + + if (zeroBasedEnum.IsSet && zeroBasedEnum.Value == null) + throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is not nullable for class ZeroBasedEnumClass."); + + return new ZeroBasedEnumClass(zeroBasedEnum); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..c6529e05402 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..39ca4a5b875 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/README.md @@ -0,0 +1,223 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo"); + ModelClient model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## 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**: Bearer Authentication + + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.gitignore b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.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/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/FILES new file mode 100644 index 00000000000..5abbcf46f35 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/NowGet200Response.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/NowGet200Response.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/Org.OpenAPITools.sln new file mode 100644 index 00000000000..547505a9856 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/api/openapi.yaml new file mode 100644 index 00000000000..a84e041a00f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/api/openapi.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + description: Thic spec contains endpoints with dates in different formats + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Dates + version: 1.0.0 +servers: +- url: / +paths: + /now: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_now_get_200_response' + description: now dates +components: + schemas: + _now_get_200_response: + example: + today: 2000-01-23 + now: 2000-01-23T04:56:07.000+00:00 + properties: + today: + format: date + type: string + now: + format: date-time + type: string + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..6b1991021ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**NowGet**](DefaultApi.md#nowget) | **GET** /now | | + + +# **NowGet** +> NowGet200Response NowGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class NowGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + NowGet200Response result = apiInstance.NowGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.NowGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the NowGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.NowGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.NowGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NowGet200Response**](NowGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | now dates | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/models/NowGet200Response.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/models/NowGet200Response.md new file mode 100644 index 00000000000..58b6c7c79f0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/models/NowGet200Response.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NowGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Now** | **DateTime** | | [optional] +**Today** | **DateTime** | | [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/net4.7/UseDateTimeForDate/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..40e1298ee62 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..05dc933c03b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test NowGet + /// + [Fact (Skip = "not implemented")] + public async Task NowGetAsyncTest() + { + var response = await _instance.NowGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..3b09a6314ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs new file mode 100644 index 00000000000..920dfd9700e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs @@ -0,0 +1,74 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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 NowGet200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NowGet200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NowGet200Response + //private NowGet200Response instance; + + public NowGet200ResponseTests() + { + // TODO uncomment below to create an instance of NowGet200Response + //instance = new NowGet200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NowGet200Response + /// + [Fact] + public void NowGet200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" NowGet200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Now' + /// + [Fact] + public void NowTest() + { + // TODO unit test for the property 'Now' + } + + /// + /// Test the property 'Today' + /// + [Fact] + public void TodayTest() + { + // TODO unit test for the property 'Today' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..5c6fff45e26 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net47 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..adb94299d24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task NowGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task NowGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface INowGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnNowGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorNowGet; + + internal void ExecuteOnNowGet(DefaultApi.NowGetApiResponse apiResponse) + { + OnNowGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorNowGet(Exception exception) + { + OnErrorNowGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterNowGetDefaultImplementation(INowGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterNowGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterNowGet(ref bool suppressDefaultLog, INowGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorNowGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorNowGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorNowGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task NowGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await NowGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task NowGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/now"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + NowGetApiResponse apiResponseLocalVar = new NowGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/now", requestedAtLocalVar, _jsonSerializerOptions); + + AfterNowGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnNowGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorNowGetDefaultImplementation(e, "/now", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorNowGet(e); + throw; + } + } + + /// + /// The + /// + public partial class NowGetApiResponse : Org.OpenAPITools.Client.ApiResponse, INowGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NowGet200Response Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NowGet200Response result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..cf39d3c11d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..c67dab81c94 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..fc501e40444 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,314 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..52e971d082a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..968d29161b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..2eaac444e5c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new NowGet200ResponseJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..2b34371084b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..cddb8405886 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..069d5230868 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..480524ee9c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..2e45faf4463 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..d469c015da9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs new file mode 100644 index 00000000000..e30105d1acf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// NowGet200Response + /// + public partial class NowGet200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// now + /// today + [JsonConstructor] + public NowGet200Response(Option now = default, Option today = default) + { + NowOption = now; + TodayOption = today; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Now + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NowOption { get; private set; } + + /// + /// Gets or Sets Now + /// + [JsonPropertyName("now")] + public DateTime? Now { get { return this.NowOption; } set { this.NowOption = new Option(value); } } + + /// + /// Used to track the state of Today + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TodayOption { get; private set; } + + /// + /// Gets or Sets Today + /// + [JsonPropertyName("today")] + public DateTime? Today { get { return this.TodayOption; } set { this.TodayOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NowGet200Response {\n"); + sb.Append(" Now: ").Append(Now).Append("\n"); + sb.Append(" Today: ").Append(Today).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 NowGet200ResponseJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Now + /// + public static string NowFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize Today + /// + public static string TodayFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NowGet200Response 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 now = default; + Option today = 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 "now": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "today": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (now.IsSet && now.Value == null) + throw new ArgumentNullException(nameof(now), "Property is not nullable for class NowGet200Response."); + + if (today.IsSet && today.Value == null) + throw new ArgumentNullException(nameof(today), "Property is not nullable for class NowGet200Response."); + + return new NowGet200Response(now, today); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nowGet200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) + { + if (nowGet200Response.NowOption.IsSet) + writer.WriteString("now", nowGet200Response.NowOption.Value.Value.ToString(NowFormat)); + + if (nowGet200Response.TodayOption.IsSet) + writer.WriteString("today", nowGet200Response.TodayOption.Value.Value.ToString(TodayFormat)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..201640a24d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,32 @@ + + + + true + net47 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..f00d8d1ec0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/README.md @@ -0,0 +1,176 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net47', + 'validatable=true', + 'nullableReferenceTypes=', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + NowGetApiResponse apiResponse = await api.NowGetAsync("todo"); + NowGet200Response model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Dates +- appVersion: 1.0.0 +- appDescription: Thic spec contains endpoints with dates in different formats + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net47 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.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/csharp/generichost/net4.8/AllOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator/FILES new file mode 100644 index 00000000000..47b2b9b5c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Adult.md +docs/models/Child.md +docs/models/Person.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Adult.cs +src/Org.OpenAPITools/Model/Child.cs +src/Org.OpenAPITools/Model/Person.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/AllOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml new file mode 100644 index 00000000000..a6144ccdba8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml @@ -0,0 +1,71 @@ +openapi: 3.0.1 +info: + license: + name: MIT + title: Example + version: 1.0.0 +servers: +- url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + operationId: list + parameters: + - description: The id of the person to retrieve + explode: false + in: path + name: personId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Person' + description: OK +components: + schemas: + Person: + discriminator: + mapping: + a: '#/components/schemas/Adult' + c: Child + propertyName: $_type + example: + lastName: lastName + firstName: firstName + $_type: $_type + properties: + $_type: + type: string + lastName: + type: string + firstName: + type: string + type: object + Adult: + allOf: + - $ref: '#/components/schemas/Person' + - properties: + children: + items: + $ref: '#/components/schemas/Child' + type: array + type: object + description: A representation of an adult + Child: + allOf: + - properties: + age: + format: int32 + type: integer + type: object + - $ref: '#/components/schemas/Person' + description: A representation of a child + properties: + boosterSeat: + type: boolean + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/AllOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..c203cd813bb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/apis/DefaultApi.md @@ -0,0 +1,95 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://api.example.xyz/v1* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**List**](DefaultApi.md#list) | **GET** /person/display/{personId} | | + + +# **List** +> Person List (string personId) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class ListExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://api.example.xyz/v1"; + var apiInstance = new DefaultApi(config); + var personId = "personId_example"; // string | The id of the person to retrieve + + try + { + Person result = apiInstance.List(personId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.List: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the ListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.ListWithHttpInfo(personId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.ListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **personId** | **string** | The id of the person to retrieve | | + +### Return type + +[**Person**](Person.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Adult.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Adult.md new file mode 100644 index 00000000000..4bf74e4efc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Adult.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Adult +A representation of an adult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [optional] +**Children** | [**List<Child>**](Child.md) | | [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/net4.8/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md new file mode 100644 index 00000000000..bb2a1e5a561 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Child +A representation of a child + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [optional] +**Age** | **int** | | [optional] +**BoosterSeat** | **bool** | | [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/net4.8/AllOf/docs/models/Person.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Person.md new file mode 100644 index 00000000000..42c19689f9a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Person.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Person + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Type** | **string** | | [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/net4.8/AllOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5dd80394d3f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..8181a987b5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,65 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test List + /// + [Fact (Skip = "not implemented")] + public async Task ListAsyncTest() + { + string personId = default; + var response = await _instance.ListAsync(personId); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..470d080ffd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs new file mode 100644 index 00000000000..31079eac974 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs @@ -0,0 +1,65 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Adult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Adult + //private Adult instance; + + public AdultTests() + { + // TODO uncomment below to create an instance of Adult + //instance = new Adult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Adult + /// + [Fact] + public void AdultInstanceTest() + { + // TODO uncomment below to test "IsType" Adult + //Assert.IsType(instance); + } + + /// + /// Test the property 'Children' + /// + [Fact] + public void ChildrenTest() + { + // TODO unit test for the property 'Children' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs new file mode 100644 index 00000000000..17720f6e735 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs @@ -0,0 +1,74 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Child + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Child + //private Child instance; + + public ChildTests() + { + // TODO uncomment below to create an instance of Child + //instance = new Child(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Child + /// + [Fact] + public void ChildInstanceTest() + { + // TODO uncomment below to test "IsType" Child + //Assert.IsType(instance); + } + + /// + /// Test the property 'Age' + /// + [Fact] + public void AgeTest() + { + // TODO unit test for the property 'Age' + } + + /// + /// Test the property 'BoosterSeat' + /// + [Fact] + public void BoosterSeatTest() + { + // TODO unit test for the property 'BoosterSeat' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs new file mode 100644 index 00000000000..aa3fc482188 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs @@ -0,0 +1,103 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 Person + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PersonTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Person + //private Person instance; + + public PersonTests() + { + // TODO uncomment below to create an instance of Person + //instance = new Person(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Person + /// + [Fact] + public void PersonInstanceTest() + { + // TODO uncomment below to test "IsType" Person + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Adult from type Person + /// + [Fact] + public void AdultDeserializeFromPersonTest() + { + // TODO uncomment below to test deserialize a Adult from type Person + //Assert.IsType(JsonConvert.DeserializeObject(new Adult().ToJson())); + } + + /// + /// Test deserialize a Child from type Person + /// + [Fact] + public void ChildDeserializeFromPersonTest() + { + // TODO uncomment below to test deserialize a Child from type Person + //Assert.IsType(JsonConvert.DeserializeObject(new Child().ToJson())); + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..7b111e173ae --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,355 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + Task ListAsync(string personId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + Task ListOrDefaultAsync(string personId, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IListApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnList; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorList; + + internal void ExecuteOnList(DefaultApi.ListApiResponse apiResponse) + { + OnList?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorList(Exception exception) + { + OnErrorList?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + partial void FormatList(ref string personId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateList(string personId) + { + if (personId == null) + throw new ArgumentNullException(nameof(personId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterListDefaultImplementation(IListApiResponse apiResponseLocalVar, string personId) + { + bool suppressDefaultLog = false; + AfterList(ref suppressDefaultLog, apiResponseLocalVar, personId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterList(ref bool suppressDefaultLog, IListApiResponse apiResponseLocalVar, string personId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorListDefaultImplementation(Exception exception, string pathFormat, string path, string personId) + { + bool suppressDefaultLog = false; + OnErrorList(ref suppressDefaultLog, exception, pathFormat, path, personId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorList(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string personId); + + /// + /// + /// + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + public async Task ListOrDefaultAsync(string personId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await ListAsync(personId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// The id of the person to retrieve + /// Cancellation Token to cancel the request. + /// <> + public async Task ListAsync(string personId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateList(personId); + + FormatList(ref personId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/person/display/{personId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpersonId%7D", Uri.EscapeDataString(personId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + ListApiResponse apiResponseLocalVar = new ListApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/person/display/{personId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterListDefaultImplementation(apiResponseLocalVar, personId); + + Events.ExecuteOnList(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorListDefaultImplementation(e, "/person/display/{personId}", uriBuilderLocalVar.Path, personId); + Events.ExecuteOnErrorList(e); + throw; + } + } + + /// + /// The + /// + public partial class ListApiResponse : Org.OpenAPITools.Client.ApiResponse, IListApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public ListApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Person Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Person result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..78fdad8039f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..16e55f8c7b9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..8ea796e8169 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://api.example.xyz/v1"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v1"; + + /// + /// The host of the API + /// + public const string HOST = "api.example.xyz"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..a7f3806b960 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..c818977618f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..7b7d86c3238 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AdultJsonConverter()); + _jsonOptions.Converters.Add(new ChildJsonConverter()); + _jsonOptions.Converters.Add(new PersonJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..0b113d11177 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..53ad628a9a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..ed829aca772 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..2221ca651c6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..a4c5431cf87 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..3995735c8ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs new file mode 100644 index 00000000000..7806add08bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -0,0 +1,205 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// A representation of an adult + /// + public partial class Adult : Person, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// children + /// firstName + /// lastName + [JsonConstructor] + public Adult(Option> children = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) + { + ChildrenOption = children; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Children + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ChildrenOption { get; private set; } + + /// + /// Gets or Sets Children + /// + [JsonPropertyName("children")] + public List Children { get { return this.ChildrenOption; } set { this.ChildrenOption = new Option>(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Adult"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Adult {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Children: ").Append(Children).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class AdultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Adult 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> children = default; + Option firstName = default; + Option lastName = default; + Option type = 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 "children": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (children.IsSet && children.Value == null) + throw new ArgumentNullException(nameof(children), "Property is not nullable for class Adult."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Adult."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Adult."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Adult."); + + return new Adult(children, firstName, lastName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Adult adult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, adult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (adult.FirstNameOption.IsSet && adult.FirstName == null) + throw new ArgumentNullException(nameof(adult.FirstName), "Property is required for class Adult."); + + if (adult.LastNameOption.IsSet && adult.LastName == null) + throw new ArgumentNullException(nameof(adult.LastName), "Property is required for class Adult."); + + if (adult.ChildrenOption.IsSet) + { + writer.WritePropertyName("children"); + JsonSerializer.Serialize(writer, adult.Children, jsonSerializerOptions); + } + if (adult.FirstNameOption.IsSet) + writer.WriteString("firstName", adult.FirstName); + + if (adult.LastNameOption.IsSet) + writer.WriteString("lastName", adult.LastName); + + writer.WriteString("$_type", adult.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs new file mode 100644 index 00000000000..35adb6d4880 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -0,0 +1,227 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// A representation of a child + /// + public partial class Child : Person, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// age + /// firstName + /// lastName + /// boosterSeat + [JsonConstructor] + public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) + { + AgeOption = age; + BoosterSeatOption = boosterSeat; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Age + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AgeOption { get; private set; } + + /// + /// Gets or Sets Age + /// + [JsonPropertyName("age")] + public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + + /// + /// Used to track the state of BoosterSeat + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoosterSeatOption { get; private set; } + + /// + /// Gets or Sets BoosterSeat + /// + [JsonPropertyName("boosterSeat")] + public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Child {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Age: ").Append(Age).Append("\n"); + sb.Append(" BoosterSeat: ").Append(BoosterSeat).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Child 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 age = default; + Option firstName = default; + Option lastName = default; + Option type = default; + Option boosterSeat = 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 "age": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + age = new Option(utf8JsonReader.GetInt32()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + case "boosterSeat": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (age.IsSet && age.Value == null) + throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Child."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child."); + + if (boosterSeat.IsSet && boosterSeat.Value == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); + + return new Child(age, firstName, lastName, boosterSeat); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Child child, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, child, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (child.LastNameOption.IsSet && child.LastName == null) + throw new ArgumentNullException(nameof(child.LastName), "Property is required for class Child."); + + if (child.AgeOption.IsSet) + writer.WriteNumber("age", child.AgeOption.Value.Value); + + if (child.FirstNameOption.IsSet) + writer.WriteString("firstName", child.FirstName); + + if (child.LastNameOption.IsSet) + writer.WriteString("lastName", child.LastName); + + writer.WriteString("$_type", child.Type); + + if (child.BoosterSeatOption.IsSet) + writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Person.cs new file mode 100644 index 00000000000..c1944c79014 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Person.cs @@ -0,0 +1,247 @@ +// +/* + * Example + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * 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 +{ + /// + /// Person + /// + public partial class Person : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// firstName + /// lastName + [JsonConstructor] + public Person(Option firstName = default, Option lastName = default) + { + FirstNameOption = firstName; + LastNameOption = lastName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string Type { get; } = "Person"; + + /// + /// 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 Person {\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PersonJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Person 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 firstName = default; + 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) + 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 "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "$_type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Person."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Person."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Person."); + + return new Person(firstName, lastName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, person, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (person.LastNameOption.IsSet && person.LastName == null) + throw new ArgumentNullException(nameof(person.LastName), "Property is required for class Person."); + + if (person.FirstNameOption.IsSet) + writer.WriteString("firstName", person.FirstName); + + if (person.LastNameOption.IsSet) + writer.WriteString("lastName", person.LastName); + + writer.WriteString("$_type", person.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..73a85280057 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..0f667b9e0a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + ListApiResponse apiResponse = await api.ListAsync("todo"); + Person model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: Example +- appVersion: 1.0.0 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.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/csharp/generichost/net4.8/AnyOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/api/openapi.yaml new file mode 100644 index 00000000000..25b9adb5f50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/api/openapi.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + example: + color: color + properties: + color: + type: string + title: fruit + type: object + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.8/AnyOf/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.8/AnyOf/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/AnyOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..91e5f4c09c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..b8a2dfc1dc6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,174 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..e7289665b3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,172 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..99db2b0a04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,242 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public Fruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new Fruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); + 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(writer, fruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..73a85280057 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..37b7b4a6278 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.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/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/api/openapi.yaml new file mode 100644 index 00000000000..25b9adb5f50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/api/openapi.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + example: + color: color + properties: + color: + type: string + title: fruit + type: object + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.8/AnyOfNoCompare/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.8/AnyOfNoCompare/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/AnyOfNoCompare/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..4c9be2b60cf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,314 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..67a32fa90b5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,173 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..7ac2140b8e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,171 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..eb932d45136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,241 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public Fruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new Fruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); + 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(writer, fruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..82bb1c228e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,32 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..f6e93629b87 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/README.md @@ -0,0 +1,176 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.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/csharp/generichost/net4.8/FormModels/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator/FILES new file mode 100644 index 00000000000..45c476af318 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator/FILES @@ -0,0 +1,290 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ChildCatAllOfPetType.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DateOnlyClass.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumArraysArrayEnumInner.md +docs/models/EnumArraysJustSymbol.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EnumTestEnumInteger.md +docs/models/EnumTestEnumIntegerOnly.md +docs/models/EnumTestEnumString.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/FindPetsByStatusStatusParameterInner.md +docs/models/Foo.md +docs/models/FooGetDefaultResponse.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/LiteralStringClass.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MapTestMapOfEnumStringValue.md +docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NotificationtestGetElementsV1ResponseMPayload.md +docs/models/NullableClass.md +docs/models/NullableGuidClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/OneOfString.md +docs/models/Order.md +docs/models/OrderStatus.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/OuterEnumTest.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/PetStatus.md +docs/models/Pig.md +docs/models/PolymorphicProperty.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/RequiredClass.md +docs/models/RequiredClassRequiredNotnullableEnumInteger.md +docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md +docs/models/RequiredClassRequiredNotnullableEnumString.md +docs/models/RequiredClassRequiredNullableEnumInteger.md +docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md +docs/models/RequiredClassRequiredNullableEnumString.md +docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestEnumParametersEnumHeaderStringParameter.md +docs/models/TestEnumParametersEnumQueryDoubleParameter.md +docs/models/TestEnumParametersEnumQueryIntegerParameter.md +docs/models/TestEnumParametersRequestEnumFormString.md +docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/models/ZebraType.md +docs/models/ZeroBasedEnum.md +docs/models/ZeroBasedEnumClass.md +docs/models/ZeroBasedEnumClassZeroBasedEnum.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs +src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs +src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/EnumTestEnumString.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +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/MapTestMapOfEnumStringValue.cs +src/Org.OpenAPITools/Model/MixLog.cs +src/Org.OpenAPITools/Model/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/OneOfString.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OrderStatus.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumTest.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/PetStatus.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/RequiredClass.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs +src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/RolesReportsHash.cs +src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs +src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs +src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Model/ZebraType.cs +src/Org.OpenAPITools/Model/ZeroBasedEnum.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/FormModels/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml new file mode 100644 index 00000000000..c64890a0634 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml @@ -0,0 +1,3042 @@ +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_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /roles/report: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/RolesReport' + type: array + description: returns report + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /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: + $ref: '#/components/schemas/findPetsByStatus_status_parameter_inner' + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - 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 + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - 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: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - 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: [] + - api_key_query: [] + summary: Find pet by ID + tags: + - 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: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - 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 + /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 + /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 + /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 + 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 + /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 + /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 + /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 + /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: + 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 + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - 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 + 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 + "598": + description: Not a real HTTP status code + "599": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Not a real HTTP status code with a return object + summary: Get user by user name + tags: + - 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 + /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#$%^ + /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 + 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: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_header_string_parameter' + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_header_string_parameter' + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_query_integer_parameter' + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + $ref: '#/components/schemas/testEnumParameters_enum_query_double_parameter' + 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 + 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 + 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 + /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 + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + 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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - 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: requiredNotNullable + required: true + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: requiredNullable + required: true + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: notRequiredNotNullable + required: false + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: notRequiredNullable + required: false + schema: + nullable: true + type: string + style: form + responses: + "200": + description: Success + tags: + - 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' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - 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 + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK + /test: + get: + operationId: Test + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload' + description: Successful response + summary: Retrieve an existing Notificationtest's Elements +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + 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: + RolesReport: + description: Roles report + items: + $ref: '#/components/schemas/RolesReportsHash' + type: array + RolesReportsHash: + description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + role_uuid: + format: uuid + type: string + role: + $ref: '#/components/schemas/RolesReportsHash_role' + type: object + 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: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + $ref: '#/components/schemas/Order_status' + 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 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + 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 + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + 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 + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + $ref: '#/components/schemas/Pet_status' + 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 + lock: + type: string + abstract: + nullable: true + type: string + unsafe: + type: string + required: + - abstract + - lock + 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' + - $ref: '#/components/schemas/Address' + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + 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 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + 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: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_backslash: + description: None + pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ + /([0-9]|[1-2][0-9]|3[0-2]))$" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Outer_Enum_Test: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test: + properties: + enum_string: + $ref: '#/components/schemas/Enum_Test_enum_string' + enum_string_required: + $ref: '#/components/schemas/Enum_Test_enum_string' + enum_integer: + $ref: '#/components/schemas/Enum_Test_enum_integer' + enum_integer_only: + $ref: '#/components/schemas/Enum_Test_enum_integer_only' + enum_number: + $ref: '#/components/schemas/testEnumParameters_enum_query_double_parameter' + 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 + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + 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: + $ref: '#/components/schemas/MapTest_map_of_enum_string_value' + 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 + 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 + x-cls-compliant: true + x-com-visible: true + 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: + $ref: '#/components/schemas/EnumArrays_just_symbol' + array_enum: + items: + $ref: '#/components/schemas/EnumArrays_array_enum_inner' + 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 + 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 + 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 + _special_model.name_: + type: string + 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 + RequiredClass: + properties: + required_nullable_integer_prop: + nullable: true + type: integer + required_notnullableinteger_prop: + nullable: false + type: integer + not_required_nullable_integer_prop: + nullable: true + type: integer + not_required_notnullableinteger_prop: + nullable: false + type: integer + required_nullable_string_prop: + nullable: true + type: string + required_notnullable_string_prop: + nullable: false + type: string + notrequired_nullable_string_prop: + nullable: true + type: string + notrequired_notnullable_string_prop: + nullable: false + type: string + required_nullable_boolean_prop: + nullable: true + type: boolean + required_notnullable_boolean_prop: + nullable: false + type: boolean + notrequired_nullable_boolean_prop: + nullable: true + type: boolean + notrequired_notnullable_boolean_prop: + nullable: false + type: boolean + required_nullable_date_prop: + format: date + nullable: true + type: string + required_not_nullable_date_prop: + format: date + nullable: false + type: string + not_required_nullable_date_prop: + format: date + nullable: true + type: string + not_required_notnullable_date_prop: + format: date + nullable: false + type: string + required_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer' + required_notnullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer' + notrequired_nullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer' + notrequired_notnullable_enum_integer: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer' + required_nullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer_only' + required_notnullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer_only' + notrequired_nullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_integer_only' + notrequired_notnullable_enum_integer_only: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_integer_only' + required_notnullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_string' + required_nullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_string' + notrequired_nullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_nullable_enum_string' + notrequired_notnullable_enum_string: + $ref: '#/components/schemas/RequiredClass_required_notnullable_enum_string' + required_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + required_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + notrequired_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + notrequired_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + required_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + required_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + notrequired_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + notrequired_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + required_nullable_array_of_string: + items: + type: string + nullable: true + type: array + required_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + notrequired_nullable_array_of_string: + items: + type: string + nullable: true + type: array + notrequired_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + required: + - required_not_nullable_date_prop + - required_notnullable_array_of_string + - required_notnullable_boolean_prop + - required_notnullable_datetime_prop + - required_notnullable_enum_integer + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_notnullable_outerEnumDefaultValue + - required_notnullable_string_prop + - required_notnullable_uuid + - required_notnullableinteger_prop + - required_nullable_array_of_string + - required_nullable_boolean_prop + - required_nullable_date_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_nullable_enum_integer_only + - required_nullable_enum_string + - required_nullable_integer_prop + - required_nullable_outerEnumDefaultValue + - required_nullable_string_prop + - required_nullable_uuid + 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 + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + color_code: + pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + $ref: '#/components/schemas/zebra_type' + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - properties: + name: + type: string + pet_type: + $ref: '#/components/schemas/ChildCat_allOf_pet_type' + required: + - pet_type + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + 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 + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + OneOfString: + oneOf: + - pattern: ^a + type: string + - pattern: ^b + type: string + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + ZeroBasedEnumClass: + properties: + ZeroBasedEnum: + $ref: '#/components/schemas/ZeroBasedEnumClass_ZeroBasedEnum' + type: object + Custom-Variableobject-Response: + additionalProperties: true + description: A Variable object without predefined property names + type: object + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + example: + a_objVariableobject: + - null + - null + pkiNotificationtestID: 0 + properties: + pkiNotificationtestID: + type: integer + a_objVariableobject: + items: + $ref: '#/components/schemas/Custom-Variableobject-Response' + type: array + required: + - a_objVariableobject + - pkiNotificationtestID + type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string + 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: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + findPetsByStatus_status_parameter_inner: + default: available + enum: + - available + - pending + - sold + type: string + 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_enum_form_string_array_inner: + default: $ + enum: + - '>' + - $ + type: string + testEnumParameters_request_enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string_array_inner' + type: array + enum_form_string: + $ref: '#/components/schemas/testEnumParameters_request_enum_form_string' + type: object + testEnumParameters_enum_header_string_parameter: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + testEnumParameters_enum_query_integer_parameter: + enum: + - 1 + - -2 + format: int32 + type: integer + testEnumParameters_enum_query_double_parameter: + enum: + - 1.1 + - -1.2 + format: double + type: number + 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: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + 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 + 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 + getCountry_request: + allOf: + - properties: + country: + type: string + required: + - country + type: object + RolesReportsHash_role: + example: + name: name + properties: + name: + type: string + type: object + Order_status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + Pet_status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + Enum_Test_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test_enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + Enum_Test_enum_integer_only: + enum: + - 2 + - -2 + type: integer + MapTest_map_of_enum_string_value: + enum: + - UPPER + - lower + type: string + EnumArrays_just_symbol: + enum: + - '>=' + - $ + type: string + EnumArrays_array_enum_inner: + enum: + - fish + - crab + type: string + RequiredClass_required_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + RequiredClass_required_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + RequiredClass_required_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + RequiredClass_required_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + RequiredClass_required_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + RequiredClass_required_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + zebra_type: + enum: + - plains + - mountain + - grevys + type: string + ChildCat_allOf_pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + ZeroBasedEnumClass_ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing + 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/csharp/generichost/net4.8/FormModels/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/FormModels/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md new file mode 100644 index 00000000000..36948898657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/AnotherFakeApi.md @@ -0,0 +1,99 @@ +# Org.OpenAPITools.Api.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** +> ModelClient Call123TestSpecialTags (ModelClient modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the Call123TestSpecialTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test special tags + ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..0bdfd6af347 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/DefaultApi.md @@ -0,0 +1,429 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | +| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | +| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | | +| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements | + + +# **FooGet** +> FooGetDefaultResponse FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + FooGetDefaultResponse result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FooGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FooGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetCountry** +> void GetCountry (string country) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + var country = "country_example"; // string | + + try + { + apiInstance.GetCountry(country); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.GetCountryWithHttpInfo(country); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | | | + +### Return type + +void (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** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **RolesReportGet** +> List<List<RolesReportsHash>> RolesReportGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RolesReportGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + List> result = apiInstance.RolesReportGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RolesReportGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns report | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Test** +> NotificationtestGetElementsV1ResponseMPayload Test () + +Retrieve an existing Notificationtest's Elements + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Retrieve an existing Notificationtest's Elements + NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Test: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve an existing Notificationtest's Elements + ApiResponse response = apiInstance.TestWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md new file mode 100644 index 00000000000..8e9abed3c22 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeApi.md @@ -0,0 +1,1830 @@ +# Org.OpenAPITools.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**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 | | +| [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | +| [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + +# **FakeHealthGet** +> HealthCheckResult FakeHealthGet () + +Health check endpoint + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeHealthGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Health check endpoint + ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeHealthGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterBooleanSerialize** +> bool FakeOuterBooleanSerialize (bool body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterBooleanSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **bool** | Input boolean as post body | [optional] | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterCompositeSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterNumberSerialize** +> decimal FakeOuterNumberSerialize (decimal body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterNumberSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **decimal** | Input number as post body | [optional] | + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterStringSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | +| **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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetArrayOfEnumsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Array of Enums + ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestAdditionalPropertiesReference** +> void TestAdditionalPropertiesReference (Dictionary requestBody) + +test referenced additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestAdditionalPropertiesReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, Object>**](Object.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithFileSchema** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithFileSchemaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User user, string query) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var user = new User(); // User | + var query = "query_example"; // string | + + try + { + apiInstance.TestBodyWithQueryParams(user, query); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithQueryParamsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithQueryParamsWithHttpInfo(user, query); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | | | +| **query** | **string** | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClientModelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test \"client\" model + ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestClientModelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, DateTime date = null, System.IO.Stream binary = null, float varFloat = null, int integer = null, int int32 = null, long int64 = null, string varString = null, string password = null, string callback = null, DateTime dateTime = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var number = 8.14D; // decimal | None + var varDouble = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var varFloat = 3.4F; // float | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789L; // long | None (optional) + var varString = "varString_example"; // string | None (optional) + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEndpointParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParametersWithHttpInfo(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **varByte** | **byte[]** | None | | +| **number** | **decimal** | None | | +| **varDouble** | **double** | None | | +| **patternWithoutDelimiter** | **string** | None | | +| **date** | **DateTime** | None | [optional] | +| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] | +| **varFloat** | **float** | None | [optional] | +| **integer** | **int** | None | [optional] | +| **int32** | **int** | None | [optional] | +| **int64** | **long** | None | [optional] | +| **varString** | **string** | None | [optional] | +| **password** | **string** | None | [optional] | +| **callback** | **string** | None | [optional] | +| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumHeaderStringArray = null, List enumQueryStringArray = null, List enumFormStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersRequestEnumFormString enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) + var enumHeaderString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Header parameter enum test (string) (optional) + var enumQueryString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Query parameter enum test (string) (optional) + var enumQueryDouble = (TestEnumParametersEnumQueryDoubleParameter) "1.1"; // TestEnumParametersEnumQueryDoubleParameter | Query parameter enum test (double) (optional) + var enumQueryInteger = (TestEnumParametersEnumQueryIntegerParameter) "1"; // TestEnumParametersEnumQueryIntegerParameter | Query parameter enum test (double) (optional) + var enumFormString = (TestEnumParametersRequestEnumFormString) "_abc"; // TestEnumParametersRequestEnumFormString | (optional) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEnumParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test enum parameters + apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **enumHeaderStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Header parameter enum test (string array) | [optional] | +| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] | +| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] | +| **enumHeaderString** | **TestEnumParametersEnumHeaderStringParameter** | Header parameter enum test (string) | [optional] | +| **enumQueryString** | **TestEnumParametersEnumHeaderStringParameter** | Query parameter enum test (string) | [optional] | +| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] | +| **enumQueryInteger** | **TestEnumParametersEnumQueryIntegerParameter** | Query parameter enum test (double) | [optional] | +| **enumFormString** | **TestEnumParametersRequestEnumFormString** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestGroupParameters** +> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool booleanGroup = null, int stringGroup = null, long int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var stringGroup = 56; // int | String in group parameters (optional) + var int64Group = 789L; // long | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestGroupParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | | +| **requiredStringGroup** | **int** | Required String in group parameters | | +| **requiredInt64Group** | **long** | Required Integer in group parameters | | +| **booleanGroup** | **bool** | Boolean in group parameters | [optional] | +| **stringGroup** | **int** | String in group parameters | [optional] | +| **int64Group** | **long** | Integer in group parameters | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline additionalProperties + apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestJsonFormDataWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test json serialization of form data + apiInstance.TestJsonFormDataWithHttpInfo(param, param2); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **param** | **string** | field1 | | +| **param2** | **string** | field2 | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestQueryParameterCollectionFormat** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = null, string notRequiredNullable = null) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + var requiredNotNullable = "requiredNotNullable_example"; // string | + var requiredNullable = "requiredNullable_example"; // string | + var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional) + var notRequiredNullable = "notRequiredNullable_example"; // string | (optional) + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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) | | | +| **requiredNotNullable** | **string** | | | +| **requiredNullable** | **string** | | | +| **notRequiredNotNullable** | **string** | | [optional] | +| **notRequiredNullable** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..dfe1adefd0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,104 @@ +# Org.OpenAPITools.Api.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** +> ModelClient TestClassname (ModelClient modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClassnameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test class name in snake case + ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/PetApi.md new file mode 100644 index 00000000000..862c66f0bee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/PetApi.md @@ -0,0 +1,860 @@ +# Org.OpenAPITools.Api.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 pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<FindPetsByStatusStatusParameterInner>**](FindPetsByStatusStatusParameterInner.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/StoreApi.md new file mode 100644 index 00000000000..4a1cd29ada7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.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 (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/UserApi.md new file mode 100644 index 00000000000..ee189c866ec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/apis/UserApi.md @@ -0,0 +1,715 @@ +# Org.OpenAPITools.Api.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 user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | +| **598** | Not a real HTTP status code | - | +| **599** | Not a real HTTP status code with a return object | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdateUser** +> void UpdateUser (User user, string username) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Updated user object + var username = "username_example"; // string | name that need to be deleted + + try + { + // Updated user + apiInstance.UpdateUser(user, username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(user, username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Updated user object | | +| **username** | **string** | name that need to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Activity.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [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/net4.8/FormModels/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ActivityOutputElementRepresentation.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ActivityOutputElementRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | [optional] +**Prop2** | **Object** | | [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/net4.8/FormModels/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..2bbe882fcfc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Anytype1** | **Object** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [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/net4.8/FormModels/docs/models/Animal.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Animal.md new file mode 100644 index 00000000000..1a1760bd869 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ApiResponse.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ApiResponse.md new file mode 100644 index 00000000000..d89ed1a25dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Message** | **string** | | [optional] +**Type** | **string** | | [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/net4.8/FormModels/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Apple.md new file mode 100644 index 00000000000..9ad1da8cd68 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Apple.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ColorCode** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [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/net4.8/FormModels/docs/models/AppleReq.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/AppleReq.md new file mode 100644 index 00000000000..325521123f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [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/net4.8/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..a23ba59e609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [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/net4.8/FormModels/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..10b8413439b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [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/net4.8/FormModels/docs/models/ArrayTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayTest.md new file mode 100644 index 00000000000..ed572120cd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] +**ArrayOfString** | **List<string>** | | [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/net4.8/FormModels/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Banana.md new file mode 100644 index 00000000000..d32e90cf298 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [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/net4.8/FormModels/docs/models/BananaReq.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/BananaReq.md new file mode 100644 index 00000000000..c8372b73c5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/net4.8/FormModels/docs/models/BasquePig.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/BasquePig.md new file mode 100644 index 00000000000..db4f7a36226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/FormModels/docs/models/Capitalization.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Capitalization.md new file mode 100644 index 00000000000..9e225c17232 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ATT_NAME** | **string** | Name of the pet | [optional] +**CapitalCamel** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**SmallCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [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/net4.8/FormModels/docs/models/Cat.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Cat.md new file mode 100644 index 00000000000..310a5e6575e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [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/net4.8/FormModels/docs/models/Category.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Category.md new file mode 100644 index 00000000000..6eb0a2e13ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ChildCat.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ChildCat.md new file mode 100644 index 00000000000..4085cdef26d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **ChildCatAllOfPetType** | | +**Name** | **string** | | [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/net4.8/FormModels/docs/models/ChildCatAllOfPetType.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ChildCatAllOfPetType.md new file mode 100644 index 00000000000..47a390dc581 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ChildCatAllOfPetType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ChildCatAllOfPetType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ClassModel.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ClassModel.md new file mode 100644 index 00000000000..bb35816c914 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [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/net4.8/FormModels/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ComplexQuadrilateral.md new file mode 100644 index 00000000000..fb00d4ebf08 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/DanishPig.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DanishPig.md new file mode 100644 index 00000000000..4d6ec1400a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/FormModels/docs/models/DateOnlyClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DateOnlyClass.md new file mode 100644 index 00000000000..5dd63b313cc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DateOnlyClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DateOnlyClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateOnlyProperty** | **DateTime** | | [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/net4.8/FormModels/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DeprecatedObject.md new file mode 100644 index 00000000000..e90c59555a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.8/FormModels/docs/models/Dog.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Dog.md new file mode 100644 index 00000000000..70cdc80e83e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [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/net4.8/FormModels/docs/models/Drawing.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Drawing.md new file mode 100644 index 00000000000..95f49b2ed60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [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/net4.8/FormModels/docs/models/EnumArrays.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArrays.md new file mode 100644 index 00000000000..ae3e81632c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayEnum** | [**List<EnumArraysArrayEnumInner>**](EnumArraysArrayEnumInner.md) | | [optional] +**JustSymbol** | **EnumArraysJustSymbol** | | [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/net4.8/FormModels/docs/models/EnumArraysArrayEnumInner.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArraysArrayEnumInner.md new file mode 100644 index 00000000000..9c08ed9cfed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArraysArrayEnumInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumArraysArrayEnumInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EnumArraysJustSymbol.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArraysJustSymbol.md new file mode 100644 index 00000000000..4cf0e643400 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumArraysJustSymbol.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumArraysJustSymbol + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EnumClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumClass.md new file mode 100644 index 00000000000..d259f0f4696 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EnumTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTest.md new file mode 100644 index 00000000000..898c1ea1fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumStringRequired** | **EnumTestEnumString** | | +**EnumInteger** | **EnumTestEnumInteger** | | [optional] +**EnumIntegerOnly** | **EnumTestEnumIntegerOnly** | | [optional] +**EnumNumber** | **TestEnumParametersEnumQueryDoubleParameter** | | [optional] +**EnumString** | **EnumTestEnumString** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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/net4.8/FormModels/docs/models/EnumTestEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumInteger.md new file mode 100644 index 00000000000..2476caf61c7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EnumTestEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumIntegerOnly.md new file mode 100644 index 00000000000..08f59f08776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EnumTestEnumString.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumString.md new file mode 100644 index 00000000000..783198941ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EnumTestEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumTestEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EquilateralTriangle.md new file mode 100644 index 00000000000..8360b5c16a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/FormModels/docs/models/File.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/File.md new file mode 100644 index 00000000000..58b9c2fc369 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [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/net4.8/FormModels/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FileSchemaTestClass.md new file mode 100644 index 00000000000..a47efad77d8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [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/net4.8/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md new file mode 100644 index 00000000000..e4b9110e6a6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FindPetsByStatusStatusParameterInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FindPetsByStatusStatusParameterInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Foo.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Foo.md new file mode 100644 index 00000000000..b9e7d261736 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/FooGetDefaultResponse.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FooGetDefaultResponse.md new file mode 100644 index 00000000000..47e50daca3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FooGetDefaultResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FooGetDefaultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [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/net4.8/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md new file mode 100644 index 00000000000..0983002c5da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md @@ -0,0 +1,28 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Number** | **decimal** | | +**Password** | **string** | | +**Binary** | **System.IO.Stream** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Decimal** | **decimal** | | [optional] +**Double** | **double** | | [optional] +**Float** | **float** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Integer** | **int** | | [optional] +**PatternWithBackslash** | **string** | None | [optional] +**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] +**String** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] +**Uuid** | **Guid** | | [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/net4.8/FormModels/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/FormModels/docs/models/FruitReq.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FruitReq.md new file mode 100644 index 00000000000..38ab0c1a6ca --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FruitReq.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/GmFruit.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/GmFruit.md new file mode 100644 index 00000000000..584c4fd323d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/GmFruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/FormModels/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/GrandparentAnimal.md new file mode 100644 index 00000000000..eca96162b6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.8/FormModels/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/HasOnlyReadOnly.md new file mode 100644 index 00000000000..060a614a698 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/HealthCheckResult.md new file mode 100644 index 00000000000..682cfc50e3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.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] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/IsoscelesTriangle.md new file mode 100644 index 00000000000..07c62ac9338 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/FormModels/docs/models/List.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/List.md new file mode 100644 index 00000000000..0b54858ac24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | **string** | | [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/net4.8/FormModels/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Mammal.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Mammal.md new file mode 100644 index 00000000000..ac14f00c0ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Mammal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/FormModels/docs/models/MapTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MapTest.md new file mode 100644 index 00000000000..b2dea1b6cb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | [**Dictionary<string, MapTestMapOfEnumStringValue>**](MapTestMapOfEnumStringValue.md) | | [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/net4.8/FormModels/docs/models/MapTestMapOfEnumStringValue.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MapTestMapOfEnumStringValue.md new file mode 100644 index 00000000000..f587f829988 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MapTestMapOfEnumStringValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.MapTestMapOfEnumStringValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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/net4.8/FormModels/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/net4.8/FormModels/docs/models/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/net4.8/FormModels/docs/models/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..1bc0740add9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] +**Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [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/net4.8/FormModels/docs/models/MixedSubId.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/net4.8/FormModels/docs/models/Model200Response.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Model200Response.md new file mode 100644 index 00000000000..2752a0d87c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] +**Name** | **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/generichost/net4.8/FormModels/docs/models/ModelClient.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ModelClient.md new file mode 100644 index 00000000000..c658e84ef57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarClient** | **string** | | [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/net4.8/FormModels/docs/models/Name.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Name.md new file mode 100644 index 00000000000..ffe61a31d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarName** | **int** | | +**Property** | **string** | | [optional] +**SnakeCase** | **int** | | [optional] [readonly] +**Var123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md new file mode 100644 index 00000000000..25f223a8360 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NotificationtestGetElementsV1ResponseMPayload.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AObjVariableobject** | **List<Dictionary<string, Object>>** | | +**PkiNotificationtestID** | **int** | | + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/NullableClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableClass.md new file mode 100644 index 00000000000..5d9965f55c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**BooleanProp** | **bool** | | [optional] +**DateProp** | **DateTime** | | [optional] +**DatetimeProp** | **DateTime** | | [optional] +**IntegerProp** | **int** | | [optional] +**NumberProp** | **decimal** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**StringProp** | **string** | | [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/net4.8/FormModels/docs/models/NullableGuidClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableGuidClass.md new file mode 100644 index 00000000000..8d939afe998 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableGuidClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NullableGuidClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [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/net4.8/FormModels/docs/models/NullableShape.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableShape.md new file mode 100644 index 00000000000..2720167ccaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NullableShape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/NumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NumberOnly.md new file mode 100644 index 00000000000..1b83cce764d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [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/net4.8/FormModels/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..9f44c24d19a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bars** | **List<string>** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Id** | **decimal** | | [optional] +**Uuid** | **string** | | [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/net4.8/FormModels/docs/models/OneOfString.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OneOfString.md new file mode 100644 index 00000000000..54caf618776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OneOfString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OneOfString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Order.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Order.md new file mode 100644 index 00000000000..f3fcb0f21f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Complete** | **bool** | | [optional] [default to false] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **OrderStatus** | | [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/net4.8/FormModels/docs/models/OrderStatus.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OrderStatus.md new file mode 100644 index 00000000000..5a80d8efa8c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OrderStatus.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.OrderStatus +Order Status + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/OuterComposite.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterComposite.md new file mode 100644 index 00000000000..8985c59d094 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyBoolean** | **bool** | | [optional] +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [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/net4.8/FormModels/docs/models/OuterEnum.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnum.md new file mode 100644 index 00000000000..36844bc4b17 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..351383f0aea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumInteger.md new file mode 100644 index 00000000000..1013b5b1956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..55e314e3102 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/OuterEnumTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumTest.md new file mode 100644 index 00000000000..b99d27c2c2e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/OuterEnumTest.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ParentPet.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ParentPet.md new file mode 100644 index 00000000000..bdf57005637 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.8/FormModels/docs/models/Pet.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Pet.md new file mode 100644 index 00000000000..2de6e7ef512 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Category** | [**Category**](Category.md) | | [optional] +**Id** | **long** | | [optional] +**Status** | **PetStatus** | | [optional] +**Tags** | [**List<Tag>**](Tag.md) | | [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/net4.8/FormModels/docs/models/PetStatus.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/PetStatus.md new file mode 100644 index 00000000000..c710ca8cbce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/PetStatus.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.PetStatus +pet status in the store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Pig.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Pig.md new file mode 100644 index 00000000000..fd7bb9359ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/FormModels/docs/models/PolymorphicProperty.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/PolymorphicProperty.md new file mode 100644 index 00000000000..4507ec41cd5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/PolymorphicProperty.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PolymorphicProperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Quadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Quadrilateral.md new file mode 100644 index 00000000000..fbbf4f81cec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Quadrilateral.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.8/FormModels/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/QuadrilateralInterface.md new file mode 100644 index 00000000000..756ba09c6dd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.8/FormModels/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ReadOnlyFirst.md new file mode 100644 index 00000000000..afaf2ee4fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [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/net4.8/FormModels/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClass.md new file mode 100644 index 00000000000..11265eef841 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClass.md @@ -0,0 +1,53 @@ +# Org.OpenAPITools.Model.RequiredClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequiredNotNullableDateProp** | **DateTime** | | +**RequiredNotnullableArrayOfString** | **List<string>** | | +**RequiredNotnullableBooleanProp** | **bool** | | +**RequiredNotnullableDatetimeProp** | **DateTime** | | +**RequiredNotnullableEnumInteger** | **RequiredClassRequiredNotnullableEnumInteger** | | +**RequiredNotnullableEnumIntegerOnly** | **RequiredClassRequiredNotnullableEnumIntegerOnly** | | +**RequiredNotnullableEnumString** | **RequiredClassRequiredNotnullableEnumString** | | +**RequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNotnullableStringProp** | **string** | | +**RequiredNotnullableUuid** | **Guid** | | +**RequiredNotnullableintegerProp** | **int** | | +**NotRequiredNotnullableDateProp** | **DateTime** | | [optional] +**NotRequiredNotnullableintegerProp** | **int** | | [optional] +**NotRequiredNullableDateProp** | **DateTime** | | [optional] +**NotRequiredNullableIntegerProp** | **int** | | [optional] +**NotrequiredNotnullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNotnullableBooleanProp** | **bool** | | [optional] +**NotrequiredNotnullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNotnullableEnumInteger** | **RequiredClassRequiredNotnullableEnumInteger** | | [optional] +**NotrequiredNotnullableEnumIntegerOnly** | **RequiredClassRequiredNotnullableEnumIntegerOnly** | | [optional] +**NotrequiredNotnullableEnumString** | **RequiredClassRequiredNotnullableEnumString** | | [optional] +**NotrequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNotnullableStringProp** | **string** | | [optional] +**NotrequiredNotnullableUuid** | **Guid** | | [optional] +**NotrequiredNullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNullableBooleanProp** | **bool** | | [optional] +**NotrequiredNullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNullableEnumInteger** | **RequiredClassRequiredNullableEnumInteger** | | [optional] +**NotrequiredNullableEnumIntegerOnly** | **RequiredClassRequiredNullableEnumIntegerOnly** | | [optional] +**NotrequiredNullableEnumString** | **RequiredClassRequiredNullableEnumString** | | [optional] +**NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNullableStringProp** | **string** | | [optional] +**NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateTime** | | +**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/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md new file mode 100644 index 00000000000..e229576c45b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md new file mode 100644 index 00000000000..da648bc919d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md new file mode 100644 index 00000000000..d0e080d727c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNotnullableEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNotnullableEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md new file mode 100644 index 00000000000..7f04aa4d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md new file mode 100644 index 00000000000..2d0eb8b05c5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumIntegerOnly.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumIntegerOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md new file mode 100644 index 00000000000..cb0fbdac213 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RequiredClassRequiredNullableEnumString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.RequiredClassRequiredNullableEnumString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/Return.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Return.md new file mode 100644 index 00000000000..ad96a170bbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Return.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lock** | **string** | | +**Abstract** | **string** | | +**VarReturn** | **int** | | [optional] +**Unsafe** | **string** | | [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/net4.8/FormModels/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **Guid** | | [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/net4.8/FormModels/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/RolesReportsHashRole.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.RolesReportsHashRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.8/FormModels/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ScaleneTriangle.md new file mode 100644 index 00000000000..d3f15354bcc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/FormModels/docs/models/Shape.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Shape.md new file mode 100644 index 00000000000..ae75c592540 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Shape.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/ShapeInterface.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ShapeInterface.md new file mode 100644 index 00000000000..882d3186830 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ShapeOrNull.md new file mode 100644 index 00000000000..7fcd31a3a5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ShapeOrNull.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/SimpleQuadrilateral.md new file mode 100644 index 00000000000..a9c7f93b67a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.8/FormModels/docs/models/SpecialModelName.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/SpecialModelName.md new file mode 100644 index 00000000000..890bcd923de --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarSpecialModelName** | **string** | | [optional] +**SpecialPropertyName** | **long** | | [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/net4.8/FormModels/docs/models/Tag.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Tag.md new file mode 100644 index 00000000000..2b2d9674d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [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/net4.8/FormModels/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **string** | | [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/net4.8/FormModels/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.md) | | [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/net4.8/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md new file mode 100644 index 00000000000..b5768f76fa5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumHeaderStringParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md new file mode 100644 index 00000000000..72510955c1a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryDoubleParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumQueryDoubleParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md new file mode 100644 index 00000000000..b2c9b9c5a9d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersEnumQueryIntegerParameter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersEnumQueryIntegerParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md new file mode 100644 index 00000000000..b734496b5fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormString.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestEnumParametersRequestEnumFormString +Form parameter enum test (string) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md new file mode 100644 index 00000000000..ca4e762853a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestEnumParametersRequestEnumFormStringArrayInner.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.TestEnumParametersRequestEnumFormStringArrayInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [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/net4.8/FormModels/docs/models/Triangle.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Triangle.md new file mode 100644 index 00000000000..e1510991195 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Triangle.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.8/FormModels/docs/models/TriangleInterface.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TriangleInterface.md new file mode 100644 index 00000000000..4127c08b14f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.8/FormModels/docs/models/User.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/User.md new file mode 100644 index 00000000000..b5700f1c75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**Email** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**Id** | **long** | | [optional] +**LastName** | **string** | | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**Username** | **string** | | [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/net4.8/FormModels/docs/models/Whale.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Whale.md new file mode 100644 index 00000000000..1c633fdce61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [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/net4.8/FormModels/docs/models/Zebra.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Zebra.md new file mode 100644 index 00000000000..5b0d6780969 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Type** | **ZebraType** | | [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/net4.8/FormModels/docs/models/ZebraType.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZebraType.md new file mode 100644 index 00000000000..d3197017490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZebraType.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZebraType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnum.md new file mode 100644 index 00000000000..cb71966c4c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/models/ZeroBasedEnumClass.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnumClass.md new file mode 100644 index 00000000000..afb2e863064 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnumClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ZeroBasedEnum** | **ZeroBasedEnumClassZeroBasedEnum** | | [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/net4.8/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md new file mode 100644 index 00000000000..bf5145894ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/ZeroBasedEnumClassZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClassZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/FormModels/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..cf82a3e39bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..c178aac4eab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + string apiKeyTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken1 = new ApiKeyToken(apiKeyTokenValue1, ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + string apiKeyTokenValue2 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken2 = new ApiKeyToken(apiKeyTokenValue2, ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + string bearerTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken1 = new BearerToken(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + string basicTokenUsername1 = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword1 = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken1 = new BasicToken(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + string oauthTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken1 = new OAuthToken(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..88cf05ba9ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + var model = response.Default(); + Assert.IsType(model); + } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test RolesReportGet + /// + [Fact (Skip = "not implemented")] + public async Task RolesReportGetAsyncTest() + { + var response = await _instance.RolesReportGetAsync(); + var model = response.Ok(); + Assert.IsType>>(model); + } + + /// + /// Test Test + /// + [Fact (Skip = "not implemented")] + public async Task TestAsyncTest() + { + var response = await _instance.TestAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..bbccd77b29c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,243 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..00017fc4214 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + Client.Option outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + Guid requiredStringUuid = default; + Client.Option body = default; + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + User user = default; + string query = default; + await _instance.TestBodyWithQueryParamsAsync(user, query); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + byte[] varByte = default; + decimal number = default; + double varDouble = default; + string patternWithoutDelimiter = default; + Client.Option date = default; + Client.Option binary = default; + Client.Option varFloat = default; + Client.Option integer = default; + Client.Option int32 = default; + Client.Option int64 = default; + Client.Option varString = default; + Client.Option password = default; + Client.Option callback = default; + Client.Option dateTime = default; + await _instance.TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + Client.Option> enumHeaderStringArray = default; + Client.Option> enumQueryStringArray = default; + Client.Option> enumFormStringArray = default; + Client.Option enumHeaderString = default; + Client.Option enumQueryString = default; + Client.Option enumQueryDouble = default; + Client.Option enumQueryInteger = default; + Client.Option enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + bool requiredBooleanGroup = default; + int requiredStringGroup = default; + long requiredInt64Group = default; + Client.Option booleanGroup = default; + Client.Option stringGroup = default; + Client.Option int64Group = default; + await _instance.TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestInlineFreeformAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineFreeformAdditionalPropertiesAsyncTest() + { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default; + await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + string requiredNotNullable = default; + string requiredNullable = default; + Client.Option notRequiredNotNullable = default; + 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/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..5964bf6e51d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..01ef5de875e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + Client.Option apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + Client.Option name = default; + Client.Option status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + Client.Option file = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileAsync(petId, file, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + System.IO.Stream requiredFile = default; + long petId = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..1b75e341700 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..38ee1125438 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + User user = default; + string username = default; + await _instance.UpdateUserAsync(user, username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..adbf639fd72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -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 + * 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 ActivityOutputElementRepresentation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityOutputElementRepresentationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation + //private ActivityOutputElementRepresentation instance; + + public ActivityOutputElementRepresentationTests() + { + // TODO uncomment below to create an instance of ActivityOutputElementRepresentation + //instance = new ActivityOutputElementRepresentation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ActivityOutputElementRepresentation + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..6cc2927eaaf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -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 + * 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 Activity + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Activity + //private Activity instance; + + public ActivityTests() + { + // TODO uncomment below to create an instance of Activity + //instance = new Activity(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Activity + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..e157b477193 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -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 + * 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 AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..1db9725afb8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -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 + * 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 Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..c296a82116a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -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 + * 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 ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 00000000000..d698ee44504 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -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 + * 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 AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..c7c8ccd47c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -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 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'ColorCode' + /// + [Fact] + public void ColorCodeTest() + { + // TODO unit test for the property 'ColorCode' + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..29fe9cfb1d4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..2b0956c0b98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..3b01d0b7abb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -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 + * 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 ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 00000000000..1e54c1f3e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -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 + * 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 BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5a88e9dabbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -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 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 00000000000..4ffd6c2c0c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -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 + * 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 BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..d0391fb47f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -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 + * 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 Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 00000000000..a5d4bf43bbf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -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 + * 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 Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..7fe8f333c81 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -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 + * 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 Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs new file mode 100644 index 00000000000..f24fa44b0e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatAllOfPetTypeTests.cs @@ -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 + * 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 ChildCatAllOfPetType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfPetTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOfPetType + //private ChildCatAllOfPetType instance; + + public ChildCatAllOfPetTypeTests() + { + // TODO uncomment below to create an instance of ChildCatAllOfPetType + //instance = new ChildCatAllOfPetType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOfPetType + /// + [Fact] + public void ChildCatAllOfPetTypeInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOfPetType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 00000000000..4aecdf9bed3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -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 + * 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 ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..a866bfbe242 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -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 + * 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 ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 00000000000..a7a864154ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -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 + * 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 ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 00000000000..e7c505b5136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -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 + * 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 DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs new file mode 100644 index 00000000000..83a4185e53d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -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 + * 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 DateOnlyClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DateOnlyClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DateOnlyClass + //private DateOnlyClass instance; + + public DateOnlyClassTests() + { + // TODO uncomment below to create an instance of DateOnlyClass + //instance = new DateOnlyClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DateOnlyClass + /// + [Fact] + public void DateOnlyClassInstanceTest() + { + // TODO uncomment below to test "IsType" DateOnlyClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateOnlyProperty' + /// + [Fact] + public void DateOnlyPropertyTest() + { + // TODO unit test for the property 'DateOnlyProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 00000000000..95e56f782da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -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 + * 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 DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 00000000000..b8e8bca0538 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -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 + * 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 Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 00000000000..a2de4a1b97b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs new file mode 100644 index 00000000000..131ed18d63f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysArrayEnumInnerTests.cs @@ -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 + * 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 EnumArraysArrayEnumInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysArrayEnumInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArraysArrayEnumInner + //private EnumArraysArrayEnumInner instance; + + public EnumArraysArrayEnumInnerTests() + { + // TODO uncomment below to create an instance of EnumArraysArrayEnumInner + //instance = new EnumArraysArrayEnumInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArraysArrayEnumInner + /// + [Fact] + public void EnumArraysArrayEnumInnerInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArraysArrayEnumInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs new file mode 100644 index 00000000000..98fb4af3a1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysJustSymbolTests.cs @@ -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 + * 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 EnumArraysJustSymbol + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysJustSymbolTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArraysJustSymbol + //private EnumArraysJustSymbol instance; + + public EnumArraysJustSymbolTests() + { + // TODO uncomment below to create an instance of EnumArraysJustSymbol + //instance = new EnumArraysJustSymbol(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArraysJustSymbol + /// + [Fact] + public void EnumArraysJustSymbolInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArraysJustSymbol + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..c6fee27690b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -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 + * 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 EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..44dbbe4d324 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -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 + * 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 EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..5354a6a395c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerOnlyTests.cs @@ -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 + * 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 EnumTestEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumIntegerOnly + //private EnumTestEnumIntegerOnly instance; + + public EnumTestEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of EnumTestEnumIntegerOnly + //instance = new EnumTestEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumIntegerOnly + /// + [Fact] + public void EnumTestEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs new file mode 100644 index 00000000000..da32ebb09ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumIntegerTests.cs @@ -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 + * 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 EnumTestEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumInteger + //private EnumTestEnumInteger instance; + + public EnumTestEnumIntegerTests() + { + // TODO uncomment below to create an instance of EnumTestEnumInteger + //instance = new EnumTestEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumInteger + /// + [Fact] + public void EnumTestEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs new file mode 100644 index 00000000000..02321eb5de6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestEnumStringTests.cs @@ -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 + * 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 EnumTestEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTestEnumString + //private EnumTestEnumString instance; + + public EnumTestEnumStringTests() + { + // TODO uncomment below to create an instance of EnumTestEnumString + //instance = new EnumTestEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTestEnumString + /// + [Fact] + public void EnumTestEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTestEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..3781eebbfcf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -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 + * 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 EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 00000000000..f8d3daec3fe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -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 + * 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 EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 00000000000..e2685848d5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -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 + * 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 FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 00000000000..c305c5356b0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -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 + * 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 File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs new file mode 100644 index 00000000000..33d0a40c803 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FindPetsByStatusStatusParameterInnerTests.cs @@ -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 + * 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 FindPetsByStatusStatusParameterInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FindPetsByStatusStatusParameterInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FindPetsByStatusStatusParameterInner + //private FindPetsByStatusStatusParameterInner instance; + + public FindPetsByStatusStatusParameterInnerTests() + { + // TODO uncomment below to create an instance of FindPetsByStatusStatusParameterInner + //instance = new FindPetsByStatusStatusParameterInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FindPetsByStatusStatusParameterInner + /// + [Fact] + public void FindPetsByStatusStatusParameterInnerInstanceTest() + { + // TODO uncomment below to test "IsType" FindPetsByStatusStatusParameterInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs new file mode 100644 index 00000000000..55086a7cf24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -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 + * 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 FooGetDefaultResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooGetDefaultResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FooGetDefaultResponse + //private FooGetDefaultResponse instance; + + public FooGetDefaultResponseTests() + { + // TODO uncomment below to create an instance of FooGetDefaultResponse + //instance = new FooGetDefaultResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FooGetDefaultResponse + /// + [Fact] + public void FooGetDefaultResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FooGetDefaultResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 00000000000..871506eeaac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -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 + * 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 Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..b658f317f1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + + /// + /// Test the property 'PatternWithBackslash' + /// + [Fact] + public void PatternWithBackslashTest() + { + // TODO unit test for the property 'PatternWithBackslash' + } + + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 00000000000..a33c55ae487 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -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 + * 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 FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..46448efc62f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -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 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 00000000000..7e79cd06792 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -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 + * 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 GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 00000000000..5f0e8672ed5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -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 + * 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 GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..134a7d515eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -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 + * 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 HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 00000000000..18bb8672e98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -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 + * 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 HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 00000000000..464750233cd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -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 + * 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 IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 00000000000..d95303d9751 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -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 + * 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 List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + /// + /// Test the property 'Var123List' + /// + [Fact] + public void Var123ListTest() + { + // TODO unit test for the property 'Var123List' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..31d21de5b60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * 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 LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 00000000000..64bd9e89034 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -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 + * 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 Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs new file mode 100644 index 00000000000..37713bb0496 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestMapOfEnumStringValueTests.cs @@ -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 + * 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 MapTestMapOfEnumStringValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestMapOfEnumStringValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTestMapOfEnumStringValue + //private MapTestMapOfEnumStringValue instance; + + public MapTestMapOfEnumStringValueTests() + { + // TODO uncomment below to create an instance of MapTestMapOfEnumStringValue + //instance = new MapTestMapOfEnumStringValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTestMapOfEnumStringValue + /// + [Fact] + public void MapTestMapOfEnumStringValueInstanceTest() + { + // TODO uncomment below to test "IsType" MapTestMapOfEnumStringValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..2dc6d8d8e04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..d3689c15f40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..3b5e94c5f8f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -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 + * 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 Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..5a986cfdc6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -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 + * 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 ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarClient' + /// + [Fact] + public void VarClientTest() + { + // TODO unit test for the property 'VarClient' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 00000000000..3aac92ae468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarName' + /// + [Fact] + public void VarNameTest() + { + // TODO unit test for the property 'VarName' + } + + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + + /// + /// Test the property 'Var123Number' + /// + [Fact] + public void Var123NumberTest() + { + // TODO unit test for the property 'Var123Number' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs new file mode 100644 index 00000000000..dd3b74e3306 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs @@ -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 + * 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 NotificationtestGetElementsV1ResponseMPayload + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NotificationtestGetElementsV1ResponseMPayloadTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NotificationtestGetElementsV1ResponseMPayload + //private NotificationtestGetElementsV1ResponseMPayload instance; + + public NotificationtestGetElementsV1ResponseMPayloadTests() + { + // TODO uncomment below to create an instance of NotificationtestGetElementsV1ResponseMPayload + //instance = new NotificationtestGetElementsV1ResponseMPayload(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NotificationtestGetElementsV1ResponseMPayload + /// + [Fact] + public void NotificationtestGetElementsV1ResponseMPayloadInstanceTest() + { + // TODO uncomment below to test "IsType" NotificationtestGetElementsV1ResponseMPayload + //Assert.IsType(instance); + } + + /// + /// Test the property 'AObjVariableobject' + /// + [Fact] + public void AObjVariableobjectTest() + { + // TODO unit test for the property 'AObjVariableobject' + } + + /// + /// Test the property 'PkiNotificationtestID' + /// + [Fact] + public void PkiNotificationtestIDTest() + { + // TODO unit test for the property 'PkiNotificationtestID' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 00000000000..1e19aa6b823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs new file mode 100644 index 00000000000..db8c9aa0956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -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 + * 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 NullableGuidClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableGuidClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableGuidClass + //private NullableGuidClass instance; + + public NullableGuidClassTests() + { + // TODO uncomment below to create an instance of NullableGuidClass + //instance = new NullableGuidClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableGuidClass + /// + [Fact] + public void NullableGuidClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableGuidClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 00000000000..e65ba44efa2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -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 + * 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 NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..2b88fb1a609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -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 + * 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 NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 00000000000..078655aaba7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs new file mode 100644 index 00000000000..8ef411a15eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs @@ -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 + * 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 OneOfString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OneOfStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OneOfString + //private OneOfString instance; + + public OneOfStringTests() + { + // TODO uncomment below to create an instance of OneOfString + //instance = new OneOfString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OneOfString + /// + [Fact] + public void OneOfStringInstanceTest() + { + // TODO uncomment below to test "IsType" OneOfString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs new file mode 100644 index 00000000000..4b9bcdbbc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderStatusTests.cs @@ -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 + * 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 OrderStatus + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderStatusTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OrderStatus + //private OrderStatus instance; + + public OrderStatusTests() + { + // TODO uncomment below to create an instance of OrderStatus + //instance = new OrderStatus(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OrderStatus + /// + [Fact] + public void OrderStatusInstanceTest() + { + // TODO uncomment below to test "IsType" OrderStatus + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..e7187bbdc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -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 + * 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 Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..0bb8ce5e5d9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -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 + * 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 OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 00000000000..a1d1e152777 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -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 + * 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 OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 00000000000..030326d7579 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -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 + * 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 OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 00000000000..1f3bfe459e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -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 + * 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 OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs new file mode 100644 index 00000000000..c4cb8eeecee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs @@ -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 + * 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 OuterEnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumTest + //private OuterEnumTest instance; + + public OuterEnumTestTests() + { + // TODO uncomment below to create an instance of OuterEnumTest + //instance = new OuterEnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumTest + /// + [Fact] + public void OuterEnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumTest + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..2859494010b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -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 + * 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 OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 00000000000..b0ebddd374f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -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 + * 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 ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs new file mode 100644 index 00000000000..0b3bb9f168b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetStatusTests.cs @@ -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 + * 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 PetStatus + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetStatusTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PetStatus + //private PetStatus instance; + + public PetStatusTests() + { + // TODO uncomment below to create an instance of PetStatus + //instance = new PetStatus(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PetStatus + /// + [Fact] + public void PetStatusInstanceTest() + { + // TODO uncomment below to test "IsType" PetStatus + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 00000000000..8485d1213ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -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 + * 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 Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 00000000000..bd052bc705b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -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 + * 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 Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs new file mode 100644 index 00000000000..23120ba7bdf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -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 + * 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 PolymorphicProperty + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PolymorphicPropertyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PolymorphicProperty + //private PolymorphicProperty instance; + + public PolymorphicPropertyTests() + { + // TODO uncomment below to create an instance of PolymorphicProperty + //instance = new PolymorphicProperty(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PolymorphicProperty + /// + [Fact] + public void PolymorphicPropertyInstanceTest() + { + // TODO uncomment below to test "IsType" PolymorphicProperty + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 00000000000..2ddd31cfcbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -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 + * 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 QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 00000000000..65673847d75 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -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 + * 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 Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..a4c91cf44a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -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 + * 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 ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..d0f0ae6b6f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerOnlyTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumIntegerOnly + //private RequiredClassRequiredNotnullableEnumIntegerOnly instance; + + public RequiredClassRequiredNotnullableEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumIntegerOnly + //instance = new RequiredClassRequiredNotnullableEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumIntegerOnly + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs new file mode 100644 index 00000000000..60c35933cc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumIntegerTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumInteger + //private RequiredClassRequiredNotnullableEnumInteger instance; + + public RequiredClassRequiredNotnullableEnumIntegerTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumInteger + //instance = new RequiredClassRequiredNotnullableEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumInteger + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs new file mode 100644 index 00000000000..0cd9b817a01 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNotnullableEnumStringTests.cs @@ -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 + * 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 RequiredClassRequiredNotnullableEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNotnullableEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNotnullableEnumString + //private RequiredClassRequiredNotnullableEnumString instance; + + public RequiredClassRequiredNotnullableEnumStringTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNotnullableEnumString + //instance = new RequiredClassRequiredNotnullableEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNotnullableEnumString + /// + [Fact] + public void RequiredClassRequiredNotnullableEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNotnullableEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs new file mode 100644 index 00000000000..890639ce905 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerOnlyTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumIntegerOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumIntegerOnly + //private RequiredClassRequiredNullableEnumIntegerOnly instance; + + public RequiredClassRequiredNullableEnumIntegerOnlyTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumIntegerOnly + //instance = new RequiredClassRequiredNullableEnumIntegerOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumIntegerOnly + /// + [Fact] + public void RequiredClassRequiredNullableEnumIntegerOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumIntegerOnly + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs new file mode 100644 index 00000000000..ed87acb3c0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumIntegerTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumInteger + //private RequiredClassRequiredNullableEnumInteger instance; + + public RequiredClassRequiredNullableEnumIntegerTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumInteger + //instance = new RequiredClassRequiredNullableEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumInteger + /// + [Fact] + public void RequiredClassRequiredNullableEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs new file mode 100644 index 00000000000..965d4bbd2e3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassRequiredNullableEnumStringTests.cs @@ -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 + * 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 RequiredClassRequiredNullableEnumString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassRequiredNullableEnumStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClassRequiredNullableEnumString + //private RequiredClassRequiredNullableEnumString instance; + + public RequiredClassRequiredNullableEnumStringTests() + { + // TODO uncomment below to create an instance of RequiredClassRequiredNullableEnumString + //instance = new RequiredClassRequiredNullableEnumString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClassRequiredNullableEnumString + /// + [Fact] + public void RequiredClassRequiredNullableEnumStringInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClassRequiredNullableEnumString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs new file mode 100644 index 00000000000..d1da68281ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -0,0 +1,452 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 RequiredClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClass + //private RequiredClass instance; + + public RequiredClassTests() + { + // TODO uncomment below to create an instance of RequiredClass + //instance = new RequiredClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClass + /// + [Fact] + public void RequiredClassInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'RequiredNotNullableDateProp' + /// + [Fact] + public void RequiredNotNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNotNullableDateProp' + } + + /// + /// Test the property 'RequiredNotnullableArrayOfString' + /// + [Fact] + public void RequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'RequiredNotnullableBooleanProp' + /// + [Fact] + public void RequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'RequiredNotnullableDatetimeProp' + /// + [Fact] + public void RequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNotnullableEnumInteger' + /// + [Fact] + public void RequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'RequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNotnullableEnumString' + /// + [Fact] + public void RequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumString' + } + + /// + /// Test the property 'RequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNotnullableStringProp' + /// + [Fact] + public void RequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'RequiredNotnullableStringProp' + } + + /// + /// Test the property 'RequiredNotnullableUuid' + /// + [Fact] + public void RequiredNotnullableUuidTest() + { + // TODO unit test for the property 'RequiredNotnullableUuid' + } + + /// + /// Test the property 'RequiredNotnullableintegerProp' + /// + [Fact] + public void RequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'RequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNotnullableDateProp' + /// + [Fact] + public void NotRequiredNotnullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableDateProp' + } + + /// + /// Test the property 'NotRequiredNotnullableintegerProp' + /// + [Fact] + public void NotRequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNullableDateProp' + /// + [Fact] + public void NotRequiredNullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNullableDateProp' + } + + /// + /// Test the property 'NotRequiredNullableIntegerProp' + /// + [Fact] + public void NotRequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'NotRequiredNullableIntegerProp' + } + + /// + /// Test the property 'NotrequiredNotnullableArrayOfString' + /// + [Fact] + public void NotrequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNotnullableBooleanProp' + /// + [Fact] + public void NotrequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNotnullableDatetimeProp' + /// + [Fact] + public void NotrequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumInteger' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumString' + /// + [Fact] + public void NotrequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumString' + } + + /// + /// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNotnullableStringProp' + /// + [Fact] + public void NotrequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableStringProp' + } + + /// + /// Test the property 'NotrequiredNotnullableUuid' + /// + [Fact] + public void NotrequiredNotnullableUuidTest() + { + // TODO unit test for the property 'NotrequiredNotnullableUuid' + } + + /// + /// Test the property 'NotrequiredNullableArrayOfString' + /// + [Fact] + public void NotrequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNullableBooleanProp' + /// + [Fact] + public void NotrequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNullableDatetimeProp' + /// + [Fact] + public void NotrequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNullableEnumInteger' + /// + [Fact] + public void NotrequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNullableEnumString' + /// + [Fact] + public void NotrequiredNullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumString' + } + + /// + /// Test the property 'NotrequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNullableStringProp' + /// + [Fact] + public void NotrequiredNullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNullableStringProp' + } + + /// + /// Test the property 'NotrequiredNullableUuid' + /// + [Fact] + public void NotrequiredNullableUuidTest() + { + // 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/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..bbea79ed951 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //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' + /// + [Fact] + public void VarReturnTest() + { + // 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/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 + * 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 RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashRoleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHashRole + //private RolesReportsHashRole instance; + + public RolesReportsHashRoleTests() + { + // TODO uncomment below to create an instance of RolesReportsHashRole + //instance = new RolesReportsHashRole(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 + * 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 RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHash + //private RolesReportsHash instance; + + public RolesReportsHashTests() + { + // TODO uncomment below to create an instance of RolesReportsHash + //instance = new RolesReportsHash(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 00000000000..085d3e550a1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -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 + * 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 ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 00000000000..62d6d69ff72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -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 + * 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 ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 00000000000..dc6970b16f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -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 + * 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 ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 00000000000..dbdf012c5ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -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 + * 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 Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 00000000000..baa6e1e9f6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -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 + * 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 SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..23763d9c3af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -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 + * 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 SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarSpecialModelName' + /// + [Fact] + public void VarSpecialModelNameTest() + { + // TODO unit test for the property 'VarSpecialModelName' + } + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 00000000000..fe7f3d82bab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -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 + * 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 Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..eca020ce1fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -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 + * 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 TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e3c86aefabe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -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 + * 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 TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs new file mode 100644 index 00000000000..13a2e1eb54f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumHeaderStringParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumHeaderStringParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumHeaderStringParameter + //private TestEnumParametersEnumHeaderStringParameter instance; + + public TestEnumParametersEnumHeaderStringParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumHeaderStringParameter + //instance = new TestEnumParametersEnumHeaderStringParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumHeaderStringParameter + /// + [Fact] + public void TestEnumParametersEnumHeaderStringParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumHeaderStringParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs new file mode 100644 index 00000000000..4d7a6d9b665 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryDoubleParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumQueryDoubleParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumQueryDoubleParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumQueryDoubleParameter + //private TestEnumParametersEnumQueryDoubleParameter instance; + + public TestEnumParametersEnumQueryDoubleParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumQueryDoubleParameter + //instance = new TestEnumParametersEnumQueryDoubleParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumQueryDoubleParameter + /// + [Fact] + public void TestEnumParametersEnumQueryDoubleParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumQueryDoubleParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs new file mode 100644 index 00000000000..700dbb98ec9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumQueryIntegerParameterTests.cs @@ -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 + * 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 TestEnumParametersEnumQueryIntegerParameter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersEnumQueryIntegerParameterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersEnumQueryIntegerParameter + //private TestEnumParametersEnumQueryIntegerParameter instance; + + public TestEnumParametersEnumQueryIntegerParameterTests() + { + // TODO uncomment below to create an instance of TestEnumParametersEnumQueryIntegerParameter + //instance = new TestEnumParametersEnumQueryIntegerParameter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersEnumQueryIntegerParameter + /// + [Fact] + public void TestEnumParametersEnumQueryIntegerParameterInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersEnumQueryIntegerParameter + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs new file mode 100644 index 00000000000..9dd379868e6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringArrayInnerTests.cs @@ -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 + * 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 TestEnumParametersRequestEnumFormStringArrayInner + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersRequestEnumFormStringArrayInner + //private TestEnumParametersRequestEnumFormStringArrayInner instance; + + public TestEnumParametersRequestEnumFormStringArrayInnerTests() + { + // TODO uncomment below to create an instance of TestEnumParametersRequestEnumFormStringArrayInner + //instance = new TestEnumParametersRequestEnumFormStringArrayInner(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersRequestEnumFormStringArrayInner + /// + [Fact] + public void TestEnumParametersRequestEnumFormStringArrayInnerInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersRequestEnumFormStringArrayInner + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs new file mode 100644 index 00000000000..a99aa2d7d3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersRequestEnumFormStringTests.cs @@ -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 + * 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 TestEnumParametersRequestEnumFormString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestEnumParametersRequestEnumFormStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestEnumParametersRequestEnumFormString + //private TestEnumParametersRequestEnumFormString instance; + + public TestEnumParametersRequestEnumFormStringTests() + { + // TODO uncomment below to create an instance of TestEnumParametersRequestEnumFormString + //instance = new TestEnumParametersRequestEnumFormString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestEnumParametersRequestEnumFormString + /// + [Fact] + public void TestEnumParametersRequestEnumFormStringInstanceTest() + { + // TODO uncomment below to test "IsType" TestEnumParametersRequestEnumFormString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -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 + * 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 TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 00000000000..1293a2b212e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -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 + * 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 TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 00000000000..4cb53522348 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -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 + * 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 Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 00000000000..6415f8561f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 00000000000..7d05cc5e59a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -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 + * 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 Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 00000000000..cd0d1c1c361 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -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 + * 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 Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs new file mode 100644 index 00000000000..d257a4a319e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZebraTypeTests.cs @@ -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 + * 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 ZebraType + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTypeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZebraType + //private ZebraType instance; + + public ZebraTypeTests() + { + // TODO uncomment below to create an instance of ZebraType + //instance = new ZebraType(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZebraType + /// + [Fact] + public void ZebraTypeInstanceTest() + { + // TODO uncomment below to test "IsType" ZebraType + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs new file mode 100644 index 00000000000..b432edb28c2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs @@ -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 + * 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 ZeroBasedEnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClass + //private ZeroBasedEnumClass instance; + + public ZeroBasedEnumClassTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClass + //instance = new ZeroBasedEnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClass + /// + [Fact] + public void ZeroBasedEnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ZeroBasedEnum' + /// + [Fact] + public void ZeroBasedEnumTest() + { + // TODO unit test for the property 'ZeroBasedEnum' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs new file mode 100644 index 00000000000..42fabdfc6a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnumClassZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClassZeroBasedEnum + //private ZeroBasedEnumClassZeroBasedEnum instance; + + public ZeroBasedEnumClassZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClassZeroBasedEnum + //instance = new ZeroBasedEnumClassZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClassZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumClassZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClassZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs new file mode 100644 index 00000000000..3689a873c34 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnum + //private ZeroBasedEnum instance; + + public ZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnum + //instance = new ZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..c629057faad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,402 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IAnotherFakeApi : IApi + { + /// + /// The class containing the events + /// + AnotherFakeApiEvents Events { get; } + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICall123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class AnotherFakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCall123TestSpecialTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCall123TestSpecialTags; + + internal void ExecuteOnCall123TestSpecialTags(AnotherFakeApi.Call123TestSpecialTagsApiResponse apiResponse) + { + OnCall123TestSpecialTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCall123TestSpecialTags(Exception exception) + { + OnErrorCall123TestSpecialTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class AnotherFakeApi : IAnotherFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public AnotherFakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, AnotherFakeApiEvents anotherFakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = anotherFakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCall123TestSpecialTags(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCall123TestSpecialTags(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCall123TestSpecialTagsDefaultImplementation(ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterCall123TestSpecialTags(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCall123TestSpecialTags(ref bool suppressDefaultLog, ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorCall123TestSpecialTags(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await Call123TestSpecialTagsAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCall123TestSpecialTags(modelClient); + + FormatCall123TestSpecialTags(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + Call123TestSpecialTagsApiResponse apiResponseLocalVar = new Call123TestSpecialTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/another-fake/dummy", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCall123TestSpecialTagsDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnCall123TestSpecialTags(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCall123TestSpecialTagsDefaultImplementation(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorCall123TestSpecialTags(e); + throw; + } + } + + /// + /// The + /// + public partial class Call123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, ICall123TestSpecialTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public Call123TestSpecialTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..d58e3391473 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,1352 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task HelloAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Cancellation Token to cancel the request. + /// <> + Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task TestAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFooGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IDefault + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IGetCountryApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IHelloApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFooGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFooGet; + + internal void ExecuteOnFooGet(DefaultApi.FooGetApiResponse apiResponse) + { + OnFooGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFooGet(Exception exception) + { + OnErrorFooGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetCountry; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetCountry; + + internal void ExecuteOnGetCountry(DefaultApi.GetCountryApiResponse apiResponse) + { + OnGetCountry?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetCountry(Exception exception) + { + OnErrorGetCountry?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnHello; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorHello; + + internal void ExecuteOnHello(DefaultApi.HelloApiResponse apiResponse) + { + OnHello?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorHello(Exception exception) + { + OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(DefaultApi.RolesReportGetApiResponse apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTest; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTest; + + internal void ExecuteOnTest(DefaultApi.TestApiResponse apiResponse) + { + OnTest?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTest(Exception exception) + { + OnErrorTest?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFooGetDefaultImplementation(IFooGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFooGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFooGet(ref bool suppressDefaultLog, IFooGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFooGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFooGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFooGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FooGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FooGetApiResponse apiResponseLocalVar = new FooGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/foo", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFooGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFooGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFooGetDefaultImplementation(e, "/foo", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFooGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FooGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFooGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + /// + /// Deserializes the response if the response is 0 Default + /// + /// + public Org.OpenAPITools.Model.FooGetDefaultResponse Default() + { + // This logic may be modified with the AsModel.mustache template + return IsDefault + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 0 Default and the deserialized response is not null + /// + /// + /// + public bool TryDefault(out Org.OpenAPITools.Model.FooGetDefaultResponse result) + { + result = null; + + try + { + result = Default(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)0); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetCountry(ref string country); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetCountry(string country) + { + if (country == null) + throw new ArgumentNullException(nameof(country)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetCountryDefaultImplementation(IGetCountryApiResponse apiResponseLocalVar, string country) + { + bool suppressDefaultLog = false; + AfterGetCountry(ref suppressDefaultLog, apiResponseLocalVar, country); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetCountry(ref bool suppressDefaultLog, IGetCountryApiResponse apiResponseLocalVar, string country); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetCountryDefaultImplementation(Exception exception, string pathFormat, string path, string country) + { + bool suppressDefaultLog = false; + OnErrorGetCountry(ref suppressDefaultLog, exception, pathFormat, path, country); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetCountry(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string country); + + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetCountryAsync(country, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetCountry(country); + + FormatGetCountry(ref country); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetCountryApiResponse apiResponseLocalVar = new GetCountryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/country", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetCountryDefaultImplementation(apiResponseLocalVar, country); + + Events.ExecuteOnGetCountry(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetCountryDefaultImplementation(e, "/country", uriBuilderLocalVar.Path, country); + Events.ExecuteOnErrorGetCountry(e); + throw; + } + } + + /// + /// The + /// + public partial class GetCountryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetCountryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetCountryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterHelloDefaultImplementation(IHelloApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterHello(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterHello(ref bool suppressDefaultLog, IHelloApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorHelloDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorHello(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorHello(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Hello Hello + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await HelloAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + HelloApiResponse apiResponseLocalVar = new HelloApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/hello", requestedAtLocalVar, _jsonSerializerOptions); + + AfterHelloDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnHello(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHelloDefaultImplementation(e, "/hello", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorHello(e); + throw; + } + } + + /// + /// The + /// + public partial class HelloApiResponse : Org.OpenAPITools.Client.ApiResponse, IHelloApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(IRolesReportGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, IRolesReportGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RolesReportGetApiResponse apiResponseLocalVar = new RolesReportGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RolesReportGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRolesReportGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RolesReportGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterTestDefaultImplementation(ITestApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterTest(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterTest(ref bool suppressDefaultLog, ITestApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorTestDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorTest(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorTest(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/test"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestApiResponse apiResponseLocalVar = new TestApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnTest(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestDefaultImplementation(e, "/test", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorTest(e); + throw; + } + } + + /// + /// The + /// + public partial class TestApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 00000000000..01eeeb00511 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,5673 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeApi : IApi + { + /// + /// The class containing the events + /// + FakeApiEvents Events { get; } + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFakeHealthGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestClientModelApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestEndpointParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestEnumParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestGroupParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ITestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestJsonFormDataApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeHealthGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeHealthGet; + + internal void ExecuteOnFakeHealthGet(FakeApi.FakeHealthGetApiResponse apiResponse) + { + OnFakeHealthGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeHealthGet(Exception exception) + { + OnErrorFakeHealthGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterBooleanSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterBooleanSerialize; + + internal void ExecuteOnFakeOuterBooleanSerialize(FakeApi.FakeOuterBooleanSerializeApiResponse apiResponse) + { + OnFakeOuterBooleanSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterBooleanSerialize(Exception exception) + { + OnErrorFakeOuterBooleanSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterCompositeSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterCompositeSerialize; + + internal void ExecuteOnFakeOuterCompositeSerialize(FakeApi.FakeOuterCompositeSerializeApiResponse apiResponse) + { + OnFakeOuterCompositeSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterCompositeSerialize(Exception exception) + { + OnErrorFakeOuterCompositeSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterNumberSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterNumberSerialize; + + internal void ExecuteOnFakeOuterNumberSerialize(FakeApi.FakeOuterNumberSerializeApiResponse apiResponse) + { + OnFakeOuterNumberSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterNumberSerialize(Exception exception) + { + OnErrorFakeOuterNumberSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterStringSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterStringSerialize; + + internal void ExecuteOnFakeOuterStringSerialize(FakeApi.FakeOuterStringSerializeApiResponse apiResponse) + { + OnFakeOuterStringSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterStringSerialize(Exception exception) + { + OnErrorFakeOuterStringSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetArrayOfEnums; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetArrayOfEnums; + + internal void ExecuteOnGetArrayOfEnums(FakeApi.GetArrayOfEnumsApiResponse apiResponse) + { + OnGetArrayOfEnums?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetArrayOfEnums(Exception exception) + { + OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestAdditionalPropertiesReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestAdditionalPropertiesReference; + + internal void ExecuteOnTestAdditionalPropertiesReference(FakeApi.TestAdditionalPropertiesReferenceApiResponse apiResponse) + { + OnTestAdditionalPropertiesReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestAdditionalPropertiesReference(Exception exception) + { + OnErrorTestAdditionalPropertiesReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithFileSchema; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithFileSchema; + + internal void ExecuteOnTestBodyWithFileSchema(FakeApi.TestBodyWithFileSchemaApiResponse apiResponse) + { + OnTestBodyWithFileSchema?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithFileSchema(Exception exception) + { + OnErrorTestBodyWithFileSchema?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithQueryParams; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithQueryParams; + + internal void ExecuteOnTestBodyWithQueryParams(FakeApi.TestBodyWithQueryParamsApiResponse apiResponse) + { + OnTestBodyWithQueryParams?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithQueryParams(Exception exception) + { + OnErrorTestBodyWithQueryParams?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClientModel; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClientModel; + + internal void ExecuteOnTestClientModel(FakeApi.TestClientModelApiResponse apiResponse) + { + OnTestClientModel?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClientModel(Exception exception) + { + OnErrorTestClientModel?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEndpointParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEndpointParameters; + + internal void ExecuteOnTestEndpointParameters(FakeApi.TestEndpointParametersApiResponse apiResponse) + { + OnTestEndpointParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEndpointParameters(Exception exception) + { + OnErrorTestEndpointParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEnumParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEnumParameters; + + internal void ExecuteOnTestEnumParameters(FakeApi.TestEnumParametersApiResponse apiResponse) + { + OnTestEnumParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEnumParameters(Exception exception) + { + OnErrorTestEnumParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestGroupParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestGroupParameters; + + internal void ExecuteOnTestGroupParameters(FakeApi.TestGroupParametersApiResponse apiResponse) + { + OnTestGroupParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestGroupParameters(Exception exception) + { + OnErrorTestGroupParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineAdditionalProperties; + + internal void ExecuteOnTestInlineAdditionalProperties(FakeApi.TestInlineAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineAdditionalProperties(Exception exception) + { + OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(FakeApi.TestInlineFreeformAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestJsonFormData; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestJsonFormData; + + internal void ExecuteOnTestJsonFormData(FakeApi.TestJsonFormDataApiResponse apiResponse) + { + OnTestJsonFormData?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestJsonFormData(Exception exception) + { + OnErrorTestJsonFormData?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestQueryParameterCollectionFormat; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestQueryParameterCollectionFormat; + + internal void ExecuteOnTestQueryParameterCollectionFormat(FakeApi.TestQueryParameterCollectionFormatApiResponse apiResponse) + { + OnTestQueryParameterCollectionFormat?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception exception) + { + OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeApi : IFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeApiEvents fakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFakeHealthGetDefaultImplementation(IFakeHealthGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFakeHealthGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFakeHealthGet(ref bool suppressDefaultLog, IFakeHealthGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFakeHealthGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFakeHealthGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFakeHealthGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Health check endpoint + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeHealthGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeHealthGetApiResponse apiResponseLocalVar = new FakeHealthGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/health", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeHealthGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFakeHealthGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeHealthGetDefaultImplementation(e, "/fake/health", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFakeHealthGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeHealthGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeHealthGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.HealthCheckResult Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.HealthCheckResult result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterBooleanSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterBooleanSerializeDefaultImplementation(IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterBooleanSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterBooleanSerialize(ref bool suppressDefaultLog, IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterBooleanSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterBooleanSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterBooleanSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterBooleanSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterBooleanSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterBooleanSerializeApiResponse apiResponseLocalVar = new FakeOuterBooleanSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/boolean", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterBooleanSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterBooleanSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterBooleanSerializeDefaultImplementation(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterBooleanSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterBooleanSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public bool? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out bool? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterCompositeSerialize(Option outerComposite); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterCompositeSerialize(Option outerComposite) + { + if (outerComposite.IsSet && outerComposite.Value == null) + throw new ArgumentNullException(nameof(outerComposite)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterCompositeSerializeDefaultImplementation(IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite) + { + bool suppressDefaultLog = false; + AfterFakeOuterCompositeSerialize(ref suppressDefaultLog, apiResponseLocalVar, outerComposite); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterCompositeSerialize(ref bool suppressDefaultLog, IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterCompositeSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option outerComposite) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterCompositeSerialize(ref suppressDefaultLog, exception, pathFormat, path, outerComposite); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterCompositeSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option outerComposite); + + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterCompositeSerializeAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterCompositeSerialize(outerComposite); + + FormatFakeOuterCompositeSerialize(outerComposite); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if (outerComposite.IsSet) + httpRequestMessageLocalVar.Content = (outerComposite.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterCompositeSerializeApiResponse apiResponseLocalVar = new FakeOuterCompositeSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/composite", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterCompositeSerializeDefaultImplementation(apiResponseLocalVar, outerComposite); + + Events.ExecuteOnFakeOuterCompositeSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterCompositeSerializeDefaultImplementation(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); + Events.ExecuteOnErrorFakeOuterCompositeSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterCompositeSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.OuterComposite Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.OuterComposite result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterNumberSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterNumberSerializeDefaultImplementation(IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterNumberSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterNumberSerialize(ref bool suppressDefaultLog, IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterNumberSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterNumberSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterNumberSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterNumberSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterNumberSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterNumberSerializeApiResponse apiResponseLocalVar = new FakeOuterNumberSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/number", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterNumberSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterNumberSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterNumberSerializeDefaultImplementation(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterNumberSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterNumberSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public decimal? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out decimal? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterStringSerialize(ref Guid requiredStringUuid, ref Option body); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterStringSerialize(Option body) + { + if (body.IsSet && body.Value == null) + throw new ArgumentNullException(nameof(body)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterFakeOuterStringSerializeDefaultImplementation(IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterStringSerialize(ref suppressDefaultLog, apiResponseLocalVar, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterFakeOuterStringSerialize(ref bool suppressDefaultLog, IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorFakeOuterStringSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterStringSerialize(ref suppressDefaultLog, exception, pathFormat, path, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterStringSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body); + + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterStringSerializeAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterStringSerialize(body); + + FormatFakeOuterStringSerialize(ref requiredStringUuid, ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_uuid"] = ClientUtils.ParameterToString(requiredStringUuid); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterStringSerializeApiResponse apiResponseLocalVar = new FakeOuterStringSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/string", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterStringSerializeDefaultImplementation(apiResponseLocalVar, requiredStringUuid, body); + + Events.ExecuteOnFakeOuterStringSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterStringSerializeDefaultImplementation(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); + Events.ExecuteOnErrorFakeOuterStringSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterStringSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetArrayOfEnumsDefaultImplementation(IGetArrayOfEnumsApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetArrayOfEnums(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetArrayOfEnums(ref bool suppressDefaultLog, IGetArrayOfEnumsApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetArrayOfEnumsDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetArrayOfEnums(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetArrayOfEnums(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Array of Enums + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetArrayOfEnumsAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetArrayOfEnumsApiResponse apiResponseLocalVar = new GetArrayOfEnumsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/array-of-enums", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetArrayOfEnumsDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetArrayOfEnums(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetArrayOfEnumsDefaultImplementation(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetArrayOfEnums(e); + throw; + } + } + + /// + /// The + /// + public partial class GetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetArrayOfEnumsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new GetMixedAnyOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new GetMixedOneOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestAdditionalPropertiesReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestAdditionalPropertiesReferenceDefaultImplementation(ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestAdditionalPropertiesReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestAdditionalPropertiesReference(ref bool suppressDefaultLog, ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestAdditionalPropertiesReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestAdditionalPropertiesReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAdditionalPropertiesReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestAdditionalPropertiesReference(requestBody); + + FormatTestAdditionalPropertiesReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/additionalProperties-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar = new TestAdditionalPropertiesReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/additionalProperties-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestAdditionalPropertiesReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestAdditionalPropertiesReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(e, "/fake/additionalProperties-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestAdditionalPropertiesReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestAdditionalPropertiesReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestAdditionalPropertiesReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + { + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestBodyWithFileSchemaDefaultImplementation(ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + AfterTestBodyWithFileSchema(ref suppressDefaultLog, apiResponseLocalVar, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestBodyWithFileSchema(ref bool suppressDefaultLog, ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithFileSchemaDefaultImplementation(Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithFileSchema(ref suppressDefaultLog, exception, pathFormat, path, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithFileSchema(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass); + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithFileSchemaAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithFileSchema(fileSchemaTestClass); + + FormatTestBodyWithFileSchema(fileSchemaTestClass); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithFileSchemaApiResponse apiResponseLocalVar = new TestBodyWithFileSchemaApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-file-schema", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithFileSchemaDefaultImplementation(apiResponseLocalVar, fileSchemaTestClass); + + Events.ExecuteOnTestBodyWithFileSchema(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithFileSchemaDefaultImplementation(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); + Events.ExecuteOnErrorTestBodyWithFileSchema(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithFileSchemaApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithFileSchemaApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithQueryParams(User user, ref string query); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestBodyWithQueryParams(User user, string query) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (query == null) + throw new ArgumentNullException(nameof(query)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query) + { + bool suppressDefaultLog = false; + AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, user, query); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, User user, string query) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, user, query); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string query); + + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithQueryParamsAsync(user, query, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithQueryParams(user, query); + + FormatTestBodyWithQueryParams(user, ref query); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["query"] = ClientUtils.ParameterToString(query); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithQueryParamsApiResponse apiResponseLocalVar = new TestBodyWithQueryParamsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-query-params", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, user, query); + + Events.ExecuteOnTestBodyWithQueryParams(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); + Events.ExecuteOnErrorTestBodyWithQueryParams(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithQueryParamsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithQueryParamsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestClientModel(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClientModel(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClientModelDefaultImplementation(ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClientModel(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClientModel(ref bool suppressDefaultLog, ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClientModelDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClientModel(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClientModel(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test \"client\" model To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClientModelAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClientModel(modelClient); + + FormatTestClientModel(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClientModelApiResponse apiResponseLocalVar = new TestClientModelApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClientModelDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClientModel(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClientModelDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClientModel(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClientModelApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClientModelApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEndpointParameters(ref byte[] varByte, ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref Option date, ref Option binary, ref Option varFloat, ref Option integer, ref Option int32, ref Option int64, ref Option varString, ref Option password, ref Option callback, ref Option dateTime); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + { + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary)); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString)); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); + + if (callback.IsSet && callback.Value == null) + throw new ArgumentNullException(nameof(callback)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + + FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(varByte))); + + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(varDouble))); + + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + if (date.IsSet) + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date.Value))); + + if (binary.IsSet) + multipartContentLocalVar.Add(new StreamContent(binary.Value)); + + if (varFloat.IsSet) + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(varFloat.Value))); + + if (integer.IsSet) + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer.Value))); + + if (int32.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32.Value))); + + if (int64.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64.Value))); + + if (varString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(varString.Value))); + + if (password.IsSet) + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password.Value))); + + if (callback.IsSet) + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback.Value))); + + if (dateTime.IsSet) + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEndpointParametersApiResponse apiResponseLocalVar = new TestEndpointParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEndpointParametersDefaultImplementation(apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + + Events.ExecuteOnTestEndpointParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEndpointParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + Events.ExecuteOnErrorTestEndpointParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEndpointParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEndpointParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEndpointParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, ref Option enumHeaderString, ref Option enumQueryString, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumFormString); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray) + { + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); + + if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) + throw new ArgumentNullException(nameof(enumQueryStringArray)); + + if (enumFormStringArray.IsSet && enumFormStringArray.Value == null) + throw new ArgumentNullException(nameof(enumFormStringArray)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString) + { + bool suppressDefaultLog = false; + AfterTestEnumParameters(ref suppressDefaultLog, apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEnumParametersDefaultImplementation(Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString) + { + bool suppressDefaultLog = false; + OnErrorTestEnumParameters(ref suppressDefaultLog, exception, pathFormat, path, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEnumParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumQueryDouble, Option enumQueryInteger, Option enumFormString); + + /// + /// To test enum parameters To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Form parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional) + /// Query parameter enum test (string) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray); + + FormatTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, ref enumHeaderString, ref enumQueryString, ref enumQueryDouble, ref enumQueryInteger, ref enumFormString); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if (enumQueryStringArray.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); + + if (enumQueryString.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); + + if (enumQueryDouble.IsSet) + // here too + parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); + + if (enumQueryInteger.IsSet) + // here too + parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (enumHeaderStringArray.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray.Value)); + + if (enumHeaderString.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString.Value)); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray.Value))); + + if (enumFormString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString.Value))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEnumParametersApiResponse apiResponseLocalVar = new TestEnumParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEnumParametersDefaultImplementation(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + + Events.ExecuteOnTestEnumParameters(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEnumParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString); + Events.ExecuteOnErrorTestEnumParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEnumParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEnumParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEnumParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestGroupParameters(ref bool requiredBooleanGroup, ref int requiredStringGroup, ref long requiredInt64Group, ref Option booleanGroup, ref Option stringGroup, ref Option int64Group); + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestGroupParametersDefaultImplementation(ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + AfterTestGroupParameters(ref suppressDefaultLog, apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestGroupParameters(ref bool suppressDefaultLog, ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestGroupParametersDefaultImplementation(Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + OnErrorTestGroupParameters(ref suppressDefaultLog, exception, pathFormat, path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestGroupParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatTestGroupParameters(ref requiredBooleanGroup, ref requiredStringGroup, ref requiredInt64Group, ref booleanGroup, ref stringGroup, ref int64Group); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_group"] = ClientUtils.ParameterToString(requiredStringGroup); + parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); + + if (stringGroup.IsSet) + // here too + parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); + + if (int64Group.IsSet) + // here too + parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup.IsSet) + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestGroupParametersApiResponse apiResponseLocalVar = new TestGroupParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestGroupParametersDefaultImplementation(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + + Events.ExecuteOnTestGroupParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestGroupParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + Events.ExecuteOnErrorTestGroupParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestGroupParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestGroupParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestGroupParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineAdditionalProperties(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineAdditionalProperties(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineAdditionalPropertiesDefaultImplementation(ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestInlineAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineAdditionalProperties(ref bool suppressDefaultLog, ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestInlineAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test inline additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineAdditionalPropertiesAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineAdditionalProperties(requestBody); + + FormatTestInlineAdditionalProperties(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestInlineAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineAdditionalPropertiesDefaultImplementation(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestInlineAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineFreeformAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineFreeformAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineFreeformAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestJsonFormData(ref string param, ref string param2); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestJsonFormData(string param, string param2) + { + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestJsonFormDataDefaultImplementation(ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2) + { + bool suppressDefaultLog = false; + AfterTestJsonFormData(ref suppressDefaultLog, apiResponseLocalVar, param, param2); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestJsonFormData(ref bool suppressDefaultLog, ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestJsonFormDataDefaultImplementation(Exception exception, string pathFormat, string path, string param, string param2) + { + bool suppressDefaultLog = false; + OnErrorTestJsonFormData(ref suppressDefaultLog, exception, pathFormat, path, param, param2); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestJsonFormData(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string param, string param2); + + /// + /// test json serialization of form data + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestJsonFormDataAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestJsonFormData(param, param2); + + FormatTestJsonFormData(ref param, ref param2); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestJsonFormDataApiResponse apiResponseLocalVar = new TestJsonFormDataApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/jsonFormData", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestJsonFormDataDefaultImplementation(apiResponseLocalVar, param, param2); + + Events.ExecuteOnTestJsonFormData(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestJsonFormDataDefaultImplementation(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); + Events.ExecuteOnErrorTestJsonFormData(e); + throw; + } + } + + /// + /// The + /// + public partial class TestJsonFormDataApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestJsonFormDataApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestJsonFormDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ref string requiredNotNullable, ref string requiredNullable, ref Option notRequiredNotNullable, ref Option notRequiredNullable); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + { + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + if (requiredNotNullable == null) + throw new ArgumentNullException(nameof(requiredNotNullable)); + + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestQueryParameterCollectionFormatDefaultImplementation(ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + AfterTestQueryParameterCollectionFormat(ref suppressDefaultLog, apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestQueryParameterCollectionFormatDefaultImplementation(Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + OnErrorTestQueryParameterCollectionFormat(ref suppressDefaultLog, exception, pathFormat, path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + + FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["pipe"] = ClientUtils.ParameterToString(pipe); + parseQueryStringLocalVar["ioutil"] = ClientUtils.ParameterToString(ioutil); + parseQueryStringLocalVar["http"] = ClientUtils.ParameterToString(http); + parseQueryStringLocalVar["url"] = ClientUtils.ParameterToString(url); + parseQueryStringLocalVar["context"] = ClientUtils.ParameterToString(context); + parseQueryStringLocalVar["requiredNotNullable"] = ClientUtils.ParameterToString(requiredNotNullable); + parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); + + if (notRequiredNotNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); + + if (notRequiredNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestQueryParameterCollectionFormatApiResponse apiResponseLocalVar = new TestQueryParameterCollectionFormatApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/test-query-parameters", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestQueryParameterCollectionFormatDefaultImplementation(apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + + Events.ExecuteOnTestQueryParameterCollectionFormat(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestQueryParameterCollectionFormatDefaultImplementation(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + Events.ExecuteOnErrorTestQueryParameterCollectionFormat(e); + throw; + } + } + + /// + /// The + /// + public partial class TestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestQueryParameterCollectionFormatApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestQueryParameterCollectionFormatApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new TestStringMapReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..1d5bd38c527 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,415 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// The class containing the events + /// + FakeClassnameTags123ApiEvents Events { get; } + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ITestClassnameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeClassnameTags123ApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClassname; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClassname; + + internal void ExecuteOnTestClassname(FakeClassnameTags123Api.TestClassnameApiResponse apiResponse) + { + OnTestClassname?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClassname(Exception exception) + { + OnErrorTestClassname?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeClassnameTags123ApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeClassnameTags123ApiEvents fakeClassnameTags123ApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeClassnameTags123ApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatTestClassname(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClassname(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClassnameDefaultImplementation(ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClassname(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClassname(ref bool suppressDefaultLog, ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClassnameDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClassname(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClassname(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test class name in snake case To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClassnameAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClassname(modelClient); + + FormatTestClassname(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + + apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClassnameApiResponse apiResponseLocalVar = new TestClassnameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake_classname_test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClassnameDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClassname(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClassnameDefaultImplementation(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClassname(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClassnameApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClassnameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClassnameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 00000000000..d97995fd5ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2784 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IPetApi : IApi + { + /// + /// The class containing the events + /// + PetApiEvents Events { get; } + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IAddPetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IDeletePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByStatusApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IGetPetByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IUpdatePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUpdatePetWithFormApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUploadFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IUploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PetApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnAddPet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorAddPet; + + internal void ExecuteOnAddPet(PetApi.AddPetApiResponse apiResponse) + { + OnAddPet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorAddPet(Exception exception) + { + OnErrorAddPet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeletePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeletePet; + + internal void ExecuteOnDeletePet(PetApi.DeletePetApiResponse apiResponse) + { + OnDeletePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeletePet(Exception exception) + { + OnErrorDeletePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByStatus; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByStatus; + + internal void ExecuteOnFindPetsByStatus(PetApi.FindPetsByStatusApiResponse apiResponse) + { + OnFindPetsByStatus?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByStatus(Exception exception) + { + OnErrorFindPetsByStatus?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByTags; + + internal void ExecuteOnFindPetsByTags(PetApi.FindPetsByTagsApiResponse apiResponse) + { + OnFindPetsByTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByTags(Exception exception) + { + OnErrorFindPetsByTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetPetById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetPetById; + + internal void ExecuteOnGetPetById(PetApi.GetPetByIdApiResponse apiResponse) + { + OnGetPetById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetPetById(Exception exception) + { + OnErrorGetPetById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePet; + + internal void ExecuteOnUpdatePet(PetApi.UpdatePetApiResponse apiResponse) + { + OnUpdatePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePet(Exception exception) + { + OnErrorUpdatePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePetWithForm; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePetWithForm; + + internal void ExecuteOnUpdatePetWithForm(PetApi.UpdatePetWithFormApiResponse apiResponse) + { + OnUpdatePetWithForm?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePetWithForm(Exception exception) + { + OnErrorUpdatePetWithForm?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFile; + + internal void ExecuteOnUploadFile(PetApi.UploadFileApiResponse apiResponse) + { + OnUploadFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFile(Exception exception) + { + OnErrorUploadFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFileWithRequiredFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFileWithRequiredFile; + + internal void ExecuteOnUploadFileWithRequiredFile(PetApi.UploadFileWithRequiredFileApiResponse apiResponse) + { + OnUploadFileWithRequiredFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFileWithRequiredFile(Exception exception) + { + OnErrorUploadFileWithRequiredFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class PetApi : IPetApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PetApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PetApiEvents petApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = petApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatAddPet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateAddPet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterAddPetDefaultImplementation(IAddPetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterAddPet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterAddPet(ref bool suppressDefaultLog, IAddPetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorAddPetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorAddPet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorAddPet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await AddPetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateAddPet(pet); + + FormatAddPet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + AddPetApiResponse apiResponseLocalVar = new AddPetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterAddPetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnAddPet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorAddPetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorAddPet(e); + throw; + } + } + + /// + /// The + /// + public partial class AddPetApiResponse : Org.OpenAPITools.Client.ApiResponse, IAddPetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public AddPetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeletePet(ref long petId, ref Option apiKey); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeletePet(Option apiKey) + { + if (apiKey.IsSet && apiKey.Value == null) + throw new ArgumentNullException(nameof(apiKey)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDeletePetDefaultImplementation(IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + AfterDeletePet(ref suppressDefaultLog, apiResponseLocalVar, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDeletePet(ref bool suppressDefaultLog, IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDeletePetDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + OnErrorDeletePet(ref suppressDefaultLog, exception, pathFormat, path, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDeletePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option apiKey); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeletePetAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeletePet(apiKey); + + FormatDeletePet(ref petId, ref apiKey); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeletePetApiResponse apiResponseLocalVar = new DeletePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeletePetDefaultImplementation(apiResponseLocalVar, petId, apiKey); + + Events.ExecuteOnDeletePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeletePetDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); + Events.ExecuteOnErrorDeletePet(e); + throw; + } + } + + /// + /// The + /// + public partial class DeletePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeletePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeletePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByStatus(List status); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByStatus(List status) + { + if (status == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByStatusDefaultImplementation(IFindPetsByStatusApiResponse apiResponseLocalVar, List status) + { + bool suppressDefaultLog = false; + AfterFindPetsByStatus(ref suppressDefaultLog, apiResponseLocalVar, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByStatus(ref bool suppressDefaultLog, IFindPetsByStatusApiResponse apiResponseLocalVar, List status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByStatusDefaultImplementation(Exception exception, string pathFormat, string path, List status) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByStatus(ref suppressDefaultLog, exception, pathFormat, path, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByStatus(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List status); + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByStatusAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByStatus(status); + + FormatFindPetsByStatus(status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["status"] = ClientUtils.ParameterToString(status); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByStatusApiResponse apiResponseLocalVar = new FindPetsByStatusApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByStatus", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByStatusDefaultImplementation(apiResponseLocalVar, status); + + Events.ExecuteOnFindPetsByStatus(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByStatusDefaultImplementation(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); + Events.ExecuteOnErrorFindPetsByStatus(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByStatusApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByStatusApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByTags(List tags); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByTags(List tags) + { + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByTagsDefaultImplementation(IFindPetsByTagsApiResponse apiResponseLocalVar, List tags) + { + bool suppressDefaultLog = false; + AfterFindPetsByTags(ref suppressDefaultLog, apiResponseLocalVar, tags); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByTags(ref bool suppressDefaultLog, IFindPetsByTagsApiResponse apiResponseLocalVar, List tags); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByTagsDefaultImplementation(Exception exception, string pathFormat, string path, List tags) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByTags(ref suppressDefaultLog, exception, pathFormat, path, tags); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List tags); + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByTagsAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByTags(tags); + + FormatFindPetsByTags(tags); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["tags"] = ClientUtils.ParameterToString(tags); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByTagsApiResponse apiResponseLocalVar = new FindPetsByTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByTags", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByTagsDefaultImplementation(apiResponseLocalVar, tags); + + Events.ExecuteOnFindPetsByTags(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByTagsDefaultImplementation(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); + Events.ExecuteOnErrorFindPetsByTags(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetPetById(ref long petId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetPetByIdDefaultImplementation(IGetPetByIdApiResponse apiResponseLocalVar, long petId) + { + bool suppressDefaultLog = false; + AfterGetPetById(ref suppressDefaultLog, apiResponseLocalVar, petId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetPetById(ref bool suppressDefaultLog, IGetPetByIdApiResponse apiResponseLocalVar, long petId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetPetByIdDefaultImplementation(Exception exception, string pathFormat, string path, long petId) + { + bool suppressDefaultLog = false; + OnErrorGetPetById(ref suppressDefaultLog, exception, pathFormat, path, petId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetPetById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId); + + /// + /// Find pet by ID Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetPetByIdAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetPetById(ref petId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + + apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetPetByIdApiResponse apiResponseLocalVar = new GetPetByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetPetByIdDefaultImplementation(apiResponseLocalVar, petId); + + Events.ExecuteOnGetPetById(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetPetByIdDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); + Events.ExecuteOnErrorGetPetById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetPetByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetPetByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Pet Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Pet result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateUpdatePet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterUpdatePetDefaultImplementation(IUpdatePetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterUpdatePet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterUpdatePet(ref bool suppressDefaultLog, IUpdatePetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorUpdatePetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorUpdatePet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePet(pet); + + FormatUpdatePet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetApiResponse apiResponseLocalVar = new UpdatePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnUpdatePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorUpdatePet(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePetWithForm(ref long petId, ref Option name, ref Option status); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatePetWithForm(Option name, Option status) + { + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUpdatePetWithFormDefaultImplementation(IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + AfterUpdatePetWithForm(ref suppressDefaultLog, apiResponseLocalVar, petId, name, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUpdatePetWithForm(ref bool suppressDefaultLog, IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatePetWithFormDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + OnErrorUpdatePetWithForm(ref suppressDefaultLog, exception, pathFormat, path, petId, name, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePetWithForm(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option name, Option status); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetWithFormAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePetWithForm(name, status); + + FormatUpdatePetWithForm(ref petId, ref name, ref status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name.IsSet) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name.Value))); + + if (status.IsSet) + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetWithFormApiResponse apiResponseLocalVar = new UpdatePetWithFormApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetWithFormDefaultImplementation(apiResponseLocalVar, petId, name, status); + + Events.ExecuteOnUpdatePetWithForm(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetWithFormDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); + Events.ExecuteOnErrorUpdatePetWithForm(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetWithFormApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetWithFormApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetWithFormApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFile(ref long petId, ref Option file, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFile(Option file, Option additionalMetadata) + { + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileDefaultImplementation(IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFile(ref suppressDefaultLog, apiResponseLocalVar, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFile(ref bool suppressDefaultLog, IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFile(ref suppressDefaultLog, exception, pathFormat, path, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata); + + /// + /// uploads an image + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFile(file, additionalMetadata); + + FormatUploadFile(ref petId, ref file, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file.IsSet) + multipartContentLocalVar.Add(new StreamContent(file.Value)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileApiResponse apiResponseLocalVar = new UploadFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}/uploadImage", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileDefaultImplementation(apiResponseLocalVar, petId, file, additionalMetadata); + + Events.ExecuteOnUploadFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileDefaultImplementation(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); + Events.ExecuteOnErrorUploadFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFileWithRequiredFile(ref System.IO.Stream requiredFile, ref long petId, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFileWithRequiredFile(System.IO.Stream requiredFile, Option additionalMetadata) + { + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileWithRequiredFileDefaultImplementation(IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFileWithRequiredFile(ref suppressDefaultLog, apiResponseLocalVar, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFileWithRequiredFile(ref bool suppressDefaultLog, IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileWithRequiredFileDefaultImplementation(Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFileWithRequiredFile(ref suppressDefaultLog, exception, pathFormat, path, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFileWithRequiredFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// uploads an image (required) + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFileWithRequiredFile(requiredFile, additionalMetadata); + + FormatUploadFileWithRequiredFile(ref requiredFile, ref petId, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileWithRequiredFileApiResponse apiResponseLocalVar = new UploadFileWithRequiredFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/{petId}/uploadImageWithRequiredFile", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileWithRequiredFileDefaultImplementation(apiResponseLocalVar, requiredFile, petId, additionalMetadata); + + Events.ExecuteOnUploadFileWithRequiredFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileWithRequiredFileDefaultImplementation(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); + Events.ExecuteOnErrorUploadFileWithRequiredFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileWithRequiredFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 00000000000..4e9980c869e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,1197 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IStoreApi : IApi + { + /// + /// The class containing the events + /// + StoreApiEvents Events { get; } + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteOrderApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetInventoryApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetOrderByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IPlaceOrderApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class StoreApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteOrder; + + internal void ExecuteOnDeleteOrder(StoreApi.DeleteOrderApiResponse apiResponse) + { + OnDeleteOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteOrder(Exception exception) + { + OnErrorDeleteOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetInventory; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetInventory; + + internal void ExecuteOnGetInventory(StoreApi.GetInventoryApiResponse apiResponse) + { + OnGetInventory?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetInventory(Exception exception) + { + OnErrorGetInventory?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetOrderById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetOrderById; + + internal void ExecuteOnGetOrderById(StoreApi.GetOrderByIdApiResponse apiResponse) + { + OnGetOrderById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetOrderById(Exception exception) + { + OnErrorGetOrderById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPlaceOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPlaceOrder; + + internal void ExecuteOnPlaceOrder(StoreApi.PlaceOrderApiResponse apiResponse) + { + OnPlaceOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPlaceOrder(Exception exception) + { + OnErrorPlaceOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class StoreApi : IStoreApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public StoreApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, StoreApiEvents storeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = storeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatDeleteOrder(ref string orderId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteOrder(string orderId) + { + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteOrderDefaultImplementation(IDeleteOrderApiResponse apiResponseLocalVar, string orderId) + { + bool suppressDefaultLog = false; + AfterDeleteOrder(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteOrder(ref bool suppressDefaultLog, IDeleteOrderApiResponse apiResponseLocalVar, string orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteOrderDefaultImplementation(Exception exception, string pathFormat, string path, string orderId) + { + bool suppressDefaultLog = false; + OnErrorDeleteOrder(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteOrderAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteOrder(orderId); + + FormatDeleteOrder(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteOrderApiResponse apiResponseLocalVar = new DeleteOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteOrderDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnDeleteOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteOrderDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorDeleteOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetInventoryDefaultImplementation(IGetInventoryApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetInventory(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetInventory(ref bool suppressDefaultLog, IGetInventoryApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetInventoryDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetInventory(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetInventory(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetInventoryAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetInventoryApiResponse apiResponseLocalVar = new GetInventoryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/inventory", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetInventoryDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetInventory(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetInventoryDefaultImplementation(e, "/store/inventory", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetInventory(e); + throw; + } + } + + /// + /// The + /// + public partial class GetInventoryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetInventoryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Dictionary Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Dictionary result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetOrderById(ref long orderId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetOrderByIdDefaultImplementation(IGetOrderByIdApiResponse apiResponseLocalVar, long orderId) + { + bool suppressDefaultLog = false; + AfterGetOrderById(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetOrderById(ref bool suppressDefaultLog, IGetOrderByIdApiResponse apiResponseLocalVar, long orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetOrderByIdDefaultImplementation(Exception exception, string pathFormat, string path, long orderId) + { + bool suppressDefaultLog = false; + OnErrorGetOrderById(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetOrderById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetOrderByIdAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetOrderById(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetOrderByIdApiResponse apiResponseLocalVar = new GetOrderByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetOrderByIdDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnGetOrderById(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetOrderByIdDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorGetOrderById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetOrderByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetOrderByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPlaceOrder(Order order); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidatePlaceOrder(Order order) + { + if (order == null) + throw new ArgumentNullException(nameof(order)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterPlaceOrderDefaultImplementation(IPlaceOrderApiResponse apiResponseLocalVar, Order order) + { + bool suppressDefaultLog = false; + AfterPlaceOrder(ref suppressDefaultLog, apiResponseLocalVar, order); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterPlaceOrder(ref bool suppressDefaultLog, IPlaceOrderApiResponse apiResponseLocalVar, Order order); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorPlaceOrderDefaultImplementation(Exception exception, string pathFormat, string path, Order order) + { + bool suppressDefaultLog = false; + OnErrorPlaceOrder(ref suppressDefaultLog, exception, pathFormat, path, order); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorPlaceOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Order order); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PlaceOrderAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePlaceOrder(order); + + FormatPlaceOrder(order); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PlaceOrderApiResponse apiResponseLocalVar = new PlaceOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPlaceOrderDefaultImplementation(apiResponseLocalVar, order); + + Events.ExecuteOnPlaceOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPlaceOrderDefaultImplementation(e, "/store/order", uriBuilderLocalVar.Path, order); + Events.ExecuteOnErrorPlaceOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class PlaceOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IPlaceOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 00000000000..721984089ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,2223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IUserApi : IApi + { + /// + /// The class containing the events + /// + UserApiEvents Events { get; } + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICreateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IDeleteUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetUserByNameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk, ICustomHttpStatusCode599 + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + bool IsCustomHttpStatusCode598 { get; } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + bool IsCustomHttpStatusCode599 { get; } + } + + /// + /// The + /// + public interface ILoginUserApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ILogoutUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IUpdateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UserApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUser; + + internal void ExecuteOnCreateUser(UserApi.CreateUserApiResponse apiResponse) + { + OnCreateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUser(Exception exception) + { + OnErrorCreateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithArrayInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithArrayInput; + + internal void ExecuteOnCreateUsersWithArrayInput(UserApi.CreateUsersWithArrayInputApiResponse apiResponse) + { + OnCreateUsersWithArrayInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithArrayInput(Exception exception) + { + OnErrorCreateUsersWithArrayInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithListInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithListInput; + + internal void ExecuteOnCreateUsersWithListInput(UserApi.CreateUsersWithListInputApiResponse apiResponse) + { + OnCreateUsersWithListInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithListInput(Exception exception) + { + OnErrorCreateUsersWithListInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteUser; + + internal void ExecuteOnDeleteUser(UserApi.DeleteUserApiResponse apiResponse) + { + OnDeleteUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteUser(Exception exception) + { + OnErrorDeleteUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetUserByName; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetUserByName; + + internal void ExecuteOnGetUserByName(UserApi.GetUserByNameApiResponse apiResponse) + { + OnGetUserByName?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetUserByName(Exception exception) + { + OnErrorGetUserByName?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLoginUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLoginUser; + + internal void ExecuteOnLoginUser(UserApi.LoginUserApiResponse apiResponse) + { + OnLoginUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLoginUser(Exception exception) + { + OnErrorLoginUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLogoutUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLogoutUser; + + internal void ExecuteOnLogoutUser(UserApi.LogoutUserApiResponse apiResponse) + { + OnLogoutUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLogoutUser(Exception exception) + { + OnErrorLogoutUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateUser; + + internal void ExecuteOnUpdateUser(UserApi.UpdateUserApiResponse apiResponse) + { + OnUpdateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdateUser(Exception exception) + { + OnErrorUpdateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class UserApi : IUserApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public UserApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UserApiEvents userApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = userApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCreateUser(User user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUser(User user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUserDefaultImplementation(ICreateUserApiResponse apiResponseLocalVar, User user) + { + bool suppressDefaultLog = false; + AfterCreateUser(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUser(ref bool suppressDefaultLog, ICreateUserApiResponse apiResponseLocalVar, User user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user) + { + bool suppressDefaultLog = false; + OnErrorCreateUser(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user); + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUserAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUser(user); + + FormatCreateUser(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUserApiResponse apiResponseLocalVar = new CreateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUserDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUserDefaultImplementation(e, "/user", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithArrayInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithArrayInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithArrayInputDefaultImplementation(ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithArrayInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithArrayInput(ref bool suppressDefaultLog, ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithArrayInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithArrayInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithArrayInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithArrayInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithArrayInput(user); + + FormatCreateUsersWithArrayInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithArrayInputApiResponse apiResponseLocalVar = new CreateUsersWithArrayInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithArray", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithArrayInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithArrayInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithArrayInputDefaultImplementation(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithArrayInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithArrayInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithArrayInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithListInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithListInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithListInputDefaultImplementation(ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithListInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithListInput(ref bool suppressDefaultLog, ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithListInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithListInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithListInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithListInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithListInput(user); + + FormatCreateUsersWithListInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithListInputApiResponse apiResponseLocalVar = new CreateUsersWithListInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithList", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithListInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithListInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithListInputDefaultImplementation(e, "/user/createWithList", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithListInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithListInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithListInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeleteUser(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteUser(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteUserDefaultImplementation(IDeleteUserApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterDeleteUser(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteUser(ref bool suppressDefaultLog, IDeleteUserApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteUserDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorDeleteUser(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteUserAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteUser(username); + + FormatDeleteUser(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteUserApiResponse apiResponseLocalVar = new DeleteUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteUserDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnDeleteUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorDeleteUser(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetUserByName(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetUserByName(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetUserByNameDefaultImplementation(IGetUserByNameApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterGetUserByName(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetUserByName(ref bool suppressDefaultLog, IGetUserByNameApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetUserByNameDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorGetUserByName(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetUserByName(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetUserByNameAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetUserByName(username); + + FormatGetUserByName(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetUserByNameApiResponse apiResponseLocalVar = new GetUserByNameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetUserByNameDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnGetUserByName(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetUserByNameDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorGetUserByName(e); + throw; + } + } + + /// + /// The + /// + public partial class GetUserByNameApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetUserByNameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.User Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + public bool IsCustomHttpStatusCode598 => 598 == (int)StatusCode; + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + public bool IsCustomHttpStatusCode599 => 599 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 599 CustomHttpStatusCode599 + /// + /// + public Org.OpenAPITools.Model.User CustomHttpStatusCode599() + { + // This logic may be modified with the AsModel.mustache template + return IsCustomHttpStatusCode599 + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + public bool TryCustomHttpStatusCode599(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = CustomHttpStatusCode599(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)599); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatLoginUser(ref string username, ref string password); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateLoginUser(string username, string password) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterLoginUserDefaultImplementation(ILoginUserApiResponse apiResponseLocalVar, string username, string password) + { + bool suppressDefaultLog = false; + AfterLoginUser(ref suppressDefaultLog, apiResponseLocalVar, username, password); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterLoginUser(ref bool suppressDefaultLog, ILoginUserApiResponse apiResponseLocalVar, string username, string password); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorLoginUserDefaultImplementation(Exception exception, string pathFormat, string path, string username, string password) + { + bool suppressDefaultLog = false; + OnErrorLoginUser(ref suppressDefaultLog, exception, pathFormat, path, username, password); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorLoginUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username, string password); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LoginUserAsync(username, password, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateLoginUser(username, password); + + FormatLoginUser(ref username, ref password); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["username"] = ClientUtils.ParameterToString(username); + parseQueryStringLocalVar["password"] = ClientUtils.ParameterToString(password); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LoginUserApiResponse apiResponseLocalVar = new LoginUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/login", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLoginUserDefaultImplementation(apiResponseLocalVar, username, password); + + Events.ExecuteOnLoginUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLoginUserDefaultImplementation(e, "/user/login", uriBuilderLocalVar.Path, username, password); + Events.ExecuteOnErrorLoginUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LoginUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILoginUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterLogoutUserDefaultImplementation(ILogoutUserApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterLogoutUser(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterLogoutUser(ref bool suppressDefaultLog, ILogoutUserApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorLogoutUserDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorLogoutUser(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorLogoutUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Logs out current logged in user session + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LogoutUserAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LogoutUserApiResponse apiResponseLocalVar = new LogoutUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/logout", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLogoutUserDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnLogoutUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLogoutUserDefaultImplementation(e, "/user/logout", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorLogoutUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LogoutUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILogoutUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LogoutUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateUser(User user, ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdateUser(User user, string username) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdateUserDefaultImplementation(IUpdateUserApiResponse apiResponseLocalVar, User user, string username) + { + bool suppressDefaultLog = false; + AfterUpdateUser(ref suppressDefaultLog, apiResponseLocalVar, user, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdateUser(ref bool suppressDefaultLog, IUpdateUserApiResponse apiResponseLocalVar, User user, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user, string username) + { + bool suppressDefaultLog = false; + OnErrorUpdateUser(ref suppressDefaultLog, exception, pathFormat, path, user, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string username); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateUserAsync(user, username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateUser(user, username); + + FormatUpdateUser(user, ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdateUserApiResponse apiResponseLocalVar = new UpdateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdateUserDefaultImplementation(apiResponseLocalVar, user, username); + + Events.ExecuteOnUpdateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdateUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); + Events.ExecuteOnErrorUpdateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..fdd11dd19c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiException.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 00000000000..b8bdf9964ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..63c4e7c4bc3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICustomHttpStatusCode599 : IApiResponse + { + /// + /// Deserializes the response if the response is CustomHttpStatusCode599 + /// + /// + TType CustomHttpStatusCode599(); + + /// + /// Returns true if the response is CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + bool TryCustomHttpStatusCode599(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IDefault : IApiResponse + { + /// + /// Deserializes the response if the response is Default + /// + /// + TType Default(); + + /// + /// Returns true if the response is Default and the deserialized response is not null + /// + /// + /// + bool TryDefault(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 00000000000..c58c0563231 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 00000000000..df5c2310bac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..efff79097e0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,423 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + /// + /// The api_key header + /// + Api_key, + /// + /// The api_key_query header + /// + Api_key_query + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) + { + switch(value) + { + case ApiKeyHeader.Api_key: + return "api_key"; + case ApiKeyHeader.Api_key_query: + return "api_key_query"; + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ChildCatAllOfPetType childCatAllOfPetType) + return ChildCatAllOfPetTypeValueConverter.ToJsonValue(childCatAllOfPetType); + if (obj is EnumArraysArrayEnumInner enumArraysArrayEnumInner) + return EnumArraysArrayEnumInnerValueConverter.ToJsonValue(enumArraysArrayEnumInner); + if (obj is EnumArraysJustSymbol enumArraysJustSymbol) + return EnumArraysJustSymbolValueConverter.ToJsonValue(enumArraysJustSymbol); + if (obj is EnumClass enumClass) + return EnumClassValueConverter.ToJsonValue(enumClass); + if (obj is EnumTestEnumInteger enumTestEnumInteger) + return EnumTestEnumIntegerValueConverter.ToJsonValue(enumTestEnumInteger).ToString(); + if (obj is EnumTestEnumIntegerOnly enumTestEnumIntegerOnly) + return EnumTestEnumIntegerOnlyValueConverter.ToJsonValue(enumTestEnumIntegerOnly).ToString(); + if (obj is EnumTestEnumString enumTestEnumString) + return EnumTestEnumStringValueConverter.ToJsonValue(enumTestEnumString); + if (obj is FindPetsByStatusStatusParameterInner findPetsByStatusStatusParameterInner) + return FindPetsByStatusStatusParameterInnerValueConverter.ToJsonValue(findPetsByStatusStatusParameterInner); + if (obj is MapTestMapOfEnumStringValue mapTestMapOfEnumStringValue) + return MapTestMapOfEnumStringValueValueConverter.ToJsonValue(mapTestMapOfEnumStringValue); + if (obj is OrderStatus orderStatus) + return OrderStatusValueConverter.ToJsonValue(orderStatus); + if (obj is OuterEnum outerEnum) + return OuterEnumValueConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerValueConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is OuterEnumTest outerEnumTest) + return OuterEnumTestValueConverter.ToJsonValue(outerEnumTest); + if (obj is PetStatus petStatus) + return PetStatusValueConverter.ToJsonValue(petStatus); + if (obj is RequiredClassRequiredNotnullableEnumInteger requiredClassRequiredNotnullableEnumInteger) + return RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumInteger).ToString(); + if (obj is RequiredClassRequiredNotnullableEnumIntegerOnly requiredClassRequiredNotnullableEnumIntegerOnly) + return RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnly).ToString(); + if (obj is RequiredClassRequiredNotnullableEnumString requiredClassRequiredNotnullableEnumString) + return RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClassRequiredNotnullableEnumString); + if (obj is RequiredClassRequiredNullableEnumInteger requiredClassRequiredNullableEnumInteger) + return RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClassRequiredNullableEnumInteger).ToString(); + if (obj is RequiredClassRequiredNullableEnumIntegerOnly requiredClassRequiredNullableEnumIntegerOnly) + return RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClassRequiredNullableEnumIntegerOnly).ToString(); + if (obj is RequiredClassRequiredNullableEnumString requiredClassRequiredNullableEnumString) + return RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClassRequiredNullableEnumString); + if (obj is TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter) + return TestEnumParametersEnumHeaderStringParameterValueConverter.ToJsonValue(testEnumParametersEnumHeaderStringParameter); + if (obj is TestEnumParametersEnumQueryDoubleParameter testEnumParametersEnumQueryDoubleParameter) + return TestEnumParametersEnumQueryDoubleParameterValueConverter.ToJsonValue(testEnumParametersEnumQueryDoubleParameter).ToString(); + if (obj is TestEnumParametersEnumQueryIntegerParameter testEnumParametersEnumQueryIntegerParameter) + return TestEnumParametersEnumQueryIntegerParameterValueConverter.ToJsonValue(testEnumParametersEnumQueryIntegerParameter).ToString(); + if (obj is TestEnumParametersRequestEnumFormString testEnumParametersRequestEnumFormString) + return TestEnumParametersRequestEnumFormStringValueConverter.ToJsonValue(testEnumParametersRequestEnumFormString); + if (obj is TestEnumParametersRequestEnumFormStringArrayInner testEnumParametersRequestEnumFormStringArrayInner) + return TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.ToJsonValue(testEnumParametersRequestEnumFormStringArrayInner); + if (obj is ZebraType zebraType) + return ZebraTypeValueConverter.ToJsonValue(zebraType); + if (obj is ZeroBasedEnum zeroBasedEnum) + return ZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnum); + if (obj is ZeroBasedEnumClassZeroBasedEnum zeroBasedEnumClassZeroBasedEnum) + return ZeroBasedEnumClassZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnumClassZeroBasedEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..973f9e9d4e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..b491c61f07f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..c706302171c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ActivityJsonConverter()); + _jsonOptions.Converters.Add(new ActivityOutputElementRepresentationJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new AnimalJsonConverter()); + _jsonOptions.Converters.Add(new ApiResponseJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new AppleReqJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayTestJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new BananaReqJsonConverter()); + _jsonOptions.Converters.Add(new BasquePigJsonConverter()); + _jsonOptions.Converters.Add(new CapitalizationJsonConverter()); + _jsonOptions.Converters.Add(new CatJsonConverter()); + _jsonOptions.Converters.Add(new CategoryJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatAllOfPetTypeJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatAllOfPetTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ClassModelJsonConverter()); + _jsonOptions.Converters.Add(new ComplexQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new DanishPigJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyClassJsonConverter()); + _jsonOptions.Converters.Add(new DeprecatedObjectJsonConverter()); + _jsonOptions.Converters.Add(new DogJsonConverter()); + _jsonOptions.Converters.Add(new DrawingJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysArrayEnumInnerJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysArrayEnumInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJustSymbolJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJustSymbolNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new EquilateralTriangleJsonConverter()); + _jsonOptions.Converters.Add(new FileJsonConverter()); + _jsonOptions.Converters.Add(new FileSchemaTestClassJsonConverter()); + _jsonOptions.Converters.Add(new FindPetsByStatusStatusParameterInnerJsonConverter()); + _jsonOptions.Converters.Add(new FindPetsByStatusStatusParameterInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new FooJsonConverter()); + _jsonOptions.Converters.Add(new FooGetDefaultResponseJsonConverter()); + _jsonOptions.Converters.Add(new FormatTestJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + _jsonOptions.Converters.Add(new FruitReqJsonConverter()); + _jsonOptions.Converters.Add(new GmFruitJsonConverter()); + _jsonOptions.Converters.Add(new GrandparentAnimalJsonConverter()); + _jsonOptions.Converters.Add(new HasOnlyReadOnlyJsonConverter()); + _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); + _jsonOptions.Converters.Add(new MammalJsonConverter()); + _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueJsonConverter()); + _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); + _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); + _jsonOptions.Converters.Add(new ModelClientJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new NotificationtestGetElementsV1ResponseMPayloadJsonConverter()); + _jsonOptions.Converters.Add(new NullableClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableGuidClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableShapeJsonConverter()); + _jsonOptions.Converters.Add(new NumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ObjectWithDeprecatedFieldsJsonConverter()); + _jsonOptions.Converters.Add(new OneOfStringJsonConverter()); + _jsonOptions.Converters.Add(new OrderJsonConverter()); + _jsonOptions.Converters.Add(new OrderStatusJsonConverter()); + _jsonOptions.Converters.Add(new OrderStatusNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterCompositeJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestNullableJsonConverter()); + _jsonOptions.Converters.Add(new ParentPetJsonConverter()); + _jsonOptions.Converters.Add(new PetJsonConverter()); + _jsonOptions.Converters.Add(new PetStatusJsonConverter()); + _jsonOptions.Converters.Add(new PetStatusNullableJsonConverter()); + _jsonOptions.Converters.Add(new PigJsonConverter()); + _jsonOptions.Converters.Add(new PolymorphicPropertyJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNotnullableEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerOnlyJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumIntegerOnlyNullableJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumStringJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassRequiredNullableEnumStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); + _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ShapeJsonConverter()); + _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ShapeOrNullJsonConverter()); + _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); + _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryIntegerParameterJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersEnumQueryIntegerParameterNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringArrayInnerJsonConverter()); + _jsonOptions.Converters.Add(new TestEnumParametersRequestEnumFormStringArrayInnerNullableJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); + _jsonOptions.Converters.Add(new TriangleJsonConverter()); + _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new UserJsonConverter()); + _jsonOptions.Converters.Add(new WhaleJsonConverter()); + _jsonOptions.Converters.Add(new ZebraJsonConverter()); + _jsonOptions.Converters.Add(new ZebraTypeJsonConverter()); + _jsonOptions.Converters.Add(new ZebraTypeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassZeroBasedEnumNullableJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 00000000000..53f435c05f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,641 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPhrase = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 format + return null; + } + + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 00000000000..b6301dc17c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,41 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 00000000000..ec4d08e9c99 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..8cf79a713b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/Option.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..534f27a8cc5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, Channel.CreateBounded(options)); + } + } + else + { + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + } + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..36d7dad03e2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..dce7b971eaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..40eeffc9676 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..c82fea7a865 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..428d69dd8ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -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 + * 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 +{ + /// + /// test map of maps + /// + public partial class Activity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + [JsonConstructor] + public Activity(Option>> activityOutputs = default) + { + ActivityOutputsOption = activityOutputs; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ActivityOutputs + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ActivityOutputsOption { get; private set; } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get { return this.ActivityOutputsOption; } set { this.ActivityOutputsOption = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 ActivityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Activity 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>> activityOutputs = 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 "activity_outputs": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (activityOutputs.IsSet && activityOutputs.Value == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is not nullable for class Activity."); + + return new Activity(activityOutputs); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activity.ActivityOutputsOption.IsSet) + { + writer.WritePropertyName("activity_outputs"); + JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs new file mode 100644 index 00000000000..8ae65f50c23 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,207 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + [JsonConstructor] + public ActivityOutputElementRepresentation(Option prop1 = default, Option prop2 = default) + { + Prop1Option = prop1; + Prop2Option = prop2; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Prop1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop1Option { get; private set; } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get { return this.Prop1Option; } set { this.Prop1Option = new Option(value); } } + + /// + /// Used to track the state of Prop2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop2Option { get; private set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get { return this.Prop2Option; } set { this.Prop2Option = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ActivityOutputElementRepresentation 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 prop1 = default; + Option prop2 = 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 "prop1": + prop1 = new Option(utf8JsonReader.GetString()); + break; + case "prop2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (prop1.IsSet && prop1.Value == null) + throw new ArgumentNullException(nameof(prop1), "Property is not nullable for class ActivityOutputElementRepresentation."); + + if (prop2.IsSet && prop2.Value == null) + throw new ArgumentNullException(nameof(prop2), "Property is not nullable for class ActivityOutputElementRepresentation."); + + return new ActivityOutputElementRepresentation(prop1, prop2); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activityOutputElementRepresentation.Prop2Option.IsSet && activityOutputElementRepresentation.Prop2 == null) + throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop2), "Property is required for class ActivityOutputElementRepresentation."); + + if (activityOutputElementRepresentation.Prop1Option.IsSet) + writer.WriteString("prop1", activityOutputElementRepresentation.Prop1); + + if (activityOutputElementRepresentation.Prop2Option.IsSet) + { + writer.WritePropertyName("prop2"); + JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d7857e4aad8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,400 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AdditionalPropertiesClass + /// + public partial class AdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// anytype1 + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// mapOfMapProperty + /// mapProperty + /// mapWithUndeclaredPropertiesAnytype1 + /// mapWithUndeclaredPropertiesAnytype2 + /// mapWithUndeclaredPropertiesAnytype3 + /// mapWithUndeclaredPropertiesString + [JsonConstructor] + public AdditionalPropertiesClass(Option anytype1 = default, Option emptyMap = default, Option>> mapOfMapProperty = default, Option> mapProperty = default, Option mapWithUndeclaredPropertiesAnytype1 = default, Option mapWithUndeclaredPropertiesAnytype2 = default, Option> mapWithUndeclaredPropertiesAnytype3 = default, Option> mapWithUndeclaredPropertiesString = default) + { + Anytype1Option = anytype1; + EmptyMapOption = emptyMap; + MapOfMapPropertyOption = mapOfMapProperty; + MapPropertyOption = mapProperty; + MapWithUndeclaredPropertiesAnytype1Option = mapWithUndeclaredPropertiesAnytype1; + MapWithUndeclaredPropertiesAnytype2Option = mapWithUndeclaredPropertiesAnytype2; + MapWithUndeclaredPropertiesAnytype3Option = mapWithUndeclaredPropertiesAnytype3; + MapWithUndeclaredPropertiesStringOption = mapWithUndeclaredPropertiesString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Anytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Anytype1Option { get; private set; } + + /// + /// Gets or Sets Anytype1 + /// + [JsonPropertyName("anytype_1")] + public Object Anytype1 { get { return this.Anytype1Option; } set { this.Anytype1Option = new Option(value); } } + + /// + /// Used to track the state of EmptyMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmptyMapOption { get; private set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [JsonPropertyName("empty_map")] + public Object EmptyMap { get { return this.EmptyMapOption; } set { this.EmptyMapOption = new Option(value); } } + + /// + /// Used to track the state of MapOfMapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapOfMapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [JsonPropertyName("map_of_map_property")] + public Dictionary> MapOfMapProperty { get { return this.MapOfMapPropertyOption; } set { this.MapOfMapPropertyOption = new Option>>(value); } } + + /// + /// Used to track the state of MapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapProperty + /// + [JsonPropertyName("map_property")] + public Dictionary MapProperty { get { return this.MapPropertyOption; } set { this.MapPropertyOption = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype1Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_1")] + public Object MapWithUndeclaredPropertiesAnytype1 { get { return this.MapWithUndeclaredPropertiesAnytype1Option; } set { this.MapWithUndeclaredPropertiesAnytype1Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype2Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_2")] + public Object MapWithUndeclaredPropertiesAnytype2 { get { return this.MapWithUndeclaredPropertiesAnytype2Option; } set { this.MapWithUndeclaredPropertiesAnytype2Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype3 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesAnytype3Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_3")] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get { return this.MapWithUndeclaredPropertiesAnytype3Option; } set { this.MapWithUndeclaredPropertiesAnytype3Option = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesStringOption { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [JsonPropertyName("map_with_undeclared_properties_string")] + public Dictionary MapWithUndeclaredPropertiesString { get { return this.MapWithUndeclaredPropertiesStringOption; } set { this.MapWithUndeclaredPropertiesStringOption = 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 AdditionalPropertiesClass {\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).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 AdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AdditionalPropertiesClass 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 anytype1 = default; + Option emptyMap = default; + Option>> mapOfMapProperty = default; + Option> mapProperty = default; + Option mapWithUndeclaredPropertiesAnytype1 = default; + Option mapWithUndeclaredPropertiesAnytype2 = default; + Option> mapWithUndeclaredPropertiesAnytype3 = default; + Option> mapWithUndeclaredPropertiesString = 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 "anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "empty_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_3": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (emptyMap.IsSet && emptyMap.Value == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapOfMapProperty.IsSet && mapOfMapProperty.Value == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapProperty.IsSet && mapProperty.Value == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1.IsSet && mapWithUndeclaredPropertiesAnytype1.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2.IsSet && mapWithUndeclaredPropertiesAnytype2.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3.IsSet && mapWithUndeclaredPropertiesAnytype3.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString.IsSet && mapWithUndeclaredPropertiesString.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is not nullable for class AdditionalPropertiesClass."); + + return new AdditionalPropertiesClass(anytype1, emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet && additionalPropertiesClass.MapOfMapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapPropertyOption.IsSet && additionalPropertiesClass.MapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.Anytype1Option.IsSet) + if (additionalPropertiesClass.Anytype1Option.Value != null) + { + writer.WritePropertyName("anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions); + } + else + writer.WriteNull("anytype_1"); + if (additionalPropertiesClass.EmptyMapOption.IsSet) + { + writer.WritePropertyName("empty_map"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet) + { + writer.WritePropertyName("map_of_map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapPropertyOption.IsSet) + { + writer.WritePropertyName("map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_2"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_3"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_string"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 00000000000..6abbd41a281 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Animal + /// + public partial class Animal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + [JsonConstructor] + public Animal(Option color = default) + { + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Animal {\n"); + sb.Append(" Color: ").Append(Color).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Animal 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 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) + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Animal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Animal."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); + + return new Animal(color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, animal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + { + if (animal.ColorOption.IsSet && animal.Color == null) + throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); + + writer.WriteString("className", animal.ClassName); + + if (animal.ColorOption.IsSet) + writer.WriteString("color", animal.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 00000000000..f6fa613cbbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,230 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ApiResponse + /// + public partial class ApiResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code + /// message + /// type + [JsonConstructor] + public ApiResponse(Option code = default, Option message = default, Option type = default) + { + CodeOption = code; + MessageOption = message; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } + + /// + /// Gets or Sets Code + /// + [JsonPropertyName("code")] + public int? Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of Message + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageOption { get; private set; } + + /// + /// Gets or Sets Message + /// + [JsonPropertyName("message")] + public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [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 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 ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ApiResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ApiResponse 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 code = default; + Option message = default; + Option type = 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 "code": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = new Option(utf8JsonReader.GetInt32()); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class ApiResponse."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class ApiResponse."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApiResponse."); + + return new ApiResponse(code, message, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apiResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apiResponse.TypeOption.IsSet && apiResponse.Type == null) + throw new ArgumentNullException(nameof(apiResponse.Type), "Property is required for class ApiResponse."); + + if (apiResponse.CodeOption.IsSet) + writer.WriteNumber("code", apiResponse.CodeOption.Value.Value); + + if (apiResponse.MessageOption.IsSet) + writer.WriteString("message", apiResponse.Message); + + if (apiResponse.TypeOption.IsSet) + writer.WriteString("type", apiResponse.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..e0c09dbf5f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// colorCode + /// cultivar + /// origin + [JsonConstructor] + public Apple(Option colorCode = default, Option cultivar = default, Option origin = default) + { + ColorCodeOption = colorCode; + CultivarOption = cultivar; + OriginOption = origin; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ColorCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorCodeOption { get; private set; } + + /// + /// Gets or Sets ColorCode + /// + [JsonPropertyName("color_code")] + public string ColorCode { get { return this.ColorCodeOption; } set { this.ColorCodeOption = new Option(value); } } + + /// + /// Used to track the state of Cultivar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CultivarOption { get; private set; } + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get { return this.CultivarOption; } set { this.CultivarOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } + + /// + /// Gets or Sets Origin + /// + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = 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 Apple {\n"); + sb.Append(" ColorCode: ").Append(ColorCode).Append("\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).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) + { + if (this.ColorCodeOption.Value != null) { + // ColorCode (string) pattern + Regex regexColorCode = new Regex(@"^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$", RegexOptions.CultureInvariant); + + if (this.ColorCodeOption.Value != null &&!regexColorCode.Match(this.ColorCodeOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ColorCode, must match a pattern of " + regexColorCode, new [] { "ColorCode" }); + } + } + + if (this.CultivarOption.Value != null) { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); + + if (this.CultivarOption.Value != null &&!regexCultivar.Match(this.CultivarOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + } + + if (this.OriginOption.Value != null) { + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.OriginOption.Value != null &&!regexOrigin.Match(this.OriginOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 colorCode = default; + Option cultivar = default; + Option origin = 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 "color_code": + colorCode = new Option(utf8JsonReader.GetString()); + break; + case "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (colorCode.IsSet && colorCode.Value == null) + throw new ArgumentNullException(nameof(colorCode), "Property is not nullable for class Apple."); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class Apple."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class Apple."); + + return new Apple(colorCode, cultivar, origin); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.CultivarOption.IsSet && apple.Cultivar == null) + throw new ArgumentNullException(nameof(apple.Cultivar), "Property is required for class Apple."); + + if (apple.OriginOption.IsSet && apple.Origin == null) + throw new ArgumentNullException(nameof(apple.Origin), "Property is required for class Apple."); + + if (apple.ColorCodeOption.IsSet) + writer.WriteString("color_code", apple.ColorCode); + + if (apple.CultivarOption.IsSet) + writer.WriteString("cultivar", apple.Cultivar); + + if (apple.OriginOption.IsSet) + writer.WriteString("origin", apple.Origin); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 00000000000..7f69b627038 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AppleReq + /// + public partial class AppleReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar + /// mealy + [JsonConstructor] + public AppleReq(string cultivar, Option mealy = default) + { + Cultivar = cultivar; + MealyOption = mealy; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get; set; } + + /// + /// Used to track the state of Mealy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MealyOption { get; private set; } + + /// + /// Gets or Sets Mealy + /// + [JsonPropertyName("mealy")] + public bool? Mealy { get { return this.MealyOption; } set { this.MealyOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).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 AppleReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AppleReq 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 cultivar = default; + Option mealy = 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 "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "mealy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!cultivar.IsSet) + throw new ArgumentException("Property is required for class AppleReq.", nameof(cultivar)); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class AppleReq."); + + if (mealy.IsSet && mealy.Value == null) + throw new ArgumentNullException(nameof(mealy), "Property is not nullable for class AppleReq."); + + return new AppleReq(cultivar.Value, mealy); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, appleReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("cultivar", appleReq.Cultivar); + + if (appleReq.MealyOption.IsSet) + writer.WriteBoolean("mealy", appleReq.MealyOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..9f6f55f4bc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + public partial class ArrayOfArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber + [JsonConstructor] + public ArrayOfArrayOfNumberOnly(Option>> arrayArrayNumber = default) + { + ArrayArrayNumberOption = arrayArrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [JsonPropertyName("ArrayArrayNumber")] + public List> ArrayArrayNumber { get { return this.ArrayArrayNumberOption; } set { this.ArrayArrayNumberOption = 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 ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).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 ArrayOfArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfArrayOfNumberOnly 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>> arrayArrayNumber = 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 "ArrayArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayNumber.IsSet && arrayArrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is not nullable for class ArrayOfArrayOfNumberOnly."); + + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..3e38c89877d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfNumberOnly + /// + public partial class ArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber + [JsonConstructor] + public ArrayOfNumberOnly(Option> arrayNumber = default) + { + ArrayNumberOption = arrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayNumber + /// + [JsonPropertyName("ArrayNumber")] + public List ArrayNumber { get { return this.ArrayNumberOption; } set { this.ArrayNumberOption = 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 ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).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 ArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfNumberOnly 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> arrayNumber = 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 "ArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayNumber.IsSet && arrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is not nullable for class ArrayOfNumberOnly."); + + return new ArrayOfNumberOnly(arrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfNumberOnly.ArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 00000000000..8ddbe4d6309 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,242 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ArrayTest + /// + public partial class ArrayTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayOfInteger + /// arrayArrayOfModel + /// arrayOfString + [JsonConstructor] + public ArrayTest(Option>> arrayArrayOfInteger = default, Option>> arrayArrayOfModel = default, Option> arrayOfString = default) + { + ArrayArrayOfIntegerOption = arrayArrayOfInteger; + ArrayArrayOfModelOption = arrayArrayOfModel; + ArrayOfStringOption = arrayOfString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayOfInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfIntegerOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [JsonPropertyName("array_array_of_integer")] + public List> ArrayArrayOfInteger { get { return this.ArrayArrayOfIntegerOption; } set { this.ArrayArrayOfIntegerOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayArrayOfModel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfModelOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [JsonPropertyName("array_array_of_model")] + public List> ArrayArrayOfModel { get { return this.ArrayArrayOfModelOption; } set { this.ArrayArrayOfModelOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets ArrayOfString + /// + [JsonPropertyName("array_of_string")] + public List ArrayOfString { get { return this.ArrayOfStringOption; } set { this.ArrayOfStringOption = 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 ArrayTest {\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).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 ArrayTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayTest 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>> arrayArrayOfInteger = default; + Option>> arrayArrayOfModel = default; + Option> arrayOfString = 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 "array_array_of_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_array_of_model": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayOfInteger.IsSet && arrayArrayOfInteger.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is not nullable for class ArrayTest."); + + if (arrayArrayOfModel.IsSet && arrayArrayOfModel.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is not nullable for class ArrayTest."); + + if (arrayOfString.IsSet && arrayOfString.Value == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is not nullable for class ArrayTest."); + + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayTest.ArrayArrayOfModelOption.IsSet && arrayTest.ArrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfModel), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayOfStringOption.IsSet && arrayTest.ArrayOfString == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayOfString), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayArrayOfIntegerOption.IsSet) + { + writer.WritePropertyName("array_array_of_integer"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions); + } + if (arrayTest.ArrayArrayOfModelOption.IsSet) + { + writer.WritePropertyName("array_array_of_model"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions); + } + if (arrayTest.ArrayOfStringOption.IsSet) + { + writer.WritePropertyName("array_of_string"); + JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..8fc9c71c574 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -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 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + [JsonConstructor] + public Banana(Option lengthCm = default) + { + LengthCmOption = lengthCm; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of LengthCm + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LengthCmOption { get; private set; } + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal? LengthCm { get { return this.LengthCmOption; } set { this.LengthCmOption = 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 Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 lengthCm = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class Banana."); + + return new Banana(lengthCm); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 00000000000..e4a3a99aafa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,187 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BananaReq + /// + public partial class BananaReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + /// sweet + [JsonConstructor] + public BananaReq(decimal lengthCm, Option sweet = default) + { + LengthCm = lengthCm; + SweetOption = sweet; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal LengthCm { get; set; } + + /// + /// Used to track the state of Sweet + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SweetOption { get; private set; } + + /// + /// Gets or Sets Sweet + /// + [JsonPropertyName("sweet")] + public bool? Sweet { get { return this.SweetOption; } set { this.SweetOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).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 BananaReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BananaReq 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 lengthCm = default; + Option sweet = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + case "sweet": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!lengthCm.IsSet) + throw new ArgumentException("Property is required for class BananaReq.", nameof(lengthCm)); + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class BananaReq."); + + if (sweet.IsSet && sweet.Value == null) + throw new ArgumentNullException(nameof(sweet), "Property is not nullable for class BananaReq."); + + return new BananaReq(lengthCm.Value.Value, sweet); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, bananaReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteNumber("lengthCm", bananaReq.LengthCm); + + if (bananaReq.SweetOption.IsSet) + writer.WriteBoolean("sweet", bananaReq.SweetOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 00000000000..9938d89e008 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BasquePig + /// + public partial class BasquePig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public BasquePig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 BasquePigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BasquePig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class BasquePig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class BasquePig."); + + return new BasquePig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, basquePig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", basquePig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 00000000000..ddf4f67e04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs @@ -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 + * 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 +{ + /// + /// Capitalization + /// + public partial class Capitalization : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the pet + /// capitalCamel + /// capitalSnake + /// sCAETHFlowPoints + /// smallCamel + /// smallSnake + [JsonConstructor] + public Capitalization(Option aTTNAME = default, Option capitalCamel = default, Option capitalSnake = default, Option sCAETHFlowPoints = default, Option smallCamel = default, Option smallSnake = default) + { + ATT_NAMEOption = aTTNAME; + CapitalCamelOption = capitalCamel; + CapitalSnakeOption = capitalSnake; + SCAETHFlowPointsOption = sCAETHFlowPoints; + SmallCamelOption = smallCamel; + SmallSnakeOption = smallSnake; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ATT_NAME + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ATT_NAMEOption { get; private set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [JsonPropertyName("ATT_NAME")] + public string ATT_NAME { get { return this.ATT_NAMEOption; } set { this.ATT_NAMEOption = new Option(value); } } + + /// + /// Used to track the state of CapitalCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalCamelOption { get; private set; } + + /// + /// Gets or Sets CapitalCamel + /// + [JsonPropertyName("CapitalCamel")] + public string CapitalCamel { get { return this.CapitalCamelOption; } set { this.CapitalCamelOption = new Option(value); } } + + /// + /// Used to track the state of CapitalSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalSnakeOption { get; private set; } + + /// + /// Gets or Sets CapitalSnake + /// + [JsonPropertyName("Capital_Snake")] + public string CapitalSnake { get { return this.CapitalSnakeOption; } set { this.CapitalSnakeOption = new Option(value); } } + + /// + /// Used to track the state of SCAETHFlowPoints + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SCAETHFlowPointsOption { get; private set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [JsonPropertyName("SCA_ETH_Flow_Points")] + public string SCAETHFlowPoints { get { return this.SCAETHFlowPointsOption; } set { this.SCAETHFlowPointsOption = new Option(value); } } + + /// + /// Used to track the state of SmallCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallCamelOption { get; private set; } + + /// + /// Gets or Sets SmallCamel + /// + [JsonPropertyName("smallCamel")] + public string SmallCamel { get { return this.SmallCamelOption; } set { this.SmallCamelOption = new Option(value); } } + + /// + /// Used to track the state of SmallSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallSnakeOption { get; private set; } + + /// + /// Gets or Sets SmallSnake + /// + [JsonPropertyName("small_Snake")] + public string SmallSnake { get { return this.SmallSnakeOption; } set { this.SmallSnakeOption = 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 Capitalization {\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).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 CapitalizationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Capitalization 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 aTTNAME = default; + Option capitalCamel = default; + Option capitalSnake = default; + Option sCAETHFlowPoints = default; + Option smallCamel = default; + Option smallSnake = 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 "ATT_NAME": + aTTNAME = new Option(utf8JsonReader.GetString()); + break; + case "CapitalCamel": + capitalCamel = new Option(utf8JsonReader.GetString()); + break; + case "Capital_Snake": + capitalSnake = new Option(utf8JsonReader.GetString()); + break; + case "SCA_ETH_Flow_Points": + sCAETHFlowPoints = new Option(utf8JsonReader.GetString()); + break; + case "smallCamel": + smallCamel = new Option(utf8JsonReader.GetString()); + break; + case "small_Snake": + smallSnake = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (aTTNAME.IsSet && aTTNAME.Value == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization."); + + if (capitalCamel.IsSet && capitalCamel.Value == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization."); + + if (capitalSnake.IsSet && capitalSnake.Value == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization."); + + if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization."); + + if (smallCamel.IsSet && smallCamel.Value == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization."); + + if (smallSnake.IsSet && smallSnake.Value == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization."); + + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, capitalization, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (capitalization.CapitalCamelOption.IsSet && capitalization.CapitalCamel == null) + throw new ArgumentNullException(nameof(capitalization.CapitalCamel), "Property is required for class Capitalization."); + + if (capitalization.CapitalSnakeOption.IsSet && capitalization.CapitalSnake == null) + throw new ArgumentNullException(nameof(capitalization.CapitalSnake), "Property is required for class Capitalization."); + + if (capitalization.SCAETHFlowPointsOption.IsSet && capitalization.SCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(capitalization.SCAETHFlowPoints), "Property is required for class Capitalization."); + + if (capitalization.SmallCamelOption.IsSet && capitalization.SmallCamel == null) + throw new ArgumentNullException(nameof(capitalization.SmallCamel), "Property is required for class Capitalization."); + + if (capitalization.SmallSnakeOption.IsSet && capitalization.SmallSnake == null) + throw new ArgumentNullException(nameof(capitalization.SmallSnake), "Property is required for class Capitalization."); + + if (capitalization.ATT_NAMEOption.IsSet) + writer.WriteString("ATT_NAME", capitalization.ATT_NAME); + + if (capitalization.CapitalCamelOption.IsSet) + writer.WriteString("CapitalCamel", capitalization.CapitalCamel); + + if (capitalization.CapitalSnakeOption.IsSet) + writer.WriteString("Capital_Snake", capitalization.CapitalSnake); + + if (capitalization.SCAETHFlowPointsOption.IsSet) + writer.WriteString("SCA_ETH_Flow_Points", capitalization.SCAETHFlowPoints); + + if (capitalization.SmallCamelOption.IsSet) + writer.WriteString("smallCamel", capitalization.SmallCamel); + + if (capitalization.SmallSnakeOption.IsSet) + writer.WriteString("small_Snake", capitalization.SmallSnake); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 00000000000..d11d16c855e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Cat + /// + public partial class Cat : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + /// declawed + [JsonConstructor] + public Cat(Option color = default, Option declawed = default) : base(color) + { + DeclawedOption = declawed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeclawedOption { get; private set; } + + /// + /// Gets or Sets Declawed + /// + [JsonPropertyName("declawed")] + public bool? Declawed { get { return this.DeclawedOption; } set { this.DeclawedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Cat 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 className = default; + Option color = default; + Option declawed = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "declawed": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Cat.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Cat."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Cat."); + + if (declawed.IsSet && declawed.Value == null) + throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); + + return new Cat(color, declawed); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + if (cat.ColorOption.IsSet && cat.Color == null) + throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); + + writer.WriteString("className", cat.ClassName); + + if (cat.ColorOption.IsSet) + writer.WriteString("color", cat.Color); + + if (cat.DeclawedOption.IsSet) + writer.WriteBoolean("declawed", cat.DeclawedOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 00000000000..1708429172a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,196 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Category + /// + public partial class Category : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name (default to "default-name") + [JsonConstructor] + public Category(Option id = default, string name = @"default-name") + { + IdOption = id; + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// 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 Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 CategoryJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Category 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Category.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Category."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Category."); + + return new Category(id, name.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, category, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (category.IdOption.IsSet) + writer.WriteNumber("id", category.IdOption.Value.Value); + + writer.WriteString("name", category.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 00000000000..437e8188ab4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs @@ -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 + * 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 +{ + /// + /// ChildCat + /// + public partial class ChildCat : ParentPet, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public ChildCat(Option name = default) : base() + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ChildCat 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 petType = default; + Option name = 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 "pet_type": + string petTypeRawValue = utf8JsonReader.GetString(); + if (petTypeRawValue != null) + petType = new Option(ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(petTypeRawValue)); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ChildCat.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat."); + + return new ChildCat(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, childCat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + 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/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs new file mode 100644 index 00000000000..9e8bc253fdb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ChildCatAllOfPetType.cs @@ -0,0 +1,160 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ChildCat_allOf_pet_type + /// + public enum ChildCatAllOfPetType + { + /// + /// Enum ChildCat for value: ChildCat + /// + ChildCat = 1 + } + + /// + /// Converts to and from the JSON value + /// + public static class ChildCatAllOfPetTypeValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ChildCatAllOfPetType FromString(string value) + { + if (value.Equals("ChildCat")) + return ChildCatAllOfPetType.ChildCat; + + throw new NotImplementedException($"Could not convert value to type ChildCatAllOfPetType: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ChildCatAllOfPetType? FromStringOrDefault(string value) + { + if (value.Equals("ChildCat")) + return ChildCatAllOfPetType.ChildCat; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ChildCatAllOfPetType value) + { + if (value == ChildCatAllOfPetType.ChildCat) + return "ChildCat"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ChildCatAllOfPetTypeJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ChildCatAllOfPetType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ChildCatAllOfPetType? result = rawValue == null + ? null + : ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ChildCatAllOfPetType to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCatAllOfPetType childCatAllOfPetType, JsonSerializerOptions options) + { + writer.WriteStringValue(childCatAllOfPetType.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatAllOfPetTypeNullableJsonConverter : JsonConverter + { + /// + /// Returns a ChildCatAllOfPetType from the Json object + /// + /// + /// + /// + /// + public override ChildCatAllOfPetType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ChildCatAllOfPetType? result = rawValue == null + ? null + : ChildCatAllOfPetTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCatAllOfPetType? childCatAllOfPetType, JsonSerializerOptions options) + { + writer.WriteStringValue(childCatAllOfPetType?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 00000000000..cf37657bf45 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model with \"_class\" property + /// + public partial class ClassModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + [JsonConstructor] + public ClassModel(Option @class = default) + { + ClassOption = @class; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("_class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = 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 ClassModel {\n"); + sb.Append(" Class: ").Append(Class).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 ClassModelJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ClassModel 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 varClass = 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 "_class": + varClass = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class ClassModel."); + + return new ClassModel(varClass); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, classModel, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (classModel.ClassOption.IsSet) + writer.WriteString("_class", classModel.Class); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 00000000000..3023a45610e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// ComplexQuadrilateral + /// + public partial class ComplexQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public ComplexQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ComplexQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ComplexQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ComplexQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class ComplexQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ComplexQuadrilateral."); + + return new ComplexQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (complexQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(complexQuadrilateral.ShapeType), "Property is required for class ComplexQuadrilateral."); + + writer.WriteString("quadrilateralType", complexQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", complexQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 00000000000..14b2ed3b153 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DanishPig + /// + public partial class DanishPig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public DanishPig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 DanishPigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DanishPig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class DanishPig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class DanishPig."); + + return new DanishPig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, danishPig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", danishPig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs new file mode 100644 index 00000000000..62bd07a9513 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -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 + * 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 +{ + /// + /// DateOnlyClass + /// + public partial class DateOnlyClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateOnlyProperty + [JsonConstructor] + public DateOnlyClass(Option dateOnlyProperty = default) + { + DateOnlyPropertyOption = dateOnlyProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateOnlyProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOnlyPropertyOption { get; private set; } + + /// + /// Gets or Sets DateOnlyProperty + /// + /// Fri Jul 21 00:00:00 UTC 2017 + [JsonPropertyName("dateOnlyProperty")] + public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = 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 DateOnlyClass {\n"); + sb.Append(" DateOnlyProperty: ").Append(DateOnlyProperty).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 DateOnlyClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOnlyProperty + /// + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DateOnlyClass 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 dateOnlyProperty = 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 "dateOnlyProperty": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (dateOnlyProperty.IsSet && dateOnlyProperty.Value == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is not nullable for class DateOnlyClass."); + + return new DateOnlyClass(dateOnlyProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 00000000000..661b1e7c2c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DeprecatedObject + /// + public partial class DeprecatedObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public DeprecatedObject(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).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 DeprecatedObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DeprecatedObject 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class DeprecatedObject."); + + return new DeprecatedObject(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (deprecatedObject.NameOption.IsSet) + writer.WriteString("name", deprecatedObject.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 00000000000..75a60416f90 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Dog.cs @@ -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 + * 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 +{ + /// + /// Dog + /// + public partial class Dog : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed + /// color (default to "red") + [JsonConstructor] + public Dog(Option breed = default, Option color = default) : base(color) + { + BreedOption = breed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BreedOption { get; private set; } + + /// + /// Gets or Sets Breed + /// + [JsonPropertyName("breed")] + public string Breed { get { return this.BreedOption; } set { this.BreedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DogJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Dog 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 className = default; + Option breed = default; + Option color = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "breed": + breed = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Dog.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Dog."); + + if (breed.IsSet && breed.Value == null) + throw new ArgumentNullException(nameof(breed), "Property is not nullable for class Dog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); + + return new Dog(breed, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + if (dog.BreedOption.IsSet && dog.Breed == null) + throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); + + if (dog.ColorOption.IsSet && dog.Color == null) + throw new ArgumentNullException(nameof(dog.Color), "Property is required for class Dog."); + + writer.WriteString("className", dog.ClassName); + + if (dog.BreedOption.IsSet) + writer.WriteString("breed", dog.Breed); + + if (dog.ColorOption.IsSet) + writer.WriteString("color", dog.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 00000000000..70ff3517f49 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Drawing + /// + public partial class Drawing : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape + /// nullableShape + /// shapeOrNull + /// shapes + [JsonConstructor] + public Drawing(Option mainShape = default, Option nullableShape = default, Option shapeOrNull = default, Option> shapes = default) + { + MainShapeOption = mainShape; + NullableShapeOption = nullableShape; + ShapeOrNullOption = shapeOrNull; + ShapesOption = shapes; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MainShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MainShapeOption { get; private set; } + + /// + /// Gets or Sets MainShape + /// + [JsonPropertyName("mainShape")] + public Shape MainShape { get { return this.MainShapeOption; } set { this.MainShapeOption = new Option(value); } } + + /// + /// Used to track the state of NullableShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableShapeOption { get; private set; } + + /// + /// Gets or Sets NullableShape + /// + [JsonPropertyName("nullableShape")] + public NullableShape NullableShape { get { return this.NullableShapeOption; } set { this.NullableShapeOption = new Option(value); } } + + /// + /// Used to track the state of ShapeOrNull + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShapeOrNullOption { get; private set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [JsonPropertyName("shapeOrNull")] + public ShapeOrNull ShapeOrNull { get { return this.ShapeOrNullOption; } set { this.ShapeOrNullOption = new Option(value); } } + + /// + /// Used to track the state of Shapes + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ShapesOption { get; private set; } + + /// + /// Gets or Sets Shapes + /// + [JsonPropertyName("shapes")] + public List Shapes { get { return this.ShapesOption; } set { this.ShapesOption = 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 Drawing {\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).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 DrawingJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Drawing 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 mainShape = default; + Option nullableShape = default; + Option shapeOrNull = default; + Option> shapes = 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 "mainShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "nullableShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapeOrNull": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapes": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (mainShape.IsSet && mainShape.Value == null) + throw new ArgumentNullException(nameof(mainShape), "Property is not nullable for class Drawing."); + + if (shapes.IsSet && shapes.Value == null) + throw new ArgumentNullException(nameof(shapes), "Property is not nullable for class Drawing."); + + return new Drawing(mainShape, nullableShape, shapeOrNull, shapes); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, drawing, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (drawing.ShapesOption.IsSet && drawing.Shapes == null) + throw new ArgumentNullException(nameof(drawing.Shapes), "Property is required for class Drawing."); + + if (drawing.MainShapeOption.IsSet) + { + writer.WritePropertyName("mainShape"); + JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions); + } + if (drawing.NullableShapeOption.IsSet) + if (drawing.NullableShapeOption.Value != null) + { + writer.WritePropertyName("nullableShape"); + JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions); + } + else + writer.WriteNull("nullableShape"); + if (drawing.ShapeOrNullOption.IsSet) + if (drawing.ShapeOrNullOption.Value != null) + { + writer.WritePropertyName("shapeOrNull"); + JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions); + } + else + writer.WriteNull("shapeOrNull"); + if (drawing.ShapesOption.IsSet) + { + writer.WritePropertyName("shapes"); + JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 00000000000..37aba162b7b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,208 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumArrays + /// + public partial class EnumArrays : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayEnum + /// justSymbol + [JsonConstructor] + public EnumArrays(Option> arrayEnum = default, Option justSymbol = default) + { + ArrayEnumOption = arrayEnum; + JustSymbolOption = justSymbol; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustSymbol + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustSymbolOption { get; private set; } + + /// + /// Gets or Sets JustSymbol + /// + [JsonPropertyName("just_symbol")] + public EnumArraysJustSymbol? JustSymbol { get { return this.JustSymbolOption; } set { this.JustSymbolOption = new Option(value); } } + + /// + /// Used to track the state of ArrayEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayEnumOption { get; private set; } + + /// + /// Gets or Sets ArrayEnum + /// + [JsonPropertyName("array_enum")] + public List ArrayEnum { get { return this.ArrayEnumOption; } set { this.ArrayEnumOption = 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 EnumArrays {\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).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 EnumArraysJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumArrays 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> arrayEnum = default; + Option justSymbol = 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 "array_enum": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "just_symbol": + string justSymbolRawValue = utf8JsonReader.GetString(); + if (justSymbolRawValue != null) + justSymbol = new Option(EnumArraysJustSymbolValueConverter.FromStringOrDefault(justSymbolRawValue)); + break; + default: + break; + } + } + } + + if (arrayEnum.IsSet && arrayEnum.Value == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is not nullable for class EnumArrays."); + + if (justSymbol.IsSet && justSymbol.Value == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is not nullable for class EnumArrays."); + + return new EnumArrays(arrayEnum, justSymbol); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumArrays, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (enumArrays.ArrayEnumOption.IsSet) + { + writer.WritePropertyName("array_enum"); + JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions); + } + if (enumArrays.JustSymbolOption.IsSet) + { + var justSymbolRawValue = EnumArraysJustSymbolValueConverter.ToJsonValue(enumArrays.JustSymbol.Value); + writer.WriteString("just_symbol", justSymbolRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs new file mode 100644 index 00000000000..c620b7197c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysArrayEnumInner.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumArrays_array_enum_inner + /// + public enum EnumArraysArrayEnumInner + { + /// + /// Enum Fish for value: fish + /// + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + Crab = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumArraysArrayEnumInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysArrayEnumInner FromString(string value) + { + if (value.Equals("fish")) + return EnumArraysArrayEnumInner.Fish; + + if (value.Equals("crab")) + return EnumArraysArrayEnumInner.Crab; + + throw new NotImplementedException($"Could not convert value to type EnumArraysArrayEnumInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysArrayEnumInner? FromStringOrDefault(string value) + { + if (value.Equals("fish")) + return EnumArraysArrayEnumInner.Fish; + + if (value.Equals("crab")) + return EnumArraysArrayEnumInner.Crab; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumArraysArrayEnumInner value) + { + if (value == EnumArraysArrayEnumInner.Fish) + return "fish"; + + if (value == EnumArraysArrayEnumInner.Crab) + return "crab"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumArraysArrayEnumInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumArraysArrayEnumInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysArrayEnumInner? result = rawValue == null + ? null + : EnumArraysArrayEnumInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumArraysArrayEnumInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysArrayEnumInner enumArraysArrayEnumInner, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysArrayEnumInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumArraysArrayEnumInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumArraysArrayEnumInner from the Json object + /// + /// + /// + /// + /// + public override EnumArraysArrayEnumInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysArrayEnumInner? result = rawValue == null + ? null + : EnumArraysArrayEnumInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysArrayEnumInner? enumArraysArrayEnumInner, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysArrayEnumInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs new file mode 100644 index 00000000000..4a414d11d0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArraysJustSymbol.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumArrays_just_symbol + /// + public enum EnumArraysJustSymbol + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumArraysJustSymbolValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysJustSymbol FromString(string value) + { + if (value.Equals(">=")) + return EnumArraysJustSymbol.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return EnumArraysJustSymbol.Dollar; + + throw new NotImplementedException($"Could not convert value to type EnumArraysJustSymbol: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumArraysJustSymbol? FromStringOrDefault(string value) + { + if (value.Equals(">=")) + return EnumArraysJustSymbol.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return EnumArraysJustSymbol.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumArraysJustSymbol value) + { + if (value == EnumArraysJustSymbol.GreaterThanOrEqualTo) + return ">="; + + if (value == EnumArraysJustSymbol.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumArraysJustSymbolJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumArraysJustSymbol Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysJustSymbol? result = rawValue == null + ? null + : EnumArraysJustSymbolValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumArraysJustSymbol to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysJustSymbol enumArraysJustSymbol, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysJustSymbol.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumArraysJustSymbolNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumArraysJustSymbol from the Json object + /// + /// + /// + /// + /// + public override EnumArraysJustSymbol? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumArraysJustSymbol? result = rawValue == null + ? null + : EnumArraysJustSymbolValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArraysJustSymbol? enumArraysJustSymbol, JsonSerializerOptions options) + { + writer.WriteStringValue(enumArraysJustSymbol?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 00000000000..b1aff0adf0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumClass + /// + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumClassValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass FromString(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + throw new NotImplementedException($"Could not convert value to type EnumClass: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumClass value) + { + if (value == EnumClass.Abc) + return "_abc"; + + if (value == EnumClass.Efg) + return "-efg"; + + if (value == EnumClass.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumClassJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumClass to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumClassNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumClass from the Json object + /// + /// + /// + /// + /// + public override EnumClass? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass? enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 00000000000..48e1f8c6e67 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,410 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumTest + /// + public partial class EnumTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// enumStringRequired + /// enumInteger + /// enumIntegerOnly + /// enumNumber + /// enumString + /// outerEnum + /// outerEnumDefaultValue + /// outerEnumInteger + /// outerEnumIntegerDefaultValue + [JsonConstructor] + public EnumTest(EnumTestEnumString enumStringRequired, Option enumInteger = default, Option enumIntegerOnly = default, Option enumNumber = default, Option enumString = default, Option outerEnum = default, Option outerEnumDefaultValue = default, Option outerEnumInteger = default, Option outerEnumIntegerDefaultValue = default) + { + EnumStringRequired = enumStringRequired; + EnumIntegerOption = enumInteger; + EnumIntegerOnlyOption = enumIntegerOnly; + EnumNumberOption = enumNumber; + EnumStringOption = enumString; + OuterEnumOption = outerEnum; + OuterEnumDefaultValueOption = outerEnumDefaultValue; + OuterEnumIntegerOption = outerEnumInteger; + OuterEnumIntegerDefaultValueOption = outerEnumIntegerDefaultValue; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EnumStringRequired + /// + [JsonPropertyName("enum_string_required")] + public EnumTestEnumString EnumStringRequired { get; set; } + + /// + /// Used to track the state of EnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOption { get; private set; } + + /// + /// Gets or Sets EnumInteger + /// + [JsonPropertyName("enum_integer")] + public EnumTestEnumInteger? EnumInteger { get { return this.EnumIntegerOption; } set { this.EnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of EnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets EnumIntegerOnly + /// + [JsonPropertyName("enum_integer_only")] + public EnumTestEnumIntegerOnly? EnumIntegerOnly { get { return this.EnumIntegerOnlyOption; } set { this.EnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of EnumNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumNumberOption { get; private set; } + + /// + /// Gets or Sets EnumNumber + /// + [JsonPropertyName("enum_number")] + public TestEnumParametersEnumQueryDoubleParameter? EnumNumber { get { return this.EnumNumberOption; } set { this.EnumNumberOption = new Option(value); } } + + /// + /// Used to track the state of EnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumStringOption { get; private set; } + + /// + /// Gets or Sets EnumString + /// + [JsonPropertyName("enum_string")] + public EnumTestEnumString? EnumString { get { return this.EnumStringOption; } set { this.EnumStringOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumOption { get; private set; } + + /// + /// Gets or Sets OuterEnum + /// + [JsonPropertyName("outerEnum")] + public OuterEnum? OuterEnum { get { return this.OuterEnumOption; } set { this.OuterEnumOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [JsonPropertyName("outerEnumDefaultValue")] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get { return this.OuterEnumDefaultValueOption; } set { this.OuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [JsonPropertyName("outerEnumInteger")] + public OuterEnumInteger? OuterEnumInteger { get { return this.OuterEnumIntegerOption; } set { this.OuterEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumIntegerDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [JsonPropertyName("outerEnumIntegerDefaultValue")] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get { return this.OuterEnumIntegerDefaultValueOption; } set { this.OuterEnumIntegerDefaultValueOption = 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 EnumTest {\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).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 EnumTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumTest 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 enumStringRequired = default; + Option enumInteger = default; + Option enumIntegerOnly = default; + Option enumNumber = default; + Option enumString = default; + Option outerEnum = default; + Option outerEnumDefaultValue = default; + Option outerEnumInteger = default; + Option outerEnumIntegerDefaultValue = 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 "enum_string_required": + string enumStringRequiredRawValue = utf8JsonReader.GetString(); + if (enumStringRequiredRawValue != null) + enumStringRequired = new Option(EnumTestEnumStringValueConverter.FromStringOrDefault(enumStringRequiredRawValue)); + break; + case "enum_integer": + string enumIntegerRawValue = utf8JsonReader.GetString(); + if (enumIntegerRawValue != null) + enumInteger = new Option(EnumTestEnumIntegerValueConverter.FromStringOrDefault(enumIntegerRawValue)); + break; + case "enum_integer_only": + string enumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (enumIntegerOnlyRawValue != null) + enumIntegerOnly = new Option(EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(enumIntegerOnlyRawValue)); + break; + case "enum_number": + string enumNumberRawValue = utf8JsonReader.GetString(); + if (enumNumberRawValue != null) + enumNumber = new Option(TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(enumNumberRawValue)); + break; + case "enum_string": + string enumStringRawValue = utf8JsonReader.GetString(); + if (enumStringRawValue != null) + enumString = new Option(EnumTestEnumStringValueConverter.FromStringOrDefault(enumStringRawValue)); + break; + case "outerEnum": + string outerEnumRawValue = utf8JsonReader.GetString(); + if (outerEnumRawValue != null) + outerEnum = new Option(OuterEnumValueConverter.FromStringOrDefault(outerEnumRawValue)); + break; + case "outerEnumDefaultValue": + string outerEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumDefaultValueRawValue != null) + outerEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(outerEnumDefaultValueRawValue)); + break; + case "outerEnumInteger": + string outerEnumIntegerRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerRawValue != null) + outerEnumInteger = new Option(OuterEnumIntegerValueConverter.FromStringOrDefault(outerEnumIntegerRawValue)); + break; + case "outerEnumIntegerDefaultValue": + string outerEnumIntegerDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerDefaultValueRawValue != null) + outerEnumIntegerDefaultValue = new Option(OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(outerEnumIntegerDefaultValueRawValue)); + break; + default: + break; + } + } + } + + if (!enumStringRequired.IsSet) + throw new ArgumentException("Property is required for class EnumTest.", nameof(enumStringRequired)); + + if (enumStringRequired.IsSet && enumStringRequired.Value == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is not nullable for class EnumTest."); + + if (enumInteger.IsSet && enumInteger.Value == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is not nullable for class EnumTest."); + + if (enumIntegerOnly.IsSet && enumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is not nullable for class EnumTest."); + + if (enumNumber.IsSet && enumNumber.Value == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is not nullable for class EnumTest."); + + if (enumString.IsSet && enumString.Value == null) + throw new ArgumentNullException(nameof(enumString), "Property is not nullable for class EnumTest."); + + if (outerEnumDefaultValue.IsSet && outerEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is not nullable for class EnumTest."); + + if (outerEnumInteger.IsSet && outerEnumInteger.Value == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is not nullable for class EnumTest."); + + if (outerEnumIntegerDefaultValue.IsSet && outerEnumIntegerDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is not nullable for class EnumTest."); + + return new EnumTest(enumStringRequired.Value.Value, enumInteger, enumIntegerOnly, enumNumber, enumString, outerEnum, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + var enumStringRequiredRawValue = EnumTestEnumStringValueConverter.ToJsonValue(enumTest.EnumStringRequired); + writer.WriteString("enum_string_required", enumStringRequiredRawValue); + + if (enumTest.EnumIntegerOption.IsSet) + { + var enumIntegerRawValue = EnumTestEnumIntegerValueConverter.ToJsonValue(enumTest.EnumInteger.Value); + writer.WriteNumber("enum_integer", enumIntegerRawValue); + } + if (enumTest.EnumIntegerOnlyOption.IsSet) + { + var enumIntegerOnlyRawValue = EnumTestEnumIntegerOnlyValueConverter.ToJsonValue(enumTest.EnumIntegerOnly.Value); + writer.WriteNumber("enum_integer_only", enumIntegerOnlyRawValue); + } + if (enumTest.EnumNumberOption.IsSet) + { + var enumNumberRawValue = TestEnumParametersEnumQueryDoubleParameterValueConverter.ToJsonValue(enumTest.EnumNumber.Value); + writer.WriteNumber("enum_number", enumNumberRawValue); + } + if (enumTest.EnumStringOption.IsSet) + { + var enumStringRawValue = EnumTestEnumStringValueConverter.ToJsonValue(enumTest.EnumString.Value); + writer.WriteString("enum_string", enumStringRawValue); + } + if (enumTest.OuterEnumOption.IsSet) + if (enumTest.OuterEnumOption.Value != null) + { + var outerEnumRawValue = OuterEnumValueConverter.ToJsonValue(enumTest.OuterEnumOption.Value.Value); + writer.WriteString("outerEnum", outerEnumRawValue); + } + else + writer.WriteNull("outerEnum"); + if (enumTest.OuterEnumDefaultValueOption.IsSet) + { + var outerEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumDefaultValue.Value); + writer.WriteString("outerEnumDefaultValue", outerEnumDefaultValueRawValue); + } + if (enumTest.OuterEnumIntegerOption.IsSet) + { + var outerEnumIntegerRawValue = OuterEnumIntegerValueConverter.ToJsonValue(enumTest.OuterEnumInteger.Value); + writer.WriteNumber("outerEnumInteger", outerEnumIntegerRawValue); + } + if (enumTest.OuterEnumIntegerDefaultValueOption.IsSet) + { + var outerEnumIntegerDefaultValueRawValue = OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumIntegerDefaultValue.Value); + writer.WriteNumber("outerEnumIntegerDefaultValue", outerEnumIntegerDefaultValueRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs new file mode 100644 index 00000000000..3a1302bf271 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines Enum_Test_enum_integer + /// + public enum EnumTestEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return EnumTestEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumTestEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return EnumTestEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumTestEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(EnumTestEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumInteger? result = rawValue == null + ? null + : EnumTestEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumInteger enumTestEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumInteger from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumInteger? result = rawValue == null + ? null + : EnumTestEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumInteger? enumTestEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs new file mode 100644 index 00000000000..cd0add6cf3c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines Enum_Test_enum_integer_only + /// + public enum EnumTestEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumTestEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(EnumTestEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumIntegerOnly? result = rawValue == null + ? null + : EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumIntegerOnly enumTestEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumIntegerOnly? result = rawValue == null + ? null + : EnumTestEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumIntegerOnly? enumTestEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs new file mode 100644 index 00000000000..adad28355b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumTestEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines Enum_Test_enum_string + /// + public enum EnumTestEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumTestEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return EnumTestEnumString.UPPER; + + if (value.Equals("lower")) + return EnumTestEnumString.Lower; + + if (value.Equals("")) + return EnumTestEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return EnumTestEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumTestEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumTestEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumTestEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumTestEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumTestEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumTestEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumTestEnumString.UPPER; + + if (value.Equals("lower")) + return EnumTestEnumString.Lower; + + if (value.Equals("")) + return EnumTestEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return EnumTestEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumTestEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumTestEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumTestEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumTestEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumTestEnumString value) + { + if (value == EnumTestEnumString.UPPER) + return "UPPER"; + + if (value == EnumTestEnumString.Lower) + return "lower"; + + if (value == EnumTestEnumString.Empty) + return ""; + + if (value == EnumTestEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumTestEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumTestEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumTestEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumTestEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumTestEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumString? result = rawValue == null + ? null + : EnumTestEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumTestEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumString enumTestEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumTestEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumTestEnumString from the Json object + /// + /// + /// + /// + /// + public override EnumTestEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumTestEnumString? result = rawValue == null + ? null + : EnumTestEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTestEnumString? enumTestEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(enumTestEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 00000000000..d65c7740e5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -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 + * 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 +{ + /// + /// EquilateralTriangle + /// + public partial class EquilateralTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public EquilateralTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 EquilateralTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EquilateralTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class EquilateralTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class EquilateralTriangle."); + + return new EquilateralTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (equilateralTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(equilateralTriangle.TriangleType), "Property is required for class EquilateralTriangle."); + + writer.WriteString("shapeType", equilateralTriangle.ShapeType); + + writer.WriteString("triangleType", equilateralTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..8d88c790110 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,175 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Must be named `File` for test. + /// + public partial class File : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization + [JsonConstructor] + public File(Option sourceURI = default) + { + SourceURIOption = sourceURI; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SourceURI + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SourceURIOption { get; private set; } + + /// + /// Test capitalization + /// + /// Test capitalization + [JsonPropertyName("sourceURI")] + public string SourceURI { get { return this.SourceURIOption; } set { this.SourceURIOption = 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 File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).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 FileJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override File 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 sourceURI = 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 "sourceURI": + sourceURI = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (sourceURI.IsSet && sourceURI.Value == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is not nullable for class File."); + + return new File(sourceURI); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, file, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (file.SourceURIOption.IsSet) + writer.WriteString("sourceURI", file.SourceURI); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..8610cbae21d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FileSchemaTestClass + /// + public partial class FileSchemaTestClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file + /// files + [JsonConstructor] + public FileSchemaTestClass(Option file = default, Option> files = default) + { + FileOption = file; + FilesOption = files; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of File + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FileOption { get; private set; } + + /// + /// Gets or Sets File + /// + [JsonPropertyName("file")] + public File File { get { return this.FileOption; } set { this.FileOption = new Option(value); } } + + /// + /// Used to track the state of Files + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> FilesOption { get; private set; } + + /// + /// Gets or Sets Files + /// + [JsonPropertyName("files")] + public List Files { get { return this.FilesOption; } set { this.FilesOption = 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 FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).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 FileSchemaTestClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FileSchemaTestClass 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 file = default; + Option> files = 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 "file": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "files": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file), "Property is not nullable for class FileSchemaTestClass."); + + if (files.IsSet && files.Value == null) + throw new ArgumentNullException(nameof(files), "Property is not nullable for class FileSchemaTestClass."); + + return new FileSchemaTestClass(file, files); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fileSchemaTestClass.FilesOption.IsSet && fileSchemaTestClass.Files == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass.Files), "Property is required for class FileSchemaTestClass."); + + if (fileSchemaTestClass.FileOption.IsSet) + { + writer.WritePropertyName("file"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.File, jsonSerializerOptions); + } + if (fileSchemaTestClass.FilesOption.IsSet) + { + writer.WritePropertyName("files"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs new file mode 100644 index 00000000000..da357d93dd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FindPetsByStatusStatusParameterInner.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines findPetsByStatus_status_parameter_inner + /// + public enum FindPetsByStatusStatusParameterInner + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class FindPetsByStatusStatusParameterInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static FindPetsByStatusStatusParameterInner FromString(string value) + { + if (value.Equals("available")) + return FindPetsByStatusStatusParameterInner.Available; + + if (value.Equals("pending")) + return FindPetsByStatusStatusParameterInner.Pending; + + if (value.Equals("sold")) + return FindPetsByStatusStatusParameterInner.Sold; + + throw new NotImplementedException($"Could not convert value to type FindPetsByStatusStatusParameterInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static FindPetsByStatusStatusParameterInner? FromStringOrDefault(string value) + { + if (value.Equals("available")) + return FindPetsByStatusStatusParameterInner.Available; + + if (value.Equals("pending")) + return FindPetsByStatusStatusParameterInner.Pending; + + if (value.Equals("sold")) + return FindPetsByStatusStatusParameterInner.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(FindPetsByStatusStatusParameterInner value) + { + if (value == FindPetsByStatusStatusParameterInner.Available) + return "available"; + + if (value == FindPetsByStatusStatusParameterInner.Pending) + return "pending"; + + if (value == FindPetsByStatusStatusParameterInner.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class FindPetsByStatusStatusParameterInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override FindPetsByStatusStatusParameterInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + FindPetsByStatusStatusParameterInner? result = rawValue == null + ? null + : FindPetsByStatusStatusParameterInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the FindPetsByStatusStatusParameterInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FindPetsByStatusStatusParameterInner findPetsByStatusStatusParameterInner, JsonSerializerOptions options) + { + writer.WriteStringValue(findPetsByStatusStatusParameterInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class FindPetsByStatusStatusParameterInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a FindPetsByStatusStatusParameterInner from the Json object + /// + /// + /// + /// + /// + public override FindPetsByStatusStatusParameterInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + FindPetsByStatusStatusParameterInner? result = rawValue == null + ? null + : FindPetsByStatusStatusParameterInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FindPetsByStatusStatusParameterInner? findPetsByStatusStatusParameterInner, JsonSerializerOptions options) + { + writer.WriteStringValue(findPetsByStatusStatusParameterInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 00000000000..659b93c0913 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Foo + /// + public partial class Foo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar") + [JsonConstructor] + public Foo(Option bar = default) + { + BarOption = bar; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; private set; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } set { this.BarOption = 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 FooJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Foo 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 bar = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class Foo."); + + return new Foo(bar); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, foo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (foo.BarOption.IsSet) + writer.WriteString("bar", foo.Bar); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs new file mode 100644 index 00000000000..205b2f3f897 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -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 + * 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 +{ + /// + /// FooGetDefaultResponse + /// + public partial class FooGetDefaultResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// string + [JsonConstructor] + public FooGetDefaultResponse(Option @string = default) + { + StringOption = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public Foo String { get { return this.StringOption; } set { this.StringOption = 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 FooGetDefaultResponse {\n"); + sb.Append(" String: ").Append(String).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 FooGetDefaultResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FooGetDefaultResponse 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 varString = 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 "string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FooGetDefaultResponse."); + + return new FooGetDefaultResponse(varString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fooGetDefaultResponse.StringOption.IsSet) + { + writer.WritePropertyName("string"); + JsonSerializer.Serialize(writer, fooGetDefaultResponse.String, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 00000000000..3fc88d4d403 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,798 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FormatTest + /// + public partial class FormatTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// byte + /// date + /// number + /// password + /// binary + /// dateTime + /// decimal + /// double + /// float + /// int32 + /// int64 + /// integer + /// None + /// A string that is a 10 digit number. Can have leading zeros. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// string + /// unsignedInteger + /// unsignedLong + /// uuid + [JsonConstructor] + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int64 = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + { + Byte = @byte; + Date = date; + Number = number; + Password = password; + BinaryOption = binary; + DateTimeOption = dateTime; + DecimalOption = @decimal; + DoubleOption = @double; + FloatOption = @float; + Int32Option = int32; + Int64Option = int64; + IntegerOption = integer; + PatternWithBackslashOption = patternWithBackslash; + PatternWithDigitsOption = patternWithDigits; + PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; + StringOption = @string; + UnsignedIntegerOption = unsignedInteger; + UnsignedLongOption = unsignedLong; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Byte + /// + [JsonPropertyName("byte")] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + /// Sun Feb 02 00:00:00 UTC 2020 + [JsonPropertyName("date")] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Number + /// + [JsonPropertyName("number")] + public decimal Number { get; set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get; set; } + + /// + /// Used to track the state of Binary + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BinaryOption { get; private set; } + + /// + /// Gets or Sets Binary + /// + [JsonPropertyName("binary")] + public System.IO.Stream Binary { get { return this.BinaryOption; } set { this.BinaryOption = new Option(value); } } + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + /// 2007-12-03T10:15:30+01:00 + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + [JsonPropertyName("decimal")] + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of Double + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DoubleOption { get; private set; } + + /// + /// Gets or Sets Double + /// + [JsonPropertyName("double")] + public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + + /// + /// Used to track the state of Float + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FloatOption { get; private set; } + + /// + /// Gets or Sets Float + /// + [JsonPropertyName("float")] + public float? Float { get { return this.FloatOption; } set { this.FloatOption = new Option(value); } } + + /// + /// Used to track the state of Int32 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32Option { get; private set; } + + /// + /// Gets or Sets Int32 + /// + [JsonPropertyName("int32")] + public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + + /// + /// Used to track the state of Int64 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64Option { get; private set; } + + /// + /// Gets or Sets Int64 + /// + [JsonPropertyName("int64")] + public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + + /// + /// Used to track the state of Integer + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerOption { get; private set; } + + /// + /// Gets or Sets Integer + /// + [JsonPropertyName("integer")] + public int? Integer { get { return this.IntegerOption; } set { this.IntegerOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithBackslash + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithBackslashOption { get; private set; } + + /// + /// None + /// + /// None + [JsonPropertyName("pattern_with_backslash")] + public string PatternWithBackslash { get { return this.PatternWithBackslashOption; } set { this.PatternWithBackslashOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigits + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsOption { get; private set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [JsonPropertyName("pattern_with_digits")] + public string PatternWithDigits { get { return this.PatternWithDigitsOption; } set { this.PatternWithDigitsOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigitsAndDelimiter + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsAndDelimiterOption { get; private set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [JsonPropertyName("pattern_with_digits_and_delimiter")] + public string PatternWithDigitsAndDelimiter { get { return this.PatternWithDigitsAndDelimiterOption; } set { this.PatternWithDigitsAndDelimiterOption = new Option(value); } } + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedIntegerOption { get; private set; } + + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint? UnsignedInteger { get { return this.UnsignedIntegerOption; } set { this.UnsignedIntegerOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedLong + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedLongOption { get; private set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong? UnsignedLong { get { return this.UnsignedLongOption; } set { this.UnsignedLongOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 FormatTest {\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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) + { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // Double (double) maximum + if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) + { + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) + { + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // Float (float) maximum + if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) + { + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) + { + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Int32 (int) maximum + if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) + { + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) + { + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Integer (int) maximum + if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) + { + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) + { + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + if (this.PatternWithBackslashOption.Value != null) { + // PatternWithBackslash (string) pattern + Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); + + if (this.PatternWithBackslashOption.Value != null &&!regexPatternWithBackslash.Match(this.PatternWithBackslashOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); + } + } + + if (this.PatternWithDigitsOption.Value != null) { + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); + + if (this.PatternWithDigitsOption.Value != null &&!regexPatternWithDigits.Match(this.PatternWithDigitsOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + } + + if (this.PatternWithDigitsAndDelimiterOption.Value != null) { + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.PatternWithDigitsAndDelimiterOption.Value != null &&!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiterOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + } + + if (this.StringOption.Value != null) { + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.StringOption.Value != null &&!regexString.Match(this.StringOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + } + + // UnsignedInteger (uint) maximum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class FormatTestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Date + /// + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FormatTest 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 varByte = default; + Option date = default; + Option number = default; + Option password = default; + Option binary = default; + Option dateTime = default; + Option varDecimal = default; + Option varDouble = default; + Option varFloat = default; + Option int32 = default; + Option int64 = default; + Option integer = default; + Option patternWithBackslash = default; + Option patternWithDigits = default; + Option patternWithDigitsAndDelimiter = default; + Option varString = default; + Option unsignedInteger = default; + Option unsignedLong = default; + Option uuid = 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 "byte": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "date": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = new Option(utf8JsonReader.GetDecimal()); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "binary": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "decimal": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "double": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDouble = new Option(utf8JsonReader.GetDouble()); + break; + case "float": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varFloat = new Option((float)utf8JsonReader.GetDouble()); + break; + case "int32": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = new Option(utf8JsonReader.GetInt32()); + break; + case "int64": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = new Option(utf8JsonReader.GetInt64()); + break; + case "integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = new Option(utf8JsonReader.GetInt32()); + break; + case "pattern_with_backslash": + patternWithBackslash = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits": + patternWithDigits = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits_and_delimiter": + patternWithDigitsAndDelimiter = new Option(utf8JsonReader.GetString()); + break; + case "string": + varString = new Option(utf8JsonReader.GetString()); + break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = new Option(utf8JsonReader.GetUInt64()); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (!varByte.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(varByte)); + + if (!date.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(date)); + + if (!number.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(number)); + + if (!password.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + + if (varByte.IsSet && varByte.Value == null) + throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); + + if (date.IsSet && date.Value == null) + throw new ArgumentNullException(nameof(date), "Property is not nullable for class FormatTest."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class FormatTest."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class FormatTest."); + + if (varDecimal.IsSet && varDecimal.Value == null) + throw new ArgumentNullException(nameof(varDecimal), "Property is not nullable for class FormatTest."); + + if (varDouble.IsSet && varDouble.Value == null) + throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + + if (varFloat.IsSet && varFloat.Value == null) + throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); + + if (int32.IsSet && int32.Value == null) + throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + + if (int64.IsSet && int64.Value == null) + throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + + if (integer.IsSet && integer.Value == null) + throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); + + if (patternWithBackslash.IsSet && patternWithBackslash.Value == null) + throw new ArgumentNullException(nameof(patternWithBackslash), "Property is not nullable for class FormatTest."); + + if (patternWithDigits.IsSet && patternWithDigits.Value == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is not nullable for class FormatTest."); + + if (patternWithDigitsAndDelimiter.IsSet && patternWithDigitsAndDelimiter.Value == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is not nullable for class FormatTest."); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + + if (unsignedInteger.IsSet && unsignedInteger.Value == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); + + if (unsignedLong.IsSet && unsignedLong.Value == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is not nullable for class FormatTest."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); + + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, formatTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (formatTest.Password == null) + throw new ArgumentNullException(nameof(formatTest.Password), "Property is required for class FormatTest."); + + if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) + throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsOption.IsSet && formatTest.PatternWithDigits == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigits), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet && formatTest.PatternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + + if (formatTest.StringOption.IsSet && formatTest.String == null) + throw new ArgumentNullException(nameof(formatTest.String), "Property is required for class FormatTest."); + + writer.WritePropertyName("byte"); + JsonSerializer.Serialize(writer, formatTest.Byte, jsonSerializerOptions); + writer.WriteString("date", formatTest.Date.ToString(DateFormat)); + + writer.WriteNumber("number", formatTest.Number); + + writer.WriteString("password", formatTest.Password); + + if (formatTest.BinaryOption.IsSet) + { + writer.WritePropertyName("binary"); + JsonSerializer.Serialize(writer, formatTest.Binary, jsonSerializerOptions); + } + if (formatTest.DateTimeOption.IsSet) + writer.WriteString("dateTime", formatTest.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (formatTest.DecimalOption.IsSet) + { + writer.WritePropertyName("decimal"); + JsonSerializer.Serialize(writer, formatTest.Decimal, jsonSerializerOptions); + } + if (formatTest.DoubleOption.IsSet) + writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + + if (formatTest.FloatOption.IsSet) + writer.WriteNumber("float", formatTest.FloatOption.Value.Value); + + if (formatTest.Int32Option.IsSet) + writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + + if (formatTest.Int64Option.IsSet) + writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + + if (formatTest.IntegerOption.IsSet) + writer.WriteNumber("integer", formatTest.IntegerOption.Value.Value); + + if (formatTest.PatternWithBackslashOption.IsSet) + writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash); + + if (formatTest.PatternWithDigitsOption.IsSet) + writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet) + writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); + + if (formatTest.StringOption.IsSet) + writer.WriteString("string", formatTest.String); + + if (formatTest.UnsignedIntegerOption.IsSet) + writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); + + if (formatTest.UnsignedLongOption.IsSet) + writer.WriteNumber("unsigned_long", formatTest.UnsignedLongOption.Value.Value); + + if (formatTest.UuidOption.IsSet) + writer.WriteString("uuid", formatTest.UuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..0302533cd2f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs @@ -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 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 00000000000..1e72875d4d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FruitReq + /// + public partial class FruitReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(AppleReq appleReq) + { + AppleReq = appleReq; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(BananaReq bananaReq) + { + BananaReq = bananaReq; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AppleReq + /// + public AppleReq AppleReq { get; set; } + + /// + /// Gets or Sets BananaReq + /// + public BananaReq BananaReq { 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 FruitReq {\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 FruitReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FruitReq 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; + + AppleReq appleReq = default; + BananaReq bananaReq = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderAppleReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAppleReq, jsonSerializerOptions, out appleReq); + + Utf8JsonReader utf8JsonReaderBananaReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBananaReq, jsonSerializerOptions, out bananaReq); + } + } + + 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) + { + default: + break; + } + } + } + + if (appleReq != null) + return new FruitReq(appleReq); + + if (bananaReq != null) + return new FruitReq(bananaReq); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruitReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 00000000000..e2eb2c897a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,235 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// GmFruit + /// + public partial class GmFruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public GmFruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" Color: ").Append(Color).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 GmFruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GmFruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class GmFruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new GmFruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); + 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(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, gmFruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (gmFruit.ColorOption.IsSet) + writer.WriteString("color", gmFruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 00000000000..838cae14f98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -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 + * 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 +{ + /// + /// GrandparentAnimal + /// + public partial class GrandparentAnimal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + public GrandparentAnimal() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; + + /// + /// 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 GrandparentAnimal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GrandparentAnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GrandparentAnimal 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class GrandparentAnimal.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); + + return new GrandparentAnimal(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, grandparentAnimal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", grandparentAnimal.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..680ead387fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,244 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// HasOnlyReadOnly + /// + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// foo + [JsonConstructor] + internal HasOnlyReadOnly(Option bar = default, Option foo = default) + { + BarOption = bar; + FooOption = foo; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Foo + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FooOption { get; } + + /// + /// Gets or Sets Foo + /// + [JsonPropertyName("foo")] + public string Foo { get { return this.FooOption; } } + + /// + /// 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 HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + if (Foo != null) + hashCode = (hashCode * 59) + Foo.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 HasOnlyReadOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HasOnlyReadOnly 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 bar = default; + Option foo = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "foo": + foo = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class HasOnlyReadOnly."); + + if (foo.IsSet && foo.Value == null) + throw new ArgumentNullException(nameof(foo), "Property is not nullable for class HasOnlyReadOnly."); + + return new HasOnlyReadOnly(bar, foo); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (hasOnlyReadOnly.FooOption.IsSet && hasOnlyReadOnly.Foo == null) + throw new ArgumentNullException(nameof(hasOnlyReadOnly.Foo), "Property is required for class HasOnlyReadOnly."); + + if (hasOnlyReadOnly.BarOption.IsSet) + writer.WriteString("bar", hasOnlyReadOnly.Bar); + + if (hasOnlyReadOnly.FooOption.IsSet) + writer.WriteString("foo", hasOnlyReadOnly.Foo); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 00000000000..112f55c9ab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -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 + * 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 +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + public partial class HealthCheckResult : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage + [JsonConstructor] + public HealthCheckResult(Option nullableMessage = default) + { + NullableMessageOption = nullableMessage; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of NullableMessage + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableMessageOption { get; private set; } + + /// + /// Gets or Sets NullableMessage + /// + [JsonPropertyName("NullableMessage")] + public string NullableMessage { get { return this.NullableMessageOption; } set { this.NullableMessageOption = 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HealthCheckResult 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 nullableMessage = 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 "NullableMessage": + nullableMessage = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + return new HealthCheckResult(nullableMessage); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + if (healthCheckResult.NullableMessageOption.IsSet) + if (healthCheckResult.NullableMessageOption.Value != null) + writer.WriteString("NullableMessage", healthCheckResult.NullableMessage); + else + writer.WriteNull("NullableMessage"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 00000000000..cce85952411 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -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 + * 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 +{ + /// + /// IsoscelesTriangle + /// + public partial class IsoscelesTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public IsoscelesTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { 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 IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 IsoscelesTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IsoscelesTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class IsoscelesTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class IsoscelesTriangle."); + + return new IsoscelesTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (isoscelesTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(isoscelesTriangle.TriangleType), "Property is required for class IsoscelesTriangle."); + + writer.WriteString("shapeType", isoscelesTriangle.ShapeType); + + writer.WriteString("triangleType", isoscelesTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 00000000000..acadb2f2842 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// List + /// + public partial class List : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// var123List + [JsonConstructor] + public List(Option var123List = default) + { + Var123ListOption = var123List; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Var123List + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123ListOption { get; private set; } + + /// + /// Gets or Sets Var123List + /// + [JsonPropertyName("123-list")] + public string Var123List { get { return this.Var123ListOption; } set { this.Var123ListOption = 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 List {\n"); + sb.Append(" Var123List: ").Append(Var123List).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 ListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override List 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 var123List = 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 "123-list": + var123List = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (var123List.IsSet && var123List.Value == null) + throw new ArgumentNullException(nameof(var123List), "Property is not nullable for class List."); + + return new List(var123List); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, list, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (list.Var123ListOption.IsSet) + writer.WriteString("123-list", list.Var123List); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..bfcbb4465fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,203 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(Option escapedLiteralString = default, Option unescapedLiteralString = default) + { + EscapedLiteralStringOption = escapedLiteralString; + UnescapedLiteralStringOption = unescapedLiteralString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of EscapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EscapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get { return this.EscapedLiteralStringOption; } set { this.EscapedLiteralStringOption = new Option(value); } } + + /// + /// Used to track the state of UnescapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnescapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get { return this.UnescapedLiteralStringOption; } set { this.UnescapedLiteralStringOption = 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 LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).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 LiteralStringClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override LiteralStringClass 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 escapedLiteralString = default; + Option unescapedLiteralString = 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 "escapedLiteralString": + escapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + case "unescapedLiteralString": + unescapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (escapedLiteralString.IsSet && escapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + if (unescapedLiteralString.IsSet && unescapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, literalStringClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet && literalStringClass.UnescapedLiteralString == null) + throw new ArgumentNullException(nameof(literalStringClass.UnescapedLiteralString), "Property is required for class LiteralStringClass."); + + if (literalStringClass.EscapedLiteralStringOption.IsSet) + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet) + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 00000000000..267ac8769d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mammal + /// + public partial class Mammal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Whale whale) + { + Whale = whale; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Zebra zebra) + { + Zebra = zebra; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Pig pig) + { + Pig = pig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Whale + /// + public Whale Whale { get; set; } + + /// + /// Gets or Sets Zebra + /// + public Zebra Zebra { get; set; } + + /// + /// Gets or Sets Pig + /// + public Pig Pig { get; set; } + + /// + /// 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 Mammal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Mammal 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 className = default; + + Pig pig = null; + Whale whale = null; + Zebra zebra = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Pig")) + { + Utf8JsonReader utf8JsonReaderPig = utf8JsonReader; + pig = JsonSerializer.Deserialize(ref utf8JsonReaderPig, jsonSerializerOptions); + } + if (discriminator.Equals("whale")) + { + Utf8JsonReader utf8JsonReaderWhale = utf8JsonReader; + whale = JsonSerializer.Deserialize(ref utf8JsonReaderWhale, jsonSerializerOptions); + } + if (discriminator.Equals("zebra")) + { + Utf8JsonReader utf8JsonReaderZebra = utf8JsonReader; + zebra = JsonSerializer.Deserialize(ref utf8JsonReaderZebra, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Mammal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); + + if (pig != null) + return new Mammal(pig); + + if (whale != null) + return new Mammal(whale); + + if (zebra != null) + return new Mammal(zebra); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mammal.Whale != null) + { + WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); + } + + if (mammal.Zebra != null) + { + ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); + } + + if (mammal.Pig != null) + { + PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); + } + + WriteProperties(writer, mammal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 00000000000..51649bbb138 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,274 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MapTest + /// + public partial class MapTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// directMap + /// indirectMap + /// mapMapOfString + /// mapOfEnumString + [JsonConstructor] + public MapTest(Option> directMap = default, Option> indirectMap = default, Option>> mapMapOfString = default, Option> mapOfEnumString = default) + { + DirectMapOption = directMap; + IndirectMapOption = indirectMap; + MapMapOfStringOption = mapMapOfString; + MapOfEnumStringOption = mapOfEnumString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> DirectMapOption { get; private set; } + + /// + /// Gets or Sets DirectMap + /// + [JsonPropertyName("direct_map")] + public Dictionary DirectMap { get { return this.DirectMapOption; } set { this.DirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of IndirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> IndirectMapOption { get; private set; } + + /// + /// Gets or Sets IndirectMap + /// + [JsonPropertyName("indirect_map")] + public Dictionary IndirectMap { get { return this.IndirectMapOption; } set { this.IndirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of MapMapOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapMapOfStringOption { get; private set; } + + /// + /// Gets or Sets MapMapOfString + /// + [JsonPropertyName("map_map_of_string")] + public Dictionary> MapMapOfString { get { return this.MapMapOfStringOption; } set { this.MapMapOfStringOption = new Option>>(value); } } + + /// + /// Used to track the state of MapOfEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOfEnumStringOption { get; private set; } + + /// + /// Gets or Sets MapOfEnumString + /// + [JsonPropertyName("map_of_enum_string")] + public Dictionary MapOfEnumString { get { return this.MapOfEnumStringOption; } set { this.MapOfEnumStringOption = 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 MapTest {\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).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 MapTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MapTest 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> directMap = default; + Option> indirectMap = default; + Option>> mapMapOfString = default; + Option> mapOfEnumString = 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 "direct_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "indirect_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_map_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_enum_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (directMap.IsSet && directMap.Value == null) + throw new ArgumentNullException(nameof(directMap), "Property is not nullable for class MapTest."); + + if (indirectMap.IsSet && indirectMap.Value == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is not nullable for class MapTest."); + + if (mapMapOfString.IsSet && mapMapOfString.Value == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is not nullable for class MapTest."); + + if (mapOfEnumString.IsSet && mapOfEnumString.Value == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is not nullable for class MapTest."); + + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mapTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mapTest.IndirectMapOption.IsSet && mapTest.IndirectMap == null) + throw new ArgumentNullException(nameof(mapTest.IndirectMap), "Property is required for class MapTest."); + + if (mapTest.MapMapOfStringOption.IsSet && mapTest.MapMapOfString == null) + throw new ArgumentNullException(nameof(mapTest.MapMapOfString), "Property is required for class MapTest."); + + if (mapTest.MapOfEnumStringOption.IsSet && mapTest.MapOfEnumString == null) + throw new ArgumentNullException(nameof(mapTest.MapOfEnumString), "Property is required for class MapTest."); + + if (mapTest.DirectMapOption.IsSet) + { + writer.WritePropertyName("direct_map"); + JsonSerializer.Serialize(writer, mapTest.DirectMap, jsonSerializerOptions); + } + if (mapTest.IndirectMapOption.IsSet) + { + writer.WritePropertyName("indirect_map"); + JsonSerializer.Serialize(writer, mapTest.IndirectMap, jsonSerializerOptions); + } + if (mapTest.MapMapOfStringOption.IsSet) + { + writer.WritePropertyName("map_map_of_string"); + JsonSerializer.Serialize(writer, mapTest.MapMapOfString, jsonSerializerOptions); + } + if (mapTest.MapOfEnumStringOption.IsSet) + { + writer.WritePropertyName("map_of_enum_string"); + JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs new file mode 100644 index 00000000000..441ea5dcb7d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines MapTest_map_of_enum_string_value + /// + public enum MapTestMapOfEnumStringValue + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class MapTestMapOfEnumStringValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static MapTestMapOfEnumStringValue FromString(string value) + { + if (value.Equals("UPPER")) + return MapTestMapOfEnumStringValue.UPPER; + + if (value.Equals("lower")) + return MapTestMapOfEnumStringValue.Lower; + + throw new NotImplementedException($"Could not convert value to type MapTestMapOfEnumStringValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static MapTestMapOfEnumStringValue? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return MapTestMapOfEnumStringValue.UPPER; + + if (value.Equals("lower")) + return MapTestMapOfEnumStringValue.Lower; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(MapTestMapOfEnumStringValue value) + { + if (value == MapTestMapOfEnumStringValue.UPPER) + return "UPPER"; + + if (value == MapTestMapOfEnumStringValue.Lower) + return "lower"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class MapTestMapOfEnumStringValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override MapTestMapOfEnumStringValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + MapTestMapOfEnumStringValue? result = rawValue == null + ? null + : MapTestMapOfEnumStringValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the MapTestMapOfEnumStringValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTestMapOfEnumStringValue mapTestMapOfEnumStringValue, JsonSerializerOptions options) + { + writer.WriteStringValue(mapTestMapOfEnumStringValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class MapTestMapOfEnumStringValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a MapTestMapOfEnumStringValue from the Json object + /// + /// + /// + /// + /// + public override MapTestMapOfEnumStringValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + MapTestMapOfEnumStringValue? result = rawValue == null + ? null + : MapTestMapOfEnumStringValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTestMapOfEnumStringValue? mapTestMapOfEnumStringValue, JsonSerializerOptions options) + { + writer.WriteStringValue(mapTestMapOfEnumStringValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..0f3a07debfe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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 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/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..74047904b27 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..b335b252782 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new Option(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..7b435033f6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d3cb505539d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -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 + * 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 +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + public partial class MixedPropertiesAndAdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateTime + /// map + /// uuid + /// uuidWithPattern + [JsonConstructor] + public MixedPropertiesAndAdditionalPropertiesClass(Option dateTime = default, Option> map = default, Option uuid = default, Option uuidWithPattern = default) + { + DateTimeOption = dateTime; + MapOption = map; + UuidOption = uuid; + UuidWithPatternOption = uuidWithPattern; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Map + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOption { get; private set; } + + /// + /// Gets or Sets Map + /// + [JsonPropertyName("map")] + public Dictionary Map { get { return this.MapOption; } set { this.MapOption = new Option>(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option(value); } } + + /// + /// Used to track the state of UuidWithPattern + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidWithPatternOption { get; private set; } + + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid? UuidWithPattern { get { return this.UuidWithPatternOption; } set { this.UuidWithPatternOption = 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 MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).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) + { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + + if (this.UuidWithPatternOption.Value != null &&!regexUuidWithPattern.Match(this.UuidWithPatternOption.Value.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixedPropertiesAndAdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedPropertiesAndAdditionalPropertiesClass 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 dateTime = default; + Option> map = default; + Option uuid = default; + Option uuidWithPattern = 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 "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + case "uuid_with_pattern": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map.IsSet && map.Value == null) + throw new ArgumentNullException(nameof(map), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuidWithPattern.IsSet && uuidWithPattern.Value == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.IsSet) + writer.WriteString("dateTime", mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet) + { + writer.WritePropertyName("map"); + JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); + } + if (mixedPropertiesAndAdditionalPropertiesClass.UuidOption.IsSet) + writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.UuidOption.Value.Value); + + if (mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.IsSet) + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..1af8feed0a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 00000000000..30ee980fae9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name starting with number + /// + public partial class Model200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + /// name + [JsonConstructor] + public Model200Response(Option @class = default, Option name = default) + { + ClassOption = @class; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public int? Name { get { return this.NameOption; } set { this.NameOption = 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 Model200Response {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" Name: ").Append(Name).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 Model200ResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Model200Response 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 varClass = default; + Option name = 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 "class": + varClass = new Option(utf8JsonReader.GetString()); + break; + case "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class Model200Response."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Model200Response."); + + return new Model200Response(varClass, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, model200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (model200Response.ClassOption.IsSet) + writer.WriteString("class", model200Response.Class); + + if (model200Response.NameOption.IsSet) + writer.WriteNumber("name", model200Response.NameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 00000000000..28da419bb21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ModelClient + /// + public partial class ModelClient : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varClient + [JsonConstructor] + public ModelClient(Option varClient = default) + { + VarClientOption = varClient; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarClient + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarClientOption { get; private set; } + + /// + /// Gets or Sets VarClient + /// + [JsonPropertyName("client")] + public string VarClient { get { return this.VarClientOption; } set { this.VarClientOption = 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 ModelClient {\n"); + sb.Append(" VarClient: ").Append(VarClient).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 ModelClientJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ModelClient 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 varClient = 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 "client": + varClient = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClient.IsSet && varClient.Value == null) + throw new ArgumentNullException(nameof(varClient), "Property is not nullable for class ModelClient."); + + return new ModelClient(varClient); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, modelClient, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (modelClient.VarClientOption.IsSet) + writer.WriteString("client", modelClient.VarClient); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 00000000000..f353f694fb2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,291 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name same as property name + /// + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varName + /// property + /// snakeCase + /// var123Number + [JsonConstructor] + public Name(int varName, Option property = default, Option snakeCase = default, Option var123Number = default) + { + VarName = varName; + PropertyOption = property; + SnakeCaseOption = snakeCase; + Var123NumberOption = var123Number; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets VarName + /// + [JsonPropertyName("name")] + public int VarName { get; set; } + + /// + /// Used to track the state of Property + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PropertyOption { get; private set; } + + /// + /// Gets or Sets Property + /// + [JsonPropertyName("property")] + public string Property { get { return this.PropertyOption; } set { this.PropertyOption = new Option(value); } } + + /// + /// Used to track the state of SnakeCase + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SnakeCaseOption { get; } + + /// + /// Gets or Sets SnakeCase + /// + [JsonPropertyName("snake_case")] + public int? SnakeCase { get { return this.SnakeCaseOption; } } + + /// + /// Used to track the state of Var123Number + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123NumberOption { get; } + + /// + /// Gets or Sets Var123Number + /// + [JsonPropertyName("123Number")] + public int? Var123Number { get { return this.Var123NumberOption; } } + + /// + /// 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 Name {\n"); + sb.Append(" VarName: ").Append(VarName).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Var123Number: ").Append(Var123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name 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 (SnakeCase != null) + hashCode = (hashCode * 59) + SnakeCase.GetHashCode(); + + if (Var123Number != null) + hashCode = (hashCode * 59) + Var123Number.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 NameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Name 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 varName = default; + Option property = default; + Option snakeCase = default; + Option var123Number = 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 "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varName = new Option(utf8JsonReader.GetInt32()); + break; + case "property": + property = new Option(utf8JsonReader.GetString()); + break; + case "snake_case": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = new Option(utf8JsonReader.GetInt32()); + break; + case "123Number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + var123Number = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!varName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(varName)); + + if (varName.IsSet && varName.Value == null) + throw new ArgumentNullException(nameof(varName), "Property is not nullable for class Name."); + + if (property.IsSet && property.Value == null) + throw new ArgumentNullException(nameof(property), "Property is not nullable for class Name."); + + if (snakeCase.IsSet && snakeCase.Value == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is not nullable for class Name."); + + if (var123Number.IsSet && var123Number.Value == null) + throw new ArgumentNullException(nameof(var123Number), "Property is not nullable for class Name."); + + return new Name(varName.Value.Value, property, snakeCase, var123Number); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, name, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteNumber("name", name.VarName); + + if (name.PropertyOption.IsSet) + writer.WriteString("property", name.Property); + + if (name.SnakeCaseOption.IsSet) + writer.WriteNumber("snake_case", name.SnakeCaseOption.Value.Value); + + if (name.Var123NumberOption.IsSet) + writer.WriteNumber("123Number", name.Var123NumberOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs new file mode 100644 index 00000000000..ea8abdda0d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -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 + * 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 +{ + /// + /// NotificationtestGetElementsV1ResponseMPayload + /// + public partial class NotificationtestGetElementsV1ResponseMPayload : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// aObjVariableobject + /// pkiNotificationtestID + [JsonConstructor] + public NotificationtestGetElementsV1ResponseMPayload(List> aObjVariableobject, int pkiNotificationtestID) + { + AObjVariableobject = aObjVariableobject; + PkiNotificationtestID = pkiNotificationtestID; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AObjVariableobject + /// + [JsonPropertyName("a_objVariableobject")] + public List> AObjVariableobject { get; set; } + + /// + /// Gets or Sets PkiNotificationtestID + /// + [JsonPropertyName("pkiNotificationtestID")] + public int PkiNotificationtestID { get; set; } + + /// + /// 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 NotificationtestGetElementsV1ResponseMPayload {\n"); + sb.Append(" AObjVariableobject: ").Append(AObjVariableobject).Append("\n"); + sb.Append(" PkiNotificationtestID: ").Append(PkiNotificationtestID).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 NotificationtestGetElementsV1ResponseMPayloadJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NotificationtestGetElementsV1ResponseMPayload 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>> aObjVariableobject = default; + Option pkiNotificationtestID = 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 "a_objVariableobject": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pkiNotificationtestID": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!aObjVariableobject.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(aObjVariableobject)); + + if (!pkiNotificationtestID.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(pkiNotificationtestID)); + + if (aObjVariableobject.IsSet && aObjVariableobject.Value == null) + throw new ArgumentNullException(nameof(aObjVariableobject), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + if (pkiNotificationtestID.IsSet && pkiNotificationtestID.Value == null) + throw new ArgumentNullException(nameof(pkiNotificationtestID), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + return new NotificationtestGetElementsV1ResponseMPayload(aObjVariableobject.Value, pkiNotificationtestID.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WritePropertyName("a_objVariableobject"); + JsonSerializer.Serialize(writer, notificationtestGetElementsV1ResponseMPayload.AObjVariableobject, jsonSerializerOptions); + writer.WriteNumber("pkiNotificationtestID", notificationtestGetElementsV1ResponseMPayload.PkiNotificationtestID); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 00000000000..ff026f1fbb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,496 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// NullableClass + /// + public partial class NullableClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayAndItemsNullableProp + /// arrayItemsNullable + /// arrayNullableProp + /// booleanProp + /// dateProp + /// datetimeProp + /// integerProp + /// numberProp + /// objectAndItemsNullableProp + /// objectItemsNullable + /// objectNullableProp + /// stringProp + [JsonConstructor] + public NullableClass(Option> arrayAndItemsNullableProp = default, Option> arrayItemsNullable = default, Option> arrayNullableProp = default, Option booleanProp = default, Option dateProp = default, Option datetimeProp = default, Option integerProp = default, Option numberProp = default, Option> objectAndItemsNullableProp = default, Option> objectItemsNullable = default, Option> objectNullableProp = default, Option stringProp = default) + { + ArrayAndItemsNullablePropOption = arrayAndItemsNullableProp; + ArrayItemsNullableOption = arrayItemsNullable; + ArrayNullablePropOption = arrayNullableProp; + BooleanPropOption = booleanProp; + DatePropOption = dateProp; + DatetimePropOption = datetimeProp; + IntegerPropOption = integerProp; + NumberPropOption = numberProp; + ObjectAndItemsNullablePropOption = objectAndItemsNullableProp; + ObjectItemsNullableOption = objectItemsNullable; + ObjectNullablePropOption = objectNullableProp; + StringPropOption = stringProp; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [JsonPropertyName("array_and_items_nullable_prop")] + public List ArrayAndItemsNullableProp { get { return this.ArrayAndItemsNullablePropOption; } set { this.ArrayAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [JsonPropertyName("array_items_nullable")] + public List ArrayItemsNullable { get { return this.ArrayItemsNullableOption; } set { this.ArrayItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [JsonPropertyName("array_nullable_prop")] + public List ArrayNullableProp { get { return this.ArrayNullablePropOption; } set { this.ArrayNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of BooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BooleanPropOption { get; private set; } + + /// + /// Gets or Sets BooleanProp + /// + [JsonPropertyName("boolean_prop")] + public bool? BooleanProp { get { return this.BooleanPropOption; } set { this.BooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of DateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatePropOption { get; private set; } + + /// + /// Gets or Sets DateProp + /// + [JsonPropertyName("date_prop")] + public DateTime? DateProp { get { return this.DatePropOption; } set { this.DatePropOption = new Option(value); } } + + /// + /// Used to track the state of DatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatetimePropOption { get; private set; } + + /// + /// Gets or Sets DatetimeProp + /// + [JsonPropertyName("datetime_prop")] + public DateTime? DatetimeProp { get { return this.DatetimePropOption; } set { this.DatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of IntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerPropOption { get; private set; } + + /// + /// Gets or Sets IntegerProp + /// + [JsonPropertyName("integer_prop")] + public int? IntegerProp { get { return this.IntegerPropOption; } set { this.IntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NumberProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberPropOption { get; private set; } + + /// + /// Gets or Sets NumberProp + /// + [JsonPropertyName("number_prop")] + public decimal? NumberProp { get { return this.NumberPropOption; } set { this.NumberPropOption = new Option(value); } } + + /// + /// Used to track the state of ObjectAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [JsonPropertyName("object_and_items_nullable_prop")] + public Dictionary ObjectAndItemsNullableProp { get { return this.ObjectAndItemsNullablePropOption; } set { this.ObjectAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [JsonPropertyName("object_items_nullable")] + public Dictionary ObjectItemsNullable { get { return this.ObjectItemsNullableOption; } set { this.ObjectItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [JsonPropertyName("object_nullable_prop")] + public Dictionary ObjectNullableProp { get { return this.ObjectNullablePropOption; } set { this.ObjectNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of StringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringPropOption { get; private set; } + + /// + /// Gets or Sets StringProp + /// + [JsonPropertyName("string_prop")] + public string StringProp { get { return this.StringPropOption; } set { this.StringPropOption = 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 NullableClass {\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).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 NullableClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateProp + /// + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DatetimeProp + /// + public static string DatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableClass 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> arrayAndItemsNullableProp = default; + Option> arrayItemsNullable = default; + Option> arrayNullableProp = default; + Option booleanProp = default; + Option dateProp = default; + Option datetimeProp = default; + Option integerProp = default; + Option numberProp = default; + Option> objectAndItemsNullableProp = default; + Option> objectItemsNullable = default; + Option> objectNullableProp = default; + Option stringProp = 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 "array_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "number_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + numberProp = new Option(utf8JsonReader.GetDecimal()); + break; + case "object_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "string_prop": + stringProp = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (arrayItemsNullable.IsSet && arrayItemsNullable.Value == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is not nullable for class NullableClass."); + + if (objectItemsNullable.IsSet && objectItemsNullable.Value == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is not nullable for class NullableClass."); + + return new NullableClass(arrayAndItemsNullableProp, arrayItemsNullable, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectItemsNullable, objectNullableProp, stringProp); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (nullableClass.ObjectItemsNullableOption.IsSet && nullableClass.ObjectItemsNullable == null) + throw new ArgumentNullException(nameof(nullableClass.ObjectItemsNullable), "Property is required for class NullableClass."); + + if (nullableClass.ArrayAndItemsNullablePropOption.IsSet) + if (nullableClass.ArrayAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("array_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_and_items_nullable_prop"); + if (nullableClass.ArrayItemsNullableOption.IsSet) + { + writer.WritePropertyName("array_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ArrayNullablePropOption.IsSet) + if (nullableClass.ArrayNullablePropOption.Value != null) + { + writer.WritePropertyName("array_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_nullable_prop"); + if (nullableClass.BooleanPropOption.IsSet) + if (nullableClass.BooleanPropOption.Value != null) + writer.WriteBoolean("boolean_prop", nullableClass.BooleanPropOption.Value.Value); + else + writer.WriteNull("boolean_prop"); + + if (nullableClass.DatePropOption.IsSet) + if (nullableClass.DatePropOption.Value != null) + writer.WriteString("date_prop", nullableClass.DatePropOption.Value.Value.ToString(DatePropFormat)); + else + writer.WriteNull("date_prop"); + + if (nullableClass.DatetimePropOption.IsSet) + if (nullableClass.DatetimePropOption.Value != null) + writer.WriteString("datetime_prop", nullableClass.DatetimePropOption.Value.Value.ToString(DatetimePropFormat)); + else + writer.WriteNull("datetime_prop"); + + if (nullableClass.IntegerPropOption.IsSet) + if (nullableClass.IntegerPropOption.Value != null) + writer.WriteNumber("integer_prop", nullableClass.IntegerPropOption.Value.Value); + else + writer.WriteNull("integer_prop"); + + if (nullableClass.NumberPropOption.IsSet) + if (nullableClass.NumberPropOption.Value != null) + writer.WriteNumber("number_prop", nullableClass.NumberPropOption.Value.Value); + else + writer.WriteNull("number_prop"); + + if (nullableClass.ObjectAndItemsNullablePropOption.IsSet) + if (nullableClass.ObjectAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("object_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_and_items_nullable_prop"); + if (nullableClass.ObjectItemsNullableOption.IsSet) + { + writer.WritePropertyName("object_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ObjectNullablePropOption.IsSet) + if (nullableClass.ObjectNullablePropOption.Value != null) + { + writer.WritePropertyName("object_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_nullable_prop"); + if (nullableClass.StringPropOption.IsSet) + if (nullableClass.StringPropOption.Value != null) + writer.WriteString("string_prop", nullableClass.StringProp); + else + writer.WriteNull("string_prop"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs new file mode 100644 index 00000000000..8c52be7e14a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -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 + * 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 +{ + /// + /// NullableGuidClass + /// + public partial class NullableGuidClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid + [JsonConstructor] + public NullableGuidClass(Option uuid = default) + { + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 NullableGuidClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).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 NullableGuidClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableGuidClass 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 uuid = 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 "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + return new NullableGuidClass(uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + if (nullableGuidClass.UuidOption.IsSet) + if (nullableGuidClass.UuidOption.Value != null) + writer.WriteString("uuid", nullableGuidClass.UuidOption.Value.Value); + else + writer.WriteNull("uuid"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 00000000000..9a93cb734e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + public partial class NullableShape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 NullableShape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableShape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class NullableShape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); + + if (quadrilateral != null) + return new NullableShape(quadrilateral); + + if (triangle != null) + return new NullableShape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (nullableShape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); + } + + if (nullableShape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, nullableShape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 00000000000..923180c653b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -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 + * 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 +{ + /// + /// NumberOnly + /// + public partial class NumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber + [JsonConstructor] + public NumberOnly(Option justNumber = default) + { + JustNumberOption = justNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustNumberOption { get; private set; } + + /// + /// Gets or Sets JustNumber + /// + [JsonPropertyName("JustNumber")] + public decimal? JustNumber { get { return this.JustNumberOption; } set { this.JustNumberOption = 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 NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).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 NumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NumberOnly 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 justNumber = 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 "JustNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (justNumber.IsSet && justNumber.Value == null) + throw new ArgumentNullException(nameof(justNumber), "Property is not nullable for class NumberOnly."); + + return new NumberOnly(justNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, numberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 00000000000..e25bbf00940 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ObjectWithDeprecatedFields + /// + public partial class ObjectWithDeprecatedFields : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bars + /// deprecatedRef + /// id + /// uuid + [JsonConstructor] + public ObjectWithDeprecatedFields(Option> bars = default, Option deprecatedRef = default, Option id = default, Option uuid = default) + { + BarsOption = bars; + DeprecatedRefOption = deprecatedRef; + IdOption = id; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bars + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> BarsOption { get; private set; } + + /// + /// Gets or Sets Bars + /// + [JsonPropertyName("bars")] + [Obsolete] + public List Bars { get { return this.BarsOption; } set { this.BarsOption = new Option>(value); } } + + /// + /// Used to track the state of DeprecatedRef + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeprecatedRefOption { get; private set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [JsonPropertyName("deprecatedRef")] + [Obsolete] + public DeprecatedObject DeprecatedRef { get { return this.DeprecatedRefOption; } set { this.DeprecatedRefOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + [Obsolete] + public decimal? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public string Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 ObjectWithDeprecatedFields {\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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 ObjectWithDeprecatedFieldsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ObjectWithDeprecatedFields 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> bars = default; + Option deprecatedRef = default; + Option id = default; + Option uuid = 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 "bars": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deprecatedRef": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetDecimal()); + break; + case "uuid": + uuid = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bars.IsSet && bars.Value == null) + throw new ArgumentNullException(nameof(bars), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (deprecatedRef.IsSet && deprecatedRef.Value == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class ObjectWithDeprecatedFields."); + + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet && objectWithDeprecatedFields.DeprecatedRef == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.DeprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.UuidOption.IsSet && objectWithDeprecatedFields.Uuid == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.BarsOption.IsSet) + { + writer.WritePropertyName("bars"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet) + { + writer.WritePropertyName("deprecatedRef"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.IdOption.IsSet) + writer.WriteNumber("id", objectWithDeprecatedFields.IdOption.Value.Value); + + if (objectWithDeprecatedFields.UuidOption.IsSet) + writer.WriteString("uuid", objectWithDeprecatedFields.Uuid); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs new file mode 100644 index 00000000000..c89963f55a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs @@ -0,0 +1,157 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OneOfString + /// + public partial class OneOfString : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal OneOfString(string @string) + { + String = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// 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 OneOfString {\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 OneOfStringJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OneOfString 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; + + string varString = 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) + { + default: + break; + } + } + } + + if (varString != null) + return new OneOfString(varString); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, oneOfString, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 00000000000..5d78af761d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,317 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order + /// + public partial class Order : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// complete (default to false) + /// id + /// petId + /// quantity + /// shipDate + /// status + [JsonConstructor] + public Order(Option complete = default, Option id = default, Option petId = default, Option quantity = default, Option shipDate = default, Option status = default) + { + CompleteOption = complete; + IdOption = id; + PetIdOption = petId; + QuantityOption = quantity; + ShipDateOption = shipDate; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Gets or Sets Status + /// + [JsonPropertyName("status")] + public OrderStatus? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Used to track the state of Complete + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CompleteOption { get; private set; } + + /// + /// Gets or Sets Complete + /// + [JsonPropertyName("complete")] + public bool? Complete { get { return this.CompleteOption; } set { this.CompleteOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of PetId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PetIdOption { get; private set; } + + /// + /// Gets or Sets PetId + /// + [JsonPropertyName("petId")] + public long? PetId { get { return this.PetIdOption; } set { this.PetIdOption = new Option(value); } } + + /// + /// Used to track the state of Quantity + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option QuantityOption { get; private set; } + + /// + /// Gets or Sets Quantity + /// + [JsonPropertyName("quantity")] + public int? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } + + /// + /// Used to track the state of ShipDate + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipDateOption { get; private set; } + + /// + /// Gets or Sets ShipDate + /// + /// 2020-02-02T20:20:20.000222Z + [JsonPropertyName("shipDate")] + public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = 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 Order {\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).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 OrderJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ShipDate + /// + public static string ShipDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Order 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 complete = default; + Option id = default; + Option petId = default; + Option quantity = default; + Option shipDate = default; + Option status = 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 "complete": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = new Option(utf8JsonReader.GetBoolean()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "petId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = new Option(utf8JsonReader.GetInt64()); + break; + case "quantity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = new Option(utf8JsonReader.GetInt32()); + break; + case "shipDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(OrderStatusValueConverter.FromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } + } + + if (complete.IsSet && complete.Value == null) + throw new ArgumentNullException(nameof(complete), "Property is not nullable for class Order."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Order."); + + if (petId.IsSet && petId.Value == null) + throw new ArgumentNullException(nameof(petId), "Property is not nullable for class Order."); + + if (quantity.IsSet && quantity.Value == null) + throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class Order."); + + if (shipDate.IsSet && shipDate.Value == null) + throw new ArgumentNullException(nameof(shipDate), "Property is not nullable for class Order."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Order."); + + return new Order(complete, id, petId, quantity, shipDate, status); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, order, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + if (order.CompleteOption.IsSet) + writer.WriteBoolean("complete", order.CompleteOption.Value.Value); + + if (order.IdOption.IsSet) + writer.WriteNumber("id", order.IdOption.Value.Value); + + if (order.PetIdOption.IsSet) + writer.WriteNumber("petId", order.PetIdOption.Value.Value); + + if (order.QuantityOption.IsSet) + writer.WriteNumber("quantity", order.QuantityOption.Value.Value); + + if (order.ShipDateOption.IsSet) + writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat)); + + if (order.StatusOption.IsSet) + { + var statusRawValue = OrderStatusValueConverter.ToJsonValue(order.Status.Value); + writer.WriteString("status", statusRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs new file mode 100644 index 00000000000..6566ca4aa56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OrderStatus.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order Status + /// + /// Order Status + public enum OrderStatus + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OrderStatusValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OrderStatus FromString(string value) + { + if (value.Equals("placed")) + return OrderStatus.Placed; + + if (value.Equals("approved")) + return OrderStatus.Approved; + + if (value.Equals("delivered")) + return OrderStatus.Delivered; + + throw new NotImplementedException($"Could not convert value to type OrderStatus: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OrderStatus? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OrderStatus.Placed; + + if (value.Equals("approved")) + return OrderStatus.Approved; + + if (value.Equals("delivered")) + return OrderStatus.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OrderStatus value) + { + if (value == OrderStatus.Placed) + return "placed"; + + if (value == OrderStatus.Approved) + return "approved"; + + if (value == OrderStatus.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OrderStatusJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OrderStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OrderStatus? result = rawValue == null + ? null + : OrderStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OrderStatus to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OrderStatus orderStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(orderStatus.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OrderStatusNullableJsonConverter : JsonConverter + { + /// + /// Returns a OrderStatus from the Json object + /// + /// + /// + /// + /// + public override OrderStatus? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OrderStatus? result = rawValue == null + ? null + : OrderStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OrderStatus? orderStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(orderStatus?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 00000000000..dbf262b28c3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,228 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OuterComposite + /// + public partial class OuterComposite : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myBoolean + /// myNumber + /// myString + [JsonConstructor] + public OuterComposite(Option myBoolean = default, Option myNumber = default, Option myString = default) + { + MyBooleanOption = myBoolean; + MyNumberOption = myNumber; + MyStringOption = myString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MyBoolean + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyBooleanOption { get; private set; } + + /// + /// Gets or Sets MyBoolean + /// + [JsonPropertyName("my_boolean")] + public bool? MyBoolean { get { return this.MyBooleanOption; } set { this.MyBooleanOption = new Option(value); } } + + /// + /// Used to track the state of MyNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyNumberOption { get; private set; } + + /// + /// Gets or Sets MyNumber + /// + [JsonPropertyName("my_number")] + public decimal? MyNumber { get { return this.MyNumberOption; } set { this.MyNumberOption = new Option(value); } } + + /// + /// Used to track the state of MyString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyStringOption { get; private set; } + + /// + /// Gets or Sets MyString + /// + [JsonPropertyName("my_string")] + public string MyString { get { return this.MyStringOption; } set { this.MyStringOption = 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 OuterComposite {\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).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 OuterCompositeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OuterComposite 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 myBoolean = default; + Option myNumber = default; + Option myString = 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 "my_boolean": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = new Option(utf8JsonReader.GetBoolean()); + break; + case "my_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = new Option(utf8JsonReader.GetDecimal()); + break; + case "my_string": + myString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (myBoolean.IsSet && myBoolean.Value == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is not nullable for class OuterComposite."); + + if (myNumber.IsSet && myNumber.Value == null) + throw new ArgumentNullException(nameof(myNumber), "Property is not nullable for class OuterComposite."); + + if (myString.IsSet && myString.Value == null) + throw new ArgumentNullException(nameof(myString), "Property is not nullable for class OuterComposite."); + + return new OuterComposite(myBoolean, myNumber, myString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, outerComposite, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (outerComposite.MyBooleanOption.IsSet) + writer.WriteBoolean("my_boolean", outerComposite.MyBooleanOption.Value.Value); + + if (outerComposite.MyNumberOption.IsSet) + writer.WriteNumber("my_number", outerComposite.MyNumberOption.Value.Value); + + if (outerComposite.MyStringOption.IsSet) + writer.WriteString("my_string", outerComposite.MyString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 00000000000..47bb6793c6a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnum + /// + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum FromString(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnum value) + { + if (value == OuterEnum.Placed) + return "placed"; + + if (value == OuterEnum.Approved) + return "approved"; + + if (value == OuterEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnum from the Json object + /// + /// + /// + /// + /// + public override OuterEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum? outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 00000000000..136fb4c54c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnumDefaultValue + /// + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue FromString(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnumDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumDefaultValue value) + { + if (value == OuterEnumDefaultValue.Placed) + return "placed"; + + if (value == OuterEnumDefaultValue.Approved) + return "approved"; + + if (value == OuterEnumDefaultValue.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue? outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 00000000000..2ed4f18a657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumInteger from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger? outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 00000000000..c6a470cc64d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumIntegerDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumIntegerDefaultValue value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumIntegerDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumIntegerDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs new file mode 100644 index 00000000000..a2e789f2ede --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterEnumTest.cs @@ -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 + * 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 +{ + /// + /// Defines Outer_Enum_Test + /// + public enum OuterEnumTest + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumTestValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest FromString(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumTest: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumTest value) + { + if (value == OuterEnumTest.UPPER) + return "UPPER"; + + if (value == OuterEnumTest.Lower) + return "lower"; + + if (value == OuterEnumTest.Empty) + return ""; + + if (value == OuterEnumTest.ValuewithTab) + return "Value\twith tab"; + + if (value == OuterEnumTest.ValueWithQuote) + return "Value with \" quote"; + + if (value == OuterEnumTest.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == OuterEnumTest.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == OuterEnumTest.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumTestJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumTest to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumTestNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumTest from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest? outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 00000000000..5d1cab769fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs @@ -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 + * 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 +{ + /// + /// ParentPet + /// + public partial class ParentPet : GrandparentAnimal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + 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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ParentPetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ParentPet 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ParentPet.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); + + return new ParentPet(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + writer.WriteStartObject(); + + WriteProperties(writer, parentPet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", parentPet.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 00000000000..bc209ae7cbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,317 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pet + /// + public partial class Pet : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + /// photoUrls + /// category + /// id + /// status + /// tags + [JsonConstructor] + public Pet(string name, List photoUrls, Option category = default, Option id = default, Option status = default, Option> tags = default) + { + Name = name; + PhotoUrls = photoUrls; + CategoryOption = category; + IdOption = id; + StatusOption = status; + TagsOption = tags; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Gets or Sets Status + /// + [JsonPropertyName("status")] + public PetStatus? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + /// doggie + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [JsonPropertyName("photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Used to track the state of Category + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryOption { get; private set; } + + /// + /// Gets or Sets Category + /// + [JsonPropertyName("category")] + public Category Category { get { return this.CategoryOption; } set { this.CategoryOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TagsOption { get; private set; } + + /// + /// Gets or Sets Tags + /// + [JsonPropertyName("tags")] + public List Tags { get { return this.TagsOption; } set { this.TagsOption = 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 Pet {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Tags: ").Append(Tags).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 PetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pet 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 name = default; + Option> photoUrls = default; + Option category = default; + Option id = default; + Option status = default; + Option> tags = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "photoUrls": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "category": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); + break; + case "tags": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(name)); + + if (!photoUrls.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(photoUrls)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Pet."); + + if (photoUrls.IsSet && photoUrls.Value == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is not nullable for class Pet."); + + if (category.IsSet && category.Value == null) + throw new ArgumentNullException(nameof(category), "Property is not nullable for class Pet."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Pet."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Pet."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class Pet."); + + return new Pet(name.Value, photoUrls.Value, category, id, status, tags); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, pet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (pet.PhotoUrls == null) + throw new ArgumentNullException(nameof(pet.PhotoUrls), "Property is required for class Pet."); + + if (pet.CategoryOption.IsSet && pet.Category == null) + throw new ArgumentNullException(nameof(pet.Category), "Property is required for class Pet."); + + if (pet.TagsOption.IsSet && pet.Tags == null) + throw new ArgumentNullException(nameof(pet.Tags), "Property is required for class Pet."); + + writer.WriteString("name", pet.Name); + + writer.WritePropertyName("photoUrls"); + JsonSerializer.Serialize(writer, pet.PhotoUrls, jsonSerializerOptions); + if (pet.CategoryOption.IsSet) + { + writer.WritePropertyName("category"); + JsonSerializer.Serialize(writer, pet.Category, jsonSerializerOptions); + } + if (pet.IdOption.IsSet) + writer.WriteNumber("id", pet.IdOption.Value.Value); + + if (pet.StatusOption.IsSet) + { + var statusRawValue = PetStatusValueConverter.ToJsonValue(pet.Status.Value); + writer.WriteString("status", statusRawValue); + } + if (pet.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, pet.Tags, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs new file mode 100644 index 00000000000..9e19b612bf9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PetStatus.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// pet status in the store + /// + /// pet status in the store + public enum PetStatus + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class PetStatusValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static PetStatus FromString(string value) + { + if (value.Equals("available")) + return PetStatus.Available; + + if (value.Equals("pending")) + return PetStatus.Pending; + + if (value.Equals("sold")) + return PetStatus.Sold; + + throw new NotImplementedException($"Could not convert value to type PetStatus: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static PetStatus? FromStringOrDefault(string value) + { + if (value.Equals("available")) + return PetStatus.Available; + + if (value.Equals("pending")) + return PetStatus.Pending; + + if (value.Equals("sold")) + return PetStatus.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(PetStatus value) + { + if (value == PetStatus.Available) + return "available"; + + if (value == PetStatus.Pending) + return "pending"; + + if (value == PetStatus.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class PetStatusJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override PetStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + PetStatus? result = rawValue == null + ? null + : PetStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the PetStatus to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PetStatus petStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(petStatus.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class PetStatusNullableJsonConverter : JsonConverter + { + /// + /// Returns a PetStatus from the Json object + /// + /// + /// + /// + /// + public override PetStatus? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + PetStatus? result = rawValue == null + ? null + : PetStatusValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PetStatus? petStatus, JsonSerializerOptions options) + { + writer.WriteStringValue(petStatus?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 00000000000..b6f300c9440 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pig + /// + public partial class Pig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(BasquePig basquePig) + { + BasquePig = basquePig; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(DanishPig danishPig) + { + DanishPig = danishPig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets BasquePig + /// + public BasquePig BasquePig { get; set; } + + /// + /// Gets or Sets DanishPig + /// + public DanishPig DanishPig { get; set; } + + /// + /// 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 Pig {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pig 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 className = default; + + BasquePig basquePig = null; + DanishPig danishPig = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("BasquePig")) + { + Utf8JsonReader utf8JsonReaderBasquePig = utf8JsonReader; + basquePig = JsonSerializer.Deserialize(ref utf8JsonReaderBasquePig, jsonSerializerOptions); + } + if (discriminator.Equals("DanishPig")) + { + Utf8JsonReader utf8JsonReaderDanishPig = utf8JsonReader; + danishPig = JsonSerializer.Deserialize(ref utf8JsonReaderDanishPig, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Pig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); + + if (basquePig != null) + return new Pig(basquePig); + + if (danishPig != null) + return new Pig(danishPig); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (pig.BasquePig != null) + { + BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); + } + + if (pig.DanishPig != null) + { + DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); + } + + WriteProperties(writer, pig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs new file mode 100644 index 00000000000..ddea47edf40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// PolymorphicProperty + /// + public partial class PolymorphicProperty : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(Object @object) + { + Object = @object; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(List list) + { + List = list; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Object + /// + public Object Object { get; set; } + + /// + /// Gets or Sets List + /// + public List List { get; set; } + + /// + /// 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 PolymorphicProperty {\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 PolymorphicPropertyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PolymorphicProperty 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; + + bool? varBool = default; + string varString = default; + Object varObject = default; + List list = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); + + Utf8JsonReader utf8JsonReaderList = utf8JsonReader; + ClientUtils.TryDeserialize>(ref utf8JsonReaderList, jsonSerializerOptions, out list); + } + } + + 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) + { + default: + break; + } + } + } + + if (varBool != null) + return new PolymorphicProperty(varBool.Value); + + if (varString != null) + return new PolymorphicProperty(varString); + + if (varObject != null) + return new PolymorphicProperty(varObject); + + if (list != null) + return new PolymorphicProperty(list); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 00000000000..e8a2e243997 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Quadrilateral + /// + public partial class Quadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) + { + SimpleQuadrilateral = simpleQuadrilateral; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) + { + ComplexQuadrilateral = complexQuadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SimpleQuadrilateral + /// + public SimpleQuadrilateral SimpleQuadrilateral { get; set; } + + /// + /// Gets or Sets ComplexQuadrilateral + /// + public ComplexQuadrilateral ComplexQuadrilateral { get; set; } + + /// + /// 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 Quadrilateral {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Quadrilateral 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 quadrilateralType = default; + + ComplexQuadrilateral complexQuadrilateral = null; + SimpleQuadrilateral simpleQuadrilateral = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("quadrilateralType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("ComplexQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderComplexQuadrilateral = utf8JsonReader; + complexQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderComplexQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("SimpleQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderSimpleQuadrilateral = utf8JsonReader; + simpleQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderSimpleQuadrilateral, jsonSerializerOptions); + } + } + } + } + + 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class Quadrilateral.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); + + if (complexQuadrilateral != null) + return new Quadrilateral(complexQuadrilateral); + + if (simpleQuadrilateral != null) + return new Quadrilateral(simpleQuadrilateral); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (quadrilateral.SimpleQuadrilateral != null) + { + SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + } + + if (quadrilateral.ComplexQuadrilateral != null) + { + ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, quadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 00000000000..519ed66393c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// QuadrilateralInterface + /// + public partial class QuadrilateralInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + [JsonConstructor] + public QuadrilateralInterface(string quadrilateralType) + { + QuadrilateralType = quadrilateralType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// 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 QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).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 QuadrilateralInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override QuadrilateralInterface 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 quadrilateralType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class QuadrilateralInterface.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class QuadrilateralInterface."); + + return new QuadrilateralInterface(quadrilateralType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("quadrilateralType", quadrilateralInterface.QuadrilateralType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..afb58fb0e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -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 + * 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 +{ + /// + /// ReadOnlyFirst + /// + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// baz + [JsonConstructor] + public ReadOnlyFirst(Option bar = default, Option baz = default) + { + BarOption = bar; + BazOption = baz; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Baz + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BazOption { get; private set; } + + /// + /// Gets or Sets Baz + /// + [JsonPropertyName("baz")] + public string Baz { get { return this.BazOption; } set { this.BazOption = 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 ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 ReadOnlyFirstJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ReadOnlyFirst 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 bar = default; + Option baz = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "baz": + baz = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class ReadOnlyFirst."); + + if (baz.IsSet && baz.Value == null) + throw new ArgumentNullException(nameof(baz), "Property is not nullable for class ReadOnlyFirst."); + + return new ReadOnlyFirst(bar, baz); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (readOnlyFirst.BazOption.IsSet && readOnlyFirst.Baz == null) + throw new ArgumentNullException(nameof(readOnlyFirst.Baz), "Property is required for class ReadOnlyFirst."); + + if (readOnlyFirst.BarOption.IsSet) + writer.WriteString("bar", readOnlyFirst.Bar); + + if (readOnlyFirst.BazOption.IsSet) + writer.WriteString("baz", readOnlyFirst.Baz); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs new file mode 100644 index 00000000000..a60c25e0468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -0,0 +1,1335 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RequiredClass + /// + public partial class RequiredClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// requiredNotNullableDateProp + /// requiredNotnullableArrayOfString + /// requiredNotnullableBooleanProp + /// requiredNotnullableDatetimeProp + /// requiredNotnullableEnumInteger + /// requiredNotnullableEnumIntegerOnly + /// requiredNotnullableEnumString + /// requiredNotnullableOuterEnumDefaultValue + /// requiredNotnullableStringProp + /// requiredNotnullableUuid + /// requiredNotnullableintegerProp + /// notRequiredNotnullableDateProp + /// notRequiredNotnullableintegerProp + /// notRequiredNullableDateProp + /// notRequiredNullableIntegerProp + /// notrequiredNotnullableArrayOfString + /// notrequiredNotnullableBooleanProp + /// notrequiredNotnullableDatetimeProp + /// notrequiredNotnullableEnumInteger + /// notrequiredNotnullableEnumIntegerOnly + /// notrequiredNotnullableEnumString + /// notrequiredNotnullableOuterEnumDefaultValue + /// notrequiredNotnullableStringProp + /// notrequiredNotnullableUuid + /// notrequiredNullableArrayOfString + /// notrequiredNullableBooleanProp + /// notrequiredNullableDatetimeProp + /// notrequiredNullableEnumInteger + /// notrequiredNullableEnumIntegerOnly + /// notrequiredNullableEnumString + /// 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, 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, DateTime? 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; + RequiredNotnullableBooleanProp = requiredNotnullableBooleanProp; + RequiredNotnullableDatetimeProp = requiredNotnullableDatetimeProp; + RequiredNotnullableEnumInteger = requiredNotnullableEnumInteger; + RequiredNotnullableEnumIntegerOnly = requiredNotnullableEnumIntegerOnly; + RequiredNotnullableEnumString = requiredNotnullableEnumString; + RequiredNotnullableOuterEnumDefaultValue = requiredNotnullableOuterEnumDefaultValue; + RequiredNotnullableStringProp = requiredNotnullableStringProp; + RequiredNotnullableUuid = requiredNotnullableUuid; + RequiredNotnullableintegerProp = requiredNotnullableintegerProp; + NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; + NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; + NotRequiredNullableDatePropOption = notRequiredNullableDateProp; + NotRequiredNullableIntegerPropOption = notRequiredNullableIntegerProp; + NotrequiredNotnullableArrayOfStringOption = notrequiredNotnullableArrayOfString; + NotrequiredNotnullableBooleanPropOption = notrequiredNotnullableBooleanProp; + NotrequiredNotnullableDatetimePropOption = notrequiredNotnullableDatetimeProp; + NotrequiredNotnullableEnumIntegerOption = notrequiredNotnullableEnumInteger; + NotrequiredNotnullableEnumIntegerOnlyOption = notrequiredNotnullableEnumIntegerOnly; + NotrequiredNotnullableEnumStringOption = notrequiredNotnullableEnumString; + NotrequiredNotnullableOuterEnumDefaultValueOption = notrequiredNotnullableOuterEnumDefaultValue; + NotrequiredNotnullableStringPropOption = notrequiredNotnullableStringProp; + NotrequiredNotnullableUuidOption = notrequiredNotnullableUuid; + NotrequiredNullableArrayOfStringOption = notrequiredNullableArrayOfString; + NotrequiredNullableBooleanPropOption = notrequiredNullableBooleanProp; + NotrequiredNullableDatetimePropOption = notrequiredNullableDatetimeProp; + NotrequiredNullableEnumIntegerOption = notrequiredNullableEnumInteger; + NotrequiredNullableEnumIntegerOnlyOption = notrequiredNullableEnumIntegerOnly; + NotrequiredNullableEnumStringOption = notrequiredNullableEnumString; + 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(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets RequiredNotnullableEnumInteger + /// + [JsonPropertyName("required_notnullable_enum_integer")] + public RequiredClassRequiredNotnullableEnumInteger RequiredNotnullableEnumInteger { get; set; } + + /// + /// Gets or Sets RequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("required_notnullable_enum_integer_only")] + public RequiredClassRequiredNotnullableEnumIntegerOnly RequiredNotnullableEnumIntegerOnly { get; set; } + + /// + /// Gets or Sets RequiredNotnullableEnumString + /// + [JsonPropertyName("required_notnullable_enum_string")] + public RequiredClassRequiredNotnullableEnumString RequiredNotnullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } + + /// + /// Used to track the state of NotrequiredNotnullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumInteger + /// + [JsonPropertyName("notrequired_notnullable_enum_integer")] + public RequiredClassRequiredNotnullableEnumInteger? NotrequiredNotnullableEnumInteger { get { return this.NotrequiredNotnullableEnumIntegerOption; } set { this.NotrequiredNotnullableEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_notnullable_enum_integer_only")] + public RequiredClassRequiredNotnullableEnumIntegerOnly? NotrequiredNotnullableEnumIntegerOnly { get { return this.NotrequiredNotnullableEnumIntegerOnlyOption; } set { this.NotrequiredNotnullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumString + /// + [JsonPropertyName("notrequired_notnullable_enum_string")] + public RequiredClassRequiredNotnullableEnumString? NotrequiredNotnullableEnumString { get { return this.NotrequiredNotnullableEnumStringOption; } set { this.NotrequiredNotnullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNotnullableOuterEnumDefaultValue { get { return this.NotrequiredNotnullableOuterEnumDefaultValueOption; } set { this.NotrequiredNotnullableOuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumInteger + /// + [JsonPropertyName("notrequired_nullable_enum_integer")] + public RequiredClassRequiredNullableEnumInteger? NotrequiredNullableEnumInteger { get { return this.NotrequiredNullableEnumIntegerOption; } set { this.NotrequiredNullableEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_nullable_enum_integer_only")] + public RequiredClassRequiredNullableEnumIntegerOnly? NotrequiredNullableEnumIntegerOnly { get { return this.NotrequiredNullableEnumIntegerOnlyOption; } set { this.NotrequiredNullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumString + /// + [JsonPropertyName("notrequired_nullable_enum_string")] + public RequiredClassRequiredNullableEnumString? NotrequiredNullableEnumString { get { return this.NotrequiredNullableEnumStringOption; } set { this.NotrequiredNullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new Option(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 + /// + [JsonPropertyName("required_not_nullable_date_prop")] + public DateTime RequiredNotNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableArrayOfString + /// + [JsonPropertyName("required_notnullable_array_of_string")] + public List RequiredNotnullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableBooleanProp + /// + [JsonPropertyName("required_notnullable_boolean_prop")] + public bool RequiredNotnullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableDatetimeProp + /// + [JsonPropertyName("required_notnullable_datetime_prop")] + public DateTime RequiredNotnullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableStringProp + /// + [JsonPropertyName("required_notnullable_string_prop")] + public string RequiredNotnullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_notnullable_uuid")] + public Guid RequiredNotnullableUuid { get; set; } + + /// + /// Gets or Sets RequiredNotnullableintegerProp + /// + [JsonPropertyName("required_notnullableinteger_prop")] + public int RequiredNotnullableintegerProp { get; set; } + + /// + /// Used to track the state of NotRequiredNotnullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableDateProp + /// + [JsonPropertyName("not_required_notnullable_date_prop")] + public DateTime? NotRequiredNotnullableDateProp { get { return this.NotRequiredNotnullableDatePropOption; } set { this.NotRequiredNotnullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNotnullableintegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableintegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableintegerProp + /// + [JsonPropertyName("not_required_notnullableinteger_prop")] + public int? NotRequiredNotnullableintegerProp { get { return this.NotRequiredNotnullableintegerPropOption; } set { this.NotRequiredNotnullableintegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableDateProp + /// + [JsonPropertyName("not_required_nullable_date_prop")] + public DateTime? NotRequiredNullableDateProp { get { return this.NotRequiredNullableDatePropOption; } set { this.NotRequiredNullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableIntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableIntegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableIntegerProp + /// + [JsonPropertyName("not_required_nullable_integer_prop")] + public int? NotRequiredNullableIntegerProp { get { return this.NotRequiredNullableIntegerPropOption; } set { this.NotRequiredNullableIntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNotnullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableArrayOfString + /// + [JsonPropertyName("notrequired_notnullable_array_of_string")] + public List NotrequiredNotnullableArrayOfString { get { return this.NotrequiredNotnullableArrayOfStringOption; } set { this.NotrequiredNotnullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableBooleanProp + /// + [JsonPropertyName("notrequired_notnullable_boolean_prop")] + public bool? NotrequiredNotnullableBooleanProp { get { return this.NotrequiredNotnullableBooleanPropOption; } set { this.NotrequiredNotnullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableDatetimeProp + /// + [JsonPropertyName("notrequired_notnullable_datetime_prop")] + public DateTime? NotrequiredNotnullableDatetimeProp { get { return this.NotrequiredNotnullableDatetimePropOption; } set { this.NotrequiredNotnullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableStringProp + /// + [JsonPropertyName("notrequired_notnullable_string_prop")] + public string NotrequiredNotnullableStringProp { get { return this.NotrequiredNotnullableStringPropOption; } set { this.NotrequiredNotnullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("notrequired_notnullable_uuid")] + public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableArrayOfString + /// + [JsonPropertyName("notrequired_nullable_array_of_string")] + public List NotrequiredNullableArrayOfString { get { return this.NotrequiredNullableArrayOfStringOption; } set { this.NotrequiredNullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableBooleanProp + /// + [JsonPropertyName("notrequired_nullable_boolean_prop")] + public bool? NotrequiredNullableBooleanProp { get { return this.NotrequiredNullableBooleanPropOption; } set { this.NotrequiredNullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableDatetimeProp + /// + [JsonPropertyName("notrequired_nullable_datetime_prop")] + public DateTime? NotrequiredNullableDatetimeProp { get { return this.NotrequiredNullableDatetimePropOption; } set { this.NotrequiredNullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableStringProp + /// + [JsonPropertyName("notrequired_nullable_string_prop")] + public string NotrequiredNullableStringProp { get { return this.NotrequiredNullableStringPropOption; } set { this.NotrequiredNullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [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 + /// + [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 RequiredClass {\n"); + sb.Append(" RequiredNotNullableDateProp: ").Append(RequiredNotNullableDateProp).Append("\n"); + sb.Append(" RequiredNotnullableArrayOfString: ").Append(RequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" RequiredNotnullableBooleanProp: ").Append(RequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" RequiredNotnullableDatetimeProp: ").Append(RequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNotnullableEnumInteger: ").Append(RequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" RequiredNotnullableEnumIntegerOnly: ").Append(RequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNotnullableEnumString: ").Append(RequiredNotnullableEnumString).Append("\n"); + sb.Append(" RequiredNotnullableOuterEnumDefaultValue: ").Append(RequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); + sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); + sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); + sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); + sb.Append(" NotRequiredNullableIntegerProp: ").Append(NotRequiredNullableIntegerProp).Append("\n"); + sb.Append(" NotrequiredNotnullableArrayOfString: ").Append(NotrequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNotnullableBooleanProp: ").Append(NotrequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNotnullableDatetimeProp: ").Append(NotrequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumInteger: ").Append(NotrequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumIntegerOnly: ").Append(NotrequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumString: ").Append(NotrequiredNotnullableEnumString).Append("\n"); + sb.Append(" NotrequiredNotnullableOuterEnumDefaultValue: ").Append(NotrequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" NotrequiredNotnullableStringProp: ").Append(NotrequiredNotnullableStringProp).Append("\n"); + sb.Append(" NotrequiredNotnullableUuid: ").Append(NotrequiredNotnullableUuid).Append("\n"); + sb.Append(" NotrequiredNullableArrayOfString: ").Append(NotrequiredNullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNullableBooleanProp: ").Append(NotrequiredNullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNullableDatetimeProp: ").Append(NotrequiredNullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNullableEnumInteger: ").Append(NotrequiredNullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNullableEnumIntegerOnly: ").Append(NotrequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNullableEnumString: ").Append(NotrequiredNullableEnumString).Append("\n"); + 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(); + } + + /// + /// 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 RequiredClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize RequiredNotNullableDateProp + /// + public static string RequiredNotNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNotnullableDatetimeProp + /// + public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotRequiredNotnullableDateProp + /// + public static string NotRequiredNotnullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotRequiredNullableDateProp + /// + public static string NotRequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotrequiredNotnullableDatetimeProp + /// + public static string NotrequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotrequiredNullableDatetimeProp + /// + 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 + /// + /// + /// + /// + /// + /// + public override RequiredClass 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 requiredNotNullableDateProp = default; + Option> requiredNotnullableArrayOfString = default; + Option requiredNotnullableBooleanProp = default; + Option requiredNotnullableDatetimeProp = default; + Option requiredNotnullableEnumInteger = default; + Option requiredNotnullableEnumIntegerOnly = default; + Option requiredNotnullableEnumString = default; + Option requiredNotnullableOuterEnumDefaultValue = default; + Option requiredNotnullableStringProp = default; + Option requiredNotnullableUuid = default; + Option requiredNotnullableintegerProp = 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; + 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()) + { + 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 "required_not_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_enum_integer": + string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumIntegerRawValue != null) + requiredNotnullableEnumInteger = new Option(RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(requiredNotnullableEnumIntegerRawValue)); + break; + case "required_notnullable_enum_integer_only": + string requiredNotnullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumIntegerOnlyRawValue != null) + requiredNotnullableEnumIntegerOnly = new Option(RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(requiredNotnullableEnumIntegerOnlyRawValue)); + break; + case "required_notnullable_enum_string": + string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumStringRawValue != null) + requiredNotnullableEnumString = new Option(RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(requiredNotnullableEnumStringRawValue)); + break; + case "required_notnullable_outerEnumDefaultValue": + string requiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableOuterEnumDefaultValueRawValue != null) + requiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "required_notnullable_string_prop": + requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_notnullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_enum_integer": + string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumIntegerRawValue != null) + notrequiredNotnullableEnumInteger = new Option(RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(notrequiredNotnullableEnumIntegerRawValue)); + break; + case "notrequired_notnullable_enum_integer_only": + string notrequiredNotnullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumIntegerOnlyRawValue != null) + notrequiredNotnullableEnumIntegerOnly = new Option(RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(notrequiredNotnullableEnumIntegerOnlyRawValue)); + break; + case "notrequired_notnullable_enum_string": + string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumStringRawValue != null) + notrequiredNotnullableEnumString = new Option(RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(notrequiredNotnullableEnumStringRawValue)); + break; + case "notrequired_notnullable_outerEnumDefaultValue": + string notrequiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableOuterEnumDefaultValueRawValue != null) + notrequiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_notnullable_string_prop": + notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "notrequired_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_enum_integer": + string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumIntegerRawValue != null) + notrequiredNullableEnumInteger = new Option(RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(notrequiredNullableEnumIntegerRawValue)); + break; + case "notrequired_nullable_enum_integer_only": + string notrequiredNullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumIntegerOnlyRawValue != null) + notrequiredNullableEnumIntegerOnly = new Option(RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(notrequiredNullableEnumIntegerOnlyRawValue)); + break; + case "notrequired_nullable_enum_string": + string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumStringRawValue != null) + notrequiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(notrequiredNullableEnumStringRawValue)); + break; + case "notrequired_nullable_outerEnumDefaultValue": + string notrequiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableOuterEnumDefaultValueRawValue != null) + notrequiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_nullable_string_prop": + notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_nullable_uuid": + 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; + } + } + } + + if (!requiredNotNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotNullableDateProp)); + + if (!requiredNotnullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableArrayOfString)); + + if (!requiredNotnullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableBooleanProp)); + + if (!requiredNotnullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableDatetimeProp)); + + if (!requiredNotnullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumInteger)); + + if (!requiredNotnullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumIntegerOnly)); + + if (!requiredNotnullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumString)); + + if (!requiredNotnullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableOuterEnumDefaultValue)); + + if (!requiredNotnullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableStringProp)); + + if (!requiredNotnullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableUuid)); + + if (!requiredNotnullableintegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableintegerProp)); + + if (!requiredNullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableArrayOfString)); + + if (!requiredNullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableBooleanProp)); + + if (!requiredNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDateProp)); + + if (!requiredNullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDatetimeProp)); + + if (!requiredNullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumInteger)); + + if (!requiredNullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumIntegerOnly)); + + if (!requiredNullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumString)); + + if (!requiredNullableIntegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableIntegerProp)); + + if (!requiredNullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableOuterEnumDefaultValue)); + + if (!requiredNullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableStringProp)); + + if (!requiredNullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableUuid)); + + if (requiredNotNullableDateProp.IsSet && requiredNotNullableDateProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotNullableDateProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableArrayOfString.IsSet && requiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableBooleanProp.IsSet && requiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableDatetimeProp.IsSet && requiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumInteger.IsSet && requiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumIntegerOnly.IsSet && requiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumString.IsSet && requiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableOuterEnumDefaultValue.IsSet && requiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableStringProp.IsSet && requiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableUuid.IsSet && requiredNotnullableUuid.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableUuid), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableintegerProp.IsSet && requiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableDateProp.IsSet && notRequiredNotnullableDateProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableDateProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableintegerProp.IsSet && notRequiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableArrayOfString.IsSet && notrequiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableBooleanProp.IsSet && notrequiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableDatetimeProp.IsSet && notrequiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumInteger.IsSet && notrequiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumIntegerOnly.IsSet && notrequiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumString.IsSet && notrequiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableOuterEnumDefaultValue.IsSet && notrequiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableStringProp.IsSet && notrequiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + 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, 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); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, requiredClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (requiredClass.RequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet && requiredClass.NotrequiredNotnullableArrayOfString == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet && requiredClass.NotrequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + writer.WriteString("required_not_nullable_date_prop", requiredClass.RequiredNotNullableDateProp.ToString(RequiredNotNullableDatePropFormat)); + + writer.WritePropertyName("required_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNotnullableArrayOfString, jsonSerializerOptions); + writer.WriteBoolean("required_notnullable_boolean_prop", requiredClass.RequiredNotnullableBooleanProp); + + writer.WriteString("required_notnullable_datetime_prop", requiredClass.RequiredNotnullableDatetimeProp.ToString(RequiredNotnullableDatetimePropFormat)); + + var requiredNotnullableEnumIntegerRawValue = RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumInteger); + writer.WriteNumber("required_notnullable_enum_integer", requiredNotnullableEnumIntegerRawValue); + + var requiredNotnullableEnumIntegerOnlyRawValue = RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly); + writer.WriteNumber("required_notnullable_enum_integer_only", requiredNotnullableEnumIntegerOnlyRawValue); + + var requiredNotnullableEnumStringRawValue = RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClass.RequiredNotnullableEnumString); + writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue); + + var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue); + writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue); + + writer.WriteString("required_notnullable_string_prop", requiredClass.RequiredNotnullableStringProp); + + writer.WriteString("required_notnullable_uuid", requiredClass.RequiredNotnullableUuid); + + writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); + + if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) + writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); + + if (requiredClass.NotRequiredNotnullableintegerPropOption.IsSet) + writer.WriteNumber("not_required_notnullableinteger_prop", requiredClass.NotRequiredNotnullableintegerPropOption.Value.Value); + + if (requiredClass.NotRequiredNullableDatePropOption.IsSet) + if (requiredClass.NotRequiredNullableDatePropOption.Value != null) + writer.WriteString("not_required_nullable_date_prop", requiredClass.NotRequiredNullableDatePropOption.Value.Value.ToString(NotRequiredNullableDatePropFormat)); + else + writer.WriteNull("not_required_nullable_date_prop"); + + if (requiredClass.NotRequiredNullableIntegerPropOption.IsSet) + if (requiredClass.NotRequiredNullableIntegerPropOption.Value != null) + writer.WriteNumber("not_required_nullable_integer_prop", requiredClass.NotRequiredNullableIntegerPropOption.Value.Value); + else + writer.WriteNull("not_required_nullable_integer_prop"); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet) + { + writer.WritePropertyName("notrequired_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNotnullableArrayOfString, jsonSerializerOptions); + } + if (requiredClass.NotrequiredNotnullableBooleanPropOption.IsSet) + writer.WriteBoolean("notrequired_notnullable_boolean_prop", requiredClass.NotrequiredNotnullableBooleanPropOption.Value.Value); + + if (requiredClass.NotrequiredNotnullableDatetimePropOption.IsSet) + writer.WriteString("notrequired_notnullable_datetime_prop", requiredClass.NotrequiredNotnullableDatetimePropOption.Value.Value.ToString(NotrequiredNotnullableDatetimePropFormat)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOption.IsSet) + { + var notrequiredNotnullableEnumIntegerRawValue = RequiredClassRequiredNotnullableEnumIntegerValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumInteger.Value); + writer.WriteNumber("notrequired_notnullable_enum_integer", notrequiredNotnullableEnumIntegerRawValue); + } + if (requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.IsSet) + { + var notrequiredNotnullableEnumIntegerOnlyRawValue = RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnly.Value); + writer.WriteNumber("notrequired_notnullable_enum_integer_only", notrequiredNotnullableEnumIntegerOnlyRawValue); + } + if (requiredClass.NotrequiredNotnullableEnumStringOption.IsSet) + { + var notrequiredNotnullableEnumStringRawValue = RequiredClassRequiredNotnullableEnumStringValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableEnumString.Value); + writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue); + } + if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet) + { + var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value); + writer.WriteString("notrequired_notnullable_outerEnumDefaultValue", notrequiredNotnullableOuterEnumDefaultValueRawValue); + } + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet) + writer.WriteString("notrequired_notnullable_string_prop", requiredClass.NotrequiredNotnullableStringProp); + + if (requiredClass.NotrequiredNotnullableUuidOption.IsSet) + writer.WriteString("notrequired_notnullable_uuid", requiredClass.NotrequiredNotnullableUuidOption.Value.Value); + + if (requiredClass.NotrequiredNullableArrayOfStringOption.IsSet) + if (requiredClass.NotrequiredNullableArrayOfStringOption.Value != null) + { + writer.WritePropertyName("notrequired_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("notrequired_nullable_array_of_string"); + if (requiredClass.NotrequiredNullableBooleanPropOption.IsSet) + if (requiredClass.NotrequiredNullableBooleanPropOption.Value != null) + writer.WriteBoolean("notrequired_nullable_boolean_prop", requiredClass.NotrequiredNullableBooleanPropOption.Value.Value); + else + writer.WriteNull("notrequired_nullable_boolean_prop"); + + if (requiredClass.NotrequiredNullableDatetimePropOption.IsSet) + if (requiredClass.NotrequiredNullableDatetimePropOption.Value != null) + writer.WriteString("notrequired_nullable_datetime_prop", requiredClass.NotrequiredNullableDatetimePropOption.Value.Value.ToString(NotrequiredNullableDatetimePropFormat)); + else + writer.WriteNull("notrequired_nullable_datetime_prop"); + + if (requiredClass.NotrequiredNullableEnumIntegerOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOption.Value != null) + { + var notrequiredNullableEnumIntegerRawValue = RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOption.Value.Value); + writer.WriteNumber("notrequired_nullable_enum_integer", notrequiredNullableEnumIntegerRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_integer"); + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value != null) + { + var notrequiredNullableEnumIntegerOnlyRawValue = RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value.Value); + writer.WriteNumber("notrequired_nullable_enum_integer_only", notrequiredNullableEnumIntegerOnlyRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_integer_only"); + if (requiredClass.NotrequiredNullableEnumStringOption.IsSet) + if (requiredClass.NotrequiredNullableEnumStringOption.Value != null) + { + var notrequiredNullableEnumStringRawValue = RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClass.NotrequiredNullableEnumStringOption.Value.Value); + writer.WriteString("notrequired_nullable_enum_string", notrequiredNullableEnumStringRawValue); + } + else + writer.WriteNull("notrequired_nullable_enum_string"); + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.IsSet) + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value != null) + { + var notrequiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value.Value); + writer.WriteString("notrequired_nullable_outerEnumDefaultValue", notrequiredNullableOuterEnumDefaultValueRawValue); + } + else + writer.WriteNull("notrequired_nullable_outerEnumDefaultValue"); + if (requiredClass.NotrequiredNullableStringPropOption.IsSet) + if (requiredClass.NotrequiredNullableStringPropOption.Value != null) + writer.WriteString("notrequired_nullable_string_prop", requiredClass.NotrequiredNullableStringProp); + else + writer.WriteNull("notrequired_nullable_string_prop"); + + if (requiredClass.NotrequiredNullableUuidOption.IsSet) + if (requiredClass.NotrequiredNullableUuidOption.Value != null) + 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/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs new file mode 100644 index 00000000000..04988ef3ee9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_integer + /// + public enum RequiredClassRequiredNotnullableEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNotnullableEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNotnullableEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumInteger requiredClassRequiredNotnullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumInteger from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumInteger? requiredClassRequiredNotnullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs new file mode 100644 index 00000000000..775aba4f6af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_integer_only + /// + public enum RequiredClassRequiredNotnullableEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNotnullableEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNotnullableEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumIntegerOnly requiredClassRequiredNotnullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumIntegerOnly? requiredClassRequiredNotnullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs new file mode 100644 index 00000000000..5b4f29294ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNotnullableEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines RequiredClass_required_notnullable_enum_string + /// + public enum RequiredClassRequiredNotnullableEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNotnullableEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNotnullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNotnullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNotnullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNotnullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNotnullableEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNotnullableEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNotnullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNotnullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNotnullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNotnullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNotnullableEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(RequiredClassRequiredNotnullableEnumString value) + { + if (value == RequiredClassRequiredNotnullableEnumString.UPPER) + return "UPPER"; + + if (value == RequiredClassRequiredNotnullableEnumString.Lower) + return "lower"; + + if (value == RequiredClassRequiredNotnullableEnumString.Empty) + return ""; + + if (value == RequiredClassRequiredNotnullableEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredClassRequiredNotnullableEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredClassRequiredNotnullableEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredClassRequiredNotnullableEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredClassRequiredNotnullableEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNotnullableEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNotnullableEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumString requiredClassRequiredNotnullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNotnullableEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNotnullableEnumString from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNotnullableEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNotnullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNotnullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNotnullableEnumString? requiredClassRequiredNotnullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNotnullableEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs new file mode 100644 index 00000000000..365504a241b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumInteger.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_integer + /// + public enum RequiredClassRequiredNullableEnumInteger + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumInteger FromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredClassRequiredNullableEnumInteger.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNullableEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumInteger requiredClassRequiredNullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumInteger from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumInteger? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumInteger? requiredClassRequiredNullableEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs new file mode 100644 index 00000000000..4c5f2c56ba5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumIntegerOnly.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_integer_only + /// + public enum RequiredClassRequiredNullableEnumIntegerOnly + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumIntegerOnlyValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumIntegerOnly FromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumIntegerOnly: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumIntegerOnly? FromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredClassRequiredNullableEnumIntegerOnly.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(RequiredClassRequiredNullableEnumIntegerOnly value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumIntegerOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumIntegerOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumIntegerOnly requiredClassRequiredNullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumIntegerOnly.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumIntegerOnlyNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumIntegerOnly from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumIntegerOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumIntegerOnly? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumIntegerOnly? requiredClassRequiredNullableEnumIntegerOnly, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumIntegerOnly?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs new file mode 100644 index 00000000000..36bcb148131 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClassRequiredNullableEnumString.cs @@ -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 + * 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 +{ + /// + /// Defines RequiredClass_required_nullable_enum_string + /// + public enum RequiredClassRequiredNullableEnumString + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class RequiredClassRequiredNullableEnumStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumString FromString(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredClassRequiredNullableEnumString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static RequiredClassRequiredNullableEnumString? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredClassRequiredNullableEnumString.UPPER; + + if (value.Equals("lower")) + return RequiredClassRequiredNullableEnumString.Lower; + + if (value.Equals("")) + return RequiredClassRequiredNullableEnumString.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredClassRequiredNullableEnumString.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredClassRequiredNullableEnumString.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(RequiredClassRequiredNullableEnumString value) + { + if (value == RequiredClassRequiredNullableEnumString.UPPER) + return "UPPER"; + + if (value == RequiredClassRequiredNullableEnumString.Lower) + return "lower"; + + if (value == RequiredClassRequiredNullableEnumString.Empty) + return ""; + + if (value == RequiredClassRequiredNullableEnumString.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredClassRequiredNullableEnumString.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredClassRequiredNullableEnumString.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredClassRequiredNullableEnumString.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredClassRequiredNullableEnumString.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class RequiredClassRequiredNullableEnumStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the RequiredClassRequiredNullableEnumString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumString requiredClassRequiredNullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class RequiredClassRequiredNullableEnumStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a RequiredClassRequiredNullableEnumString from the Json object + /// + /// + /// + /// + /// + public override RequiredClassRequiredNullableEnumString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + RequiredClassRequiredNullableEnumString? result = rawValue == null + ? null + : RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClassRequiredNullableEnumString? requiredClassRequiredNullableEnumString, JsonSerializerOptions options) + { + writer.WriteStringValue(requiredClassRequiredNullableEnumString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 00000000000..25b3b73e9c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,246 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing reserved words + /// + public partial class Return : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lock + /// abstract + /// varReturn + /// unsafe + [JsonConstructor] + public Return(string @lock, string @abstract = default, Option varReturn = default, Option @unsafe = default) + { + Lock = @lock; + Abstract = @abstract; + VarReturnOption = varReturn; + UnsafeOption = @unsafe; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Lock + /// + [JsonPropertyName("lock")] + public string Lock { get; set; } + + /// + /// Gets or Sets Abstract + /// + [JsonPropertyName("abstract")] + public string Abstract { get; set; } + + /// + /// Used to track the state of VarReturn + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarReturnOption { get; private set; } + + /// + /// Gets or Sets VarReturn + /// + [JsonPropertyName("return")] + public int? VarReturn { get { return this.VarReturnOption; } set { this.VarReturnOption = new Option(value); } } + + /// + /// Used to track the state of Unsafe + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsafeOption { get; private set; } + + /// + /// Gets or Sets Unsafe + /// + [JsonPropertyName("unsafe")] + public string Unsafe { get { return this.UnsafeOption; } set { this.UnsafeOption = 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 Return {\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); + sb.Append(" Abstract: ").Append(Abstract).Append("\n"); + sb.Append(" VarReturn: ").Append(VarReturn).Append("\n"); + sb.Append(" Unsafe: ").Append(Unsafe).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 ReturnJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Return 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 varLock = default; + Option varAbstract = default; + Option varReturn = default; + Option varUnsafe = 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 "lock": + varLock = new Option(utf8JsonReader.GetString()); + break; + case "abstract": + varAbstract = new Option(utf8JsonReader.GetString()); + break; + case "return": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varReturn = new Option(utf8JsonReader.GetInt32()); + break; + case "unsafe": + varUnsafe = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!varLock.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varLock)); + + if (!varAbstract.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varAbstract)); + + if (varLock.IsSet && varLock.Value == null) + throw new ArgumentNullException(nameof(varLock), "Property is not nullable for class Return."); + + if (varReturn.IsSet && varReturn.Value == null) + throw new ArgumentNullException(nameof(varReturn), "Property is not nullable for class Return."); + + if (varUnsafe.IsSet && varUnsafe.Value == null) + throw new ArgumentNullException(nameof(varUnsafe), "Property is not nullable for class Return."); + + return new Return(varLock.Value, varAbstract.Value, varReturn, varUnsafe); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, varReturn, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (varReturn.UnsafeOption.IsSet && varReturn.Unsafe == null) + throw new ArgumentNullException(nameof(varReturn.Unsafe), "Property is required for class Return."); + + writer.WriteString("lock", varReturn.Lock); + + if (varReturn.Abstract != null) + writer.WriteString("abstract", varReturn.Abstract); + else + writer.WriteNull("abstract"); + + if (varReturn.VarReturnOption.IsSet) + writer.WriteNumber("return", varReturn.VarReturnOption.Value.Value); + + if (varReturn.UnsafeOption.IsSet) + writer.WriteString("unsafe", varReturn.Unsafe); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..1adc0bbf76b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,204 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(Option role = default, Option roleUuid = default) + { + RoleOption = role; + RoleUuidOption = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Role + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleOption { get; private set; } + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get { return this.RoleOption; } set { this.RoleOption = new Option(value); } } + + /// + /// Used to track the state of RoleUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleUuidOption { get; private set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid? RoleUuid { get { return this.RoleUuidOption; } set { this.RoleUuidOption = 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 RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).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 RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash 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 role = default; + Option roleUuid = 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 "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (role.IsSet && role.Value == null) + throw new ArgumentNullException(nameof(role), "Property is not nullable for class RolesReportsHash."); + + if (roleUuid.IsSet && roleUuid.Value == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is not nullable for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHash.RoleOption.IsSet) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + } + if (rolesReportsHash.RoleUuidOption.IsSet) + writer.WriteString("role_uuid", rolesReportsHash.RoleUuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..866b9fa4871 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).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 RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHashRole.NameOption.IsSet) + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 00000000000..5c960eb5474 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -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 + * 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 +{ + /// + /// ScaleneTriangle + /// + public partial class ScaleneTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public ScaleneTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 ScaleneTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ScaleneTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ScaleneTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class ScaleneTriangle."); + + return new ScaleneTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (scaleneTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(scaleneTriangle.TriangleType), "Property is required for class ScaleneTriangle."); + + writer.WriteString("shapeType", scaleneTriangle.ShapeType); + + writer.WriteString("triangleType", scaleneTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 00000000000..c651ac7d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Shape + /// + public partial class Shape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 Shape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Shape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class Shape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); + + if (quadrilateral != null) + return new Shape(quadrilateral); + + if (triangle != null) + return new Shape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); + } + + if (shape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 00000000000..37db5df6490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ShapeInterface + /// + public partial class ShapeInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + [JsonConstructor] + public ShapeInterface(string shapeType) + { + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ShapeInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeInterface 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 shapeType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeInterface.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeInterface."); + + return new ShapeInterface(shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, shapeInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("shapeType", shapeInterface.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 00000000000..1f0b2203007 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + public partial class ShapeOrNull : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 ShapeOrNull {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeOrNull 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeOrNull.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); + + if (quadrilateral != null) + return new ShapeOrNull(quadrilateral); + + if (triangle != null) + return new ShapeOrNull(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shapeOrNull.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); + } + + if (shapeOrNull.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 00000000000..ffa68d1e75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// SimpleQuadrilateral + /// + public partial class SimpleQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public SimpleQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 SimpleQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 SimpleQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SimpleQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class SimpleQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class SimpleQuadrilateral."); + + return new SimpleQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (simpleQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(simpleQuadrilateral.ShapeType), "Property is required for class SimpleQuadrilateral."); + + writer.WriteString("quadrilateralType", simpleQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", simpleQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 00000000000..8f3593c5f41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// SpecialModelName + /// + public partial class SpecialModelName : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varSpecialModelName + /// specialPropertyName + [JsonConstructor] + public SpecialModelName(Option varSpecialModelName = default, Option specialPropertyName = default) + { + VarSpecialModelNameOption = varSpecialModelName; + SpecialPropertyNameOption = specialPropertyName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarSpecialModelName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarSpecialModelNameOption { get; private set; } + + /// + /// Gets or Sets VarSpecialModelName + /// + [JsonPropertyName("_special_model.name_")] + public string VarSpecialModelName { get { return this.VarSpecialModelNameOption; } set { this.VarSpecialModelNameOption = new Option(value); } } + + /// + /// Used to track the state of SpecialPropertyName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SpecialPropertyNameOption { get; private set; } + + /// + /// Gets or Sets SpecialPropertyName + /// + [JsonPropertyName("$special[property.name]")] + public long? SpecialPropertyName { get { return this.SpecialPropertyNameOption; } set { this.SpecialPropertyNameOption = 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 SpecialModelName {\n"); + sb.Append(" VarSpecialModelName: ").Append(VarSpecialModelName).Append("\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).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 SpecialModelNameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SpecialModelName 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 varSpecialModelName = default; + Option specialPropertyName = 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 "_special_model.name_": + varSpecialModelName = new Option(utf8JsonReader.GetString()); + break; + case "$special[property.name]": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (varSpecialModelName.IsSet && varSpecialModelName.Value == null) + throw new ArgumentNullException(nameof(varSpecialModelName), "Property is not nullable for class SpecialModelName."); + + if (specialPropertyName.IsSet && specialPropertyName.Value == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is not nullable for class SpecialModelName."); + + return new SpecialModelName(varSpecialModelName, specialPropertyName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, specialModelName, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (specialModelName.VarSpecialModelNameOption.IsSet) + writer.WriteString("_special_model.name_", specialModelName.VarSpecialModelName); + + if (specialModelName.SpecialPropertyNameOption.IsSet) + writer.WriteNumber("$special[property.name]", specialModelName.SpecialPropertyNameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 00000000000..e1678abe491 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Tag + /// + public partial class Tag : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name + [JsonConstructor] + public Tag(Option id = default, Option name = default) + { + IdOption = id; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 TagJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Tag 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Tag."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Tag."); + + return new Tag(id, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, tag, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (tag.IdOption.IsSet) + writer.WriteNumber("id", tag.IdOption.Value.Value); + + if (tag.NameOption.IsSet) + writer.WriteString("name", tag.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..f4fca096217 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(Option value = default) + { + ValueOption = value; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = 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 TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).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 TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList 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 value = 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 "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class TestCollectionEndingWithWordList."); + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordList.ValueOption.IsSet) + writer.WriteString("value", testCollectionEndingWithWordList.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..6c324e6ef4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -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 + * 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 +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(Option> testCollectionEndingWithWordList = default) + { + TestCollectionEndingWithWordListOption = testCollectionEndingWithWordList; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of TestCollectionEndingWithWordList + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TestCollectionEndingWithWordListOption { get; private set; } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get { return this.TestCollectionEndingWithWordListOption; } set { this.TestCollectionEndingWithWordListOption = 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 TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).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 TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject 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> testCollectionEndingWithWordList = 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 "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (testCollectionEndingWithWordList.IsSet && testCollectionEndingWithWordList.Value == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is not nullable for class TestCollectionEndingWithWordListObject."); + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet) + { + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs new file mode 100644 index 00000000000..ccb446b0250 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_header_string_parameter + /// + public enum TestEnumParametersEnumHeaderStringParameter + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumHeaderStringParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumHeaderStringParameter FromString(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersEnumHeaderStringParameter.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersEnumHeaderStringParameter.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersEnumHeaderStringParameter.Xyz; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumHeaderStringParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumHeaderStringParameter? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersEnumHeaderStringParameter.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersEnumHeaderStringParameter.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersEnumHeaderStringParameter.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersEnumHeaderStringParameter value) + { + if (value == TestEnumParametersEnumHeaderStringParameter.Abc) + return "_abc"; + + if (value == TestEnumParametersEnumHeaderStringParameter.Efg) + return "-efg"; + + if (value == TestEnumParametersEnumHeaderStringParameter.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumHeaderStringParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumHeaderStringParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumHeaderStringParameter? result = rawValue == null + ? null + : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumHeaderStringParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumHeaderStringParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumHeaderStringParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumHeaderStringParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumHeaderStringParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumHeaderStringParameter? result = rawValue == null + ? null + : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter? testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumHeaderStringParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs new file mode 100644 index 00000000000..ec14b39944d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_query_double_parameter + /// + public enum TestEnumParametersEnumQueryDoubleParameter + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumQueryDoubleParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryDoubleParameter FromString(string value) + { + if (value.Equals("1.1")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_MINUS_1_DOT_2; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumQueryDoubleParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryDoubleParameter? FromStringOrDefault(string value) + { + if (value.Equals("1.1")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return TestEnumParametersEnumQueryDoubleParameter.NUMBER_MINUS_1_DOT_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static double ToJsonValue(TestEnumParametersEnumQueryDoubleParameter value) + { + return (double) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumQueryDoubleParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryDoubleParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryDoubleParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumQueryDoubleParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryDoubleParameter testEnumParametersEnumQueryDoubleParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryDoubleParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumQueryDoubleParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumQueryDoubleParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryDoubleParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryDoubleParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryDoubleParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryDoubleParameter? testEnumParametersEnumQueryDoubleParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryDoubleParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs new file mode 100644 index 00000000000..33ff2ce2cc2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs @@ -0,0 +1,168 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_enum_query_integer_parameter + /// + public enum TestEnumParametersEnumQueryIntegerParameter + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersEnumQueryIntegerParameterValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryIntegerParameter FromString(string value) + { + if (value.Equals((1).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_1; + + if (value.Equals((-2).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumQueryIntegerParameter: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersEnumQueryIntegerParameter? FromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_1; + + if (value.Equals((-2).ToString())) + return TestEnumParametersEnumQueryIntegerParameter.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(TestEnumParametersEnumQueryIntegerParameter value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersEnumQueryIntegerParameterJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryIntegerParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryIntegerParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryIntegerParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersEnumQueryIntegerParameter to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryIntegerParameter testEnumParametersEnumQueryIntegerParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryIntegerParameter.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersEnumQueryIntegerParameterNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersEnumQueryIntegerParameter from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersEnumQueryIntegerParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersEnumQueryIntegerParameter? result = rawValue == null + ? null + : TestEnumParametersEnumQueryIntegerParameterValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumQueryIntegerParameter? testEnumParametersEnumQueryIntegerParameter, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersEnumQueryIntegerParameter?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs new file mode 100644 index 00000000000..d86b48d4a9b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Form parameter enum test (string) + /// + /// Form parameter enum test (string) + public enum TestEnumParametersRequestEnumFormString + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersRequestEnumFormStringValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormString FromString(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersRequestEnumFormString.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersRequestEnumFormString.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersRequestEnumFormString.Xyz; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersRequestEnumFormString: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormString? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return TestEnumParametersRequestEnumFormString.Abc; + + if (value.Equals("-efg")) + return TestEnumParametersRequestEnumFormString.Efg; + + if (value.Equals("(xyz)")) + return TestEnumParametersRequestEnumFormString.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersRequestEnumFormString value) + { + if (value == TestEnumParametersRequestEnumFormString.Abc) + return "_abc"; + + if (value == TestEnumParametersRequestEnumFormString.Efg) + return "-efg"; + + if (value == TestEnumParametersRequestEnumFormString.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersRequestEnumFormStringJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormString Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormString? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersRequestEnumFormString to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormString testEnumParametersRequestEnumFormString, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormString.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersRequestEnumFormStringNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersRequestEnumFormString from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormString? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormString? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormString? testEnumParametersRequestEnumFormString, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormString?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs new file mode 100644 index 00000000000..4f1c9c53c60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormStringArrayInner.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines testEnumParameters_request_enum_form_string_array_inner + /// + public enum TestEnumParametersRequestEnumFormStringArrayInner + { + /// + /// Enum GreaterThan for value: > + /// + GreaterThan = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class TestEnumParametersRequestEnumFormStringArrayInnerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormStringArrayInner FromString(string value) + { + if (value.Equals(">")) + return TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan; + + if (value.Equals("$")) + return TestEnumParametersRequestEnumFormStringArrayInner.Dollar; + + throw new NotImplementedException($"Could not convert value to type TestEnumParametersRequestEnumFormStringArrayInner: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static TestEnumParametersRequestEnumFormStringArrayInner? FromStringOrDefault(string value) + { + if (value.Equals(">")) + return TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan; + + if (value.Equals("$")) + return TestEnumParametersRequestEnumFormStringArrayInner.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(TestEnumParametersRequestEnumFormStringArrayInner value) + { + if (value == TestEnumParametersRequestEnumFormStringArrayInner.GreaterThan) + return ">"; + + if (value == TestEnumParametersRequestEnumFormStringArrayInner.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormStringArrayInner Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormStringArrayInner? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the TestEnumParametersRequestEnumFormStringArrayInner to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormStringArrayInner testEnumParametersRequestEnumFormStringArrayInner, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormStringArrayInner.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class TestEnumParametersRequestEnumFormStringArrayInnerNullableJsonConverter : JsonConverter + { + /// + /// Returns a TestEnumParametersRequestEnumFormStringArrayInner from the Json object + /// + /// + /// + /// + /// + public override TestEnumParametersRequestEnumFormStringArrayInner? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + TestEnumParametersRequestEnumFormStringArrayInner? result = rawValue == null + ? null + : TestEnumParametersRequestEnumFormStringArrayInnerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestEnumParametersRequestEnumFormStringArrayInner? testEnumParametersRequestEnumFormStringArrayInner, JsonSerializerOptions options) + { + writer.WriteStringValue(testEnumParametersRequestEnumFormStringArrayInner?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..3bf95d67c57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(Option someProperty = default) + { + SomePropertyOption = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SomeProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomePropertyOption { get; private set; } + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get { return this.SomePropertyOption; } set { this.SomePropertyOption = 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 TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).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 TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest 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 someProperty = 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 "someProperty": + someProperty = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (someProperty.IsSet && someProperty.Value == null) + throw new ArgumentNullException(nameof(someProperty), "Property is not nullable for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet) + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 00000000000..cf22051519a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Triangle + /// + public partial class Triangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(EquilateralTriangle equilateralTriangle) + { + EquilateralTriangle = equilateralTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(IsoscelesTriangle isoscelesTriangle) + { + IsoscelesTriangle = isoscelesTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(ScaleneTriangle scaleneTriangle) + { + ScaleneTriangle = scaleneTriangle; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EquilateralTriangle + /// + public EquilateralTriangle EquilateralTriangle { get; set; } + + /// + /// Gets or Sets IsoscelesTriangle + /// + public IsoscelesTriangle IsoscelesTriangle { get; set; } + + /// + /// Gets or Sets ScaleneTriangle + /// + public ScaleneTriangle ScaleneTriangle { get; set; } + + /// + /// 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 Triangle {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Triangle 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 triangleType = default; + + EquilateralTriangle equilateralTriangle = null; + IsoscelesTriangle isoscelesTriangle = null; + ScaleneTriangle scaleneTriangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("triangleType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("EquilateralTriangle")) + { + Utf8JsonReader utf8JsonReaderEquilateralTriangle = utf8JsonReader; + equilateralTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderEquilateralTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("IsoscelesTriangle")) + { + Utf8JsonReader utf8JsonReaderIsoscelesTriangle = utf8JsonReader; + isoscelesTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderIsoscelesTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("ScaleneTriangle")) + { + Utf8JsonReader utf8JsonReaderScaleneTriangle = utf8JsonReader; + scaleneTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderScaleneTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class Triangle.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); + + if (equilateralTriangle != null) + return new Triangle(equilateralTriangle); + + if (isoscelesTriangle != null) + return new Triangle(isoscelesTriangle); + + if (scaleneTriangle != null) + return new Triangle(scaleneTriangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (triangle.EquilateralTriangle != null) + { + EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); + } + + if (triangle.IsoscelesTriangle != null) + { + IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + } + + if (triangle.ScaleneTriangle != null) + { + ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); + } + + WriteProperties(writer, triangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 00000000000..0f13b0e7745 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TriangleInterface + /// + public partial class TriangleInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// triangleType + [JsonConstructor] + public TriangleInterface(string triangleType) + { + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 TriangleInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TriangleInterface 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 triangleType = 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class TriangleInterface.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class TriangleInterface."); + + return new TriangleInterface(triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, triangleInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("triangleType", triangleInterface.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 00000000000..21eff6d47a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,497 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// User + /// + public partial class User : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// email + /// firstName + /// id + /// lastName + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// password + /// phone + /// User Status + /// username + [JsonConstructor] + public User(Option anyTypeProp = default, Option anyTypePropNullable = default, Option email = default, Option firstName = default, Option id = default, Option lastName = default, Option objectWithNoDeclaredProps = default, Option objectWithNoDeclaredPropsNullable = default, Option password = default, Option phone = default, Option userStatus = default, Option username = default) + { + AnyTypePropOption = anyTypeProp; + AnyTypePropNullableOption = anyTypePropNullable; + EmailOption = email; + FirstNameOption = firstName; + IdOption = id; + LastNameOption = lastName; + ObjectWithNoDeclaredPropsOption = objectWithNoDeclaredProps; + ObjectWithNoDeclaredPropsNullableOption = objectWithNoDeclaredPropsNullable; + PasswordOption = password; + PhoneOption = phone; + UserStatusOption = userStatus; + UsernameOption = username; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AnyTypeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [JsonPropertyName("anyTypeProp")] + public Object AnyTypeProp { get { return this.AnyTypePropOption; } set { this.AnyTypePropOption = new Option(value); } } + + /// + /// Used to track the state of AnyTypePropNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropNullableOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [JsonPropertyName("anyTypePropNullable")] + public Object AnyTypePropNullable { get { return this.AnyTypePropNullableOption; } set { this.AnyTypePropNullableOption = new Option(value); } } + + /// + /// Used to track the state of Email + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailOption { get; private set; } + + /// + /// Gets or Sets Email + /// + [JsonPropertyName("email")] + public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredProps + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsOption { get; private set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [JsonPropertyName("objectWithNoDeclaredProps")] + public Object ObjectWithNoDeclaredProps { get { return this.ObjectWithNoDeclaredPropsOption; } set { this.ObjectWithNoDeclaredPropsOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredPropsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsNullableOption { get; private set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [JsonPropertyName("objectWithNoDeclaredPropsNullable")] + public Object ObjectWithNoDeclaredPropsNullable { get { return this.ObjectWithNoDeclaredPropsNullableOption; } set { this.ObjectWithNoDeclaredPropsNullableOption = new Option(value); } } + + /// + /// Used to track the state of Password + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordOption { get; private set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get { return this.PasswordOption; } set { this.PasswordOption = new Option(value); } } + + /// + /// Used to track the state of Phone + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneOption { get; private set; } + + /// + /// Gets or Sets Phone + /// + [JsonPropertyName("phone")] + public string Phone { get { return this.PhoneOption; } set { this.PhoneOption = new Option(value); } } + + /// + /// Used to track the state of UserStatus + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UserStatusOption { get; private set; } + + /// + /// User Status + /// + /// User Status + [JsonPropertyName("userStatus")] + public int? UserStatus { get { return this.UserStatusOption; } set { this.UserStatusOption = new Option(value); } } + + /// + /// Used to track the state of Username + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UsernameOption { get; private set; } + + /// + /// Gets or Sets Username + /// + [JsonPropertyName("username")] + public string Username { get { return this.UsernameOption; } set { this.UsernameOption = 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 User {\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" Username: ").Append(Username).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 UserJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override User 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 anyTypeProp = default; + Option anyTypePropNullable = default; + Option email = default; + Option firstName = default; + Option id = default; + Option lastName = default; + Option objectWithNoDeclaredProps = default; + Option objectWithNoDeclaredPropsNullable = default; + Option password = default; + Option phone = default; + Option userStatus = default; + Option username = 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 "anyTypeProp": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "anyTypePropNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "email": + email = new Option(utf8JsonReader.GetString()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "objectWithNoDeclaredProps": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "objectWithNoDeclaredPropsNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "phone": + phone = new Option(utf8JsonReader.GetString()); + break; + case "userStatus": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = new Option(utf8JsonReader.GetInt32()); + break; + case "username": + username = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (email.IsSet && email.Value == null) + throw new ArgumentNullException(nameof(email), "Property is not nullable for class User."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class User."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class User."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class User."); + + if (objectWithNoDeclaredProps.IsSet && objectWithNoDeclaredProps.Value == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is not nullable for class User."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class User."); + + if (phone.IsSet && phone.Value == null) + throw new ArgumentNullException(nameof(phone), "Property is not nullable for class User."); + + if (userStatus.IsSet && userStatus.Value == null) + throw new ArgumentNullException(nameof(userStatus), "Property is not nullable for class User."); + + if (username.IsSet && username.Value == null) + throw new ArgumentNullException(nameof(username), "Property is not nullable for class User."); + + return new User(anyTypeProp, anyTypePropNullable, email, firstName, id, lastName, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, password, phone, userStatus, username); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, user, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (user.FirstNameOption.IsSet && user.FirstName == null) + throw new ArgumentNullException(nameof(user.FirstName), "Property is required for class User."); + + if (user.LastNameOption.IsSet && user.LastName == null) + throw new ArgumentNullException(nameof(user.LastName), "Property is required for class User."); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet && user.ObjectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(user.ObjectWithNoDeclaredProps), "Property is required for class User."); + + if (user.PasswordOption.IsSet && user.Password == null) + throw new ArgumentNullException(nameof(user.Password), "Property is required for class User."); + + if (user.PhoneOption.IsSet && user.Phone == null) + throw new ArgumentNullException(nameof(user.Phone), "Property is required for class User."); + + if (user.UsernameOption.IsSet && user.Username == null) + throw new ArgumentNullException(nameof(user.Username), "Property is required for class User."); + + if (user.AnyTypePropOption.IsSet) + if (user.AnyTypePropOption.Value != null) + { + writer.WritePropertyName("anyTypeProp"); + JsonSerializer.Serialize(writer, user.AnyTypeProp, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypeProp"); + if (user.AnyTypePropNullableOption.IsSet) + if (user.AnyTypePropNullableOption.Value != null) + { + writer.WritePropertyName("anyTypePropNullable"); + JsonSerializer.Serialize(writer, user.AnyTypePropNullable, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypePropNullable"); + if (user.EmailOption.IsSet) + writer.WriteString("email", user.Email); + + if (user.FirstNameOption.IsSet) + writer.WriteString("firstName", user.FirstName); + + if (user.IdOption.IsSet) + writer.WriteNumber("id", user.IdOption.Value.Value); + + if (user.LastNameOption.IsSet) + writer.WriteString("lastName", user.LastName); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet) + { + writer.WritePropertyName("objectWithNoDeclaredProps"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, jsonSerializerOptions); + } + if (user.ObjectWithNoDeclaredPropsNullableOption.IsSet) + if (user.ObjectWithNoDeclaredPropsNullableOption.Value != null) + { + writer.WritePropertyName("objectWithNoDeclaredPropsNullable"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, jsonSerializerOptions); + } + else + writer.WriteNull("objectWithNoDeclaredPropsNullable"); + if (user.PasswordOption.IsSet) + writer.WriteString("password", user.Password); + + if (user.PhoneOption.IsSet) + writer.WriteString("phone", user.Phone); + + if (user.UserStatusOption.IsSet) + writer.WriteNumber("userStatus", user.UserStatusOption.Value.Value); + + if (user.UsernameOption.IsSet) + writer.WriteString("username", user.Username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 00000000000..6d1afa8b592 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Whale + /// + public partial class Whale : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// hasBaleen + /// hasTeeth + [JsonConstructor] + public Whale(string className, Option hasBaleen = default, Option hasTeeth = default) + { + ClassName = className; + HasBaleenOption = hasBaleen; + HasTeethOption = hasTeeth; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// Used to track the state of HasBaleen + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasBaleenOption { get; private set; } + + /// + /// Gets or Sets HasBaleen + /// + [JsonPropertyName("hasBaleen")] + public bool? HasBaleen { get { return this.HasBaleenOption; } set { this.HasBaleenOption = new Option(value); } } + + /// + /// Used to track the state of HasTeeth + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasTeethOption { get; private set; } + + /// + /// Gets or Sets HasTeeth + /// + [JsonPropertyName("hasTeeth")] + public bool? HasTeeth { get { return this.HasTeethOption; } set { this.HasTeethOption = 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 Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).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 WhaleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Whale 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 className = default; + Option hasBaleen = default; + Option hasTeeth = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "hasBaleen": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = new Option(utf8JsonReader.GetBoolean()); + break; + case "hasTeeth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Whale.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Whale."); + + if (hasBaleen.IsSet && hasBaleen.Value == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is not nullable for class Whale."); + + if (hasTeeth.IsSet && hasTeeth.Value == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is not nullable for class Whale."); + + return new Whale(className.Value, hasBaleen, hasTeeth); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, whale, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", whale.ClassName); + + if (whale.HasBaleenOption.IsSet) + writer.WriteBoolean("hasBaleen", whale.HasBaleenOption.Value.Value); + + if (whale.HasTeethOption.IsSet) + writer.WriteBoolean("hasTeeth", whale.HasTeethOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 00000000000..65c93ce8316 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs @@ -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 + * 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 +{ + /// + /// Zebra + /// + public partial class Zebra : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// type + [JsonConstructor] + public Zebra(string className, Option type = default) + { + ClassName = className; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// Gets or Sets Type + /// + [JsonPropertyName("type")] + public ZebraType? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 Zebra {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ZebraJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Zebra 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 className = default; + Option type = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(ZebraTypeValueConverter.FromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Zebra.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Zebra."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Zebra."); + + return new Zebra(className.Value, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zebra, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", zebra.ClassName); + + if (zebra.TypeOption.IsSet) + { + var typeRawValue = ZebraTypeValueConverter.ToJsonValue(zebra.Type.Value); + writer.WriteString("type", typeRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs new file mode 100644 index 00000000000..4a54f2a265a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZebraType.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines zebra_type + /// + public enum ZebraType + { + /// + /// Enum Plains for value: plains + /// + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + Grevys = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class ZebraTypeValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZebraType FromString(string value) + { + if (value.Equals("plains")) + return ZebraType.Plains; + + if (value.Equals("mountain")) + return ZebraType.Mountain; + + if (value.Equals("grevys")) + return ZebraType.Grevys; + + throw new NotImplementedException($"Could not convert value to type ZebraType: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZebraType? FromStringOrDefault(string value) + { + if (value.Equals("plains")) + return ZebraType.Plains; + + if (value.Equals("mountain")) + return ZebraType.Mountain; + + if (value.Equals("grevys")) + return ZebraType.Grevys; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZebraType value) + { + if (value == ZebraType.Plains) + return "plains"; + + if (value == ZebraType.Mountain) + return "mountain"; + + if (value == ZebraType.Grevys) + return "grevys"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZebraTypeJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZebraType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZebraType? result = rawValue == null + ? null + : ZebraTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZebraType to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZebraType zebraType, JsonSerializerOptions options) + { + writer.WriteStringValue(zebraType.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZebraTypeNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZebraType from the Json object + /// + /// + /// + /// + /// + public override ZebraType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZebraType? result = rawValue == null + ? null + : ZebraTypeValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZebraType? zebraType, JsonSerializerOptions options) + { + writer.WriteStringValue(zebraType?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs new file mode 100644 index 00000000000..34a044fb8b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnum value) + { + if (value == ZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum? zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs new file mode 100644 index 00000000000..9596f0b9bff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -0,0 +1,176 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ZeroBasedEnumClass + /// + public partial class ZeroBasedEnumClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// zeroBasedEnum + [JsonConstructor] + public ZeroBasedEnumClass(Option zeroBasedEnum = default) + { + ZeroBasedEnumOption = zeroBasedEnum; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ZeroBasedEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ZeroBasedEnumOption { get; private set; } + + /// + /// Gets or Sets ZeroBasedEnum + /// + [JsonPropertyName("ZeroBasedEnum")] + public ZeroBasedEnumClassZeroBasedEnum? ZeroBasedEnum { get { return this.ZeroBasedEnumOption; } set { this.ZeroBasedEnumOption = 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 ZeroBasedEnumClass {\n"); + sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 ZeroBasedEnumClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ZeroBasedEnumClass 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 zeroBasedEnum = 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 "ZeroBasedEnum": + string zeroBasedEnumRawValue = utf8JsonReader.GetString(); + if (zeroBasedEnumRawValue != null) + zeroBasedEnum = new Option(ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(zeroBasedEnumRawValue)); + break; + default: + break; + } + } + } + + if (zeroBasedEnum.IsSet && zeroBasedEnum.Value == null) + throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is not nullable for class ZeroBasedEnumClass."); + + return new ZeroBasedEnumClass(zeroBasedEnum); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + if (zeroBasedEnumClass.ZeroBasedEnumOption.IsSet) + { + var zeroBasedEnumRawValue = ZeroBasedEnumClassZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnumClass.ZeroBasedEnum.Value); + writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs new file mode 100644 index 00000000000..2b062a550ab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClassZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnumClass_ZeroBasedEnum + /// + public enum ZeroBasedEnumClassZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumClassZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnumClassZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumClassZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumClassZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumClassZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnumClassZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumClassZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumClassZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnumClassZeroBasedEnum value) + { + if (value == ZeroBasedEnumClassZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnumClassZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumClassZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnumClassZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnumClassZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnumClassZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClassZeroBasedEnum zeroBasedEnumClassZeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnumClassZeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumClassZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnumClassZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnumClassZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnumClassZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumClassZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClassZeroBasedEnum? zeroBasedEnumClassZeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnumClassZeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..73a85280057 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..003f9f4268e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/README.md @@ -0,0 +1,223 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo"); + ModelClient model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## 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**: Bearer Authentication + + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.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/csharp/generichost/net4.8/OneOf/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator/FILES new file mode 100644 index 00000000000..59cc1ea25a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/Apple.md +docs/models/Banana.md +docs/models/Fruit.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/OneOf/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/README.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/OneOf/api/openapi.yaml new file mode 100644 index 00000000000..06fd58be740 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/api/openapi.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + example: + color: color + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + title: fruit + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/OneOf/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..bccf3af9c51 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**RootGet**](DefaultApi.md#rootget) | **GET** / | | + + +# **RootGet** +> Fruit RootGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RootGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + Fruit result = apiInstance.RootGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RootGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RootGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.RootGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RootGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | desc | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Apple.md new file mode 100644 index 00000000000..95f57583439 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Apple.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [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/net4.8/OneOf/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Banana.md new file mode 100644 index 00000000000..c9aea6fb56c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **decimal** | | [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/net4.8/OneOf/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/OneOf/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..5a82cd6c99d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..b7bcc281037 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test RootGet + /// + [Fact (Skip = "not implemented")] + public async Task RootGetAsyncTest() + { + var response = await _instance.RootGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..c9833ec353e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..483628b6a4a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5befec8d7e5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'Count' + /// + [Fact] + public void CountTest() + { + // TODO unit test for the property 'Count' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..a6607ae5d56 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,65 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..8ea8bdbe84e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IRootGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnRootGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRootGet; + + internal void ExecuteOnRootGet(DefaultApi.RootGetApiResponse apiResponse) + { + OnRootGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRootGet(Exception exception) + { + OnErrorRootGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRootGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRootGet(ref bool suppressDefaultLog, IRootGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RootGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RootGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RootGetApiResponse apiResponseLocalVar = new RootGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRootGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRootGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRootGetDefaultImplementation(e, "/", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRootGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RootGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRootGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RootGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Fruit Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Fruit result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..1d43e69742f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..de1f5521df6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..91e5f4c09c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,329 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..68e90f4ecbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..3cb4b6ce51e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..a90199eebd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,131 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..55d56f3f204 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..8e7bed46e9c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..3924246ab7c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..df405f3894d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..e1dec11976d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..2e27cceb8d1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..b8a2dfc1dc6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,174 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// kind + [JsonConstructor] + public Apple(Option kind = default) + { + KindOption = kind; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Kind + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option KindOption { get; private set; } + + /// + /// Gets or Sets Kind + /// + [JsonPropertyName("kind")] + public string Kind { get { return this.KindOption; } set { this.KindOption = 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 Apple {\n"); + sb.Append(" Kind: ").Append(Kind).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 AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 kind = 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 "kind": + kind = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (kind.IsSet && kind.Value == null) + throw new ArgumentNullException(nameof(kind), "Property is not nullable for class Apple."); + + return new Apple(kind); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.KindOption.IsSet) + writer.WriteString("kind", apple.Kind); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..e7289665b3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,172 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// count + [JsonConstructor] + public Banana(Option count = default) + { + CountOption = count; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Count + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountOption { get; private set; } + + /// + /// Gets or Sets Count + /// + [JsonPropertyName("count")] + public decimal? Count { get { return this.CountOption; } set { this.CountOption = 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 Banana {\n"); + sb.Append(" Count: ").Append(Count).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 count = 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 "count": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (count.IsSet && count.Value == null) + throw new ArgumentNullException(nameof(count), "Property is not nullable for class Banana."); + + return new Banana(count); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..cbfa563798a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,225 @@ +// +/* + * fruity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..73a85280057 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..37b7b4a6278 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/README.md @@ -0,0 +1,177 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + RootGetApiResponse apiResponse = await api.RootGetAsync("todo"); + Fruit model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: fruity +- appVersion: 0.0.1 +- appDescription: No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.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/csharp/generichost/net4.8/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator/FILES new file mode 100644 index 00000000000..0bf16fb19b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator/FILES @@ -0,0 +1,244 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/AnotherFakeApi.md +docs/apis/DefaultApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md +docs/models/AdditionalPropertiesClass.md +docs/models/Animal.md +docs/models/ApiResponse.md +docs/models/Apple.md +docs/models/AppleReq.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/Banana.md +docs/models/BananaReq.md +docs/models/BasquePig.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/Category.md +docs/models/ChildCat.md +docs/models/ClassModel.md +docs/models/ComplexQuadrilateral.md +docs/models/DanishPig.md +docs/models/DateOnlyClass.md +docs/models/DeprecatedObject.md +docs/models/Dog.md +docs/models/Drawing.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/EquilateralTriangle.md +docs/models/File.md +docs/models/FileSchemaTestClass.md +docs/models/Foo.md +docs/models/FooGetDefaultResponse.md +docs/models/FormatTest.md +docs/models/Fruit.md +docs/models/FruitReq.md +docs/models/GmFruit.md +docs/models/GrandparentAnimal.md +docs/models/HasOnlyReadOnly.md +docs/models/HealthCheckResult.md +docs/models/IsoscelesTriangle.md +docs/models/List.md +docs/models/LiteralStringClass.md +docs/models/Mammal.md +docs/models/MapTest.md +docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md +docs/models/Model200Response.md +docs/models/ModelClient.md +docs/models/Name.md +docs/models/NotificationtestGetElementsV1ResponseMPayload.md +docs/models/NullableClass.md +docs/models/NullableGuidClass.md +docs/models/NullableShape.md +docs/models/NumberOnly.md +docs/models/ObjectWithDeprecatedFields.md +docs/models/OneOfString.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/OuterEnumDefaultValue.md +docs/models/OuterEnumInteger.md +docs/models/OuterEnumIntegerDefaultValue.md +docs/models/OuterEnumTest.md +docs/models/ParentPet.md +docs/models/Pet.md +docs/models/Pig.md +docs/models/PolymorphicProperty.md +docs/models/Quadrilateral.md +docs/models/QuadrilateralInterface.md +docs/models/ReadOnlyFirst.md +docs/models/RequiredClass.md +docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md +docs/models/ScaleneTriangle.md +docs/models/Shape.md +docs/models/ShapeInterface.md +docs/models/ShapeOrNull.md +docs/models/SimpleQuadrilateral.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md +docs/models/TestInlineFreeformAdditionalPropertiesRequest.md +docs/models/Triangle.md +docs/models/TriangleInterface.md +docs/models/User.md +docs/models/Whale.md +docs/models/Zebra.md +docs/models/ZeroBasedEnum.md +docs/models/ZeroBasedEnumClass.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiKeyToken.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/BasicToken.cs +src/Org.OpenAPITools/Client/BearerToken.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningToken.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/OAuthToken.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/OneOfString.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumTest.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/RequiredClass.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/RolesReportsHash.cs +src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Model/ZeroBasedEnum.cs +src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/Petstore/Org.OpenAPITools.sln new file mode 100644 index 00000000000..5b15451c9dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/README.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml new file mode 100644 index 00000000000..f772773afef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml @@ -0,0 +1,3066 @@ +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_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /roles/report: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/RolesReport' + type: array + description: returns report + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - 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 + 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: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - 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: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - 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: [] + - api_key_query: [] + summary: Find pet by ID + tags: + - 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: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - 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 + /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 + /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 + /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 + 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 + /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 + /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 + /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 + /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: + 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 + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - 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 + 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 + "598": + description: Not a real HTTP status code + "599": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Not a real HTTP status code with a return object + summary: Get user by user name + tags: + - 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 + /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#$%^ + /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 + 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 + 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 + 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 + 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 + /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 + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + 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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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 + /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? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - 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: requiredNotNullable + required: true + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: requiredNullable + required: true + schema: + nullable: true + type: string + style: form + - explode: true + in: query + name: notRequiredNotNullable + required: false + schema: + nullable: false + type: string + style: form + - explode: true + in: query + name: notRequiredNullable + required: false + schema: + nullable: true + type: string + style: form + responses: + "200": + description: Success + tags: + - 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' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - 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 + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK + /test: + get: + operationId: Test + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload' + description: Successful response + summary: Retrieve an existing Notificationtest's Elements +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + 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: + RolesReport: + description: Roles report + items: + $ref: '#/components/schemas/RolesReportsHash' + type: array + RolesReportsHash: + description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + properties: + role_uuid: + format: uuid + type: string + role: + $ref: '#/components/schemas/RolesReportsHash_role' + type: object + 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: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + 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 + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + 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 + 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 + lock: + type: string + abstract: + nullable: true + type: string + unsafe: + type: string + required: + - abstract + - lock + 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' + - $ref: '#/components/schemas/Address' + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + 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 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + 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: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_backslash: + description: None + pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ + /([0-9]|[1-2][0-9]|3[0-2]))$" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Outer_Enum_Test: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + 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 + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + 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 + 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 + x-cls-compliant: true + x-com-visible: true + 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 + 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 + 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 + _special_model.name_: + type: string + 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 + RequiredClass: + properties: + required_nullable_integer_prop: + nullable: true + type: integer + required_notnullableinteger_prop: + nullable: false + type: integer + not_required_nullable_integer_prop: + nullable: true + type: integer + not_required_notnullableinteger_prop: + nullable: false + type: integer + required_nullable_string_prop: + nullable: true + type: string + required_notnullable_string_prop: + nullable: false + type: string + notrequired_nullable_string_prop: + nullable: true + type: string + notrequired_notnullable_string_prop: + nullable: false + type: string + required_nullable_boolean_prop: + nullable: true + type: boolean + required_notnullable_boolean_prop: + nullable: false + type: boolean + notrequired_nullable_boolean_prop: + nullable: true + type: boolean + notrequired_notnullable_boolean_prop: + nullable: false + type: boolean + required_nullable_date_prop: + format: date + nullable: true + type: string + required_not_nullable_date_prop: + format: date + nullable: false + type: string + not_required_nullable_date_prop: + format: date + nullable: true + type: string + not_required_notnullable_date_prop: + format: date + nullable: false + type: string + required_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_nullable_datetime_prop: + format: date-time + nullable: true + type: string + notrequired_notnullable_datetime_prop: + format: date-time + nullable: false + type: string + required_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + required_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + notrequired_nullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: true + type: integer + notrequired_notnullable_enum_integer: + enum: + - 1 + - -1 + format: int32 + nullable: false + type: integer + required_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + required_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + notrequired_nullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: true + type: integer + notrequired_notnullable_enum_integer_only: + enum: + - 2 + - -2 + nullable: false + type: integer + required_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_nullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: true + type: string + notrequired_notnullable_enum_string: + enum: + - UPPER + - lower + - "" + - "Value\twith tab" + - Value with " quote + - Value with escaped \" quote + - |- + Duplicate + value + - "Duplicate\r\nvalue" + nullable: false + type: string + required_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + required_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + notrequired_nullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: true + notrequired_notnullable_outerEnumDefaultValue: + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + nullable: false + required_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + required_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + notrequired_nullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + notrequired_notnullable_uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: false + type: string + required_nullable_array_of_string: + items: + type: string + nullable: true + type: array + required_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + notrequired_nullable_array_of_string: + items: + type: string + nullable: true + type: array + notrequired_notnullable_array_of_string: + items: + type: string + nullable: false + type: array + required: + - required_not_nullable_date_prop + - required_notnullable_array_of_string + - required_notnullable_boolean_prop + - required_notnullable_datetime_prop + - required_notnullable_enum_integer + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_notnullable_outerEnumDefaultValue + - required_notnullable_string_prop + - required_notnullable_uuid + - required_notnullableinteger_prop + - required_nullable_array_of_string + - required_nullable_boolean_prop + - required_nullable_date_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_nullable_enum_integer_only + - required_nullable_enum_string + - required_nullable_integer_prop + - required_nullable_outerEnumDefaultValue + - required_nullable_string_prop + - required_nullable_uuid + 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 + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + color_code: + pattern: "^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + required: + - pet_type + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + 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 + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + OneOfString: + oneOf: + - pattern: ^a + type: string + - pattern: ^b + type: string + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + ZeroBasedEnumClass: + properties: + ZeroBasedEnum: + enum: + - unknown + - notUnknown + type: string + type: object + Custom-Variableobject-Response: + additionalProperties: true + description: A Variable object without predefined property names + type: object + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + example: + a_objVariableobject: + - null + - null + pkiNotificationtestID: 0 + properties: + pkiNotificationtestID: + type: integer + a_objVariableobject: + items: + $ref: '#/components/schemas/Custom-Variableobject-Response' + type: array + required: + - a_objVariableobject + - pkiNotificationtestID + type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string + 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: + 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: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + 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 + 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 + getCountry_request: + allOf: + - properties: + country: + type: string + required: + - country + type: object + RolesReportsHash_role: + example: + name: name + properties: + name: + type: string + type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing + 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/csharp/generichost/net4.8/Petstore/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/Petstore/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/AnotherFakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/AnotherFakeApi.md new file mode 100644 index 00000000000..36948898657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/AnotherFakeApi.md @@ -0,0 +1,99 @@ +# Org.OpenAPITools.Api.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** +> ModelClient Call123TestSpecialTags (ModelClient modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the Call123TestSpecialTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test special tags + ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..0bdfd6af347 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/DefaultApi.md @@ -0,0 +1,429 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | +| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | +| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | | +| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest's Elements | + + +# **FooGet** +> FooGetDefaultResponse FooGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + FooGetDefaultResponse result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FooGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FooGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetCountry** +> void GetCountry (string country) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + var country = "country_example"; // string | + + try + { + apiInstance.GetCountry(country); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.GetCountryWithHttpInfo(country); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | | | + +### Return type + +void (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** | OK | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **RolesReportGet** +> List<List<RolesReportsHash>> RolesReportGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RolesReportGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + List> result = apiInstance.RolesReportGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the RolesReportGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse>> response = apiInstance.RolesReportGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns report | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **Test** +> NotificationtestGetElementsV1ResponseMPayload Test () + +Retrieve an existing Notificationtest's Elements + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Retrieve an existing Notificationtest's Elements + NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Test: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve an existing Notificationtest's Elements + ApiResponse response = apiInstance.TestWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeApi.md new file mode 100644 index 00000000000..959c6b75e78 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeApi.md @@ -0,0 +1,1830 @@ +# Org.OpenAPITools.Api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint | +| [**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 | | +| [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | +| [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**TestStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + +# **FakeHealthGet** +> HealthCheckResult FakeHealthGet () + +Health check endpoint + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeHealthGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Health check endpoint + ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeHealthGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterBooleanSerialize** +> bool FakeOuterBooleanSerialize (bool body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterBooleanSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **bool** | Input boolean as post body | [optional] | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterCompositeSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterNumberSerialize** +> decimal FakeOuterNumberSerialize (decimal body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterNumberSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **decimal** | Input number as post body | [optional] | + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterStringSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | +| **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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetArrayOfEnumsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Array of Enums + ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestAdditionalPropertiesReference** +> void TestAdditionalPropertiesReference (Dictionary requestBody) + +test referenced additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestAdditionalPropertiesReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestAdditionalPropertiesReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced additionalProperties + apiInstance.TestAdditionalPropertiesReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestAdditionalPropertiesReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, Object>**](Object.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithFileSchema** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithFileSchemaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (User user, string query) + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var user = new User(); // User | + var query = "query_example"; // string | + + try + { + apiInstance.TestBodyWithQueryParams(user, query); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithQueryParamsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithQueryParamsWithHttpInfo(user, query); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | | | +| **query** | **string** | | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClientModelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test \"client\" model + ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestClientModelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEndpointParameters** +> void TestEndpointParameters (byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, DateTime date = null, System.IO.Stream binary = null, float varFloat = null, int integer = null, int int32 = null, long int64 = null, string varString = null, string password = null, string callback = null, DateTime dateTime = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var number = 8.14D; // decimal | None + var varDouble = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var varFloat = 3.4F; // float | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789L; // long | None (optional) + var varString = "varString_example"; // string | None (optional) + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEndpointParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParametersWithHttpInfo(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **varByte** | **byte[]** | None | | +| **number** | **decimal** | None | | +| **varDouble** | **double** | None | | +| **patternWithoutDelimiter** | **string** | None | | +| **date** | **DateTime** | None | [optional] | +| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] | +| **varFloat** | **float** | None | [optional] | +| **integer** | **int** | None | [optional] | +| **int32** | **int** | None | [optional] | +| **int64** | **long** | None | [optional] | +| **varString** | **string** | None | [optional] | +| **password** | **string** | None | [optional] | +| **callback** | **string** | None | [optional] | +| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumHeaderStringArray = null, List enumQueryStringArray = null, double enumQueryDouble = null, int enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null) + +To test enum parameters + +To test enum parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumQueryDouble = 1.1D; // double | Query parameter enum test (double) (optional) + var enumQueryInteger = 1; // int | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEnumParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test enum parameters + apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **enumHeaderStringArray** | [**List<string>**](string.md) | Header parameter enum test (string array) | [optional] | +| **enumQueryStringArray** | [**List<string>**](string.md) | Query parameter enum test (string array) | [optional] | +| **enumQueryDouble** | **double** | Query parameter enum test (double) | [optional] | +| **enumQueryInteger** | **int** | Query parameter enum test (double) | [optional] | +| **enumFormStringArray** | [**List<string>**](string.md) | Form parameter enum test (string array) | [optional] [default to $] | +| **enumHeaderString** | **string** | Header parameter enum test (string) | [optional] [default to -efg] | +| **enumQueryString** | **string** | Query parameter enum test (string) | [optional] [default to -efg] | +| **enumFormString** | **string** | Form parameter enum test (string) | [optional] [default to -efg] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestGroupParameters** +> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool booleanGroup = null, int stringGroup = null, long int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var stringGroup = 56; // int | String in group parameters (optional) + var int64Group = 789L; // long | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestGroupParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | | +| **requiredStringGroup** | **int** | Required String in group parameters | | +| **requiredInt64Group** | **long** | Required Integer in group parameters | | +| **booleanGroup** | **bool** | Boolean in group parameters | [optional] | +| **stringGroup** | **int** | String in group parameters | [optional] | +| **int64Group** | **long** | Integer in group parameters | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline additionalProperties + apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestInlineFreeformAdditionalProperties** +> void TestInlineFreeformAdditionalProperties (TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineFreeformAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + + try + { + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineFreeformAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline free-form additionalProperties + apiInstance.TestInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineFreeformAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestJsonFormDataWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test json serialization of form data + apiInstance.TestJsonFormDataWithHttpInfo(param, param2); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **param** | **string** | field1 | | +| **param2** | **string** | field2 | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestQueryParameterCollectionFormat** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, string notRequiredNotNullable = null, string notRequiredNullable = null) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + var requiredNotNullable = "requiredNotNullable_example"; // string | + var requiredNullable = "requiredNullable_example"; // string | + var notRequiredNotNullable = "notRequiredNotNullable_example"; // string | (optional) + var notRequiredNullable = "notRequiredNullable_example"; // string | (optional) + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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) | | | +| **requiredNotNullable** | **string** | | | +| **requiredNullable** | **string** | | | +| **notRequiredNotNullable** | **string** | | [optional] | +| **notRequiredNullable** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **TestStringMapReference** +> void TestStringMapReference (Dictionary requestBody) + +test referenced string map + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestStringMapReferenceExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test referenced string map + apiInstance.TestStringMapReference(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestStringMapReference: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestStringMapReferenceWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test referenced string map + apiInstance.TestStringMapReferenceWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestStringMapReferenceWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..dfe1adefd0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/FakeClassnameTags123Api.md @@ -0,0 +1,104 @@ +# Org.OpenAPITools.Api.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** +> ModelClient TestClassname (ModelClient modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClassnameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test class name in snake case + ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/PetApi.md new file mode 100644 index 00000000000..407fb30dccb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/PetApi.md @@ -0,0 +1,860 @@ +# Org.OpenAPITools.Api.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 pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string** | | [optional] | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<string>**](string.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key), [api_key_query](../README.md#api_key_query) + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePet** +> void UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [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 | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null) + +uploads an image (required) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/StoreApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/StoreApi.md new file mode 100644 index 00000000000..4a1cd29ada7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.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 (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/UserApi.md new file mode 100644 index 00000000000..ee189c866ec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/apis/UserApi.md @@ -0,0 +1,715 @@ +# Org.OpenAPITools.Api.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 user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | +| **598** | Not a real HTTP status code | - | +| **599** | Not a real HTTP status code with a return object | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **UpdateUser** +> void UpdateUser (User user, string username) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Updated user object + var username = "username_example"; // string | name that need to be deleted + + try + { + // Updated user + apiInstance.UpdateUser(user, username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(user, username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Updated user object | | +| **username** | **string** | name that need to be deleted | | + +### Return type + +void (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 | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Activity.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [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/net4.8/Petstore/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ActivityOutputElementRepresentation.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ActivityOutputElementRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | [optional] +**Prop2** | **Object** | | [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/net4.8/Petstore/docs/models/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..2bbe882fcfc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Anytype1** | **Object** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, string>** | | [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/net4.8/Petstore/docs/models/Animal.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Animal.md new file mode 100644 index 00000000000..1a1760bd869 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/ApiResponse.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ApiResponse.md new file mode 100644 index 00000000000..d89ed1a25dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ApiResponse.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Message** | **string** | | [optional] +**Type** | **string** | | [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/net4.8/Petstore/docs/models/Apple.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Apple.md new file mode 100644 index 00000000000..9ad1da8cd68 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Apple.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ColorCode** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [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/net4.8/Petstore/docs/models/AppleReq.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/AppleReq.md new file mode 100644 index 00000000000..325521123f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [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/net4.8/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..a23ba59e609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [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/net4.8/Petstore/docs/models/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..10b8413439b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [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/net4.8/Petstore/docs/models/ArrayTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayTest.md new file mode 100644 index 00000000000..ed572120cd6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] +**ArrayOfString** | **List<string>** | | [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/net4.8/Petstore/docs/models/Banana.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Banana.md new file mode 100644 index 00000000000..d32e90cf298 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [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/net4.8/Petstore/docs/models/BananaReq.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/BananaReq.md new file mode 100644 index 00000000000..c8372b73c5f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/net4.8/Petstore/docs/models/BasquePig.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/BasquePig.md new file mode 100644 index 00000000000..db4f7a36226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/Petstore/docs/models/Capitalization.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Capitalization.md new file mode 100644 index 00000000000..9e225c17232 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ATT_NAME** | **string** | Name of the pet | [optional] +**CapitalCamel** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**SmallCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [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/net4.8/Petstore/docs/models/Cat.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Cat.md new file mode 100644 index 00000000000..310a5e6575e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [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/net4.8/Petstore/docs/models/Category.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Category.md new file mode 100644 index 00000000000..6eb0a2e13ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Category.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/ChildCat.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ChildCat.md new file mode 100644 index 00000000000..88fe8f7a7fd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ChildCat.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [default to PetTypeEnum.ChildCat] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/ClassModel.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ClassModel.md new file mode 100644 index 00000000000..bb35816c914 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [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/net4.8/Petstore/docs/models/ComplexQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ComplexQuadrilateral.md new file mode 100644 index 00000000000..fb00d4ebf08 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/DanishPig.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DanishPig.md new file mode 100644 index 00000000000..4d6ec1400a7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/Petstore/docs/models/DateOnlyClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DateOnlyClass.md new file mode 100644 index 00000000000..5dd63b313cc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DateOnlyClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DateOnlyClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateOnlyProperty** | **DateTime** | | [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/net4.8/Petstore/docs/models/DeprecatedObject.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DeprecatedObject.md new file mode 100644 index 00000000000..e90c59555a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/DeprecatedObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DeprecatedObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.8/Petstore/docs/models/Dog.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Dog.md new file mode 100644 index 00000000000..70cdc80e83e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **string** | | [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/net4.8/Petstore/docs/models/Drawing.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Drawing.md new file mode 100644 index 00000000000..95f49b2ed60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.md) | | [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/net4.8/Petstore/docs/models/EnumArrays.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumArrays.md new file mode 100644 index 00000000000..7467f67978c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayEnum** | **List<EnumArrays.ArrayEnumEnum>** | | [optional] +**JustSymbol** | **string** | | [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/net4.8/Petstore/docs/models/EnumClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumClass.md new file mode 100644 index 00000000000..d259f0f4696 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/EnumTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumTest.md new file mode 100644 index 00000000000..ebd7ccf2c86 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**EnumString** | **string** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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/net4.8/Petstore/docs/models/EquilateralTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EquilateralTriangle.md new file mode 100644 index 00000000000..8360b5c16a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/Petstore/docs/models/File.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/File.md new file mode 100644 index 00000000000..58b9c2fc369 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [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/net4.8/Petstore/docs/models/FileSchemaTestClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FileSchemaTestClass.md new file mode 100644 index 00000000000..a47efad77d8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [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/net4.8/Petstore/docs/models/Foo.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Foo.md new file mode 100644 index 00000000000..b9e7d261736 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/FooGetDefaultResponse.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FooGetDefaultResponse.md new file mode 100644 index 00000000000..47e50daca3e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FooGetDefaultResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FooGetDefaultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.md) | | [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/net4.8/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md new file mode 100644 index 00000000000..0983002c5da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md @@ -0,0 +1,28 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Byte** | **byte[]** | | +**Date** | **DateTime** | | +**Number** | **decimal** | | +**Password** | **string** | | +**Binary** | **System.IO.Stream** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Decimal** | **decimal** | | [optional] +**Double** | **double** | | [optional] +**Float** | **float** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Integer** | **int** | | [optional] +**PatternWithBackslash** | **string** | None | [optional] +**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] +**String** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] +**Uuid** | **Guid** | | [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/net4.8/Petstore/docs/models/Fruit.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Fruit.md new file mode 100644 index 00000000000..b3bee18f7ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Fruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/Petstore/docs/models/FruitReq.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FruitReq.md new file mode 100644 index 00000000000..38ab0c1a6ca --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FruitReq.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/GmFruit.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/GmFruit.md new file mode 100644 index 00000000000..584c4fd323d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/GmFruit.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [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/net4.8/Petstore/docs/models/GrandparentAnimal.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/GrandparentAnimal.md new file mode 100644 index 00000000000..eca96162b6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.8/Petstore/docs/models/HasOnlyReadOnly.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/HasOnlyReadOnly.md new file mode 100644 index 00000000000..060a614a698 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/HealthCheckResult.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/HealthCheckResult.md new file mode 100644 index 00000000000..682cfc50e3a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.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] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/IsoscelesTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/IsoscelesTriangle.md new file mode 100644 index 00000000000..07c62ac9338 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/Petstore/docs/models/List.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/List.md new file mode 100644 index 00000000000..0b54858ac24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | **string** | | [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/net4.8/Petstore/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/Mammal.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Mammal.md new file mode 100644 index 00000000000..ac14f00c0ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Mammal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/Petstore/docs/models/MapTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MapTest.md new file mode 100644 index 00000000000..5dd27228bb0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, MapTest.InnerEnum>** | | [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/net4.8/Petstore/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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/net4.8/Petstore/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/net4.8/Petstore/docs/models/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/net4.8/Petstore/docs/models/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..1bc0740add9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] +**Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [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/net4.8/Petstore/docs/models/MixedSubId.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/net4.8/Petstore/docs/models/Model200Response.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Model200Response.md new file mode 100644 index 00000000000..2752a0d87c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **string** | | [optional] +**Name** | **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/generichost/net4.8/Petstore/docs/models/ModelClient.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ModelClient.md new file mode 100644 index 00000000000..c658e84ef57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarClient** | **string** | | [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/net4.8/Petstore/docs/models/Name.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Name.md new file mode 100644 index 00000000000..ffe61a31d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarName** | **int** | | +**Property** | **string** | | [optional] +**SnakeCase** | **int** | | [optional] [readonly] +**Var123Number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md new file mode 100644 index 00000000000..25f223a8360 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NotificationtestGetElementsV1ResponseMPayload.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AObjVariableobject** | **List<Dictionary<string, Object>>** | | +**PkiNotificationtestID** | **int** | | + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/NullableClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableClass.md new file mode 100644 index 00000000000..5d9965f55c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**BooleanProp** | **bool** | | [optional] +**DateProp** | **DateTime** | | [optional] +**DatetimeProp** | **DateTime** | | [optional] +**IntegerProp** | **int** | | [optional] +**NumberProp** | **decimal** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**StringProp** | **string** | | [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/net4.8/Petstore/docs/models/NullableGuidClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableGuidClass.md new file mode 100644 index 00000000000..8d939afe998 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableGuidClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NullableGuidClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid** | | [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/net4.8/Petstore/docs/models/NullableShape.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableShape.md new file mode 100644 index 00000000000..2720167ccaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NullableShape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/NumberOnly.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NumberOnly.md new file mode 100644 index 00000000000..1b83cce764d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [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/net4.8/Petstore/docs/models/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..9f44c24d19a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bars** | **List<string>** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Id** | **decimal** | | [optional] +**Uuid** | **string** | | [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/net4.8/Petstore/docs/models/OneOfString.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OneOfString.md new file mode 100644 index 00000000000..54caf618776 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OneOfString.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OneOfString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/Order.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Order.md new file mode 100644 index 00000000000..f7d6827ed5c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Order.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Complete** | **bool** | | [optional] [default to false] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [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/net4.8/Petstore/docs/models/OuterComposite.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterComposite.md new file mode 100644 index 00000000000..8985c59d094 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyBoolean** | **bool** | | [optional] +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [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/net4.8/Petstore/docs/models/OuterEnum.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnum.md new file mode 100644 index 00000000000..36844bc4b17 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/OuterEnumDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..351383f0aea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/OuterEnumInteger.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumInteger.md new file mode 100644 index 00000000000..1013b5b1956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..55e314e3102 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/OuterEnumTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumTest.md new file mode 100644 index 00000000000..b99d27c2c2e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/OuterEnumTest.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/ParentPet.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ParentPet.md new file mode 100644 index 00000000000..bdf57005637 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **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/csharp/generichost/net4.8/Petstore/docs/models/Pet.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Pet.md new file mode 100644 index 00000000000..4f019b613bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Pet.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Category** | [**Category**](Category.md) | | [optional] +**Id** | **long** | | [optional] +**Status** | **string** | pet status in the store | [optional] +**Tags** | [**List<Tag>**](Tag.md) | | [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/net4.8/Petstore/docs/models/Pig.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Pig.md new file mode 100644 index 00000000000..fd7bb9359ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **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/csharp/generichost/net4.8/Petstore/docs/models/PolymorphicProperty.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/PolymorphicProperty.md new file mode 100644 index 00000000000..4507ec41cd5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/PolymorphicProperty.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PolymorphicProperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/Quadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Quadrilateral.md new file mode 100644 index 00000000000..fbbf4f81cec --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Quadrilateral.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.8/Petstore/docs/models/QuadrilateralInterface.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/QuadrilateralInterface.md new file mode 100644 index 00000000000..756ba09c6dd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **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/csharp/generichost/net4.8/Petstore/docs/models/ReadOnlyFirst.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ReadOnlyFirst.md new file mode 100644 index 00000000000..afaf2ee4fb6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **string** | | [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/net4.8/Petstore/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RequiredClass.md new file mode 100644 index 00000000000..7460783c91d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RequiredClass.md @@ -0,0 +1,53 @@ +# Org.OpenAPITools.Model.RequiredClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequiredNotNullableDateProp** | **DateTime** | | +**RequiredNotnullableArrayOfString** | **List<string>** | | +**RequiredNotnullableBooleanProp** | **bool** | | +**RequiredNotnullableDatetimeProp** | **DateTime** | | +**RequiredNotnullableEnumInteger** | **int** | | +**RequiredNotnullableEnumIntegerOnly** | **int** | | +**RequiredNotnullableEnumString** | **string** | | +**RequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNotnullableStringProp** | **string** | | +**RequiredNotnullableUuid** | **Guid** | | +**RequiredNotnullableintegerProp** | **int** | | +**NotRequiredNotnullableDateProp** | **DateTime** | | [optional] +**NotRequiredNotnullableintegerProp** | **int** | | [optional] +**NotRequiredNullableDateProp** | **DateTime** | | [optional] +**NotRequiredNullableIntegerProp** | **int** | | [optional] +**NotrequiredNotnullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNotnullableBooleanProp** | **bool** | | [optional] +**NotrequiredNotnullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNotnullableEnumInteger** | **int** | | [optional] +**NotrequiredNotnullableEnumIntegerOnly** | **int** | | [optional] +**NotrequiredNotnullableEnumString** | **string** | | [optional] +**NotrequiredNotnullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**NotrequiredNotnullableStringProp** | **string** | | [optional] +**NotrequiredNotnullableUuid** | **Guid** | | [optional] +**NotrequiredNullableArrayOfString** | **List<string>** | | [optional] +**NotrequiredNullableBooleanProp** | **bool** | | [optional] +**NotrequiredNullableDatetimeProp** | **DateTime** | | [optional] +**NotrequiredNullableEnumInteger** | **int** | | [optional] +**NotrequiredNullableEnumIntegerOnly** | **int** | | [optional] +**NotrequiredNullableEnumString** | **string** | | [optional] +**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/net4.8/Petstore/docs/models/Return.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Return.md new file mode 100644 index 00000000000..ad96a170bbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Return.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lock** | **string** | | +**Abstract** | **string** | | +**VarReturn** | **int** | | [optional] +**Unsafe** | **string** | | [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/net4.8/Petstore/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **Guid** | | [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/net4.8/Petstore/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/RolesReportsHashRole.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.RolesReportsHashRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [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/net4.8/Petstore/docs/models/ScaleneTriangle.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ScaleneTriangle.md new file mode 100644 index 00000000000..d3f15354bcc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **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/csharp/generichost/net4.8/Petstore/docs/models/Shape.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Shape.md new file mode 100644 index 00000000000..ae75c592540 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Shape.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/ShapeInterface.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ShapeInterface.md new file mode 100644 index 00000000000..882d3186830 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/ShapeOrNull.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ShapeOrNull.md new file mode 100644 index 00000000000..7fcd31a3a5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ShapeOrNull.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/SimpleQuadrilateral.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/SimpleQuadrilateral.md new file mode 100644 index 00000000000..a9c7f93b67a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | +**ShapeType** | **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/csharp/generichost/net4.8/Petstore/docs/models/SpecialModelName.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/SpecialModelName.md new file mode 100644 index 00000000000..890bcd923de --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarSpecialModelName** | **string** | | [optional] +**SpecialPropertyName** | **long** | | [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/net4.8/Petstore/docs/models/Tag.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Tag.md new file mode 100644 index 00000000000..2b2d9674d61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Tag.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [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/net4.8/Petstore/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **string** | | [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/net4.8/Petstore/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.md) | | [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/net4.8/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..b6f9fc94847 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestInlineFreeformAdditionalPropertiesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SomeProperty** | **string** | | [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/net4.8/Petstore/docs/models/Triangle.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Triangle.md new file mode 100644 index 00000000000..e1510991195 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Triangle.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.8/Petstore/docs/models/TriangleInterface.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TriangleInterface.md new file mode 100644 index 00000000000..4127c08b14f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **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/csharp/generichost/net4.8/Petstore/docs/models/User.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/User.md new file mode 100644 index 00000000000..b5700f1c75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] +**Email** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**Id** | **long** | | [optional] +**LastName** | **string** | | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**Username** | **string** | | [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/net4.8/Petstore/docs/models/Whale.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Whale.md new file mode 100644 index 00000000000..1c633fdce61 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [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/net4.8/Petstore/docs/models/Zebra.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Zebra.md new file mode 100644 index 00000000000..aef3866b92c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/Zebra.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Type** | **string** | | [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/net4.8/Petstore/docs/models/ZeroBasedEnum.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ZeroBasedEnum.md new file mode 100644 index 00000000000..cb71966c4c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ZeroBasedEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.ZeroBasedEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/net4.8/Petstore/docs/models/ZeroBasedEnumClass.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ZeroBasedEnumClass.md new file mode 100644 index 00000000000..614d00cbe87 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/ZeroBasedEnumClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ZeroBasedEnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ZeroBasedEnum** | **string** | | [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/net4.8/Petstore/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..cf82a3e39bd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + public sealed class AnotherFakeApiTests : ApiTestsBase + { + private readonly IAnotherFakeApi _instance; + + public AnotherFakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test Call123TestSpecialTags + /// + [Fact (Skip = "not implemented")] + public async Task Call123TestSpecialTagsAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.Call123TestSpecialTagsAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..c178aac4eab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + string apiKeyTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken1 = new ApiKeyToken(apiKeyTokenValue1, ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + string apiKeyTokenValue2 = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken2 = new ApiKeyToken(apiKeyTokenValue2, ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + string bearerTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken1 = new BearerToken(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + string basicTokenUsername1 = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword1 = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken1 = new BasicToken(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + string oauthTokenValue1 = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken1 = new OAuthToken(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..88cf05ba9ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FooGet + /// + [Fact (Skip = "not implemented")] + public async Task FooGetAsyncTest() + { + var response = await _instance.FooGetAsync(); + var model = response.Default(); + Assert.IsType(model); + } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test RolesReportGet + /// + [Fact (Skip = "not implemented")] + public async Task RolesReportGetAsyncTest() + { + var response = await _instance.RolesReportGetAsync(); + var model = response.Ok(); + Assert.IsType>>(model); + } + + /// + /// Test Test + /// + [Fact (Skip = "not implemented")] + public async Task TestAsyncTest() + { + var response = await _instance.TestAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..bbccd77b29c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,243 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + ApiKeyToken apiKeyToken1 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken1); + + ApiKeyToken apiKeyToken2 = new ApiKeyToken("", ClientUtils.ApiKeyHeader.Api_key_query, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken2); + + BearerToken bearerToken1 = new BearerToken("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken1); + + BasicToken basicToken1 = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken1); + + HttpSigningConfiguration config1 = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken1); + + OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken1); + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var anotherFakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(anotherFakeApi.HttpClient.BaseAddress != null); + + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + + var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeApi.HttpClient.BaseAddress != null); + + var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null); + + var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(petApi.HttpClient.BaseAddress != null); + + var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(storeApi.HttpClient.BaseAddress != null); + + var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(userApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..0cabe51ed28 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + public sealed class FakeApiTests : ApiTestsBase + { + private readonly IFakeApi _instance; + + public FakeApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test FakeHealthGet + /// + [Fact (Skip = "not implemented")] + public async Task FakeHealthGetAsyncTest() + { + var response = await _instance.FakeHealthGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterBooleanSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterBooleanSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterCompositeSerializeAsyncTest() + { + Client.Option outerComposite = default; + var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterNumberSerializeAsyncTest() + { + Client.Option body = default; + var response = await _instance.FakeOuterNumberSerializeAsync(body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Fact (Skip = "not implemented")] + public async Task FakeOuterStringSerializeAsyncTest() + { + Guid requiredStringUuid = default; + Client.Option body = default; + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetArrayOfEnums + /// + [Fact (Skip = "not implemented")] + public async Task GetArrayOfEnumsAsyncTest() + { + var response = await _instance.GetArrayOfEnumsAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithFileSchemaAsyncTest() + { + FileSchemaTestClass fileSchemaTestClass = default; + await _instance.TestBodyWithFileSchemaAsync(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Fact (Skip = "not implemented")] + public async Task TestBodyWithQueryParamsAsyncTest() + { + User user = default; + string query = default; + await _instance.TestBodyWithQueryParamsAsync(user, query); + } + + /// + /// Test TestClientModel + /// + [Fact (Skip = "not implemented")] + public async Task TestClientModelAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClientModelAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test TestEndpointParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEndpointParametersAsyncTest() + { + byte[] varByte = default; + decimal number = default; + double varDouble = default; + string patternWithoutDelimiter = default; + Client.Option date = default; + Client.Option binary = default; + Client.Option varFloat = default; + Client.Option integer = default; + Client.Option int32 = default; + Client.Option int64 = default; + Client.Option varString = default; + Client.Option password = default; + Client.Option callback = default; + Client.Option dateTime = default; + await _instance.TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + } + + /// + /// Test TestEnumParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestEnumParametersAsyncTest() + { + Client.Option> enumHeaderStringArray = default; + Client.Option> enumQueryStringArray = default; + Client.Option enumQueryDouble = default; + Client.Option enumQueryInteger = default; + Client.Option> enumFormStringArray = default; + Client.Option enumHeaderString = default; + Client.Option enumQueryString = default; + Client.Option enumFormString = default; + await _instance.TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Fact (Skip = "not implemented")] + public async Task TestGroupParametersAsyncTest() + { + bool requiredBooleanGroup = default; + int requiredStringGroup = default; + long requiredInt64Group = default; + Client.Option booleanGroup = default; + Client.Option stringGroup = default; + Client.Option int64Group = default; + await _instance.TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineAdditionalPropertiesAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestInlineAdditionalPropertiesAsync(requestBody); + } + + /// + /// Test TestInlineFreeformAdditionalProperties + /// + [Fact (Skip = "not implemented")] + public async Task TestInlineFreeformAdditionalPropertiesAsyncTest() + { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default; + await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest); + } + + /// + /// Test TestJsonFormData + /// + [Fact (Skip = "not implemented")] + public async Task TestJsonFormDataAsyncTest() + { + string param = default; + string param2 = default; + await _instance.TestJsonFormDataAsync(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Fact (Skip = "not implemented")] + public async Task TestQueryParameterCollectionFormatAsyncTest() + { + List pipe = default; + List ioutil = default; + List http = default; + List url = default; + List context = default; + string requiredNotNullable = default; + string requiredNullable = default; + Client.Option notRequiredNotNullable = default; + 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/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..5964bf6e51d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + public sealed class FakeClassnameTags123ApiTests : ApiTestsBase + { + private readonly IFakeClassnameTags123Api _instance; + + public FakeClassnameTags123ApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test TestClassname + /// + [Fact (Skip = "not implemented")] + public async Task TestClassnameAsyncTest() + { + ModelClient modelClient = default; + var response = await _instance.TestClassnameAsync(modelClient); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..c5e6e7e2f9d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + public sealed class PetApiTests : ApiTestsBase + { + private readonly IPetApi _instance; + + public PetApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test AddPet + /// + [Fact (Skip = "not implemented")] + public async Task AddPetAsyncTest() + { + Pet pet = default; + await _instance.AddPetAsync(pet); + } + + /// + /// Test DeletePet + /// + [Fact (Skip = "not implemented")] + public async Task DeletePetAsyncTest() + { + long petId = default; + Client.Option apiKey = default; + await _instance.DeletePetAsync(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByStatusAsyncTest() + { + List status = default; + var response = await _instance.FindPetsByStatusAsync(status); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test FindPetsByTags + /// + [Fact (Skip = "not implemented")] + public async Task FindPetsByTagsAsyncTest() + { + List tags = default; + var response = await _instance.FindPetsByTagsAsync(tags); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetPetById + /// + [Fact (Skip = "not implemented")] + public async Task GetPetByIdAsyncTest() + { + long petId = default; + var response = await _instance.GetPetByIdAsync(petId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UpdatePet + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetAsyncTest() + { + Pet pet = default; + await _instance.UpdatePetAsync(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact (Skip = "not implemented")] + public async Task UpdatePetWithFormAsyncTest() + { + long petId = default; + Client.Option name = default; + Client.Option status = default; + await _instance.UpdatePetWithFormAsync(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileAsyncTest() + { + long petId = default; + Client.Option file = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileAsync(petId, file, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Fact (Skip = "not implemented")] + public async Task UploadFileWithRequiredFileAsyncTest() + { + System.IO.Stream requiredFile = default; + long petId = default; + Client.Option additionalMetadata = default; + var response = await _instance.UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..1b75e341700 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + public sealed class StoreApiTests : ApiTestsBase + { + private readonly IStoreApi _instance; + + public StoreApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test DeleteOrder + /// + [Fact (Skip = "not implemented")] + public async Task DeleteOrderAsyncTest() + { + string orderId = default; + await _instance.DeleteOrderAsync(orderId); + } + + /// + /// Test GetInventory + /// + [Fact (Skip = "not implemented")] + public async Task GetInventoryAsyncTest() + { + var response = await _instance.GetInventoryAsync(); + var model = response.Ok(); + Assert.IsType>(model); + } + + /// + /// Test GetOrderById + /// + [Fact (Skip = "not implemented")] + public async Task GetOrderByIdAsyncTest() + { + long orderId = default; + var response = await _instance.GetOrderByIdAsync(orderId); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test PlaceOrder + /// + [Fact (Skip = "not implemented")] + public async Task PlaceOrderAsyncTest() + { + Order order = default; + var response = await _instance.PlaceOrderAsync(order); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..38ee1125438 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + public sealed class UserApiTests : ApiTestsBase + { + private readonly IUserApi _instance; + + public UserApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test CreateUser + /// + [Fact (Skip = "not implemented")] + public async Task CreateUserAsyncTest() + { + User user = default; + await _instance.CreateUserAsync(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithArrayInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithArrayInputAsync(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact (Skip = "not implemented")] + public async Task CreateUsersWithListInputAsyncTest() + { + List user = default; + await _instance.CreateUsersWithListInputAsync(user); + } + + /// + /// Test DeleteUser + /// + [Fact (Skip = "not implemented")] + public async Task DeleteUserAsyncTest() + { + string username = default; + await _instance.DeleteUserAsync(username); + } + + /// + /// Test GetUserByName + /// + [Fact (Skip = "not implemented")] + public async Task GetUserByNameAsyncTest() + { + string username = default; + var response = await _instance.GetUserByNameAsync(username); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LoginUser + /// + [Fact (Skip = "not implemented")] + public async Task LoginUserAsyncTest() + { + string username = default; + string password = default; + var response = await _instance.LoginUserAsync(username, password); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test LogoutUser + /// + [Fact (Skip = "not implemented")] + public async Task LogoutUserAsyncTest() + { + await _instance.LogoutUserAsync(); + } + + /// + /// Test UpdateUser + /// + [Fact (Skip = "not implemented")] + public async Task UpdateUserAsyncTest() + { + User user = default; + string username = default; + await _instance.UpdateUserAsync(user, username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..adbf639fd72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -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 + * 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 ActivityOutputElementRepresentation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityOutputElementRepresentationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation + //private ActivityOutputElementRepresentation instance; + + public ActivityOutputElementRepresentationTests() + { + // TODO uncomment below to create an instance of ActivityOutputElementRepresentation + //instance = new ActivityOutputElementRepresentation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ActivityOutputElementRepresentation + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..6cc2927eaaf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -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 + * 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 Activity + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Activity + //private Activity instance; + + public ActivityTests() + { + // TODO uncomment below to create an instance of Activity + //instance = new Activity(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Activity + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..e157b477193 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -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 + * 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 AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Fact] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Anytype1' + /// + [Fact] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + + /// + /// Test the property 'EmptyMap' + /// + [Fact] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + + /// + /// Test the property 'MapOfMapProperty' + /// + [Fact] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + + /// + /// Test the property 'MapProperty' + /// + [Fact] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Fact] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Fact] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..1db9725afb8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -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 + * 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 Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Fact] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Cat from type Animal + /// + [Fact] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + + /// + /// Test deserialize a Dog from type Animal + /// + [Fact] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..c296a82116a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -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 + * 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 ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 00000000000..d698ee44504 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -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 + * 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 AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Fact] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Mealy' + /// + [Fact] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..c7c8ccd47c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -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 + * 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 Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Fact] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + /// + /// Test the property 'ColorCode' + /// + [Fact] + public void ColorCodeTest() + { + // TODO unit test for the property 'ColorCode' + } + + /// + /// Test the property 'Cultivar' + /// + [Fact] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + + /// + /// Test the property 'Origin' + /// + [Fact] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..29fe9cfb1d4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Fact] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Fact] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..2b0956c0b98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -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 + * 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 ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Fact] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayNumber' + /// + [Fact] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..3b01d0b7abb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -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 + * 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 ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Fact] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Fact] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Fact] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + + /// + /// Test the property 'ArrayOfString' + /// + [Fact] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 00000000000..1e54c1f3e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -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 + * 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 BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Fact] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + + /// + /// Test the property 'Sweet' + /// + [Fact] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..5a88e9dabbd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -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 + * 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 Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Fact] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + /// + /// Test the property 'LengthCm' + /// + [Fact] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 00000000000..4ffd6c2c0c8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -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 + * 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 BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Fact] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..d0391fb47f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -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 + * 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 Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Fact] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + /// + /// Test the property 'ATT_NAME' + /// + [Fact] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + + /// + /// Test the property 'CapitalCamel' + /// + [Fact] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + + /// + /// Test the property 'CapitalSnake' + /// + [Fact] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Fact] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + + /// + /// Test the property 'SmallCamel' + /// + [Fact] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + + /// + /// Test the property 'SmallSnake' + /// + [Fact] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 00000000000..a5d4bf43bbf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -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 + * 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 Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Fact] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Declawed' + /// + [Fact] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..7fe8f333c81 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -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 + * 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 Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 00000000000..2c02364a9f7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -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 + * 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 ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Fact] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..a866bfbe242 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -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 + * 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 ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Fact] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 00000000000..a7a864154ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -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 + * 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 ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Fact] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 00000000000..e7c505b5136 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -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 + * 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 DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Fact] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs new file mode 100644 index 00000000000..83a4185e53d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -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 + * 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 DateOnlyClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DateOnlyClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DateOnlyClass + //private DateOnlyClass instance; + + public DateOnlyClassTests() + { + // TODO uncomment below to create an instance of DateOnlyClass + //instance = new DateOnlyClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DateOnlyClass + /// + [Fact] + public void DateOnlyClassInstanceTest() + { + // TODO uncomment below to test "IsType" DateOnlyClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateOnlyProperty' + /// + [Fact] + public void DateOnlyPropertyTest() + { + // TODO unit test for the property 'DateOnlyProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 00000000000..95e56f782da --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -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 + * 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 DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Fact] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 00000000000..b8e8bca0538 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -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 + * 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 Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Fact] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Breed' + /// + [Fact] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 00000000000..a2de4a1b97b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Fact] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + /// + /// Test the property 'MainShape' + /// + [Fact] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + + /// + /// Test the property 'NullableShape' + /// + [Fact] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + + /// + /// Test the property 'ShapeOrNull' + /// + [Fact] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + + /// + /// Test the property 'Shapes' + /// + [Fact] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..c6fee27690b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -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 + * 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 EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Fact] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayEnum' + /// + [Fact] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + + /// + /// Test the property 'JustSymbol' + /// + [Fact] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..44dbbe4d324 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -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 + * 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 EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Fact] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..3781eebbfcf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -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 + * 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 EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Fact] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'EnumStringRequired' + /// + [Fact] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + + /// + /// Test the property 'EnumInteger' + /// + [Fact] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + + /// + /// Test the property 'EnumIntegerOnly' + /// + [Fact] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + + /// + /// Test the property 'EnumNumber' + /// + [Fact] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + + /// + /// Test the property 'EnumString' + /// + [Fact] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + + /// + /// Test the property 'OuterEnum' + /// + [Fact] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Fact] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + + /// + /// Test the property 'OuterEnumInteger' + /// + [Fact] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Fact] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 00000000000..f8d3daec3fe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -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 + * 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 EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Fact] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 00000000000..e2685848d5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -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 + * 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 FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Fact] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'File' + /// + [Fact] + public void FileTest() + { + // TODO unit test for the property 'File' + } + + /// + /// Test the property 'Files' + /// + [Fact] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 00000000000..c305c5356b0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -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 + * 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 File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Fact] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + /// + /// Test the property 'SourceURI' + /// + [Fact] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs new file mode 100644 index 00000000000..55086a7cf24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -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 + * 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 FooGetDefaultResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooGetDefaultResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FooGetDefaultResponse + //private FooGetDefaultResponse instance; + + public FooGetDefaultResponseTests() + { + // TODO uncomment below to create an instance of FooGetDefaultResponse + //instance = new FooGetDefaultResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FooGetDefaultResponse + /// + [Fact] + public void FooGetDefaultResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FooGetDefaultResponse + //Assert.IsType(instance); + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 00000000000..871506eeaac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -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 + * 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 Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Fact] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..b658f317f1c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,227 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Fact] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'Byte' + /// + [Fact] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + + /// + /// Test the property 'Date' + /// + [Fact] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + + /// + /// Test the property 'Number' + /// + [Fact] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Binary' + /// + [Fact] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Decimal' + /// + [Fact] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + + /// + /// Test the property 'Double' + /// + [Fact] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + + /// + /// Test the property 'Float' + /// + [Fact] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + + /// + /// Test the property 'Int32' + /// + [Fact] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + + /// + /// Test the property 'Int64' + /// + [Fact] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + + /// + /// Test the property 'Integer' + /// + [Fact] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + + /// + /// Test the property 'PatternWithBackslash' + /// + [Fact] + public void PatternWithBackslashTest() + { + // TODO unit test for the property 'PatternWithBackslash' + } + + /// + /// Test the property 'PatternWithDigits' + /// + [Fact] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Fact] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + + /// + /// Test the property 'String' + /// + [Fact] + public void StringTest() + { + // TODO unit test for the property 'String' + } + + /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 00000000000..a33c55ae487 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -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 + * 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 FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Fact] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..46448efc62f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -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 + * 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 Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Fact] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 00000000000..7e79cd06792 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -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 + * 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 GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Fact] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 00000000000..5f0e8672ed5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -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 + * 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 GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Fact] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Fact] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Fact] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..134a7d515eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -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 + * 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 HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Fact] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Foo' + /// + [Fact] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 00000000000..18bb8672e98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -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 + * 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 HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Fact] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + /// + /// Test the property 'NullableMessage' + /// + [Fact] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 00000000000..464750233cd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -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 + * 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 IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Fact] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 00000000000..d95303d9751 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -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 + * 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 List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Fact] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + /// + /// Test the property 'Var123List' + /// + [Fact] + public void Var123ListTest() + { + // TODO unit test for the property 'Var123List' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..31d21de5b60 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * 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 LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 00000000000..64bd9e89034 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -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 + * 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 Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Fact] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..2dc6d8d8e04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Fact] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + /// + /// Test the property 'DirectMap' + /// + [Fact] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + + /// + /// Test the property 'IndirectMap' + /// + [Fact] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + + /// + /// Test the property 'MapMapOfString' + /// + [Fact] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + + /// + /// Test the property 'MapOfEnumString' + /// + [Fact] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..d3689c15f40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Fact] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'DateTime' + /// + [Fact] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + + /// + /// Test the property 'Map' + /// + [Fact] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..3b5e94c5f8f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -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 + * 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 Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Fact] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Class' + /// + [Fact] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..5a986cfdc6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -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 + * 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 ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Fact] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarClient' + /// + [Fact] + public void VarClientTest() + { + // TODO unit test for the property 'VarClient' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 00000000000..3aac92ae468 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Fact] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarName' + /// + [Fact] + public void VarNameTest() + { + // TODO unit test for the property 'VarName' + } + + /// + /// Test the property 'Property' + /// + [Fact] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + + /// + /// Test the property 'SnakeCase' + /// + [Fact] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + + /// + /// Test the property 'Var123Number' + /// + [Fact] + public void Var123NumberTest() + { + // TODO unit test for the property 'Var123Number' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs new file mode 100644 index 00000000000..dd3b74e3306 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NotificationtestGetElementsV1ResponseMPayloadTests.cs @@ -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 + * 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 NotificationtestGetElementsV1ResponseMPayload + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NotificationtestGetElementsV1ResponseMPayloadTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NotificationtestGetElementsV1ResponseMPayload + //private NotificationtestGetElementsV1ResponseMPayload instance; + + public NotificationtestGetElementsV1ResponseMPayloadTests() + { + // TODO uncomment below to create an instance of NotificationtestGetElementsV1ResponseMPayload + //instance = new NotificationtestGetElementsV1ResponseMPayload(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NotificationtestGetElementsV1ResponseMPayload + /// + [Fact] + public void NotificationtestGetElementsV1ResponseMPayloadInstanceTest() + { + // TODO uncomment below to test "IsType" NotificationtestGetElementsV1ResponseMPayload + //Assert.IsType(instance); + } + + /// + /// Test the property 'AObjVariableobject' + /// + [Fact] + public void AObjVariableobjectTest() + { + // TODO unit test for the property 'AObjVariableobject' + } + + /// + /// Test the property 'PkiNotificationtestID' + /// + [Fact] + public void PkiNotificationtestIDTest() + { + // TODO unit test for the property 'PkiNotificationtestID' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 00000000000..1e19aa6b823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Fact] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Fact] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + + /// + /// Test the property 'ArrayItemsNullable' + /// + [Fact] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + + /// + /// Test the property 'ArrayNullableProp' + /// + [Fact] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + + /// + /// Test the property 'BooleanProp' + /// + [Fact] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + + /// + /// Test the property 'DateProp' + /// + [Fact] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + + /// + /// Test the property 'DatetimeProp' + /// + [Fact] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + + /// + /// Test the property 'IntegerProp' + /// + [Fact] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + + /// + /// Test the property 'NumberProp' + /// + [Fact] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Fact] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + + /// + /// Test the property 'ObjectItemsNullable' + /// + [Fact] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + + /// + /// Test the property 'ObjectNullableProp' + /// + [Fact] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + + /// + /// Test the property 'StringProp' + /// + [Fact] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs new file mode 100644 index 00000000000..db8c9aa0956 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -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 + * 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 NullableGuidClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableGuidClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableGuidClass + //private NullableGuidClass instance; + + public NullableGuidClassTests() + { + // TODO uncomment below to create an instance of NullableGuidClass + //instance = new NullableGuidClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableGuidClass + /// + [Fact] + public void NullableGuidClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableGuidClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 00000000000..e65ba44efa2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -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 + * 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 NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Fact] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..2b88fb1a609 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -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 + * 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 NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Fact] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + /// + /// Test the property 'JustNumber' + /// + [Fact] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 00000000000..078655aaba7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Fact] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bars' + /// + [Fact] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + + /// + /// Test the property 'DeprecatedRef' + /// + [Fact] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Uuid' + /// + [Fact] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs new file mode 100644 index 00000000000..8ef411a15eb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OneOfStringTests.cs @@ -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 + * 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 OneOfString + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OneOfStringTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OneOfString + //private OneOfString instance; + + public OneOfStringTests() + { + // TODO uncomment below to create an instance of OneOfString + //instance = new OneOfString(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OneOfString + /// + [Fact] + public void OneOfStringInstanceTest() + { + // TODO uncomment below to test "IsType" OneOfString + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..e7187bbdc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -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 + * 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 Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..0bb8ce5e5d9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -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 + * 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 OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Fact] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + /// + /// Test the property 'MyBoolean' + /// + [Fact] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + /// + /// Test the property 'MyNumber' + /// + [Fact] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + + /// + /// Test the property 'MyString' + /// + [Fact] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 00000000000..a1d1e152777 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -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 + * 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 OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Fact] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 00000000000..030326d7579 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -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 + * 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 OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Fact] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 00000000000..1f3bfe459e7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -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 + * 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 OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Fact] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs new file mode 100644 index 00000000000..c4cb8eeecee --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTestTests.cs @@ -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 + * 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 OuterEnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumTest + //private OuterEnumTest instance; + + public OuterEnumTestTests() + { + // TODO uncomment below to create an instance of OuterEnumTest + //instance = new OuterEnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumTest + /// + [Fact] + public void OuterEnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumTest + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..2859494010b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -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 + * 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 OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Fact] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 00000000000..b0ebddd374f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -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 + * 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 ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Fact] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Fact] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 00000000000..8485d1213ce --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -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 + * 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 Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 00000000000..bd052bc705b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -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 + * 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 Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Fact] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs new file mode 100644 index 00000000000..23120ba7bdf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -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 + * 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 PolymorphicProperty + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PolymorphicPropertyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PolymorphicProperty + //private PolymorphicProperty instance; + + public PolymorphicPropertyTests() + { + // TODO uncomment below to create an instance of PolymorphicProperty + //instance = new PolymorphicProperty(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PolymorphicProperty + /// + [Fact] + public void PolymorphicPropertyInstanceTest() + { + // TODO uncomment below to test "IsType" PolymorphicProperty + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 00000000000..2ddd31cfcbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -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 + * 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 QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Fact] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 00000000000..65673847d75 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -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 + * 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 Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Fact] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..a4c91cf44a5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -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 + * 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 ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Fact] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + /// + /// Test the property 'Bar' + /// + [Fact] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + + /// + /// Test the property 'Baz' + /// + [Fact] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs new file mode 100644 index 00000000000..d1da68281ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -0,0 +1,452 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 RequiredClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RequiredClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RequiredClass + //private RequiredClass instance; + + public RequiredClassTests() + { + // TODO uncomment below to create an instance of RequiredClass + //instance = new RequiredClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RequiredClass + /// + [Fact] + public void RequiredClassInstanceTest() + { + // TODO uncomment below to test "IsType" RequiredClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'RequiredNotNullableDateProp' + /// + [Fact] + public void RequiredNotNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNotNullableDateProp' + } + + /// + /// Test the property 'RequiredNotnullableArrayOfString' + /// + [Fact] + public void RequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'RequiredNotnullableBooleanProp' + /// + [Fact] + public void RequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'RequiredNotnullableDatetimeProp' + /// + [Fact] + public void RequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNotnullableEnumInteger' + /// + [Fact] + public void RequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'RequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNotnullableEnumString' + /// + [Fact] + public void RequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNotnullableEnumString' + } + + /// + /// Test the property 'RequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNotnullableStringProp' + /// + [Fact] + public void RequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'RequiredNotnullableStringProp' + } + + /// + /// Test the property 'RequiredNotnullableUuid' + /// + [Fact] + public void RequiredNotnullableUuidTest() + { + // TODO unit test for the property 'RequiredNotnullableUuid' + } + + /// + /// Test the property 'RequiredNotnullableintegerProp' + /// + [Fact] + public void RequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'RequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNotnullableDateProp' + /// + [Fact] + public void NotRequiredNotnullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableDateProp' + } + + /// + /// Test the property 'NotRequiredNotnullableintegerProp' + /// + [Fact] + public void NotRequiredNotnullableintegerPropTest() + { + // TODO unit test for the property 'NotRequiredNotnullableintegerProp' + } + + /// + /// Test the property 'NotRequiredNullableDateProp' + /// + [Fact] + public void NotRequiredNullableDatePropTest() + { + // TODO unit test for the property 'NotRequiredNullableDateProp' + } + + /// + /// Test the property 'NotRequiredNullableIntegerProp' + /// + [Fact] + public void NotRequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'NotRequiredNullableIntegerProp' + } + + /// + /// Test the property 'NotrequiredNotnullableArrayOfString' + /// + [Fact] + public void NotrequiredNotnullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNotnullableBooleanProp' + /// + [Fact] + public void NotrequiredNotnullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNotnullableDatetimeProp' + /// + [Fact] + public void NotrequiredNotnullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumInteger' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNotnullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNotnullableEnumString' + /// + [Fact] + public void NotrequiredNotnullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNotnullableEnumString' + } + + /// + /// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNotnullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNotnullableStringProp' + /// + [Fact] + public void NotrequiredNotnullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNotnullableStringProp' + } + + /// + /// Test the property 'NotrequiredNotnullableUuid' + /// + [Fact] + public void NotrequiredNotnullableUuidTest() + { + // TODO unit test for the property 'NotrequiredNotnullableUuid' + } + + /// + /// Test the property 'NotrequiredNullableArrayOfString' + /// + [Fact] + public void NotrequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'NotrequiredNullableArrayOfString' + } + + /// + /// Test the property 'NotrequiredNullableBooleanProp' + /// + [Fact] + public void NotrequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'NotrequiredNullableBooleanProp' + } + + /// + /// Test the property 'NotrequiredNullableDatetimeProp' + /// + [Fact] + public void NotrequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'NotrequiredNullableDatetimeProp' + } + + /// + /// Test the property 'NotrequiredNullableEnumInteger' + /// + [Fact] + public void NotrequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumInteger' + } + + /// + /// Test the property 'NotrequiredNullableEnumIntegerOnly' + /// + [Fact] + public void NotrequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'NotrequiredNullableEnumString' + /// + [Fact] + public void NotrequiredNullableEnumStringTest() + { + // TODO unit test for the property 'NotrequiredNullableEnumString' + } + + /// + /// Test the property 'NotrequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void NotrequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'NotrequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'NotrequiredNullableStringProp' + /// + [Fact] + public void NotrequiredNullableStringPropTest() + { + // TODO unit test for the property 'NotrequiredNullableStringProp' + } + + /// + /// Test the property 'NotrequiredNullableUuid' + /// + [Fact] + public void NotrequiredNullableUuidTest() + { + // 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/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..bbea79ed951 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Fact] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //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' + /// + [Fact] + public void VarReturnTest() + { + // 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/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 + * 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 RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashRoleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHashRole + //private RolesReportsHashRole instance; + + public RolesReportsHashRoleTests() + { + // TODO uncomment below to create an instance of RolesReportsHashRole + //instance = new RolesReportsHashRole(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 + * 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 RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class RolesReportsHashTests : IDisposable + { + // TODO uncomment below to declare an instance variable for RolesReportsHash + //private RolesReportsHash instance; + + public RolesReportsHashTests() + { + // TODO uncomment below to create an instance of RolesReportsHash + //instance = new RolesReportsHash(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 00000000000..085d3e550a1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -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 + * 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 ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Fact] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 00000000000..62d6d69ff72 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -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 + * 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 ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Fact] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 00000000000..dc6970b16f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -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 + * 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 ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Fact] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 00000000000..dbdf012c5ba --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -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 + * 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 Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Fact] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 00000000000..baa6e1e9f6f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -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 + * 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 SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Fact] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + /// + /// Test the property 'QuadrilateralType' + /// + [Fact] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + + /// + /// Test the property 'ShapeType' + /// + [Fact] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..23763d9c3af --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -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 + * 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 SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Fact] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + /// + /// Test the property 'VarSpecialModelName' + /// + [Fact] + public void VarSpecialModelNameTest() + { + // TODO unit test for the property 'VarSpecialModelName' + } + + /// + /// Test the property 'SpecialPropertyName' + /// + [Fact] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 00000000000..fe7f3d82bab --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -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 + * 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 Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..eca020ce1fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -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 + * 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 TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e3c86aefabe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -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 + * 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 TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs new file mode 100644 index 00000000000..23e08d8e4e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TestInlineFreeformAdditionalPropertiesRequestTests.cs @@ -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 + * 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 TestInlineFreeformAdditionalPropertiesRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestInlineFreeformAdditionalPropertiesRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestInlineFreeformAdditionalPropertiesRequest + //private TestInlineFreeformAdditionalPropertiesRequest instance; + + public TestInlineFreeformAdditionalPropertiesRequestTests() + { + // TODO uncomment below to create an instance of TestInlineFreeformAdditionalPropertiesRequest + //instance = new TestInlineFreeformAdditionalPropertiesRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestInlineFreeformAdditionalPropertiesRequest + /// + [Fact] + public void TestInlineFreeformAdditionalPropertiesRequestInstanceTest() + { + // TODO uncomment below to test "IsType" TestInlineFreeformAdditionalPropertiesRequest + //Assert.IsType(instance); + } + + /// + /// Test the property 'SomeProperty' + /// + [Fact] + public void SomePropertyTest() + { + // TODO unit test for the property 'SomeProperty' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 00000000000..1293a2b212e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -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 + * 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 TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Fact] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 00000000000..4cb53522348 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -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 + * 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 Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Fact] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + /// + /// Test the property 'TriangleType' + /// + [Fact] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 00000000000..6415f8561f1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + /// + /// Test the property 'AnyTypeProp' + /// + [Fact] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + + /// + /// Test the property 'AnyTypePropNullable' + /// + [Fact] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Fact] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Fact] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 00000000000..7d05cc5e59a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -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 + * 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 Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Fact] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'HasBaleen' + /// + [Fact] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + + /// + /// Test the property 'HasTeeth' + /// + [Fact] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 00000000000..cd0d1c1c361 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -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 + * 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 Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Fact] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + /// + /// Test the property 'ClassName' + /// + [Fact] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs new file mode 100644 index 00000000000..b432edb28c2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumClassTests.cs @@ -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 + * 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 ZeroBasedEnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnumClass + //private ZeroBasedEnumClass instance; + + public ZeroBasedEnumClassTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnumClass + //instance = new ZeroBasedEnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnumClass + /// + [Fact] + public void ZeroBasedEnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnumClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'ZeroBasedEnum' + /// + [Fact] + public void ZeroBasedEnumTest() + { + // TODO unit test for the property 'ZeroBasedEnum' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs new file mode 100644 index 00000000000..3689a873c34 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs @@ -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 + * 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 ZeroBasedEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZeroBasedEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ZeroBasedEnum + //private ZeroBasedEnum instance; + + public ZeroBasedEnumTests() + { + // TODO uncomment below to create an instance of ZeroBasedEnum + //instance = new ZeroBasedEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ZeroBasedEnum + /// + [Fact] + public void ZeroBasedEnumInstanceTest() + { + // TODO uncomment below to test "IsType" ZeroBasedEnum + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..c629057faad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -0,0 +1,402 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IAnotherFakeApi : IApi + { + /// + /// The class containing the events + /// + AnotherFakeApiEvents Events { get; } + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICall123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class AnotherFakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCall123TestSpecialTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCall123TestSpecialTags; + + internal void ExecuteOnCall123TestSpecialTags(AnotherFakeApi.Call123TestSpecialTagsApiResponse apiResponse) + { + OnCall123TestSpecialTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCall123TestSpecialTags(Exception exception) + { + OnErrorCall123TestSpecialTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class AnotherFakeApi : IAnotherFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public AnotherFakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, AnotherFakeApiEvents anotherFakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = anotherFakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCall123TestSpecialTags(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCall123TestSpecialTags(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCall123TestSpecialTagsDefaultImplementation(ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterCall123TestSpecialTags(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCall123TestSpecialTags(ref bool suppressDefaultLog, ICall123TestSpecialTagsApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorCall123TestSpecialTags(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await Call123TestSpecialTagsAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCall123TestSpecialTags(modelClient); + + FormatCall123TestSpecialTags(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + Call123TestSpecialTagsApiResponse apiResponseLocalVar = new Call123TestSpecialTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/another-fake/dummy", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCall123TestSpecialTagsDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnCall123TestSpecialTags(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCall123TestSpecialTagsDefaultImplementation(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorCall123TestSpecialTags(e); + throw; + } + } + + /// + /// The + /// + public partial class Call123TestSpecialTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, ICall123TestSpecialTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public Call123TestSpecialTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..d58e3391473 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,1352 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task HelloAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Cancellation Token to cancel the request. + /// <> + Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task TestAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFooGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IDefault + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IGetCountryApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IHelloApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IRolesReportGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFooGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFooGet; + + internal void ExecuteOnFooGet(DefaultApi.FooGetApiResponse apiResponse) + { + OnFooGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFooGet(Exception exception) + { + OnErrorFooGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetCountry; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetCountry; + + internal void ExecuteOnGetCountry(DefaultApi.GetCountryApiResponse apiResponse) + { + OnGetCountry?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetCountry(Exception exception) + { + OnErrorGetCountry?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnHello; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorHello; + + internal void ExecuteOnHello(DefaultApi.HelloApiResponse apiResponse) + { + OnHello?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorHello(Exception exception) + { + OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(DefaultApi.RolesReportGetApiResponse apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTest; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTest; + + internal void ExecuteOnTest(DefaultApi.TestApiResponse apiResponse) + { + OnTest?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTest(Exception exception) + { + OnErrorTest?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFooGetDefaultImplementation(IFooGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFooGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFooGet(ref bool suppressDefaultLog, IFooGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFooGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFooGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFooGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FooGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FooGetApiResponse apiResponseLocalVar = new FooGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/foo", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFooGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFooGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFooGetDefaultImplementation(e, "/foo", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFooGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FooGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFooGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FooGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + /// + /// Deserializes the response if the response is 0 Default + /// + /// + public Org.OpenAPITools.Model.FooGetDefaultResponse Default() + { + // This logic may be modified with the AsModel.mustache template + return IsDefault + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 0 Default and the deserialized response is not null + /// + /// + /// + public bool TryDefault(out Org.OpenAPITools.Model.FooGetDefaultResponse result) + { + result = null; + + try + { + result = Default(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)0); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetCountry(ref string country); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetCountry(string country) + { + if (country == null) + throw new ArgumentNullException(nameof(country)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetCountryDefaultImplementation(IGetCountryApiResponse apiResponseLocalVar, string country) + { + bool suppressDefaultLog = false; + AfterGetCountry(ref suppressDefaultLog, apiResponseLocalVar, country); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetCountry(ref bool suppressDefaultLog, IGetCountryApiResponse apiResponseLocalVar, string country); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetCountryDefaultImplementation(Exception exception, string pathFormat, string path, string country) + { + bool suppressDefaultLog = false; + OnErrorGetCountry(ref suppressDefaultLog, exception, pathFormat, path, country); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetCountry(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string country); + + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetCountryAsync(country, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetCountry(country); + + FormatGetCountry(ref country); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetCountryApiResponse apiResponseLocalVar = new GetCountryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/country", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetCountryDefaultImplementation(apiResponseLocalVar, country); + + Events.ExecuteOnGetCountry(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetCountryDefaultImplementation(e, "/country", uriBuilderLocalVar.Path, country); + Events.ExecuteOnErrorGetCountry(e); + throw; + } + } + + /// + /// The + /// + public partial class GetCountryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetCountryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetCountryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterHelloDefaultImplementation(IHelloApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterHello(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterHello(ref bool suppressDefaultLog, IHelloApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorHelloDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorHello(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorHello(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Hello Hello + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await HelloAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task HelloAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + HelloApiResponse apiResponseLocalVar = new HelloApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/hello", requestedAtLocalVar, _jsonSerializerOptions); + + AfterHelloDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnHello(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHelloDefaultImplementation(e, "/hello", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorHello(e); + throw; + } + } + + /// + /// The + /// + public partial class HelloApiResponse : Org.OpenAPITools.Client.ApiResponse, IHelloApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public HelloApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(IRolesReportGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, IRolesReportGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + RolesReportGetApiResponse apiResponseLocalVar = new RolesReportGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } + + /// + /// The + /// + public partial class RolesReportGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IRolesReportGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public RolesReportGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterTestDefaultImplementation(ITestApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterTest(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterTest(ref bool suppressDefaultLog, ITestApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorTestDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorTest(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorTest(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Retrieve an existing Notificationtest's Elements + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/test"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestApiResponse apiResponseLocalVar = new TestApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnTest(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestDefaultImplementation(e, "/test", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorTest(e); + throw; + } + } + + /// + /// The + /// + public partial class TestApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NotificationtestGetElementsV1ResponseMPayload result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 00000000000..f0ab0b4ca0a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,5685 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeApi : IApi + { + /// + /// The class containing the events + /// + FakeApiEvents Events { get; } + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test inline free-form additionalProperties + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + + /// + /// test referenced string map + /// + /// + /// + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IFakeHealthGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IFakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestClientModelApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestEndpointParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestEnumParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface ITestGroupParametersApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ITestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestJsonFormDataApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface ITestStringMapReferenceApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeHealthGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeHealthGet; + + internal void ExecuteOnFakeHealthGet(FakeApi.FakeHealthGetApiResponse apiResponse) + { + OnFakeHealthGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeHealthGet(Exception exception) + { + OnErrorFakeHealthGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterBooleanSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterBooleanSerialize; + + internal void ExecuteOnFakeOuterBooleanSerialize(FakeApi.FakeOuterBooleanSerializeApiResponse apiResponse) + { + OnFakeOuterBooleanSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterBooleanSerialize(Exception exception) + { + OnErrorFakeOuterBooleanSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterCompositeSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterCompositeSerialize; + + internal void ExecuteOnFakeOuterCompositeSerialize(FakeApi.FakeOuterCompositeSerializeApiResponse apiResponse) + { + OnFakeOuterCompositeSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterCompositeSerialize(Exception exception) + { + OnErrorFakeOuterCompositeSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterNumberSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterNumberSerialize; + + internal void ExecuteOnFakeOuterNumberSerialize(FakeApi.FakeOuterNumberSerializeApiResponse apiResponse) + { + OnFakeOuterNumberSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterNumberSerialize(Exception exception) + { + OnErrorFakeOuterNumberSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFakeOuterStringSerialize; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFakeOuterStringSerialize; + + internal void ExecuteOnFakeOuterStringSerialize(FakeApi.FakeOuterStringSerializeApiResponse apiResponse) + { + OnFakeOuterStringSerialize?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFakeOuterStringSerialize(Exception exception) + { + OnErrorFakeOuterStringSerialize?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetArrayOfEnums; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetArrayOfEnums; + + internal void ExecuteOnGetArrayOfEnums(FakeApi.GetArrayOfEnumsApiResponse apiResponse) + { + OnGetArrayOfEnums?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetArrayOfEnums(Exception exception) + { + OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestAdditionalPropertiesReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestAdditionalPropertiesReference; + + internal void ExecuteOnTestAdditionalPropertiesReference(FakeApi.TestAdditionalPropertiesReferenceApiResponse apiResponse) + { + OnTestAdditionalPropertiesReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestAdditionalPropertiesReference(Exception exception) + { + OnErrorTestAdditionalPropertiesReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithFileSchema; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithFileSchema; + + internal void ExecuteOnTestBodyWithFileSchema(FakeApi.TestBodyWithFileSchemaApiResponse apiResponse) + { + OnTestBodyWithFileSchema?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithFileSchema(Exception exception) + { + OnErrorTestBodyWithFileSchema?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestBodyWithQueryParams; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestBodyWithQueryParams; + + internal void ExecuteOnTestBodyWithQueryParams(FakeApi.TestBodyWithQueryParamsApiResponse apiResponse) + { + OnTestBodyWithQueryParams?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestBodyWithQueryParams(Exception exception) + { + OnErrorTestBodyWithQueryParams?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClientModel; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClientModel; + + internal void ExecuteOnTestClientModel(FakeApi.TestClientModelApiResponse apiResponse) + { + OnTestClientModel?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClientModel(Exception exception) + { + OnErrorTestClientModel?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEndpointParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEndpointParameters; + + internal void ExecuteOnTestEndpointParameters(FakeApi.TestEndpointParametersApiResponse apiResponse) + { + OnTestEndpointParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEndpointParameters(Exception exception) + { + OnErrorTestEndpointParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestEnumParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestEnumParameters; + + internal void ExecuteOnTestEnumParameters(FakeApi.TestEnumParametersApiResponse apiResponse) + { + OnTestEnumParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestEnumParameters(Exception exception) + { + OnErrorTestEnumParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestGroupParameters; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestGroupParameters; + + internal void ExecuteOnTestGroupParameters(FakeApi.TestGroupParametersApiResponse apiResponse) + { + OnTestGroupParameters?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestGroupParameters(Exception exception) + { + OnErrorTestGroupParameters?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineAdditionalProperties; + + internal void ExecuteOnTestInlineAdditionalProperties(FakeApi.TestInlineAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineAdditionalProperties(Exception exception) + { + OnErrorTestInlineAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestInlineFreeformAdditionalProperties; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestInlineFreeformAdditionalProperties; + + internal void ExecuteOnTestInlineFreeformAdditionalProperties(FakeApi.TestInlineFreeformAdditionalPropertiesApiResponse apiResponse) + { + OnTestInlineFreeformAdditionalProperties?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestInlineFreeformAdditionalProperties(Exception exception) + { + OnErrorTestInlineFreeformAdditionalProperties?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestJsonFormData; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestJsonFormData; + + internal void ExecuteOnTestJsonFormData(FakeApi.TestJsonFormDataApiResponse apiResponse) + { + OnTestJsonFormData?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestJsonFormData(Exception exception) + { + OnErrorTestJsonFormData?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestQueryParameterCollectionFormat; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestQueryParameterCollectionFormat; + + internal void ExecuteOnTestQueryParameterCollectionFormat(FakeApi.TestQueryParameterCollectionFormatApiResponse apiResponse) + { + OnTestQueryParameterCollectionFormat?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestQueryParameterCollectionFormat(Exception exception) + { + OnErrorTestQueryParameterCollectionFormat?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnTestStringMapReference; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestStringMapReference; + + internal void ExecuteOnTestStringMapReference(FakeApi.TestStringMapReferenceApiResponse apiResponse) + { + OnTestStringMapReference?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestStringMapReference(Exception exception) + { + OnErrorTestStringMapReference?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeApi : IFakeApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeApiEvents fakeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + /// + /// Processes the server response + /// + /// + private void AfterFakeHealthGetDefaultImplementation(IFakeHealthGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterFakeHealthGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterFakeHealthGet(ref bool suppressDefaultLog, IFakeHealthGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorFakeHealthGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorFakeHealthGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorFakeHealthGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Health check endpoint + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeHealthGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeHealthGetApiResponse apiResponseLocalVar = new FakeHealthGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/health", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeHealthGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnFakeHealthGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeHealthGetDefaultImplementation(e, "/fake/health", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorFakeHealthGet(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeHealthGetApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeHealthGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeHealthGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.HealthCheckResult Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.HealthCheckResult result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterBooleanSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterBooleanSerializeDefaultImplementation(IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterBooleanSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterBooleanSerialize(ref bool suppressDefaultLog, IFakeOuterBooleanSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterBooleanSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterBooleanSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterBooleanSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer boolean types + /// + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterBooleanSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterBooleanSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterBooleanSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterBooleanSerializeApiResponse apiResponseLocalVar = new FakeOuterBooleanSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/boolean", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterBooleanSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterBooleanSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterBooleanSerializeDefaultImplementation(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterBooleanSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterBooleanSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterBooleanSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterBooleanSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public bool? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out bool? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterCompositeSerialize(Option outerComposite); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterCompositeSerialize(Option outerComposite) + { + if (outerComposite.IsSet && outerComposite.Value == null) + throw new ArgumentNullException(nameof(outerComposite)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterCompositeSerializeDefaultImplementation(IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite) + { + bool suppressDefaultLog = false; + AfterFakeOuterCompositeSerialize(ref suppressDefaultLog, apiResponseLocalVar, outerComposite); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterCompositeSerialize(ref bool suppressDefaultLog, IFakeOuterCompositeSerializeApiResponse apiResponseLocalVar, Option outerComposite); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterCompositeSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option outerComposite) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterCompositeSerialize(ref suppressDefaultLog, exception, pathFormat, path, outerComposite); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterCompositeSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option outerComposite); + + /// + /// Test serialization of object with outer number type + /// + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeOrDefaultAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterCompositeSerializeAsync(outerComposite, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterCompositeSerializeAsync(Option outerComposite = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterCompositeSerialize(outerComposite); + + FormatFakeOuterCompositeSerialize(outerComposite); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + + if (outerComposite.IsSet) + httpRequestMessageLocalVar.Content = (outerComposite.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterCompositeSerializeApiResponse apiResponseLocalVar = new FakeOuterCompositeSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/composite", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterCompositeSerializeDefaultImplementation(apiResponseLocalVar, outerComposite); + + Events.ExecuteOnFakeOuterCompositeSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterCompositeSerializeDefaultImplementation(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); + Events.ExecuteOnErrorFakeOuterCompositeSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterCompositeSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterCompositeSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterCompositeSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.OuterComposite Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.OuterComposite result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterNumberSerialize(ref Option body); + + /// + /// Processes the server response + /// + /// + /// + private void AfterFakeOuterNumberSerializeDefaultImplementation(IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterNumberSerialize(ref suppressDefaultLog, apiResponseLocalVar, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFakeOuterNumberSerialize(ref bool suppressDefaultLog, IFakeOuterNumberSerializeApiResponse apiResponseLocalVar, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFakeOuterNumberSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterNumberSerialize(ref suppressDefaultLog, exception, pathFormat, path, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterNumberSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option body); + + /// + /// Test serialization of outer number types + /// + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeOrDefaultAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterNumberSerializeAsync(body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterNumberSerializeAsync(Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatFakeOuterNumberSerialize(ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterNumberSerializeApiResponse apiResponseLocalVar = new FakeOuterNumberSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/number", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterNumberSerializeDefaultImplementation(apiResponseLocalVar, body); + + Events.ExecuteOnFakeOuterNumberSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterNumberSerializeDefaultImplementation(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); + Events.ExecuteOnErrorFakeOuterNumberSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterNumberSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterNumberSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterNumberSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public decimal? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out decimal? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFakeOuterStringSerialize(ref Guid requiredStringUuid, ref Option body); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFakeOuterStringSerialize(Option body) + { + if (body.IsSet && body.Value == null) + throw new ArgumentNullException(nameof(body)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterFakeOuterStringSerializeDefaultImplementation(IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + AfterFakeOuterStringSerialize(ref suppressDefaultLog, apiResponseLocalVar, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterFakeOuterStringSerialize(ref bool suppressDefaultLog, IFakeOuterStringSerializeApiResponse apiResponseLocalVar, Guid requiredStringUuid, Option body); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorFakeOuterStringSerializeDefaultImplementation(Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body) + { + bool suppressDefaultLog = false; + OnErrorFakeOuterStringSerialize(ref suppressDefaultLog, exception, pathFormat, path, requiredStringUuid, body); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorFakeOuterStringSerialize(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Guid requiredStringUuid, Option body); + + /// + /// Test serialization of outer string types + /// + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FakeOuterStringSerializeAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, Option body = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFakeOuterStringSerialize(body); + + FormatFakeOuterStringSerialize(ref requiredStringUuid, ref body); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_uuid"] = ClientUtils.ParameterToString(requiredStringUuid); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (body.IsSet) + httpRequestMessageLocalVar.Content = (body.Value as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body.Value, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "*/*" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FakeOuterStringSerializeApiResponse apiResponseLocalVar = new FakeOuterStringSerializeApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/outer/string", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFakeOuterStringSerializeDefaultImplementation(apiResponseLocalVar, requiredStringUuid, body); + + Events.ExecuteOnFakeOuterStringSerialize(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFakeOuterStringSerializeDefaultImplementation(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); + Events.ExecuteOnErrorFakeOuterStringSerialize(e); + throw; + } + } + + /// + /// The + /// + public partial class FakeOuterStringSerializeApiResponse : Org.OpenAPITools.Client.ApiResponse, IFakeOuterStringSerializeApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FakeOuterStringSerializeApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetArrayOfEnumsDefaultImplementation(IGetArrayOfEnumsApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetArrayOfEnums(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetArrayOfEnums(ref bool suppressDefaultLog, IGetArrayOfEnumsApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetArrayOfEnumsDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetArrayOfEnums(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetArrayOfEnums(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Array of Enums + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetArrayOfEnumsAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetArrayOfEnumsApiResponse apiResponseLocalVar = new GetArrayOfEnumsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/array-of-enums", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetArrayOfEnumsDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetArrayOfEnums(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetArrayOfEnumsDefaultImplementation(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetArrayOfEnums(e); + throw; + } + } + + /// + /// The + /// + public partial class GetArrayOfEnumsApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetArrayOfEnumsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetArrayOfEnumsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new GetMixedAnyOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new GetMixedOneOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestAdditionalPropertiesReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestAdditionalPropertiesReferenceDefaultImplementation(ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestAdditionalPropertiesReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestAdditionalPropertiesReference(ref bool suppressDefaultLog, ITestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestAdditionalPropertiesReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestAdditionalPropertiesReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestAdditionalPropertiesReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestAdditionalPropertiesReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestAdditionalPropertiesReference(requestBody); + + FormatTestAdditionalPropertiesReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/additionalProperties-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestAdditionalPropertiesReferenceApiResponse apiResponseLocalVar = new TestAdditionalPropertiesReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/additionalProperties-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestAdditionalPropertiesReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestAdditionalPropertiesReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestAdditionalPropertiesReferenceDefaultImplementation(e, "/fake/additionalProperties-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestAdditionalPropertiesReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestAdditionalPropertiesReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestAdditionalPropertiesReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestAdditionalPropertiesReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + { + if (fileSchemaTestClass == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestBodyWithFileSchemaDefaultImplementation(ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + AfterTestBodyWithFileSchema(ref suppressDefaultLog, apiResponseLocalVar, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestBodyWithFileSchema(ref bool suppressDefaultLog, ITestBodyWithFileSchemaApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithFileSchemaDefaultImplementation(Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithFileSchema(ref suppressDefaultLog, exception, pathFormat, path, fileSchemaTestClass); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithFileSchema(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, FileSchemaTestClass fileSchemaTestClass); + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithFileSchemaAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithFileSchema(fileSchemaTestClass); + + FormatTestBodyWithFileSchema(fileSchemaTestClass); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithFileSchemaApiResponse apiResponseLocalVar = new TestBodyWithFileSchemaApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-file-schema", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithFileSchemaDefaultImplementation(apiResponseLocalVar, fileSchemaTestClass); + + Events.ExecuteOnTestBodyWithFileSchema(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithFileSchemaDefaultImplementation(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); + Events.ExecuteOnErrorTestBodyWithFileSchema(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithFileSchemaApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithFileSchemaApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithFileSchemaApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestBodyWithQueryParams(User user, ref string query); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestBodyWithQueryParams(User user, string query) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (query == null) + throw new ArgumentNullException(nameof(query)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query) + { + bool suppressDefaultLog = false; + AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, user, query); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, User user, string query) + { + bool suppressDefaultLog = false; + OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, user, query); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string query); + + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestBodyWithQueryParamsAsync(user, query, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestBodyWithQueryParams(user, query); + + FormatTestBodyWithQueryParams(user, ref query); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["query"] = ClientUtils.ParameterToString(query); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestBodyWithQueryParamsApiResponse apiResponseLocalVar = new TestBodyWithQueryParamsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-query-params", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, user, query); + + Events.ExecuteOnTestBodyWithQueryParams(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); + Events.ExecuteOnErrorTestBodyWithQueryParams(e); + throw; + } + } + + /// + /// The + /// + public partial class TestBodyWithQueryParamsApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestBodyWithQueryParamsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestBodyWithQueryParamsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestClientModel(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClientModel(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClientModelDefaultImplementation(ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClientModel(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClientModel(ref bool suppressDefaultLog, ITestClientModelApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClientModelDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClientModel(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClientModel(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test \"client\" model To test \"client\" model + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClientModelAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClientModel(modelClient); + + FormatTestClientModel(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClientModelApiResponse apiResponseLocalVar = new TestClientModelApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClientModelDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClientModel(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClientModelDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClientModel(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClientModelApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClientModelApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClientModelApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEndpointParameters(ref byte[] varByte, ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref Option date, ref Option binary, ref Option varFloat, ref Option integer, ref Option int32, ref Option int64, ref Option varString, ref Option password, ref Option callback, ref Option dateTime); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + { + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); + + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary)); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString)); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); + + if (callback.IsSet && callback.Value == null) + throw new ArgumentNullException(nameof(callback)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime) + { + bool suppressDefaultLog = false; + OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEndpointParametersAsync(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + + FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(varByte))); + + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(varDouble))); + + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + + if (date.IsSet) + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date.Value))); + + if (binary.IsSet) + multipartContentLocalVar.Add(new StreamContent(binary.Value)); + + if (varFloat.IsSet) + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(varFloat.Value))); + + if (integer.IsSet) + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer.Value))); + + if (int32.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32.Value))); + + if (int64.IsSet) + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64.Value))); + + if (varString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(varString.Value))); + + if (password.IsSet) + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password.Value))); + + if (callback.IsSet) + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback.Value))); + + if (dateTime.IsSet) + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BasicToken basicTokenLocalVar1 = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar1); + + basicTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEndpointParametersApiResponse apiResponseLocalVar = new TestEndpointParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEndpointParametersDefaultImplementation(apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + + Events.ExecuteOnTestEndpointParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEndpointParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime); + Events.ExecuteOnErrorTestEndpointParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEndpointParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEndpointParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEndpointParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, Option> enumFormStringArray, ref Option enumHeaderString, ref Option enumQueryString, ref Option enumFormString); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); + + if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) + throw new ArgumentNullException(nameof(enumQueryStringArray)); + + if (enumFormStringArray.IsSet && enumFormStringArray.Value == null) + throw new ArgumentNullException(nameof(enumFormStringArray)); + + if (enumHeaderString.IsSet && enumHeaderString.Value == null) + throw new ArgumentNullException(nameof(enumHeaderString)); + + if (enumQueryString.IsSet && enumQueryString.Value == null) + throw new ArgumentNullException(nameof(enumQueryString)); + + if (enumFormString.IsSet && enumFormString.Value == null) + throw new ArgumentNullException(nameof(enumFormString)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + bool suppressDefaultLog = false; + AfterTestEnumParameters(ref suppressDefaultLog, apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestEnumParametersDefaultImplementation(Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + { + bool suppressDefaultLog = false; + OnErrorTestEnumParameters(ref suppressDefaultLog, exception, pathFormat, path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestEnumParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option enumQueryDouble, Option enumQueryInteger, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString); + + /// + /// To test enum parameters To test enum parameters + /// + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestEnumParametersAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string) (optional, default to -efg) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + + FormatTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, ref enumQueryDouble, ref enumQueryInteger, enumFormStringArray, ref enumHeaderString, ref enumQueryString, ref enumFormString); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + if (enumQueryStringArray.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); + + if (enumQueryDouble.IsSet) + // here too + parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); + + if (enumQueryInteger.IsSet) + // here too + parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); + + if (enumQueryString.IsSet) + // here too + parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + if (enumHeaderStringArray.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray.Value)); + + if (enumHeaderString.IsSet) + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString.Value)); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray.Value))); + + if (enumFormString.IsSet) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString.Value))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestEnumParametersApiResponse apiResponseLocalVar = new TestEnumParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestEnumParametersDefaultImplementation(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + + Events.ExecuteOnTestEnumParameters(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestEnumParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + Events.ExecuteOnErrorTestEnumParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestEnumParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestEnumParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestEnumParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestGroupParameters(ref bool requiredBooleanGroup, ref int requiredStringGroup, ref long requiredInt64Group, ref Option booleanGroup, ref Option stringGroup, ref Option int64Group); + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestGroupParametersDefaultImplementation(ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + AfterTestGroupParameters(ref suppressDefaultLog, apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestGroupParameters(ref bool suppressDefaultLog, ITestGroupParametersApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestGroupParametersDefaultImplementation(Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group) + { + bool suppressDefaultLog = false; + OnErrorTestGroupParameters(ref suppressDefaultLog, exception, pathFormat, path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestGroupParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup, Option stringGroup, Option int64Group); + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestGroupParametersAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required Boolean in group parameters + /// Required String in group parameters + /// Required Integer in group parameters + /// Boolean in group parameters (optional) + /// String in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatTestGroupParameters(ref requiredBooleanGroup, ref requiredStringGroup, ref requiredInt64Group, ref booleanGroup, ref stringGroup, ref int64Group); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["required_string_group"] = ClientUtils.ParameterToString(requiredStringGroup); + parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); + + if (stringGroup.IsSet) + // here too + parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); + + if (int64Group.IsSet) + // here too + parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + + if (booleanGroup.IsSet) + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + BearerToken bearerTokenLocalVar1 = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar1); + + bearerTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestGroupParametersApiResponse apiResponseLocalVar = new TestGroupParametersApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestGroupParametersDefaultImplementation(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + + Events.ExecuteOnTestGroupParameters(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestGroupParametersDefaultImplementation(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + Events.ExecuteOnErrorTestGroupParameters(e); + throw; + } + } + + /// + /// The + /// + public partial class TestGroupParametersApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestGroupParametersApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestGroupParametersApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineAdditionalProperties(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineAdditionalProperties(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineAdditionalPropertiesDefaultImplementation(ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestInlineAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineAdditionalProperties(ref bool suppressDefaultLog, ITestInlineAdditionalPropertiesApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestInlineAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test inline additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineAdditionalPropertiesAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineAdditionalProperties(requestBody); + + FormatTestInlineAdditionalProperties(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestInlineAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineAdditionalPropertiesDefaultImplementation(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestInlineAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + if (testInlineFreeformAdditionalPropertiesRequest == null) + throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + AfterTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, ITestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) + { + bool suppressDefaultLog = false; + OnErrorTestInlineFreeformAdditionalProperties(ref suppressDefaultLog, exception, pathFormat, path, testInlineFreeformAdditionalPropertiesRequest); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestInlineFreeformAdditionalProperties(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /// + /// test inline free-form additionalProperties + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesOrDefaultAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test inline free-form additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestInlineFreeformAdditionalPropertiesAsync(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + FormatTestInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-freeform-additionalProperties"; + + httpRequestMessageLocalVar.Content = (testInlineFreeformAdditionalPropertiesRequest as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(testInlineFreeformAdditionalPropertiesRequest, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestInlineFreeformAdditionalPropertiesApiResponse apiResponseLocalVar = new TestInlineFreeformAdditionalPropertiesApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/inline-freeform-additionalProperties", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestInlineFreeformAdditionalPropertiesDefaultImplementation(apiResponseLocalVar, testInlineFreeformAdditionalPropertiesRequest); + + Events.ExecuteOnTestInlineFreeformAdditionalProperties(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestInlineFreeformAdditionalPropertiesDefaultImplementation(e, "/fake/inline-freeform-additionalProperties", uriBuilderLocalVar.Path, testInlineFreeformAdditionalPropertiesRequest); + Events.ExecuteOnErrorTestInlineFreeformAdditionalProperties(e); + throw; + } + } + + /// + /// The + /// + public partial class TestInlineFreeformAdditionalPropertiesApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestInlineFreeformAdditionalPropertiesApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestInlineFreeformAdditionalPropertiesApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestJsonFormData(ref string param, ref string param2); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateTestJsonFormData(string param, string param2) + { + if (param == null) + throw new ArgumentNullException(nameof(param)); + + if (param2 == null) + throw new ArgumentNullException(nameof(param2)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterTestJsonFormDataDefaultImplementation(ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2) + { + bool suppressDefaultLog = false; + AfterTestJsonFormData(ref suppressDefaultLog, apiResponseLocalVar, param, param2); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterTestJsonFormData(ref bool suppressDefaultLog, ITestJsonFormDataApiResponse apiResponseLocalVar, string param, string param2); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorTestJsonFormDataDefaultImplementation(Exception exception, string pathFormat, string path, string param, string param2) + { + bool suppressDefaultLog = false; + OnErrorTestJsonFormData(ref suppressDefaultLog, exception, pathFormat, path, param, param2); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestJsonFormData(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string param, string param2); + + /// + /// test json serialization of form data + /// + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestJsonFormDataAsync(param, param2, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// <> + public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestJsonFormData(param, param2); + + FormatTestJsonFormData(ref param, ref param2); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); + + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestJsonFormDataApiResponse apiResponseLocalVar = new TestJsonFormDataApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/jsonFormData", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestJsonFormDataDefaultImplementation(apiResponseLocalVar, param, param2); + + Events.ExecuteOnTestJsonFormData(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestJsonFormDataDefaultImplementation(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); + Events.ExecuteOnErrorTestJsonFormData(e); + throw; + } + } + + /// + /// The + /// + public partial class TestJsonFormDataApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestJsonFormDataApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestJsonFormDataApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ref string requiredNotNullable, ref string requiredNullable, ref Option notRequiredNotNullable, ref Option notRequiredNullable); + + /// + /// Validates the request parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + { + if (pipe == null) + throw new ArgumentNullException(nameof(pipe)); + + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + + if (http == null) + throw new ArgumentNullException(nameof(http)); + + if (url == null) + throw new ArgumentNullException(nameof(url)); + + if (context == null) + throw new ArgumentNullException(nameof(context)); + + if (requiredNotNullable == null) + throw new ArgumentNullException(nameof(requiredNotNullable)); + + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void AfterTestQueryParameterCollectionFormatDefaultImplementation(ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + AfterTestQueryParameterCollectionFormat(ref suppressDefaultLog, apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void AfterTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, ITestQueryParameterCollectionFormatApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void OnErrorTestQueryParameterCollectionFormatDefaultImplementation(Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable) + { + bool suppressDefaultLog = false; + OnErrorTestQueryParameterCollectionFormat(ref suppressDefaultLog, exception, pathFormat, path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorTestQueryParameterCollectionFormat(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable, Option notRequiredNotNullable, Option notRequiredNullable); + + /// + /// To test the collection format in query parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + /// + /// (optional) + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, string requiredNullable = default, Option notRequiredNotNullable = default, Option notRequiredNullable = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + + FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["pipe"] = ClientUtils.ParameterToString(pipe); + parseQueryStringLocalVar["ioutil"] = ClientUtils.ParameterToString(ioutil); + parseQueryStringLocalVar["http"] = ClientUtils.ParameterToString(http); + parseQueryStringLocalVar["url"] = ClientUtils.ParameterToString(url); + parseQueryStringLocalVar["context"] = ClientUtils.ParameterToString(context); + parseQueryStringLocalVar["requiredNotNullable"] = ClientUtils.ParameterToString(requiredNotNullable); + parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); + + if (notRequiredNotNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); + + if (notRequiredNullable.IsSet) + // here too + parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestQueryParameterCollectionFormatApiResponse apiResponseLocalVar = new TestQueryParameterCollectionFormatApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/test-query-parameters", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestQueryParameterCollectionFormatDefaultImplementation(apiResponseLocalVar, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + + Events.ExecuteOnTestQueryParameterCollectionFormat(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestQueryParameterCollectionFormatDefaultImplementation(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); + Events.ExecuteOnErrorTestQueryParameterCollectionFormat(e); + throw; + } + } + + /// + /// The + /// + public partial class TestQueryParameterCollectionFormatApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestQueryParameterCollectionFormatApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestQueryParameterCollectionFormatApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatTestStringMapReference(Dictionary requestBody); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestStringMapReference(Dictionary requestBody) + { + if (requestBody == null) + throw new ArgumentNullException(nameof(requestBody)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestStringMapReferenceDefaultImplementation(ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody) + { + bool suppressDefaultLog = false; + AfterTestStringMapReference(ref suppressDefaultLog, apiResponseLocalVar, requestBody); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestStringMapReference(ref bool suppressDefaultLog, ITestStringMapReferenceApiResponse apiResponseLocalVar, Dictionary requestBody); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestStringMapReferenceDefaultImplementation(Exception exception, string pathFormat, string path, Dictionary requestBody) + { + bool suppressDefaultLog = false; + OnErrorTestStringMapReference(ref suppressDefaultLog, exception, pathFormat, path, requestBody); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestStringMapReference(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Dictionary requestBody); + + /// + /// test referenced string map + /// + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestStringMapReferenceAsync(requestBody, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// test referenced string map + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// <> + public async Task TestStringMapReferenceAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestStringMapReference(requestBody); + + FormatTestStringMapReference(requestBody); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/stringMap-reference"; + + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestStringMapReferenceApiResponse apiResponseLocalVar = new TestStringMapReferenceApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/stringMap-reference", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestStringMapReferenceDefaultImplementation(apiResponseLocalVar, requestBody); + + Events.ExecuteOnTestStringMapReference(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestStringMapReferenceDefaultImplementation(e, "/fake/stringMap-reference", uriBuilderLocalVar.Path, requestBody); + Events.ExecuteOnErrorTestStringMapReference(e); + throw; + } + } + + /// + /// The + /// + public partial class TestStringMapReferenceApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestStringMapReferenceApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestStringMapReferenceApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..1d5bd38c527 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,415 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IFakeClassnameTags123Api : IApi + { + /// + /// The class containing the events + /// + FakeClassnameTags123ApiEvents Events { get; } + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ITestClassnameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class FakeClassnameTags123ApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnTestClassname; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorTestClassname; + + internal void ExecuteOnTestClassname(FakeClassnameTags123Api.TestClassnameApiResponse apiResponse) + { + OnTestClassname?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorTestClassname(Exception exception) + { + OnErrorTestClassname?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public FakeClassnameTags123ApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, FakeClassnameTags123ApiEvents fakeClassnameTags123ApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = fakeClassnameTags123ApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatTestClassname(ModelClient modelClient); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateTestClassname(ModelClient modelClient) + { + if (modelClient == null) + throw new ArgumentNullException(nameof(modelClient)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterTestClassnameDefaultImplementation(ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient) + { + bool suppressDefaultLog = false; + AfterTestClassname(ref suppressDefaultLog, apiResponseLocalVar, modelClient); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterTestClassname(ref bool suppressDefaultLog, ITestClassnameApiResponse apiResponseLocalVar, ModelClient modelClient); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorTestClassnameDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient) + { + bool suppressDefaultLog = false; + OnErrorTestClassname(ref suppressDefaultLog, exception, pathFormat, path, modelClient); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorTestClassname(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient); + + /// + /// To test class name in snake case To test class name in snake case + /// + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await TestClassnameAsync(modelClient, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// <> + public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateTestClassname(modelClient); + + FormatTestClassname(modelClient); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + + apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + TestClassnameApiResponse apiResponseLocalVar = new TestClassnameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake_classname_test", requestedAtLocalVar, _jsonSerializerOptions); + + AfterTestClassnameDefaultImplementation(apiResponseLocalVar, modelClient); + + Events.ExecuteOnTestClassname(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorTestClassnameDefaultImplementation(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); + Events.ExecuteOnErrorTestClassname(e); + throw; + } + } + + /// + /// The + /// + public partial class TestClassnameApiResponse : Org.OpenAPITools.Client.ApiResponse, ITestClassnameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public TestClassnameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ModelClient Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ModelClient result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 00000000000..9693c8ffacd --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2784 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IPetApi : IApi + { + /// + /// The class containing the events + /// + PetApiEvents Events { get; } + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// <> + Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + [Obsolete] + Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image + /// + /// + /// + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IAddPetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IDeletePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByStatusApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IFindPetsByTagsApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface IGetPetByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IUpdatePetApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUpdatePetWithFormApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + bool IsMethodNotAllowed { get; } + } + + /// + /// The + /// + public interface IUploadFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IUploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class PetApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnAddPet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorAddPet; + + internal void ExecuteOnAddPet(PetApi.AddPetApiResponse apiResponse) + { + OnAddPet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorAddPet(Exception exception) + { + OnErrorAddPet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeletePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeletePet; + + internal void ExecuteOnDeletePet(PetApi.DeletePetApiResponse apiResponse) + { + OnDeletePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeletePet(Exception exception) + { + OnErrorDeletePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByStatus; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByStatus; + + internal void ExecuteOnFindPetsByStatus(PetApi.FindPetsByStatusApiResponse apiResponse) + { + OnFindPetsByStatus?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByStatus(Exception exception) + { + OnErrorFindPetsByStatus?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnFindPetsByTags; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorFindPetsByTags; + + internal void ExecuteOnFindPetsByTags(PetApi.FindPetsByTagsApiResponse apiResponse) + { + OnFindPetsByTags?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorFindPetsByTags(Exception exception) + { + OnErrorFindPetsByTags?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetPetById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetPetById; + + internal void ExecuteOnGetPetById(PetApi.GetPetByIdApiResponse apiResponse) + { + OnGetPetById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetPetById(Exception exception) + { + OnErrorGetPetById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePet; + + internal void ExecuteOnUpdatePet(PetApi.UpdatePetApiResponse apiResponse) + { + OnUpdatePet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePet(Exception exception) + { + OnErrorUpdatePet?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdatePetWithForm; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdatePetWithForm; + + internal void ExecuteOnUpdatePetWithForm(PetApi.UpdatePetWithFormApiResponse apiResponse) + { + OnUpdatePetWithForm?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdatePetWithForm(Exception exception) + { + OnErrorUpdatePetWithForm?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFile; + + internal void ExecuteOnUploadFile(PetApi.UploadFileApiResponse apiResponse) + { + OnUploadFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFile(Exception exception) + { + OnErrorUploadFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUploadFileWithRequiredFile; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUploadFileWithRequiredFile; + + internal void ExecuteOnUploadFileWithRequiredFile(PetApi.UploadFileWithRequiredFileApiResponse apiResponse) + { + OnUploadFileWithRequiredFile?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUploadFileWithRequiredFile(Exception exception) + { + OnErrorUploadFileWithRequiredFile?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class PetApi : IPetApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public PetApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public PetApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, PetApiEvents petApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = petApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatAddPet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateAddPet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterAddPetDefaultImplementation(IAddPetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterAddPet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterAddPet(ref bool suppressDefaultLog, IAddPetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorAddPetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorAddPet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorAddPet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await AddPetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateAddPet(pet); + + FormatAddPet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + AddPetApiResponse apiResponseLocalVar = new AddPetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterAddPetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnAddPet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorAddPetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorAddPet(e); + throw; + } + } + + /// + /// The + /// + public partial class AddPetApiResponse : Org.OpenAPITools.Client.ApiResponse, IAddPetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public AddPetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeletePet(ref long petId, ref Option apiKey); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeletePet(Option apiKey) + { + if (apiKey.IsSet && apiKey.Value == null) + throw new ArgumentNullException(nameof(apiKey)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterDeletePetDefaultImplementation(IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + AfterDeletePet(ref suppressDefaultLog, apiResponseLocalVar, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterDeletePet(ref bool suppressDefaultLog, IDeletePetApiResponse apiResponseLocalVar, long petId, Option apiKey); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorDeletePetDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option apiKey) + { + bool suppressDefaultLog = false; + OnErrorDeletePet(ref suppressDefaultLog, exception, pathFormat, path, petId, apiKey); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorDeletePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option apiKey); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetOrDefaultAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeletePetAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task DeletePetAsync(long petId, Option apiKey = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeletePet(apiKey); + + FormatDeletePet(ref petId, ref apiKey); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + if (apiKey.IsSet) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey.Value)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeletePetApiResponse apiResponseLocalVar = new DeletePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeletePetDefaultImplementation(apiResponseLocalVar, petId, apiKey); + + Events.ExecuteOnDeletePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeletePetDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); + Events.ExecuteOnErrorDeletePet(e); + throw; + } + } + + /// + /// The + /// + public partial class DeletePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeletePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeletePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByStatus(List status); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByStatus(List status) + { + if (status == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByStatusDefaultImplementation(IFindPetsByStatusApiResponse apiResponseLocalVar, List status) + { + bool suppressDefaultLog = false; + AfterFindPetsByStatus(ref suppressDefaultLog, apiResponseLocalVar, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByStatus(ref bool suppressDefaultLog, IFindPetsByStatusApiResponse apiResponseLocalVar, List status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByStatusDefaultImplementation(Exception exception, string pathFormat, string path, List status) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByStatus(ref suppressDefaultLog, exception, pathFormat, path, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByStatus(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List status); + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByStatusAsync(status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByStatus(status); + + FormatFindPetsByStatus(status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["status"] = ClientUtils.ParameterToString(status); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByStatusApiResponse apiResponseLocalVar = new FindPetsByStatusApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByStatus", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByStatusDefaultImplementation(apiResponseLocalVar, status); + + Events.ExecuteOnFindPetsByStatus(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByStatusDefaultImplementation(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); + Events.ExecuteOnErrorFindPetsByStatus(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByStatusApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByStatusApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByStatusApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatFindPetsByTags(List tags); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateFindPetsByTags(List tags) + { + if (tags == null) + throw new ArgumentNullException(nameof(tags)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterFindPetsByTagsDefaultImplementation(IFindPetsByTagsApiResponse apiResponseLocalVar, List tags) + { + bool suppressDefaultLog = false; + AfterFindPetsByTags(ref suppressDefaultLog, apiResponseLocalVar, tags); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterFindPetsByTags(ref bool suppressDefaultLog, IFindPetsByTagsApiResponse apiResponseLocalVar, List tags); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorFindPetsByTagsDefaultImplementation(Exception exception, string pathFormat, string path, List tags) + { + bool suppressDefaultLog = false; + OnErrorFindPetsByTags(ref suppressDefaultLog, exception, pathFormat, path, tags); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorFindPetsByTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List tags); + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await FindPetsByTagsAsync(tags, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// <> + public async Task FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateFindPetsByTags(tags); + + FormatFindPetsByTags(tags); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["tags"] = ClientUtils.ParameterToString(tags); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + FindPetsByTagsApiResponse apiResponseLocalVar = new FindPetsByTagsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/findByTags", requestedAtLocalVar, _jsonSerializerOptions); + + AfterFindPetsByTagsDefaultImplementation(apiResponseLocalVar, tags); + + Events.ExecuteOnFindPetsByTags(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorFindPetsByTagsDefaultImplementation(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); + Events.ExecuteOnErrorFindPetsByTags(e); + throw; + } + } + + /// + /// The + /// + public partial class FindPetsByTagsApiResponse : Org.OpenAPITools.Client.ApiResponse, IFindPetsByTagsApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public FindPetsByTagsApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public List Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out List result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetPetById(ref long petId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetPetByIdDefaultImplementation(IGetPetByIdApiResponse apiResponseLocalVar, long petId) + { + bool suppressDefaultLog = false; + AfterGetPetById(ref suppressDefaultLog, apiResponseLocalVar, petId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetPetById(ref bool suppressDefaultLog, IGetPetByIdApiResponse apiResponseLocalVar, long petId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetPetByIdDefaultImplementation(Exception exception, string pathFormat, string path, long petId) + { + bool suppressDefaultLog = false; + OnErrorGetPetById(ref suppressDefaultLog, exception, pathFormat, path, petId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetPetById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId); + + /// + /// Find pet by ID Returns a single pet + /// + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetPetByIdAsync(petId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// <> + public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetPetById(ref petId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key_query", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar2); + + apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetPetByIdApiResponse apiResponseLocalVar = new GetPetByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetPetByIdDefaultImplementation(apiResponseLocalVar, petId); + + Events.ExecuteOnGetPetById(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetPetByIdDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); + Events.ExecuteOnErrorGetPetById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetPetByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetPetByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetPetByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Pet Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Pet result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePet(Pet pet); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateUpdatePet(Pet pet) + { + if (pet == null) + throw new ArgumentNullException(nameof(pet)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterUpdatePetDefaultImplementation(IUpdatePetApiResponse apiResponseLocalVar, Pet pet) + { + bool suppressDefaultLog = false; + AfterUpdatePet(ref suppressDefaultLog, apiResponseLocalVar, pet); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterUpdatePet(ref bool suppressDefaultLog, IUpdatePetApiResponse apiResponseLocalVar, Pet pet); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorUpdatePetDefaultImplementation(Exception exception, string pathFormat, string path, Pet pet) + { + bool suppressDefaultLog = false; + OnErrorUpdatePet(ref suppressDefaultLog, exception, pathFormat, path, pet); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Pet pet); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetAsync(pet, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePet(pet); + + FormatUpdatePet(pet); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + HttpSignatureToken httpSignatureTokenLocalVar2 = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar2); + + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + httpSignatureTokenLocalVar2.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + + string[] contentTypes = new string[] { + "application/json", + "application/xml" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetApiResponse apiResponseLocalVar = new UpdatePetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetDefaultImplementation(apiResponseLocalVar, pet); + + Events.ExecuteOnUpdatePet(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetDefaultImplementation(e, "/pet", uriBuilderLocalVar.Path, pet); + Events.ExecuteOnErrorUpdatePet(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdatePetWithForm(ref long petId, ref Option name, ref Option status); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdatePetWithForm(Option name, Option status) + { + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUpdatePetWithFormDefaultImplementation(IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + AfterUpdatePetWithForm(ref suppressDefaultLog, apiResponseLocalVar, petId, name, status); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUpdatePetWithForm(ref bool suppressDefaultLog, IUpdatePetWithFormApiResponse apiResponseLocalVar, long petId, Option name, Option status); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUpdatePetWithFormDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option name, Option status) + { + bool suppressDefaultLog = false; + OnErrorUpdatePetWithForm(ref suppressDefaultLog, exception, pathFormat, path, petId, name, status); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdatePetWithForm(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option name, Option status); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormOrDefaultAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdatePetWithFormAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdatePetWithFormAsync(long petId, Option name = default, Option status = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdatePetWithForm(name, status); + + FormatUpdatePetWithForm(ref petId, ref name, ref status); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name.IsSet) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name.Value))); + + if (status.IsSet) + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdatePetWithFormApiResponse apiResponseLocalVar = new UpdatePetWithFormApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdatePetWithFormDefaultImplementation(apiResponseLocalVar, petId, name, status); + + Events.ExecuteOnUpdatePetWithForm(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdatePetWithFormDefaultImplementation(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); + Events.ExecuteOnErrorUpdatePetWithForm(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdatePetWithFormApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdatePetWithFormApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdatePetWithFormApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 405 MethodNotAllowed + /// + /// + public bool IsMethodNotAllowed => 405 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFile(ref long petId, ref Option file, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFile(Option file, Option additionalMetadata) + { + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileDefaultImplementation(IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFile(ref suppressDefaultLog, apiResponseLocalVar, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFile(ref bool suppressDefaultLog, IUploadFileApiResponse apiResponseLocalVar, long petId, Option file, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileDefaultImplementation(Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFile(ref suppressDefaultLog, exception, pathFormat, path, petId, file, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long petId, Option file, Option additionalMetadata); + + /// + /// uploads an image + /// + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileOrDefaultAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload (optional) + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileAsync(long petId, Option file = default, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFile(file, additionalMetadata); + + FormatUploadFile(ref petId, ref file, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file.IsSet) + multipartContentLocalVar.Add(new StreamContent(file.Value)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileApiResponse apiResponseLocalVar = new UploadFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/pet/{petId}/uploadImage", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileDefaultImplementation(apiResponseLocalVar, petId, file, additionalMetadata); + + Events.ExecuteOnUploadFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileDefaultImplementation(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); + Events.ExecuteOnErrorUploadFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUploadFileWithRequiredFile(ref System.IO.Stream requiredFile, ref long petId, ref Option additionalMetadata); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUploadFileWithRequiredFile(System.IO.Stream requiredFile, Option additionalMetadata) + { + if (requiredFile == null) + throw new ArgumentNullException(nameof(requiredFile)); + + if (additionalMetadata.IsSet && additionalMetadata.Value == null) + throw new ArgumentNullException(nameof(additionalMetadata)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + private void AfterUploadFileWithRequiredFileDefaultImplementation(IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + AfterUploadFileWithRequiredFile(ref suppressDefaultLog, apiResponseLocalVar, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + /// + partial void AfterUploadFileWithRequiredFile(ref bool suppressDefaultLog, IUploadFileWithRequiredFileApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + /// + private void OnErrorUploadFileWithRequiredFileDefaultImplementation(Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata) + { + bool suppressDefaultLog = false; + OnErrorUploadFileWithRequiredFile(ref suppressDefaultLog, exception, pathFormat, path, requiredFile, petId, additionalMetadata); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUploadFileWithRequiredFile(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, System.IO.Stream requiredFile, long petId, Option additionalMetadata); + + /// + /// uploads an image (required) + /// + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// file to upload + /// ID of pet to update + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// <> + public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, Option additionalMetadata = default, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUploadFileWithRequiredFile(requiredFile, additionalMetadata); + + FormatUploadFileWithRequiredFile(ref requiredFile, ref petId, ref additionalMetadata); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); + + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); + + if (additionalMetadata.IsSet) + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata.Value))); + + List tokenBaseLocalVars = new List(); + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + OAuthToken oauthTokenLocalVar1 = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar1); + + oauthTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar, ""); + + string[] contentTypes = new string[] { + "multipart/form-data" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UploadFileWithRequiredFileApiResponse apiResponseLocalVar = new UploadFileWithRequiredFileApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/{petId}/uploadImageWithRequiredFile", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUploadFileWithRequiredFileDefaultImplementation(apiResponseLocalVar, requiredFile, petId, additionalMetadata); + + Events.ExecuteOnUploadFileWithRequiredFile(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUploadFileWithRequiredFileDefaultImplementation(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); + Events.ExecuteOnErrorUploadFileWithRequiredFile(e); + throw; + } + } + + /// + /// The + /// + public partial class UploadFileWithRequiredFileApiResponse : Org.OpenAPITools.Client.ApiResponse, IUploadFileWithRequiredFileApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UploadFileWithRequiredFileApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.ApiResponse Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.ApiResponse result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 00000000000..4e9980c869e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,1197 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IStoreApi : IApi + { + /// + /// The class containing the events + /// + StoreApiEvents Events { get; } + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface IDeleteOrderApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetInventoryApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk> + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetOrderByIdApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IPlaceOrderApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class StoreApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteOrder; + + internal void ExecuteOnDeleteOrder(StoreApi.DeleteOrderApiResponse apiResponse) + { + OnDeleteOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteOrder(Exception exception) + { + OnErrorDeleteOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetInventory; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetInventory; + + internal void ExecuteOnGetInventory(StoreApi.GetInventoryApiResponse apiResponse) + { + OnGetInventory?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetInventory(Exception exception) + { + OnErrorGetInventory?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetOrderById; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetOrderById; + + internal void ExecuteOnGetOrderById(StoreApi.GetOrderByIdApiResponse apiResponse) + { + OnGetOrderById?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetOrderById(Exception exception) + { + OnErrorGetOrderById?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnPlaceOrder; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorPlaceOrder; + + internal void ExecuteOnPlaceOrder(StoreApi.PlaceOrderApiResponse apiResponse) + { + OnPlaceOrder?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorPlaceOrder(Exception exception) + { + OnErrorPlaceOrder?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class StoreApi : IStoreApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public StoreApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public StoreApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, StoreApiEvents storeApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = storeApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatDeleteOrder(ref string orderId); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteOrder(string orderId) + { + if (orderId == null) + throw new ArgumentNullException(nameof(orderId)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteOrderDefaultImplementation(IDeleteOrderApiResponse apiResponseLocalVar, string orderId) + { + bool suppressDefaultLog = false; + AfterDeleteOrder(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteOrder(ref bool suppressDefaultLog, IDeleteOrderApiResponse apiResponseLocalVar, string orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteOrderDefaultImplementation(Exception exception, string pathFormat, string path, string orderId) + { + bool suppressDefaultLog = false; + OnErrorDeleteOrder(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteOrderAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteOrder(orderId); + + FormatDeleteOrder(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteOrderApiResponse apiResponseLocalVar = new DeleteOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteOrderDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnDeleteOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteOrderDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorDeleteOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetInventoryDefaultImplementation(IGetInventoryApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetInventory(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetInventory(ref bool suppressDefaultLog, IGetInventoryApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetInventoryDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetInventory(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetInventory(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetInventoryAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + + List tokenBaseLocalVars = new List(); + ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar1); + apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetInventoryApiResponse apiResponseLocalVar = new GetInventoryApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/inventory", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetInventoryDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetInventory(apiResponseLocalVar); + + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetInventoryDefaultImplementation(e, "/store/inventory", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetInventory(e); + throw; + } + } + + /// + /// The + /// + public partial class GetInventoryApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetInventoryApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetInventoryApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Dictionary Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize>(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Dictionary result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetOrderById(ref long orderId); + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetOrderByIdDefaultImplementation(IGetOrderByIdApiResponse apiResponseLocalVar, long orderId) + { + bool suppressDefaultLog = false; + AfterGetOrderById(ref suppressDefaultLog, apiResponseLocalVar, orderId); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetOrderById(ref bool suppressDefaultLog, IGetOrderByIdApiResponse apiResponseLocalVar, long orderId); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetOrderByIdDefaultImplementation(Exception exception, string pathFormat, string path, long orderId) + { + bool suppressDefaultLog = false; + OnErrorGetOrderById(ref suppressDefaultLog, exception, pathFormat, path, orderId); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetOrderById(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, long orderId); + + /// + /// 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 + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetOrderByIdAsync(orderId, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// <> + public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + FormatGetOrderById(ref orderId); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetOrderByIdApiResponse apiResponseLocalVar = new GetOrderByIdApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order/{order_id}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetOrderByIdDefaultImplementation(apiResponseLocalVar, orderId); + + Events.ExecuteOnGetOrderById(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetOrderByIdDefaultImplementation(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); + Events.ExecuteOnErrorGetOrderById(e); + throw; + } + } + + /// + /// The + /// + public partial class GetOrderByIdApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetOrderByIdApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetOrderByIdApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatPlaceOrder(Order order); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidatePlaceOrder(Order order) + { + if (order == null) + throw new ArgumentNullException(nameof(order)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterPlaceOrderDefaultImplementation(IPlaceOrderApiResponse apiResponseLocalVar, Order order) + { + bool suppressDefaultLog = false; + AfterPlaceOrder(ref suppressDefaultLog, apiResponseLocalVar, order); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterPlaceOrder(ref bool suppressDefaultLog, IPlaceOrderApiResponse apiResponseLocalVar, Order order); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorPlaceOrderDefaultImplementation(Exception exception, string pathFormat, string path, Order order) + { + bool suppressDefaultLog = false; + OnErrorPlaceOrder(ref suppressDefaultLog, exception, pathFormat, path, order); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorPlaceOrder(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, Order order); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await PlaceOrderAsync(order, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// <> + public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidatePlaceOrder(order); + + FormatPlaceOrder(order); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + PlaceOrderApiResponse apiResponseLocalVar = new PlaceOrderApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/store/order", requestedAtLocalVar, _jsonSerializerOptions); + + AfterPlaceOrderDefaultImplementation(apiResponseLocalVar, order); + + Events.ExecuteOnPlaceOrder(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorPlaceOrderDefaultImplementation(e, "/store/order", uriBuilderLocalVar.Path, order); + Events.ExecuteOnErrorPlaceOrder(e); + throw; + } + } + + /// + /// The + /// + public partial class PlaceOrderApiResponse : Org.OpenAPITools.Client.ApiResponse, IPlaceOrderApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public PlaceOrderApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.Order Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.Order result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 00000000000..721984089ad --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,2223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IUserApi : IApi + { + /// + /// The class containing the events + /// + UserApiEvents Events { get; } + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface ICreateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface ICreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IDeleteUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// The + /// + public interface IGetUserByNameApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk, ICustomHttpStatusCode599 + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + bool IsCustomHttpStatusCode598 { get; } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + bool IsCustomHttpStatusCode599 { get; } + } + + /// + /// The + /// + public interface ILoginUserApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + } + + /// + /// The + /// + public interface ILogoutUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is the default response type + /// + /// + bool IsDefault { get; } + } + + /// + /// The + /// + public interface IUpdateUserApiResponse : Org.OpenAPITools.Client.IApiResponse + { + /// + /// Returns true if the response is 400 BadRequest + /// + /// + bool IsBadRequest { get; } + + /// + /// Returns true if the response is 404 NotFound + /// + /// + bool IsNotFound { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class UserApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUser; + + internal void ExecuteOnCreateUser(UserApi.CreateUserApiResponse apiResponse) + { + OnCreateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUser(Exception exception) + { + OnErrorCreateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithArrayInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithArrayInput; + + internal void ExecuteOnCreateUsersWithArrayInput(UserApi.CreateUsersWithArrayInputApiResponse apiResponse) + { + OnCreateUsersWithArrayInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithArrayInput(Exception exception) + { + OnErrorCreateUsersWithArrayInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnCreateUsersWithListInput; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorCreateUsersWithListInput; + + internal void ExecuteOnCreateUsersWithListInput(UserApi.CreateUsersWithListInputApiResponse apiResponse) + { + OnCreateUsersWithListInput?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorCreateUsersWithListInput(Exception exception) + { + OnErrorCreateUsersWithListInput?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnDeleteUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorDeleteUser; + + internal void ExecuteOnDeleteUser(UserApi.DeleteUserApiResponse apiResponse) + { + OnDeleteUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorDeleteUser(Exception exception) + { + OnErrorDeleteUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetUserByName; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetUserByName; + + internal void ExecuteOnGetUserByName(UserApi.GetUserByNameApiResponse apiResponse) + { + OnGetUserByName?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetUserByName(Exception exception) + { + OnErrorGetUserByName?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLoginUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLoginUser; + + internal void ExecuteOnLoginUser(UserApi.LoginUserApiResponse apiResponse) + { + OnLoginUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLoginUser(Exception exception) + { + OnErrorLoginUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnLogoutUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorLogoutUser; + + internal void ExecuteOnLogoutUser(UserApi.LogoutUserApiResponse apiResponse) + { + OnLogoutUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorLogoutUser(Exception exception) + { + OnErrorLogoutUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnUpdateUser; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorUpdateUser; + + internal void ExecuteOnUpdateUser(UserApi.UpdateUserApiResponse apiResponse) + { + OnUpdateUser?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorUpdateUser(Exception exception) + { + OnErrorUpdateUser?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class UserApi : IUserApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public UserApiEvents Events { get; } + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; } + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public UserApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, UserApiEvents userApiEvents, + TokenProvider apiKeyProvider, + TokenProvider bearerTokenProvider, + TokenProvider basicTokenProvider, + TokenProvider httpSignatureTokenProvider, + TokenProvider oauthTokenProvider) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = userApiEvents; + ApiKeyProvider = apiKeyProvider; + BearerTokenProvider = bearerTokenProvider; + BasicTokenProvider = basicTokenProvider; + HttpSignatureTokenProvider = httpSignatureTokenProvider; + OauthTokenProvider = oauthTokenProvider; + } + + partial void FormatCreateUser(User user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUser(User user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUserDefaultImplementation(ICreateUserApiResponse apiResponseLocalVar, User user) + { + bool suppressDefaultLog = false; + AfterCreateUser(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUser(ref bool suppressDefaultLog, ICreateUserApiResponse apiResponseLocalVar, User user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user) + { + bool suppressDefaultLog = false; + OnErrorCreateUser(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user); + + /// + /// Create user This can only be done by the logged in user. + /// + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUserAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUser(user); + + FormatCreateUser(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUserApiResponse apiResponseLocalVar = new CreateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUserDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUserDefaultImplementation(e, "/user", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithArrayInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithArrayInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithArrayInputDefaultImplementation(ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithArrayInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithArrayInput(ref bool suppressDefaultLog, ICreateUsersWithArrayInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithArrayInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithArrayInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithArrayInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithArrayInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithArrayInput(user); + + FormatCreateUsersWithArrayInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithArrayInputApiResponse apiResponseLocalVar = new CreateUsersWithArrayInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithArray", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithArrayInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithArrayInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithArrayInputDefaultImplementation(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithArrayInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithArrayInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithArrayInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithArrayInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatCreateUsersWithListInput(List user); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateCreateUsersWithListInput(List user) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterCreateUsersWithListInputDefaultImplementation(ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user) + { + bool suppressDefaultLog = false; + AfterCreateUsersWithListInput(ref suppressDefaultLog, apiResponseLocalVar, user); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterCreateUsersWithListInput(ref bool suppressDefaultLog, ICreateUsersWithListInputApiResponse apiResponseLocalVar, List user); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorCreateUsersWithListInputDefaultImplementation(Exception exception, string pathFormat, string path, List user) + { + bool suppressDefaultLog = false; + OnErrorCreateUsersWithListInput(ref suppressDefaultLog, exception, pathFormat, path, user); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorCreateUsersWithListInput(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await CreateUsersWithListInputAsync(user, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// <> + public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateCreateUsersWithListInput(user); + + FormatCreateUsersWithListInput(user); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + CreateUsersWithListInputApiResponse apiResponseLocalVar = new CreateUsersWithListInputApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/createWithList", requestedAtLocalVar, _jsonSerializerOptions); + + AfterCreateUsersWithListInputDefaultImplementation(apiResponseLocalVar, user); + + Events.ExecuteOnCreateUsersWithListInput(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorCreateUsersWithListInputDefaultImplementation(e, "/user/createWithList", uriBuilderLocalVar.Path, user); + Events.ExecuteOnErrorCreateUsersWithListInput(e); + throw; + } + } + + /// + /// The + /// + public partial class CreateUsersWithListInputApiResponse : Org.OpenAPITools.Client.ApiResponse, ICreateUsersWithListInputApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public CreateUsersWithListInputApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatDeleteUser(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateDeleteUser(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterDeleteUserDefaultImplementation(IDeleteUserApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterDeleteUser(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterDeleteUser(ref bool suppressDefaultLog, IDeleteUserApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorDeleteUserDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorDeleteUser(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorDeleteUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Delete user This can only be done by the logged in user. + /// + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await DeleteUserAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateDeleteUser(username); + + FormatDeleteUser(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + DeleteUserApiResponse apiResponseLocalVar = new DeleteUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterDeleteUserDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnDeleteUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorDeleteUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorDeleteUser(e); + throw; + } + } + + /// + /// The + /// + public partial class DeleteUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IDeleteUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public DeleteUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatGetUserByName(ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + private void ValidateGetUserByName(string username) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + private void AfterGetUserByNameDefaultImplementation(IGetUserByNameApiResponse apiResponseLocalVar, string username) + { + bool suppressDefaultLog = false; + AfterGetUserByName(ref suppressDefaultLog, apiResponseLocalVar, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + partial void AfterGetUserByName(ref bool suppressDefaultLog, IGetUserByNameApiResponse apiResponseLocalVar, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + private void OnErrorGetUserByNameDefaultImplementation(Exception exception, string pathFormat, string path, string username) + { + bool suppressDefaultLog = false; + OnErrorGetUserByName(ref suppressDefaultLog, exception, pathFormat, path, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + partial void OnErrorGetUserByName(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetUserByNameAsync(username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// <> + public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateGetUserByName(username); + + FormatGetUserByName(ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetUserByNameApiResponse apiResponseLocalVar = new GetUserByNameApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetUserByNameDefaultImplementation(apiResponseLocalVar, username); + + Events.ExecuteOnGetUserByName(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetUserByNameDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, username); + Events.ExecuteOnErrorGetUserByName(e); + throw; + } + } + + /// + /// The + /// + public partial class GetUserByNameApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetUserByNameApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetUserByNameApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.User Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + /// + /// Returns true if the response is 598 CustomHttpStatusCode598 + /// + /// + public bool IsCustomHttpStatusCode598 => 598 == (int)StatusCode; + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 + /// + /// + public bool IsCustomHttpStatusCode599 => 599 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 599 CustomHttpStatusCode599 + /// + /// + public Org.OpenAPITools.Model.User CustomHttpStatusCode599() + { + // This logic may be modified with the AsModel.mustache template + return IsCustomHttpStatusCode599 + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 599 CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + public bool TryCustomHttpStatusCode599(out Org.OpenAPITools.Model.User result) + { + result = null; + + try + { + result = CustomHttpStatusCode599(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)599); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatLoginUser(ref string username, ref string password); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateLoginUser(string username, string password) + { + if (username == null) + throw new ArgumentNullException(nameof(username)); + + if (password == null) + throw new ArgumentNullException(nameof(password)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterLoginUserDefaultImplementation(ILoginUserApiResponse apiResponseLocalVar, string username, string password) + { + bool suppressDefaultLog = false; + AfterLoginUser(ref suppressDefaultLog, apiResponseLocalVar, username, password); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterLoginUser(ref bool suppressDefaultLog, ILoginUserApiResponse apiResponseLocalVar, string username, string password); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorLoginUserDefaultImplementation(Exception exception, string pathFormat, string path, string username, string password) + { + bool suppressDefaultLog = false; + OnErrorLoginUser(ref suppressDefaultLog, exception, pathFormat, path, username, password); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorLoginUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string username, string password); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LoginUserAsync(username, password, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// <> + public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateLoginUser(username, password); + + FormatLoginUser(ref username, ref password); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryStringLocalVar["username"] = ClientUtils.ParameterToString(username); + parseQueryStringLocalVar["password"] = ClientUtils.ParameterToString(password); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/xml", + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LoginUserApiResponse apiResponseLocalVar = new LoginUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/login", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLoginUserDefaultImplementation(apiResponseLocalVar, username, password); + + Events.ExecuteOnLoginUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLoginUserDefaultImplementation(e, "/user/login", uriBuilderLocalVar.Path, username, password); + Events.ExecuteOnErrorLoginUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LoginUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILoginUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LoginUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public string Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out string result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterLogoutUserDefaultImplementation(ILogoutUserApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterLogoutUser(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterLogoutUser(ref bool suppressDefaultLog, ILogoutUserApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorLogoutUserDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorLogoutUser(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorLogoutUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Logs out current logged in user session + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await LogoutUserAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + LogoutUserApiResponse apiResponseLocalVar = new LogoutUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/logout", requestedAtLocalVar, _jsonSerializerOptions); + + AfterLogoutUserDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnLogoutUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorLogoutUserDefaultImplementation(e, "/user/logout", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorLogoutUser(e); + throw; + } + } + + /// + /// The + /// + public partial class LogoutUserApiResponse : Org.OpenAPITools.Client.ApiResponse, ILogoutUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public LogoutUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is the default response type + /// + /// + public bool IsDefault => true; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + partial void FormatUpdateUser(User user, ref string username); + + /// + /// Validates the request parameters + /// + /// + /// + /// + private void ValidateUpdateUser(User user, string username) + { + if (user == null) + throw new ArgumentNullException(nameof(user)); + + if (username == null) + throw new ArgumentNullException(nameof(username)); + } + + /// + /// Processes the server response + /// + /// + /// + /// + private void AfterUpdateUserDefaultImplementation(IUpdateUserApiResponse apiResponseLocalVar, User user, string username) + { + bool suppressDefaultLog = false; + AfterUpdateUser(ref suppressDefaultLog, apiResponseLocalVar, user, username); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + /// + /// + partial void AfterUpdateUser(ref bool suppressDefaultLog, IUpdateUserApiResponse apiResponseLocalVar, User user, string username); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + /// + /// + private void OnErrorUpdateUserDefaultImplementation(Exception exception, string pathFormat, string path, User user, string username) + { + bool suppressDefaultLog = false; + OnErrorUpdateUser(ref suppressDefaultLog, exception, pathFormat, path, user, username); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + /// + /// + partial void OnErrorUpdateUser(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string username); + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await UpdateUserAsync(user, username, cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// <> + public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + ValidateUpdateUser(user, username); + + FormatUpdateUser(user, ref username); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] contentTypes = new string[] { + "application/json" + }; + + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + UpdateUserApiResponse apiResponseLocalVar = new UpdateUserApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/user/{username}", requestedAtLocalVar, _jsonSerializerOptions); + + AfterUpdateUserDefaultImplementation(apiResponseLocalVar, user, username); + + Events.ExecuteOnUpdateUser(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorUpdateUserDefaultImplementation(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); + Events.ExecuteOnErrorUpdateUser(e); + throw; + } + } + + /// + /// The + /// + public partial class UpdateUserApiResponse : Org.OpenAPITools.Client.ApiResponse, IUpdateUserApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public UpdateUserApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 400 BadRequest + /// + /// + public bool IsBadRequest => 400 == (int)StatusCode; + + /// + /// Returns true if the response is 404 NotFound + /// + /// + public bool IsNotFound => 404 == (int)StatusCode; + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..fdd11dd19c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiException.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs new file mode 100644 index 00000000000..b8bdf9964ff --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiKeyToken.cs @@ -0,0 +1,52 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + Header = header; + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the header. + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request) + { + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) + { + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..63c4e7c4bc3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface ICustomHttpStatusCode599 : IApiResponse + { + /// + /// Deserializes the response if the response is CustomHttpStatusCode599 + /// + /// + TType CustomHttpStatusCode599(); + + /// + /// Returns true if the response is CustomHttpStatusCode599 and the deserialized response is not null + /// + /// + /// + bool TryCustomHttpStatusCode599(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } + + /// + /// An interface for responses of type + /// + /// + public interface IDefault : IApiResponse + { + /// + /// Deserializes the response if the response is Default + /// + /// + TType Default(); + + /// + /// Returns true if the response is Default and the deserialized response is not null + /// + /// + /// + bool TryDefault(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs new file mode 100644 index 00000000000..c58c0563231 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BasicToken.cs @@ -0,0 +1,42 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Org.OpenAPITools.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs new file mode 100644 index 00000000000..df5c2310bac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/BearerToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..9cb9620cc92 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,427 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + ComparisonConfig comparisonConfig = new ComparisonConfig(); + comparisonConfig.UseHashCodeIdentifier = true; + compareLogic = new CompareLogic(comparisonConfig); + } + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + /// + /// The api_key header + /// + Api_key, + /// + /// The api_key_query header + /// + Api_key_query + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + public static string ApiKeyHeaderToString(ApiKeyHeader value) + { + switch(value) + { + case ApiKeyHeader.Api_key: + return "api_key"; + case ApiKeyHeader.Api_key_query: + return "api_key_query"; + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ChildCat.PetTypeEnum childCatPetTypeEnum) + return ChildCat.PetTypeEnumToJsonValue(childCatPetTypeEnum); + if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum) + return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum); + if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum) + return EnumArrays.JustSymbolEnumToJsonValue(enumArraysJustSymbolEnum); + if (obj is EnumClass enumClass) + return EnumClassValueConverter.ToJsonValue(enumClass); + if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum) + return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum); + if (obj is EnumTest.EnumIntegerEnum enumTestEnumIntegerEnum) + return EnumTest.EnumIntegerEnumToJsonValue(enumTestEnumIntegerEnum).ToString(); + if (obj is EnumTest.EnumIntegerOnlyEnum enumTestEnumIntegerOnlyEnum) + return EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTestEnumIntegerOnlyEnum).ToString(); + if (obj is EnumTest.EnumNumberEnum enumTestEnumNumberEnum) + return EnumTest.EnumNumberEnumToJsonValue(enumTestEnumNumberEnum).ToString(); + if (obj is EnumTest.EnumStringEnum enumTestEnumStringEnum) + return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum); + if (obj is MapTest.InnerEnum mapTestInnerEnum) + return MapTest.InnerEnumToJsonValue(mapTestInnerEnum); + if (obj is Order.StatusEnum orderStatusEnum) + return Order.StatusEnumToJsonValue(orderStatusEnum); + if (obj is OuterEnum outerEnum) + return OuterEnumValueConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerValueConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is OuterEnumTest outerEnumTest) + return OuterEnumTestValueConverter.ToJsonValue(outerEnumTest); + if (obj is Pet.StatusEnum petStatusEnum) + return Pet.StatusEnumToJsonValue(petStatusEnum); + if (obj is RequiredClass.RequiredNotnullableEnumIntegerEnum requiredClassRequiredNotnullableEnumIntegerEnum) + return RequiredClass.RequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum requiredClassRequiredNotnullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) + return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); + if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) + return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) + return RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.NotrequiredNotnullableEnumStringEnum requiredClassNotrequiredNotnullableEnumStringEnum) + return RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClassNotrequiredNotnullableEnumStringEnum); + if (obj is RequiredClass.NotrequiredNullableEnumIntegerEnum requiredClassNotrequiredNullableEnumIntegerEnum) + return RequiredClass.NotrequiredNullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum requiredClassNotrequiredNullableEnumIntegerOnlyEnum) + 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) + return ZeroBasedEnumValueConverter.ToJsonValue(zeroBasedEnum); + if (obj is ZeroBasedEnumClass.ZeroBasedEnumEnum zeroBasedEnumClassZeroBasedEnumEnum) + return ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClassZeroBasedEnumEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://petstore.swagger.io:80/v2"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "/v2"; + + /// + /// The host of the API + /// + public const string HOST = "petstore.swagger.io"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..973f9e9d4e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..b491c61f07f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..e12f1ae9779 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,249 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new ActivityJsonConverter()); + _jsonOptions.Converters.Add(new ActivityOutputElementRepresentationJsonConverter()); + _jsonOptions.Converters.Add(new AdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new AnimalJsonConverter()); + _jsonOptions.Converters.Add(new ApiResponseJsonConverter()); + _jsonOptions.Converters.Add(new AppleJsonConverter()); + _jsonOptions.Converters.Add(new AppleReqJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayOfNumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ArrayTestJsonConverter()); + _jsonOptions.Converters.Add(new BananaJsonConverter()); + _jsonOptions.Converters.Add(new BananaReqJsonConverter()); + _jsonOptions.Converters.Add(new BasquePigJsonConverter()); + _jsonOptions.Converters.Add(new CapitalizationJsonConverter()); + _jsonOptions.Converters.Add(new CatJsonConverter()); + _jsonOptions.Converters.Add(new CategoryJsonConverter()); + _jsonOptions.Converters.Add(new ChildCatJsonConverter()); + _jsonOptions.Converters.Add(new ClassModelJsonConverter()); + _jsonOptions.Converters.Add(new ComplexQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new DanishPigJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyClassJsonConverter()); + _jsonOptions.Converters.Add(new DeprecatedObjectJsonConverter()); + _jsonOptions.Converters.Add(new DogJsonConverter()); + _jsonOptions.Converters.Add(new DrawingJsonConverter()); + _jsonOptions.Converters.Add(new EnumArraysJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassJsonConverter()); + _jsonOptions.Converters.Add(new EnumClassNullableJsonConverter()); + _jsonOptions.Converters.Add(new EnumTestJsonConverter()); + _jsonOptions.Converters.Add(new EquilateralTriangleJsonConverter()); + _jsonOptions.Converters.Add(new FileJsonConverter()); + _jsonOptions.Converters.Add(new FileSchemaTestClassJsonConverter()); + _jsonOptions.Converters.Add(new FooJsonConverter()); + _jsonOptions.Converters.Add(new FooGetDefaultResponseJsonConverter()); + _jsonOptions.Converters.Add(new FormatTestJsonConverter()); + _jsonOptions.Converters.Add(new FruitJsonConverter()); + _jsonOptions.Converters.Add(new FruitReqJsonConverter()); + _jsonOptions.Converters.Add(new GmFruitJsonConverter()); + _jsonOptions.Converters.Add(new GrandparentAnimalJsonConverter()); + _jsonOptions.Converters.Add(new HasOnlyReadOnlyJsonConverter()); + _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); + _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); + _jsonOptions.Converters.Add(new MammalJsonConverter()); + _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); + _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); + _jsonOptions.Converters.Add(new ModelClientJsonConverter()); + _jsonOptions.Converters.Add(new NameJsonConverter()); + _jsonOptions.Converters.Add(new NotificationtestGetElementsV1ResponseMPayloadJsonConverter()); + _jsonOptions.Converters.Add(new NullableClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableGuidClassJsonConverter()); + _jsonOptions.Converters.Add(new NullableShapeJsonConverter()); + _jsonOptions.Converters.Add(new NumberOnlyJsonConverter()); + _jsonOptions.Converters.Add(new ObjectWithDeprecatedFieldsJsonConverter()); + _jsonOptions.Converters.Add(new OneOfStringJsonConverter()); + _jsonOptions.Converters.Add(new OrderJsonConverter()); + _jsonOptions.Converters.Add(new OuterCompositeJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumIntegerDefaultValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestJsonConverter()); + _jsonOptions.Converters.Add(new OuterEnumTestNullableJsonConverter()); + _jsonOptions.Converters.Add(new ParentPetJsonConverter()); + _jsonOptions.Converters.Add(new PetJsonConverter()); + _jsonOptions.Converters.Add(new PigJsonConverter()); + _jsonOptions.Converters.Add(new PolymorphicPropertyJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); + _jsonOptions.Converters.Add(new RequiredClassJsonConverter()); + _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); + _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); + _jsonOptions.Converters.Add(new ShapeJsonConverter()); + _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new ShapeOrNullJsonConverter()); + _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); + _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); + _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); + _jsonOptions.Converters.Add(new TestInlineFreeformAdditionalPropertiesRequestJsonConverter()); + _jsonOptions.Converters.Add(new TriangleJsonConverter()); + _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); + _jsonOptions.Converters.Add(new UserJsonConverter()); + _jsonOptions.Converters.Add(new WhaleJsonConverter()); + _jsonOptions.Converters.Add(new ZebraJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumNullableJsonConverter()); + _jsonOptions.Converters.Add(new ZeroBasedEnumClassJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 00000000000..53f435c05f9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,641 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) + { + HashAlgorithm hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, SecureString keyPassPhrase = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(); // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 format + return null; + } + + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = MD5.Create(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result, hashtarget, result.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs new file mode 100644 index 00000000000..b6301dc17c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningToken.cs @@ -0,0 +1,41 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs new file mode 100644 index 00000000000..ec4d08e9c99 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/OAuthToken.cs @@ -0,0 +1,37 @@ +// + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..8cf79a713b7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/Option.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..534f27a8cc5 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + if (container is TokenContainer apiKeyTokenContainer) + { + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); + + foreach (string header in headers) + { + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(header, Channel.CreateBounded(options)); + } + } + else + { + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + } + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..36d7dad03e2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..dce7b971eaa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..40eeffc9676 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..c82fea7a865 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..428d69dd8ea --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -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 + * 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 +{ + /// + /// test map of maps + /// + public partial class Activity : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + [JsonConstructor] + public Activity(Option>> activityOutputs = default) + { + ActivityOutputsOption = activityOutputs; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ActivityOutputs + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ActivityOutputsOption { get; private set; } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get { return this.ActivityOutputsOption; } set { this.ActivityOutputsOption = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 ActivityJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Activity 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>> activityOutputs = 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 "activity_outputs": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (activityOutputs.IsSet && activityOutputs.Value == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is not nullable for class Activity."); + + return new Activity(activityOutputs); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activity, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activity.ActivityOutputsOption.IsSet) + { + writer.WritePropertyName("activity_outputs"); + JsonSerializer.Serialize(writer, activity.ActivityOutputs, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs new file mode 100644 index 00000000000..8ae65f50c23 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,207 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + [JsonConstructor] + public ActivityOutputElementRepresentation(Option prop1 = default, Option prop2 = default) + { + Prop1Option = prop1; + Prop2Option = prop2; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Prop1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop1Option { get; private set; } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get { return this.Prop1Option; } set { this.Prop1Option = new Option(value); } } + + /// + /// Used to track the state of Prop2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Prop2Option { get; private set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get { return this.Prop2Option; } set { this.Prop2Option = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ActivityOutputElementRepresentation 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 prop1 = default; + Option prop2 = 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 "prop1": + prop1 = new Option(utf8JsonReader.GetString()); + break; + case "prop2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (prop1.IsSet && prop1.Value == null) + throw new ArgumentNullException(nameof(prop1), "Property is not nullable for class ActivityOutputElementRepresentation."); + + if (prop2.IsSet && prop2.Value == null) + throw new ArgumentNullException(nameof(prop2), "Property is not nullable for class ActivityOutputElementRepresentation."); + + return new ActivityOutputElementRepresentation(prop1, prop2); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (activityOutputElementRepresentation.Prop2Option.IsSet && activityOutputElementRepresentation.Prop2 == null) + throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop2), "Property is required for class ActivityOutputElementRepresentation."); + + if (activityOutputElementRepresentation.Prop1Option.IsSet) + writer.WriteString("prop1", activityOutputElementRepresentation.Prop1); + + if (activityOutputElementRepresentation.Prop2Option.IsSet) + { + writer.WritePropertyName("prop2"); + JsonSerializer.Serialize(writer, activityOutputElementRepresentation.Prop2, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d7857e4aad8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,400 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AdditionalPropertiesClass + /// + public partial class AdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// anytype1 + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// mapOfMapProperty + /// mapProperty + /// mapWithUndeclaredPropertiesAnytype1 + /// mapWithUndeclaredPropertiesAnytype2 + /// mapWithUndeclaredPropertiesAnytype3 + /// mapWithUndeclaredPropertiesString + [JsonConstructor] + public AdditionalPropertiesClass(Option anytype1 = default, Option emptyMap = default, Option>> mapOfMapProperty = default, Option> mapProperty = default, Option mapWithUndeclaredPropertiesAnytype1 = default, Option mapWithUndeclaredPropertiesAnytype2 = default, Option> mapWithUndeclaredPropertiesAnytype3 = default, Option> mapWithUndeclaredPropertiesString = default) + { + Anytype1Option = anytype1; + EmptyMapOption = emptyMap; + MapOfMapPropertyOption = mapOfMapProperty; + MapPropertyOption = mapProperty; + MapWithUndeclaredPropertiesAnytype1Option = mapWithUndeclaredPropertiesAnytype1; + MapWithUndeclaredPropertiesAnytype2Option = mapWithUndeclaredPropertiesAnytype2; + MapWithUndeclaredPropertiesAnytype3Option = mapWithUndeclaredPropertiesAnytype3; + MapWithUndeclaredPropertiesStringOption = mapWithUndeclaredPropertiesString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Anytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Anytype1Option { get; private set; } + + /// + /// Gets or Sets Anytype1 + /// + [JsonPropertyName("anytype_1")] + public Object Anytype1 { get { return this.Anytype1Option; } set { this.Anytype1Option = new Option(value); } } + + /// + /// Used to track the state of EmptyMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmptyMapOption { get; private set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [JsonPropertyName("empty_map")] + public Object EmptyMap { get { return this.EmptyMapOption; } set { this.EmptyMapOption = new Option(value); } } + + /// + /// Used to track the state of MapOfMapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapOfMapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [JsonPropertyName("map_of_map_property")] + public Dictionary> MapOfMapProperty { get { return this.MapOfMapPropertyOption; } set { this.MapOfMapPropertyOption = new Option>>(value); } } + + /// + /// Used to track the state of MapProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapPropertyOption { get; private set; } + + /// + /// Gets or Sets MapProperty + /// + [JsonPropertyName("map_property")] + public Dictionary MapProperty { get { return this.MapPropertyOption; } set { this.MapPropertyOption = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype1 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype1Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_1")] + public Object MapWithUndeclaredPropertiesAnytype1 { get { return this.MapWithUndeclaredPropertiesAnytype1Option; } set { this.MapWithUndeclaredPropertiesAnytype1Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype2 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MapWithUndeclaredPropertiesAnytype2Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_2")] + public Object MapWithUndeclaredPropertiesAnytype2 { get { return this.MapWithUndeclaredPropertiesAnytype2Option; } set { this.MapWithUndeclaredPropertiesAnytype2Option = new Option(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesAnytype3 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesAnytype3Option { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [JsonPropertyName("map_with_undeclared_properties_anytype_3")] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get { return this.MapWithUndeclaredPropertiesAnytype3Option; } set { this.MapWithUndeclaredPropertiesAnytype3Option = new Option>(value); } } + + /// + /// Used to track the state of MapWithUndeclaredPropertiesString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapWithUndeclaredPropertiesStringOption { get; private set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [JsonPropertyName("map_with_undeclared_properties_string")] + public Dictionary MapWithUndeclaredPropertiesString { get { return this.MapWithUndeclaredPropertiesStringOption; } set { this.MapWithUndeclaredPropertiesStringOption = 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 AdditionalPropertiesClass {\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).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 AdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AdditionalPropertiesClass 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 anytype1 = default; + Option emptyMap = default; + Option>> mapOfMapProperty = default; + Option> mapProperty = default; + Option mapWithUndeclaredPropertiesAnytype1 = default; + Option mapWithUndeclaredPropertiesAnytype2 = default; + Option> mapWithUndeclaredPropertiesAnytype3 = default; + Option> mapWithUndeclaredPropertiesString = 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 "anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "empty_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_property": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_1": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_2": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_anytype_3": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_with_undeclared_properties_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (emptyMap.IsSet && emptyMap.Value == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapOfMapProperty.IsSet && mapOfMapProperty.Value == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapProperty.IsSet && mapProperty.Value == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1.IsSet && mapWithUndeclaredPropertiesAnytype1.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2.IsSet && mapWithUndeclaredPropertiesAnytype2.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3.IsSet && mapWithUndeclaredPropertiesAnytype3.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is not nullable for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString.IsSet && mapWithUndeclaredPropertiesString.Value == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is not nullable for class AdditionalPropertiesClass."); + + return new AdditionalPropertiesClass(anytype1, emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet && additionalPropertiesClass.MapOfMapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapPropertyOption.IsSet && additionalPropertiesClass.MapProperty == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet && additionalPropertiesClass.MapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(additionalPropertiesClass.MapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + + if (additionalPropertiesClass.Anytype1Option.IsSet) + if (additionalPropertiesClass.Anytype1Option.Value != null) + { + writer.WritePropertyName("anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.Anytype1, jsonSerializerOptions); + } + else + writer.WriteNull("anytype_1"); + if (additionalPropertiesClass.EmptyMapOption.IsSet) + { + writer.WritePropertyName("empty_map"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.EmptyMap, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapOfMapPropertyOption.IsSet) + { + writer.WritePropertyName("map_of_map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapOfMapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapPropertyOption.IsSet) + { + writer.WritePropertyName("map_property"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapProperty, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_1"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_2"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Option.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_anytype_3"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3, jsonSerializerOptions); + } + if (additionalPropertiesClass.MapWithUndeclaredPropertiesStringOption.IsSet) + { + writer.WritePropertyName("map_with_undeclared_properties_string"); + JsonSerializer.Serialize(writer, additionalPropertiesClass.MapWithUndeclaredPropertiesString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 00000000000..6abbd41a281 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,221 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Animal + /// + public partial class Animal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + [JsonConstructor] + public Animal(Option color = default) + { + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = 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 Animal {\n"); + sb.Append(" Color: ").Append(Color).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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Animal 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 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) + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Animal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Animal."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); + + return new Animal(color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, animal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + { + if (animal.ColorOption.IsSet && animal.Color == null) + throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); + + writer.WriteString("className", animal.ClassName); + + if (animal.ColorOption.IsSet) + writer.WriteString("color", animal.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 00000000000..f6fa613cbbb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,230 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ApiResponse + /// + public partial class ApiResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code + /// message + /// type + [JsonConstructor] + public ApiResponse(Option code = default, Option message = default, Option type = default) + { + CodeOption = code; + MessageOption = message; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Code + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CodeOption { get; private set; } + + /// + /// Gets or Sets Code + /// + [JsonPropertyName("code")] + public int? Code { get { return this.CodeOption; } set { this.CodeOption = new Option(value); } } + + /// + /// Used to track the state of Message + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MessageOption { get; private set; } + + /// + /// Gets or Sets Message + /// + [JsonPropertyName("message")] + public string Message { get { return this.MessageOption; } set { this.MessageOption = new Option(value); } } + + /// + /// Used to track the state of Type + /// + [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 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 ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ApiResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ApiResponse 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 code = default; + Option message = default; + Option type = 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 "code": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = new Option(utf8JsonReader.GetInt32()); + break; + case "message": + message = new Option(utf8JsonReader.GetString()); + break; + case "type": + type = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (code.IsSet && code.Value == null) + throw new ArgumentNullException(nameof(code), "Property is not nullable for class ApiResponse."); + + if (message.IsSet && message.Value == null) + throw new ArgumentNullException(nameof(message), "Property is not nullable for class ApiResponse."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class ApiResponse."); + + return new ApiResponse(code, message, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apiResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apiResponse.TypeOption.IsSet && apiResponse.Type == null) + throw new ArgumentNullException(nameof(apiResponse.Type), "Property is required for class ApiResponse."); + + if (apiResponse.CodeOption.IsSet) + writer.WriteNumber("code", apiResponse.CodeOption.Value.Value); + + if (apiResponse.MessageOption.IsSet) + writer.WriteString("message", apiResponse.Message); + + if (apiResponse.TypeOption.IsSet) + writer.WriteString("type", apiResponse.Type); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..e0c09dbf5f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,262 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Apple + /// + public partial class Apple : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// colorCode + /// cultivar + /// origin + [JsonConstructor] + public Apple(Option colorCode = default, Option cultivar = default, Option origin = default) + { + ColorCodeOption = colorCode; + CultivarOption = cultivar; + OriginOption = origin; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ColorCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorCodeOption { get; private set; } + + /// + /// Gets or Sets ColorCode + /// + [JsonPropertyName("color_code")] + public string ColorCode { get { return this.ColorCodeOption; } set { this.ColorCodeOption = new Option(value); } } + + /// + /// Used to track the state of Cultivar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CultivarOption { get; private set; } + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get { return this.CultivarOption; } set { this.CultivarOption = new Option(value); } } + + /// + /// Used to track the state of Origin + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OriginOption { get; private set; } + + /// + /// Gets or Sets Origin + /// + [JsonPropertyName("origin")] + public string Origin { get { return this.OriginOption; } set { this.OriginOption = 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 Apple {\n"); + sb.Append(" ColorCode: ").Append(ColorCode).Append("\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).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) + { + if (this.ColorCodeOption.Value != null) { + // ColorCode (string) pattern + Regex regexColorCode = new Regex(@"^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$", RegexOptions.CultureInvariant); + + if (this.ColorCodeOption.Value != null &&!regexColorCode.Match(this.ColorCodeOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ColorCode, must match a pattern of " + regexColorCode, new [] { "ColorCode" }); + } + } + + if (this.CultivarOption.Value != null) { + // Cultivar (string) pattern + Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); + + if (this.CultivarOption.Value != null &&!regexCultivar.Match(this.CultivarOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); + } + } + + if (this.OriginOption.Value != null) { + // Origin (string) pattern + Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.OriginOption.Value != null &&!regexOrigin.Match(this.OriginOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); + } + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class AppleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Apple 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 colorCode = default; + Option cultivar = default; + Option origin = 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 "color_code": + colorCode = new Option(utf8JsonReader.GetString()); + break; + case "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "origin": + origin = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (colorCode.IsSet && colorCode.Value == null) + throw new ArgumentNullException(nameof(colorCode), "Property is not nullable for class Apple."); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class Apple."); + + if (origin.IsSet && origin.Value == null) + throw new ArgumentNullException(nameof(origin), "Property is not nullable for class Apple."); + + return new Apple(colorCode, cultivar, origin); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, apple, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (apple.CultivarOption.IsSet && apple.Cultivar == null) + throw new ArgumentNullException(nameof(apple.Cultivar), "Property is required for class Apple."); + + if (apple.OriginOption.IsSet && apple.Origin == null) + throw new ArgumentNullException(nameof(apple.Origin), "Property is required for class Apple."); + + if (apple.ColorCodeOption.IsSet) + writer.WriteString("color_code", apple.ColorCode); + + if (apple.CultivarOption.IsSet) + writer.WriteString("cultivar", apple.Cultivar); + + if (apple.OriginOption.IsSet) + writer.WriteString("origin", apple.Origin); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 00000000000..7f69b627038 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// AppleReq + /// + public partial class AppleReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar + /// mealy + [JsonConstructor] + public AppleReq(string cultivar, Option mealy = default) + { + Cultivar = cultivar; + MealyOption = mealy; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Cultivar + /// + [JsonPropertyName("cultivar")] + public string Cultivar { get; set; } + + /// + /// Used to track the state of Mealy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MealyOption { get; private set; } + + /// + /// Gets or Sets Mealy + /// + [JsonPropertyName("mealy")] + public bool? Mealy { get { return this.MealyOption; } set { this.MealyOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).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 AppleReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override AppleReq 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 cultivar = default; + Option mealy = 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 "cultivar": + cultivar = new Option(utf8JsonReader.GetString()); + break; + case "mealy": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!cultivar.IsSet) + throw new ArgumentException("Property is required for class AppleReq.", nameof(cultivar)); + + if (cultivar.IsSet && cultivar.Value == null) + throw new ArgumentNullException(nameof(cultivar), "Property is not nullable for class AppleReq."); + + if (mealy.IsSet && mealy.Value == null) + throw new ArgumentNullException(nameof(mealy), "Property is not nullable for class AppleReq."); + + return new AppleReq(cultivar.Value, mealy); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, appleReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("cultivar", appleReq.Cultivar); + + if (appleReq.MealyOption.IsSet) + writer.WriteBoolean("mealy", appleReq.MealyOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..9f6f55f4bc9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + public partial class ArrayOfArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber + [JsonConstructor] + public ArrayOfArrayOfNumberOnly(Option>> arrayArrayNumber = default) + { + ArrayArrayNumberOption = arrayArrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [JsonPropertyName("ArrayArrayNumber")] + public List> ArrayArrayNumber { get { return this.ArrayArrayNumberOption; } set { this.ArrayArrayNumberOption = 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 ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).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 ArrayOfArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfArrayOfNumberOnly 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>> arrayArrayNumber = 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 "ArrayArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayNumber.IsSet && arrayArrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is not nullable for class ArrayOfArrayOfNumberOnly."); + + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfArrayOfNumberOnly.ArrayArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..3e38c89877d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -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 + * 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 +{ + /// + /// ArrayOfNumberOnly + /// + public partial class ArrayOfNumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber + [JsonConstructor] + public ArrayOfNumberOnly(Option> arrayNumber = default) + { + ArrayNumberOption = arrayNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNumberOption { get; private set; } + + /// + /// Gets or Sets ArrayNumber + /// + [JsonPropertyName("ArrayNumber")] + public List ArrayNumber { get { return this.ArrayNumberOption; } set { this.ArrayNumberOption = 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 ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).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 ArrayOfNumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayOfNumberOnly 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> arrayNumber = 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 "ArrayNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayNumber.IsSet && arrayNumber.Value == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is not nullable for class ArrayOfNumberOnly."); + + return new ArrayOfNumberOnly(arrayNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayOfNumberOnly.ArrayNumberOption.IsSet) + { + writer.WritePropertyName("ArrayNumber"); + JsonSerializer.Serialize(writer, arrayOfNumberOnly.ArrayNumber, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 00000000000..8ddbe4d6309 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,242 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ArrayTest + /// + public partial class ArrayTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayOfInteger + /// arrayArrayOfModel + /// arrayOfString + [JsonConstructor] + public ArrayTest(Option>> arrayArrayOfInteger = default, Option>> arrayArrayOfModel = default, Option> arrayOfString = default) + { + ArrayArrayOfIntegerOption = arrayArrayOfInteger; + ArrayArrayOfModelOption = arrayArrayOfModel; + ArrayOfStringOption = arrayOfString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayArrayOfInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfIntegerOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [JsonPropertyName("array_array_of_integer")] + public List> ArrayArrayOfInteger { get { return this.ArrayArrayOfIntegerOption; } set { this.ArrayArrayOfIntegerOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayArrayOfModel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> ArrayArrayOfModelOption { get; private set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [JsonPropertyName("array_array_of_model")] + public List> ArrayArrayOfModel { get { return this.ArrayArrayOfModelOption; } set { this.ArrayArrayOfModelOption = new Option>>(value); } } + + /// + /// Used to track the state of ArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets ArrayOfString + /// + [JsonPropertyName("array_of_string")] + public List ArrayOfString { get { return this.ArrayOfStringOption; } set { this.ArrayOfStringOption = 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 ArrayTest {\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).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 ArrayTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ArrayTest 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>> arrayArrayOfInteger = default; + Option>> arrayArrayOfModel = default; + Option> arrayOfString = 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 "array_array_of_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_array_of_model": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (arrayArrayOfInteger.IsSet && arrayArrayOfInteger.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is not nullable for class ArrayTest."); + + if (arrayArrayOfModel.IsSet && arrayArrayOfModel.Value == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is not nullable for class ArrayTest."); + + if (arrayOfString.IsSet && arrayOfString.Value == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is not nullable for class ArrayTest."); + + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, arrayTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (arrayTest.ArrayArrayOfModelOption.IsSet && arrayTest.ArrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfModel), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayOfStringOption.IsSet && arrayTest.ArrayOfString == null) + throw new ArgumentNullException(nameof(arrayTest.ArrayOfString), "Property is required for class ArrayTest."); + + if (arrayTest.ArrayArrayOfIntegerOption.IsSet) + { + writer.WritePropertyName("array_array_of_integer"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfInteger, jsonSerializerOptions); + } + if (arrayTest.ArrayArrayOfModelOption.IsSet) + { + writer.WritePropertyName("array_array_of_model"); + JsonSerializer.Serialize(writer, arrayTest.ArrayArrayOfModel, jsonSerializerOptions); + } + if (arrayTest.ArrayOfStringOption.IsSet) + { + writer.WritePropertyName("array_of_string"); + JsonSerializer.Serialize(writer, arrayTest.ArrayOfString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..8fc9c71c574 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -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 + * 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 +{ + /// + /// Banana + /// + public partial class Banana : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + [JsonConstructor] + public Banana(Option lengthCm = default) + { + LengthCmOption = lengthCm; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of LengthCm + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LengthCmOption { get; private set; } + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal? LengthCm { get { return this.LengthCmOption; } set { this.LengthCmOption = 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 Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).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 BananaJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Banana 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 lengthCm = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class Banana."); + + return new Banana(lengthCm); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, banana, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 00000000000..e4a3a99aafa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,187 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BananaReq + /// + public partial class BananaReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm + /// sweet + [JsonConstructor] + public BananaReq(decimal lengthCm, Option sweet = default) + { + LengthCm = lengthCm; + SweetOption = sweet; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets LengthCm + /// + [JsonPropertyName("lengthCm")] + public decimal LengthCm { get; set; } + + /// + /// Used to track the state of Sweet + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SweetOption { get; private set; } + + /// + /// Gets or Sets Sweet + /// + [JsonPropertyName("sweet")] + public bool? Sweet { get { return this.SweetOption; } set { this.SweetOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).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 BananaReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BananaReq 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 lengthCm = default; + Option sweet = 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 "lengthCm": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = new Option(utf8JsonReader.GetDecimal()); + break; + case "sweet": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!lengthCm.IsSet) + throw new ArgumentException("Property is required for class BananaReq.", nameof(lengthCm)); + + if (lengthCm.IsSet && lengthCm.Value == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is not nullable for class BananaReq."); + + if (sweet.IsSet && sweet.Value == null) + throw new ArgumentNullException(nameof(sweet), "Property is not nullable for class BananaReq."); + + return new BananaReq(lengthCm.Value.Value, sweet); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, bananaReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteNumber("lengthCm", bananaReq.LengthCm); + + if (bananaReq.SweetOption.IsSet) + writer.WriteBoolean("sweet", bananaReq.SweetOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 00000000000..9938d89e008 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// BasquePig + /// + public partial class BasquePig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public BasquePig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 BasquePigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override BasquePig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class BasquePig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class BasquePig."); + + return new BasquePig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, basquePig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", basquePig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 00000000000..ddf4f67e04c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -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 + * 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 +{ + /// + /// Capitalization + /// + public partial class Capitalization : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Name of the pet + /// capitalCamel + /// capitalSnake + /// sCAETHFlowPoints + /// smallCamel + /// smallSnake + [JsonConstructor] + public Capitalization(Option aTTNAME = default, Option capitalCamel = default, Option capitalSnake = default, Option sCAETHFlowPoints = default, Option smallCamel = default, Option smallSnake = default) + { + ATT_NAMEOption = aTTNAME; + CapitalCamelOption = capitalCamel; + CapitalSnakeOption = capitalSnake; + SCAETHFlowPointsOption = sCAETHFlowPoints; + SmallCamelOption = smallCamel; + SmallSnakeOption = smallSnake; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ATT_NAME + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ATT_NAMEOption { get; private set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [JsonPropertyName("ATT_NAME")] + public string ATT_NAME { get { return this.ATT_NAMEOption; } set { this.ATT_NAMEOption = new Option(value); } } + + /// + /// Used to track the state of CapitalCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalCamelOption { get; private set; } + + /// + /// Gets or Sets CapitalCamel + /// + [JsonPropertyName("CapitalCamel")] + public string CapitalCamel { get { return this.CapitalCamelOption; } set { this.CapitalCamelOption = new Option(value); } } + + /// + /// Used to track the state of CapitalSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CapitalSnakeOption { get; private set; } + + /// + /// Gets or Sets CapitalSnake + /// + [JsonPropertyName("Capital_Snake")] + public string CapitalSnake { get { return this.CapitalSnakeOption; } set { this.CapitalSnakeOption = new Option(value); } } + + /// + /// Used to track the state of SCAETHFlowPoints + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SCAETHFlowPointsOption { get; private set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [JsonPropertyName("SCA_ETH_Flow_Points")] + public string SCAETHFlowPoints { get { return this.SCAETHFlowPointsOption; } set { this.SCAETHFlowPointsOption = new Option(value); } } + + /// + /// Used to track the state of SmallCamel + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallCamelOption { get; private set; } + + /// + /// Gets or Sets SmallCamel + /// + [JsonPropertyName("smallCamel")] + public string SmallCamel { get { return this.SmallCamelOption; } set { this.SmallCamelOption = new Option(value); } } + + /// + /// Used to track the state of SmallSnake + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SmallSnakeOption { get; private set; } + + /// + /// Gets or Sets SmallSnake + /// + [JsonPropertyName("small_Snake")] + public string SmallSnake { get { return this.SmallSnakeOption; } set { this.SmallSnakeOption = 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 Capitalization {\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).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 CapitalizationJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Capitalization 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 aTTNAME = default; + Option capitalCamel = default; + Option capitalSnake = default; + Option sCAETHFlowPoints = default; + Option smallCamel = default; + Option smallSnake = 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 "ATT_NAME": + aTTNAME = new Option(utf8JsonReader.GetString()); + break; + case "CapitalCamel": + capitalCamel = new Option(utf8JsonReader.GetString()); + break; + case "Capital_Snake": + capitalSnake = new Option(utf8JsonReader.GetString()); + break; + case "SCA_ETH_Flow_Points": + sCAETHFlowPoints = new Option(utf8JsonReader.GetString()); + break; + case "smallCamel": + smallCamel = new Option(utf8JsonReader.GetString()); + break; + case "small_Snake": + smallSnake = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (aTTNAME.IsSet && aTTNAME.Value == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization."); + + if (capitalCamel.IsSet && capitalCamel.Value == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization."); + + if (capitalSnake.IsSet && capitalSnake.Value == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization."); + + if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization."); + + if (smallCamel.IsSet && smallCamel.Value == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization."); + + if (smallSnake.IsSet && smallSnake.Value == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization."); + + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, capitalization, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (capitalization.CapitalCamelOption.IsSet && capitalization.CapitalCamel == null) + throw new ArgumentNullException(nameof(capitalization.CapitalCamel), "Property is required for class Capitalization."); + + if (capitalization.CapitalSnakeOption.IsSet && capitalization.CapitalSnake == null) + throw new ArgumentNullException(nameof(capitalization.CapitalSnake), "Property is required for class Capitalization."); + + if (capitalization.SCAETHFlowPointsOption.IsSet && capitalization.SCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(capitalization.SCAETHFlowPoints), "Property is required for class Capitalization."); + + if (capitalization.SmallCamelOption.IsSet && capitalization.SmallCamel == null) + throw new ArgumentNullException(nameof(capitalization.SmallCamel), "Property is required for class Capitalization."); + + if (capitalization.SmallSnakeOption.IsSet && capitalization.SmallSnake == null) + throw new ArgumentNullException(nameof(capitalization.SmallSnake), "Property is required for class Capitalization."); + + if (capitalization.ATT_NAMEOption.IsSet) + writer.WriteString("ATT_NAME", capitalization.ATT_NAME); + + if (capitalization.CapitalCamelOption.IsSet) + writer.WriteString("CapitalCamel", capitalization.CapitalCamel); + + if (capitalization.CapitalSnakeOption.IsSet) + writer.WriteString("Capital_Snake", capitalization.CapitalSnake); + + if (capitalization.SCAETHFlowPointsOption.IsSet) + writer.WriteString("SCA_ETH_Flow_Points", capitalization.SCAETHFlowPoints); + + if (capitalization.SmallCamelOption.IsSet) + writer.WriteString("smallCamel", capitalization.SmallCamel); + + if (capitalization.SmallSnakeOption.IsSet) + writer.WriteString("small_Snake", capitalization.SmallSnake); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 00000000000..d11d16c855e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,189 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Cat + /// + public partial class Cat : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// color (default to "red") + /// declawed + [JsonConstructor] + public Cat(Option color = default, Option declawed = default) : base(color) + { + DeclawedOption = declawed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeclawedOption { get; private set; } + + /// + /// Gets or Sets Declawed + /// + [JsonPropertyName("declawed")] + public bool? Declawed { get { return this.DeclawedOption; } set { this.DeclawedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class CatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Cat 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 className = default; + Option color = default; + Option declawed = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "declawed": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Cat.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Cat."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Cat."); + + if (declawed.IsSet && declawed.Value == null) + throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); + + return new Cat(color, declawed); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, cat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + { + if (cat.ColorOption.IsSet && cat.Color == null) + throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); + + writer.WriteString("className", cat.ClassName); + + if (cat.ColorOption.IsSet) + writer.WriteString("color", cat.Color); + + if (cat.DeclawedOption.IsSet) + writer.WriteBoolean("declawed", cat.DeclawedOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 00000000000..1708429172a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,196 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Category + /// + public partial class Category : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name (default to "default-name") + [JsonConstructor] + public Category(Option id = default, string name = @"default-name") + { + IdOption = id; + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// 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 Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 CategoryJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Category 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Category.", nameof(name)); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Category."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Category."); + + return new Category(id, name.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, category, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (category.IdOption.IsSet) + writer.WriteNumber("id", category.IdOption.Value.Value); + + writer.WriteString("name", category.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 00000000000..a2785447497 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -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 + * 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 +{ + /// + /// ChildCat + /// + public partial class ChildCat : ParentPet, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public ChildCat(Option name = default) : base() + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines PetType + /// + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + ChildCat = 1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static PetTypeEnum PetTypeEnumFromString(string value) + { + if (value.Equals("ChildCat")) + return PetTypeEnum.ChildCat; + + throw new NotImplementedException($"Could not convert value to type PetTypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static PetTypeEnum? PetTypeEnumFromStringOrDefault(string value) + { + if (value.Equals("ChildCat")) + return PetTypeEnum.ChildCat; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string PetTypeEnumToJsonValue(PetTypeEnum value) + { + if (value == PetTypeEnum.ChildCat) + return "ChildCat"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ChildCatJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ChildCat 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 name = default; + Option petType = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "pet_type": + string petTypeRawValue = utf8JsonReader.GetString(); + if (petTypeRawValue != null) + petType = new Option(ChildCat.PetTypeEnumFromStringOrDefault(petTypeRawValue)); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ChildCat.", nameof(petType)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat."); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); + + return new ChildCat(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, childCat, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (childCat.NameOption.IsSet) + writer.WriteString("name", childCat.Name); + + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 00000000000..cf37657bf45 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model with \"_class\" property + /// + public partial class ClassModel : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + [JsonConstructor] + public ClassModel(Option @class = default) + { + ClassOption = @class; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("_class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = 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 ClassModel {\n"); + sb.Append(" Class: ").Append(Class).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 ClassModelJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ClassModel 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 varClass = 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 "_class": + varClass = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class ClassModel."); + + return new ClassModel(varClass); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, classModel, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (classModel.ClassOption.IsSet) + writer.WriteString("_class", classModel.Class); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 00000000000..3023a45610e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// ComplexQuadrilateral + /// + public partial class ComplexQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public ComplexQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ComplexQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ComplexQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ComplexQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ComplexQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class ComplexQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ComplexQuadrilateral."); + + return new ComplexQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (complexQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(complexQuadrilateral.ShapeType), "Property is required for class ComplexQuadrilateral."); + + writer.WriteString("quadrilateralType", complexQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", complexQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 00000000000..14b2ed3b153 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DanishPig + /// + public partial class DanishPig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + [JsonConstructor] + public DanishPig(string className) + { + ClassName = className; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).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 DanishPigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DanishPig 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 className = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class DanishPig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class DanishPig."); + + return new DanishPig(className.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, danishPig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", danishPig.ClassName); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs new file mode 100644 index 00000000000..62bd07a9513 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -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 + * 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 +{ + /// + /// DateOnlyClass + /// + public partial class DateOnlyClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateOnlyProperty + [JsonConstructor] + public DateOnlyClass(Option dateOnlyProperty = default) + { + DateOnlyPropertyOption = dateOnlyProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateOnlyProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateOnlyPropertyOption { get; private set; } + + /// + /// Gets or Sets DateOnlyProperty + /// + /// Fri Jul 21 00:00:00 UTC 2017 + [JsonPropertyName("dateOnlyProperty")] + public DateTime? DateOnlyProperty { get { return this.DateOnlyPropertyOption; } set { this.DateOnlyPropertyOption = 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 DateOnlyClass {\n"); + sb.Append(" DateOnlyProperty: ").Append(DateOnlyProperty).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 DateOnlyClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateOnlyProperty + /// + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DateOnlyClass 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 dateOnlyProperty = 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 "dateOnlyProperty": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (dateOnlyProperty.IsSet && dateOnlyProperty.Value == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is not nullable for class DateOnlyClass."); + + return new DateOnlyClass(dateOnlyProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 00000000000..661b1e7c2c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// DeprecatedObject + /// + public partial class DeprecatedObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public DeprecatedObject(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).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 DeprecatedObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override DeprecatedObject 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class DeprecatedObject."); + + return new DeprecatedObject(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (deprecatedObject.NameOption.IsSet) + writer.WriteString("name", deprecatedObject.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 00000000000..75a60416f90 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -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 + * 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 +{ + /// + /// Dog + /// + public partial class Dog : Animal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// breed + /// color (default to "red") + [JsonConstructor] + public Dog(Option breed = default, Option color = default) : base(color) + { + BreedOption = breed; + OnCreated(); + } + + 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 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BreedOption { get; private set; } + + /// + /// Gets or Sets Breed + /// + [JsonPropertyName("breed")] + public string Breed { get { return this.BreedOption; } set { this.BreedOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class DogJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Dog 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 className = default; + Option breed = default; + Option color = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "breed": + breed = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Dog.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Dog."); + + if (breed.IsSet && breed.Value == null) + throw new ArgumentNullException(nameof(breed), "Property is not nullable for class Dog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); + + return new Dog(breed, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, dog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + { + if (dog.BreedOption.IsSet && dog.Breed == null) + throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); + + if (dog.ColorOption.IsSet && dog.Color == null) + throw new ArgumentNullException(nameof(dog.Color), "Property is required for class Dog."); + + writer.WriteString("className", dog.ClassName); + + if (dog.BreedOption.IsSet) + writer.WriteString("breed", dog.Breed); + + if (dog.ColorOption.IsSet) + writer.WriteString("color", dog.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 00000000000..70ff3517f49 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Drawing + /// + public partial class Drawing : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape + /// nullableShape + /// shapeOrNull + /// shapes + [JsonConstructor] + public Drawing(Option mainShape = default, Option nullableShape = default, Option shapeOrNull = default, Option> shapes = default) + { + MainShapeOption = mainShape; + NullableShapeOption = nullableShape; + ShapeOrNullOption = shapeOrNull; + ShapesOption = shapes; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MainShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MainShapeOption { get; private set; } + + /// + /// Gets or Sets MainShape + /// + [JsonPropertyName("mainShape")] + public Shape MainShape { get { return this.MainShapeOption; } set { this.MainShapeOption = new Option(value); } } + + /// + /// Used to track the state of NullableShape + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableShapeOption { get; private set; } + + /// + /// Gets or Sets NullableShape + /// + [JsonPropertyName("nullableShape")] + public NullableShape NullableShape { get { return this.NullableShapeOption; } set { this.NullableShapeOption = new Option(value); } } + + /// + /// Used to track the state of ShapeOrNull + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShapeOrNullOption { get; private set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [JsonPropertyName("shapeOrNull")] + public ShapeOrNull ShapeOrNull { get { return this.ShapeOrNullOption; } set { this.ShapeOrNullOption = new Option(value); } } + + /// + /// Used to track the state of Shapes + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ShapesOption { get; private set; } + + /// + /// Gets or Sets Shapes + /// + [JsonPropertyName("shapes")] + public List Shapes { get { return this.ShapesOption; } set { this.ShapesOption = 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 Drawing {\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).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 DrawingJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Drawing 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 mainShape = default; + Option nullableShape = default; + Option shapeOrNull = default; + Option> shapes = 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 "mainShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "nullableShape": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapeOrNull": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "shapes": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (mainShape.IsSet && mainShape.Value == null) + throw new ArgumentNullException(nameof(mainShape), "Property is not nullable for class Drawing."); + + if (shapes.IsSet && shapes.Value == null) + throw new ArgumentNullException(nameof(shapes), "Property is not nullable for class Drawing."); + + return new Drawing(mainShape, nullableShape, shapeOrNull, shapes); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, drawing, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (drawing.ShapesOption.IsSet && drawing.Shapes == null) + throw new ArgumentNullException(nameof(drawing.Shapes), "Property is required for class Drawing."); + + if (drawing.MainShapeOption.IsSet) + { + writer.WritePropertyName("mainShape"); + JsonSerializer.Serialize(writer, drawing.MainShape, jsonSerializerOptions); + } + if (drawing.NullableShapeOption.IsSet) + if (drawing.NullableShapeOption.Value != null) + { + writer.WritePropertyName("nullableShape"); + JsonSerializer.Serialize(writer, drawing.NullableShape, jsonSerializerOptions); + } + else + writer.WriteNull("nullableShape"); + if (drawing.ShapeOrNullOption.IsSet) + if (drawing.ShapeOrNullOption.Value != null) + { + writer.WritePropertyName("shapeOrNull"); + JsonSerializer.Serialize(writer, drawing.ShapeOrNull, jsonSerializerOptions); + } + else + writer.WriteNull("shapeOrNull"); + if (drawing.ShapesOption.IsSet) + { + writer.WritePropertyName("shapes"); + JsonSerializer.Serialize(writer, drawing.Shapes, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 00000000000..1e0b0d1c226 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,337 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumArrays + /// + public partial class EnumArrays : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayEnum + /// justSymbol + [JsonConstructor] + public EnumArrays(Option> arrayEnum = default, Option justSymbol = default) + { + ArrayEnumOption = arrayEnum; + JustSymbolOption = justSymbol; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines ArrayEnum + /// + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + Crab = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static ArrayEnumEnum ArrayEnumEnumFromString(string value) + { + if (value.Equals("fish")) + return ArrayEnumEnum.Fish; + + if (value.Equals("crab")) + return ArrayEnumEnum.Crab; + + throw new NotImplementedException($"Could not convert value to type ArrayEnumEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ArrayEnumEnum? ArrayEnumEnumFromStringOrDefault(string value) + { + if (value.Equals("fish")) + return ArrayEnumEnum.Fish; + + if (value.Equals("crab")) + return ArrayEnumEnum.Crab; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ArrayEnumEnumToJsonValue(ArrayEnumEnum value) + { + if (value == ArrayEnumEnum.Fish) + return "fish"; + + if (value == ArrayEnumEnum.Crab) + return "crab"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Defines JustSymbol + /// + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + Dollar = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static JustSymbolEnum JustSymbolEnumFromString(string value) + { + if (value.Equals(">=")) + return JustSymbolEnum.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return JustSymbolEnum.Dollar; + + throw new NotImplementedException($"Could not convert value to type JustSymbolEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static JustSymbolEnum? JustSymbolEnumFromStringOrDefault(string value) + { + if (value.Equals(">=")) + return JustSymbolEnum.GreaterThanOrEqualTo; + + if (value.Equals("$")) + return JustSymbolEnum.Dollar; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string JustSymbolEnumToJsonValue(JustSymbolEnum? value) + { + if (value == JustSymbolEnum.GreaterThanOrEqualTo) + return ">="; + + if (value == JustSymbolEnum.Dollar) + return "$"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of JustSymbol + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustSymbolOption { get; private set; } + + /// + /// Gets or Sets JustSymbol + /// + [JsonPropertyName("just_symbol")] + public JustSymbolEnum? JustSymbol { get { return this.JustSymbolOption; } set { this.JustSymbolOption = new Option(value); } } + + /// + /// Used to track the state of ArrayEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayEnumOption { get; private set; } + + /// + /// Gets or Sets ArrayEnum + /// + [JsonPropertyName("array_enum")] + public List ArrayEnum { get { return this.ArrayEnumOption; } set { this.ArrayEnumOption = 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 EnumArrays {\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).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 EnumArraysJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumArrays 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> arrayEnum = default; + Option justSymbol = 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 "array_enum": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "just_symbol": + string justSymbolRawValue = utf8JsonReader.GetString(); + if (justSymbolRawValue != null) + justSymbol = new Option(EnumArrays.JustSymbolEnumFromStringOrDefault(justSymbolRawValue)); + break; + default: + break; + } + } + } + + if (arrayEnum.IsSet && arrayEnum.Value == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is not nullable for class EnumArrays."); + + if (justSymbol.IsSet && justSymbol.Value == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is not nullable for class EnumArrays."); + + return new EnumArrays(arrayEnum, justSymbol); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumArrays, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (enumArrays.ArrayEnumOption.IsSet) + { + writer.WritePropertyName("array_enum"); + JsonSerializer.Serialize(writer, enumArrays.ArrayEnum, jsonSerializerOptions); + } + var justSymbolRawValue = EnumArrays.JustSymbolEnumToJsonValue(enumArrays.JustSymbolOption.Value.Value); + writer.WriteString("just_symbol", justSymbolRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 00000000000..b1aff0adf0d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines EnumClass + /// + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + Xyz = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class EnumClassValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass FromString(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + throw new NotImplementedException($"Could not convert value to type EnumClass: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static EnumClass? FromStringOrDefault(string value) + { + if (value.Equals("_abc")) + return EnumClass.Abc; + + if (value.Equals("-efg")) + return EnumClass.Efg; + + if (value.Equals("(xyz)")) + return EnumClass.Xyz; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(EnumClass value) + { + if (value == EnumClass.Abc) + return "_abc"; + + if (value == EnumClass.Efg) + return "-efg"; + + if (value == EnumClass.Xyz) + return "(xyz)"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class EnumClassJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override EnumClass Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the EnumClass to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class EnumClassNullableJsonConverter : JsonConverter + { + /// + /// Returns a EnumClass from the Json object + /// + /// + /// + /// + /// + public override EnumClass? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + EnumClass? result = rawValue == null + ? null + : EnumClassValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumClass? enumClass, JsonSerializerOptions options) + { + writer.WriteStringValue(enumClass?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 00000000000..0d657779fdc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,881 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// EnumTest + /// + public partial class EnumTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// enumStringRequired + /// enumInteger + /// enumIntegerOnly + /// enumNumber + /// enumString + /// outerEnum + /// outerEnumDefaultValue + /// outerEnumInteger + /// outerEnumIntegerDefaultValue + [JsonConstructor] + public EnumTest(EnumStringRequiredEnum enumStringRequired, Option enumInteger = default, Option enumIntegerOnly = default, Option enumNumber = default, Option enumString = default, Option outerEnum = default, Option outerEnumDefaultValue = default, Option outerEnumInteger = default, Option outerEnumIntegerDefaultValue = default) + { + EnumStringRequired = enumStringRequired; + EnumIntegerOption = enumInteger; + EnumIntegerOnlyOption = enumIntegerOnly; + EnumNumberOption = enumNumber; + EnumStringOption = enumString; + OuterEnumOption = outerEnum; + OuterEnumDefaultValueOption = outerEnumDefaultValue; + OuterEnumIntegerOption = outerEnumInteger; + OuterEnumIntegerDefaultValueOption = outerEnumIntegerDefaultValue; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines EnumStringRequired + /// + public enum EnumStringRequiredEnum + { + /// + /// 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 EnumStringRequiredEnum EnumStringRequiredEnumFromString(string value) + { + if (value.Equals("UPPER")) + return EnumStringRequiredEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringRequiredEnum.Lower; + + if (value.Equals("")) + return EnumStringRequiredEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringRequiredEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringRequiredEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringRequiredEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumStringRequiredEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumStringRequiredEnum? EnumStringRequiredEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumStringRequiredEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringRequiredEnum.Lower; + + if (value.Equals("")) + return EnumStringRequiredEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringRequiredEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringRequiredEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringRequiredEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringRequiredEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string EnumStringRequiredEnumToJsonValue(EnumStringRequiredEnum value) + { + if (value == EnumStringRequiredEnum.UPPER) + return "UPPER"; + + if (value == EnumStringRequiredEnum.Lower) + return "lower"; + + if (value == EnumStringRequiredEnum.Empty) + return ""; + + if (value == EnumStringRequiredEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumStringRequiredEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumStringRequiredEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumStringRequiredEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumStringRequiredEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets EnumStringRequired + /// + [JsonPropertyName("enum_string_required")] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumIntegerEnum EnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return EnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type EnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumIntegerEnum? EnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return EnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return EnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int EnumIntegerEnumToJsonValue(EnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of EnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOption { get; private set; } + + /// + /// Gets or Sets EnumInteger + /// + [JsonPropertyName("enum_integer")] + public EnumIntegerEnum? EnumInteger { get { return this.EnumIntegerOption; } set { this.EnumIntegerOption = new Option(value); } } + + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumIntegerOnlyEnum EnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type EnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumIntegerOnlyEnum? EnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return EnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int EnumIntegerOnlyEnumToJsonValue(EnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of EnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets EnumIntegerOnly + /// + [JsonPropertyName("enum_integer_only")] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get { return this.EnumIntegerOnlyOption; } set { this.EnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines EnumNumber + /// + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + NUMBER_MINUS_1_DOT_2 = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static EnumNumberEnum EnumNumberEnumFromString(string value) + { + if (value.Equals("1.1")) + return EnumNumberEnum.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return EnumNumberEnum.NUMBER_MINUS_1_DOT_2; + + throw new NotImplementedException($"Could not convert value to type EnumNumberEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumNumberEnum? EnumNumberEnumFromStringOrDefault(string value) + { + if (value.Equals("1.1")) + return EnumNumberEnum.NUMBER_1_DOT_1; + + if (value.Equals("-1.2")) + return EnumNumberEnum.NUMBER_MINUS_1_DOT_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static double EnumNumberEnumToJsonValue(EnumNumberEnum? value) + { + if (value == EnumNumberEnum.NUMBER_1_DOT_1) + return 1.1; + + if (value == EnumNumberEnum.NUMBER_MINUS_1_DOT_2) + return -1.2; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of EnumNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumNumberOption { get; private set; } + + /// + /// Gets or Sets EnumNumber + /// + [JsonPropertyName("enum_number")] + public EnumNumberEnum? EnumNumber { get { return this.EnumNumberOption; } set { this.EnumNumberOption = new Option(value); } } + + /// + /// Defines EnumString + /// + public enum EnumStringEnum + { + /// + /// 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 EnumStringEnum EnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return EnumStringEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringEnum.Lower; + + if (value.Equals("")) + return EnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type EnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static EnumStringEnum? EnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return EnumStringEnum.UPPER; + + if (value.Equals("lower")) + return EnumStringEnum.Lower; + + if (value.Equals("")) + return EnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return EnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return EnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return EnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return EnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return EnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string EnumStringEnumToJsonValue(EnumStringEnum? value) + { + if (value == EnumStringEnum.UPPER) + return "UPPER"; + + if (value == EnumStringEnum.Lower) + return "lower"; + + if (value == EnumStringEnum.Empty) + return ""; + + if (value == EnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == EnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == EnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == EnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == EnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of EnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EnumStringOption { get; private set; } + + /// + /// Gets or Sets EnumString + /// + [JsonPropertyName("enum_string")] + public EnumStringEnum? EnumString { get { return this.EnumStringOption; } set { this.EnumStringOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumOption { get; private set; } + + /// + /// Gets or Sets OuterEnum + /// + [JsonPropertyName("outerEnum")] + public OuterEnum? OuterEnum { get { return this.OuterEnumOption; } set { this.OuterEnumOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [JsonPropertyName("outerEnumDefaultValue")] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get { return this.OuterEnumDefaultValueOption; } set { this.OuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [JsonPropertyName("outerEnumInteger")] + public OuterEnumInteger? OuterEnumInteger { get { return this.OuterEnumIntegerOption; } set { this.OuterEnumIntegerOption = new Option(value); } } + + /// + /// Used to track the state of OuterEnumIntegerDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OuterEnumIntegerDefaultValueOption { get; private set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [JsonPropertyName("outerEnumIntegerDefaultValue")] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get { return this.OuterEnumIntegerDefaultValueOption; } set { this.OuterEnumIntegerDefaultValueOption = 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 EnumTest {\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).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 EnumTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EnumTest 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 enumStringRequired = default; + Option enumInteger = default; + Option enumIntegerOnly = default; + Option enumNumber = default; + Option enumString = default; + Option outerEnum = default; + Option outerEnumDefaultValue = default; + Option outerEnumInteger = default; + Option outerEnumIntegerDefaultValue = 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 "enum_string_required": + string enumStringRequiredRawValue = utf8JsonReader.GetString(); + if (enumStringRequiredRawValue != null) + enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); + break; + case "enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "enum_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + break; + case "enum_string": + string enumStringRawValue = utf8JsonReader.GetString(); + if (enumStringRawValue != null) + enumString = new Option(EnumTest.EnumStringEnumFromStringOrDefault(enumStringRawValue)); + break; + case "outerEnum": + string outerEnumRawValue = utf8JsonReader.GetString(); + if (outerEnumRawValue != null) + outerEnum = new Option(OuterEnumValueConverter.FromStringOrDefault(outerEnumRawValue)); + break; + case "outerEnumDefaultValue": + string outerEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumDefaultValueRawValue != null) + outerEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(outerEnumDefaultValueRawValue)); + break; + case "outerEnumInteger": + string outerEnumIntegerRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerRawValue != null) + outerEnumInteger = new Option(OuterEnumIntegerValueConverter.FromStringOrDefault(outerEnumIntegerRawValue)); + break; + case "outerEnumIntegerDefaultValue": + string outerEnumIntegerDefaultValueRawValue = utf8JsonReader.GetString(); + if (outerEnumIntegerDefaultValueRawValue != null) + outerEnumIntegerDefaultValue = new Option(OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(outerEnumIntegerDefaultValueRawValue)); + break; + default: + break; + } + } + } + + if (!enumStringRequired.IsSet) + throw new ArgumentException("Property is required for class EnumTest.", nameof(enumStringRequired)); + + if (enumStringRequired.IsSet && enumStringRequired.Value == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is not nullable for class EnumTest."); + + if (enumInteger.IsSet && enumInteger.Value == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is not nullable for class EnumTest."); + + if (enumIntegerOnly.IsSet && enumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is not nullable for class EnumTest."); + + if (enumNumber.IsSet && enumNumber.Value == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is not nullable for class EnumTest."); + + if (enumString.IsSet && enumString.Value == null) + throw new ArgumentNullException(nameof(enumString), "Property is not nullable for class EnumTest."); + + if (outerEnumDefaultValue.IsSet && outerEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is not nullable for class EnumTest."); + + if (outerEnumInteger.IsSet && outerEnumInteger.Value == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is not nullable for class EnumTest."); + + if (outerEnumIntegerDefaultValue.IsSet && outerEnumIntegerDefaultValue.Value == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is not nullable for class EnumTest."); + + return new EnumTest(enumStringRequired.Value.Value, enumInteger, enumIntegerOnly, enumNumber, enumString, outerEnum, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, enumTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + { + var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); + writer.WriteString("enum_string_required", enumStringRequiredRawValue); + if (enumTest.EnumIntegerOption.IsSet) + writer.WriteNumber("enum_integer", EnumTest.EnumIntegerEnumToJsonValue(enumTest.EnumIntegerOption.Value.Value)); + + if (enumTest.EnumIntegerOnlyOption.IsSet) + writer.WriteNumber("enum_integer_only", EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTest.EnumIntegerOnlyOption.Value.Value)); + + if (enumTest.EnumNumberOption.IsSet) + writer.WriteNumber("enum_number", EnumTest.EnumNumberEnumToJsonValue(enumTest.EnumNumberOption.Value.Value)); + + var enumStringRawValue = EnumTest.EnumStringEnumToJsonValue(enumTest.EnumStringOption.Value.Value); + writer.WriteString("enum_string", enumStringRawValue); + if (enumTest.OuterEnumOption.IsSet) + if (enumTest.OuterEnumOption.Value != null) + { + var outerEnumRawValue = OuterEnumValueConverter.ToJsonValue(enumTest.OuterEnumOption.Value.Value); + writer.WriteString("outerEnum", outerEnumRawValue); + } + else + writer.WriteNull("outerEnum"); + if (enumTest.OuterEnumDefaultValueOption.IsSet) + { + var outerEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumDefaultValue.Value); + writer.WriteString("outerEnumDefaultValue", outerEnumDefaultValueRawValue); + } + if (enumTest.OuterEnumIntegerOption.IsSet) + { + var outerEnumIntegerRawValue = OuterEnumIntegerValueConverter.ToJsonValue(enumTest.OuterEnumInteger.Value); + writer.WriteNumber("outerEnumInteger", outerEnumIntegerRawValue); + } + if (enumTest.OuterEnumIntegerDefaultValueOption.IsSet) + { + var outerEnumIntegerDefaultValueRawValue = OuterEnumIntegerDefaultValueValueConverter.ToJsonValue(enumTest.OuterEnumIntegerDefaultValue.Value); + writer.WriteNumber("outerEnumIntegerDefaultValue", outerEnumIntegerDefaultValueRawValue); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 00000000000..d65c7740e5e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -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 + * 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 +{ + /// + /// EquilateralTriangle + /// + public partial class EquilateralTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public EquilateralTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 EquilateralTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override EquilateralTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class EquilateralTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class EquilateralTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class EquilateralTriangle."); + + return new EquilateralTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (equilateralTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(equilateralTriangle.TriangleType), "Property is required for class EquilateralTriangle."); + + writer.WriteString("shapeType", equilateralTriangle.ShapeType); + + writer.WriteString("triangleType", equilateralTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..8d88c790110 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,175 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Must be named `File` for test. + /// + public partial class File : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization + [JsonConstructor] + public File(Option sourceURI = default) + { + SourceURIOption = sourceURI; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SourceURI + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SourceURIOption { get; private set; } + + /// + /// Test capitalization + /// + /// Test capitalization + [JsonPropertyName("sourceURI")] + public string SourceURI { get { return this.SourceURIOption; } set { this.SourceURIOption = 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 File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).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 FileJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override File 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 sourceURI = 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 "sourceURI": + sourceURI = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (sourceURI.IsSet && sourceURI.Value == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is not nullable for class File."); + + return new File(sourceURI); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, file, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (file.SourceURIOption.IsSet) + writer.WriteString("sourceURI", file.SourceURI); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..8610cbae21d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,210 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FileSchemaTestClass + /// + public partial class FileSchemaTestClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// file + /// files + [JsonConstructor] + public FileSchemaTestClass(Option file = default, Option> files = default) + { + FileOption = file; + FilesOption = files; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of File + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FileOption { get; private set; } + + /// + /// Gets or Sets File + /// + [JsonPropertyName("file")] + public File File { get { return this.FileOption; } set { this.FileOption = new Option(value); } } + + /// + /// Used to track the state of Files + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> FilesOption { get; private set; } + + /// + /// Gets or Sets Files + /// + [JsonPropertyName("files")] + public List Files { get { return this.FilesOption; } set { this.FilesOption = 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 FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).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 FileSchemaTestClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FileSchemaTestClass 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 file = default; + Option> files = 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 "file": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "files": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file), "Property is not nullable for class FileSchemaTestClass."); + + if (files.IsSet && files.Value == null) + throw new ArgumentNullException(nameof(files), "Property is not nullable for class FileSchemaTestClass."); + + return new FileSchemaTestClass(file, files); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fileSchemaTestClass.FilesOption.IsSet && fileSchemaTestClass.Files == null) + throw new ArgumentNullException(nameof(fileSchemaTestClass.Files), "Property is required for class FileSchemaTestClass."); + + if (fileSchemaTestClass.FileOption.IsSet) + { + writer.WritePropertyName("file"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.File, jsonSerializerOptions); + } + if (fileSchemaTestClass.FilesOption.IsSet) + { + writer.WritePropertyName("files"); + JsonSerializer.Serialize(writer, fileSchemaTestClass.Files, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 00000000000..659b93c0913 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Foo + /// + public partial class Foo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar") + [JsonConstructor] + public Foo(Option bar = default) + { + BarOption = bar; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; private set; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } set { this.BarOption = 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 Foo {\n"); + sb.Append(" Bar: ").Append(Bar).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 FooJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Foo 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 bar = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class Foo."); + + return new Foo(bar); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, foo, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (foo.BarOption.IsSet) + writer.WriteString("bar", foo.Bar); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs new file mode 100644 index 00000000000..205b2f3f897 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -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 + * 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 +{ + /// + /// FooGetDefaultResponse + /// + public partial class FooGetDefaultResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// string + [JsonConstructor] + public FooGetDefaultResponse(Option @string = default) + { + StringOption = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public Foo String { get { return this.StringOption; } set { this.StringOption = 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 FooGetDefaultResponse {\n"); + sb.Append(" String: ").Append(String).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 FooGetDefaultResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FooGetDefaultResponse 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 varString = 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 "string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FooGetDefaultResponse."); + + return new FooGetDefaultResponse(varString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fooGetDefaultResponse.StringOption.IsSet) + { + writer.WritePropertyName("string"); + JsonSerializer.Serialize(writer, fooGetDefaultResponse.String, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 00000000000..3fc88d4d403 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,798 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FormatTest + /// + public partial class FormatTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// byte + /// date + /// number + /// password + /// binary + /// dateTime + /// decimal + /// double + /// float + /// int32 + /// int64 + /// integer + /// None + /// A string that is a 10 digit number. Can have leading zeros. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// string + /// unsignedInteger + /// unsignedLong + /// uuid + [JsonConstructor] + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int64 = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + { + Byte = @byte; + Date = date; + Number = number; + Password = password; + BinaryOption = binary; + DateTimeOption = dateTime; + DecimalOption = @decimal; + DoubleOption = @double; + FloatOption = @float; + Int32Option = int32; + Int64Option = int64; + IntegerOption = integer; + PatternWithBackslashOption = patternWithBackslash; + PatternWithDigitsOption = patternWithDigits; + PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; + StringOption = @string; + UnsignedIntegerOption = unsignedInteger; + UnsignedLongOption = unsignedLong; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Byte + /// + [JsonPropertyName("byte")] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Date + /// + /// Sun Feb 02 00:00:00 UTC 2020 + [JsonPropertyName("date")] + public DateTime Date { get; set; } + + /// + /// Gets or Sets Number + /// + [JsonPropertyName("number")] + public decimal Number { get; set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get; set; } + + /// + /// Used to track the state of Binary + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BinaryOption { get; private set; } + + /// + /// Gets or Sets Binary + /// + [JsonPropertyName("binary")] + public System.IO.Stream Binary { get { return this.BinaryOption; } set { this.BinaryOption = new Option(value); } } + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + /// 2007-12-03T10:15:30+01:00 + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + [JsonPropertyName("decimal")] + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of Double + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DoubleOption { get; private set; } + + /// + /// Gets or Sets Double + /// + [JsonPropertyName("double")] + public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + + /// + /// Used to track the state of Float + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FloatOption { get; private set; } + + /// + /// Gets or Sets Float + /// + [JsonPropertyName("float")] + public float? Float { get { return this.FloatOption; } set { this.FloatOption = new Option(value); } } + + /// + /// Used to track the state of Int32 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32Option { get; private set; } + + /// + /// Gets or Sets Int32 + /// + [JsonPropertyName("int32")] + public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + + /// + /// Used to track the state of Int64 + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64Option { get; private set; } + + /// + /// Gets or Sets Int64 + /// + [JsonPropertyName("int64")] + public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + + /// + /// Used to track the state of Integer + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerOption { get; private set; } + + /// + /// Gets or Sets Integer + /// + [JsonPropertyName("integer")] + public int? Integer { get { return this.IntegerOption; } set { this.IntegerOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithBackslash + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithBackslashOption { get; private set; } + + /// + /// None + /// + /// None + [JsonPropertyName("pattern_with_backslash")] + public string PatternWithBackslash { get { return this.PatternWithBackslashOption; } set { this.PatternWithBackslashOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigits + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsOption { get; private set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [JsonPropertyName("pattern_with_digits")] + public string PatternWithDigits { get { return this.PatternWithDigitsOption; } set { this.PatternWithDigitsOption = new Option(value); } } + + /// + /// Used to track the state of PatternWithDigitsAndDelimiter + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PatternWithDigitsAndDelimiterOption { get; private set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [JsonPropertyName("pattern_with_digits_and_delimiter")] + public string PatternWithDigitsAndDelimiter { get { return this.PatternWithDigitsAndDelimiterOption; } set { this.PatternWithDigitsAndDelimiterOption = new Option(value); } } + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + [JsonPropertyName("string")] + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedIntegerOption { get; private set; } + + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint? UnsignedInteger { get { return this.UnsignedIntegerOption; } set { this.UnsignedIntegerOption = new Option(value); } } + + /// + /// Used to track the state of UnsignedLong + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsignedLongOption { get; private set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong? UnsignedLong { get { return this.UnsignedLongOption; } set { this.UnsignedLongOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 FormatTest {\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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) + { + // Number (decimal) maximum + if (this.Number > (decimal)543.2) + { + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + } + + // Number (decimal) minimum + if (this.Number < (decimal)32.1) + { + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + } + + // Password (string) maxLength + if (this.Password != null && this.Password.Length > 64) + { + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + } + + // Password (string) minLength + if (this.Password != null && this.Password.Length < 10) + { + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + } + + // Double (double) maximum + if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) + { + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + } + + // Double (double) minimum + if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) + { + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + } + + // Float (float) maximum + if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) + { + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + } + + // Float (float) minimum + if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) + { + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + } + + // Int32 (int) maximum + if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) + { + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + } + + // Int32 (int) minimum + if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) + { + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + } + + // Integer (int) maximum + if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) + { + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + } + + // Integer (int) minimum + if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) + { + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + } + + if (this.PatternWithBackslashOption.Value != null) { + // PatternWithBackslash (string) pattern + Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); + + if (this.PatternWithBackslashOption.Value != null &&!regexPatternWithBackslash.Match(this.PatternWithBackslashOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); + } + } + + if (this.PatternWithDigitsOption.Value != null) { + // PatternWithDigits (string) pattern + Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); + + if (this.PatternWithDigitsOption.Value != null &&!regexPatternWithDigits.Match(this.PatternWithDigitsOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); + } + } + + if (this.PatternWithDigitsAndDelimiterOption.Value != null) { + // PatternWithDigitsAndDelimiter (string) pattern + Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.PatternWithDigitsAndDelimiterOption.Value != null &&!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiterOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); + } + } + + if (this.StringOption.Value != null) { + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (this.StringOption.Value != null &&!regexString.Match(this.StringOption.Value).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); + } + } + + // UnsignedInteger (uint) maximum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) + { + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + + yield break; + } + } + + /// + /// A Json converter for type + /// + public class FormatTestJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Date + /// + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FormatTest 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 varByte = default; + Option date = default; + Option number = default; + Option password = default; + Option binary = default; + Option dateTime = default; + Option varDecimal = default; + Option varDouble = default; + Option varFloat = default; + Option int32 = default; + Option int64 = default; + Option integer = default; + Option patternWithBackslash = default; + Option patternWithDigits = default; + Option patternWithDigitsAndDelimiter = default; + Option varString = default; + Option unsignedInteger = default; + Option unsignedLong = default; + Option uuid = 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 "byte": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "date": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = new Option(utf8JsonReader.GetDecimal()); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "binary": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "decimal": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "double": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varDouble = new Option(utf8JsonReader.GetDouble()); + break; + case "float": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varFloat = new Option((float)utf8JsonReader.GetDouble()); + break; + case "int32": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = new Option(utf8JsonReader.GetInt32()); + break; + case "int64": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = new Option(utf8JsonReader.GetInt64()); + break; + case "integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = new Option(utf8JsonReader.GetInt32()); + break; + case "pattern_with_backslash": + patternWithBackslash = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits": + patternWithDigits = new Option(utf8JsonReader.GetString()); + break; + case "pattern_with_digits_and_delimiter": + patternWithDigitsAndDelimiter = new Option(utf8JsonReader.GetString()); + break; + case "string": + varString = new Option(utf8JsonReader.GetString()); + break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = new Option(utf8JsonReader.GetUInt64()); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (!varByte.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(varByte)); + + if (!date.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(date)); + + if (!number.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(number)); + + if (!password.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + + if (varByte.IsSet && varByte.Value == null) + throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); + + if (date.IsSet && date.Value == null) + throw new ArgumentNullException(nameof(date), "Property is not nullable for class FormatTest."); + + if (number.IsSet && number.Value == null) + throw new ArgumentNullException(nameof(number), "Property is not nullable for class FormatTest."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + + if (binary.IsSet && binary.Value == null) + throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class FormatTest."); + + if (varDecimal.IsSet && varDecimal.Value == null) + throw new ArgumentNullException(nameof(varDecimal), "Property is not nullable for class FormatTest."); + + if (varDouble.IsSet && varDouble.Value == null) + throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + + if (varFloat.IsSet && varFloat.Value == null) + throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); + + if (int32.IsSet && int32.Value == null) + throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + + if (int64.IsSet && int64.Value == null) + throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + + if (integer.IsSet && integer.Value == null) + throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); + + if (patternWithBackslash.IsSet && patternWithBackslash.Value == null) + throw new ArgumentNullException(nameof(patternWithBackslash), "Property is not nullable for class FormatTest."); + + if (patternWithDigits.IsSet && patternWithDigits.Value == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is not nullable for class FormatTest."); + + if (patternWithDigitsAndDelimiter.IsSet && patternWithDigitsAndDelimiter.Value == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is not nullable for class FormatTest."); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + + if (unsignedInteger.IsSet && unsignedInteger.Value == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); + + if (unsignedLong.IsSet && unsignedLong.Value == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is not nullable for class FormatTest."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); + + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, formatTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (formatTest.Password == null) + throw new ArgumentNullException(nameof(formatTest.Password), "Property is required for class FormatTest."); + + if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) + throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsOption.IsSet && formatTest.PatternWithDigits == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigits), "Property is required for class FormatTest."); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet && formatTest.PatternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(formatTest.PatternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + + if (formatTest.StringOption.IsSet && formatTest.String == null) + throw new ArgumentNullException(nameof(formatTest.String), "Property is required for class FormatTest."); + + writer.WritePropertyName("byte"); + JsonSerializer.Serialize(writer, formatTest.Byte, jsonSerializerOptions); + writer.WriteString("date", formatTest.Date.ToString(DateFormat)); + + writer.WriteNumber("number", formatTest.Number); + + writer.WriteString("password", formatTest.Password); + + if (formatTest.BinaryOption.IsSet) + { + writer.WritePropertyName("binary"); + JsonSerializer.Serialize(writer, formatTest.Binary, jsonSerializerOptions); + } + if (formatTest.DateTimeOption.IsSet) + writer.WriteString("dateTime", formatTest.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (formatTest.DecimalOption.IsSet) + { + writer.WritePropertyName("decimal"); + JsonSerializer.Serialize(writer, formatTest.Decimal, jsonSerializerOptions); + } + if (formatTest.DoubleOption.IsSet) + writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + + if (formatTest.FloatOption.IsSet) + writer.WriteNumber("float", formatTest.FloatOption.Value.Value); + + if (formatTest.Int32Option.IsSet) + writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + + if (formatTest.Int64Option.IsSet) + writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + + if (formatTest.IntegerOption.IsSet) + writer.WriteNumber("integer", formatTest.IntegerOption.Value.Value); + + if (formatTest.PatternWithBackslashOption.IsSet) + writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash); + + if (formatTest.PatternWithDigitsOption.IsSet) + writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); + + if (formatTest.PatternWithDigitsAndDelimiterOption.IsSet) + writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); + + if (formatTest.StringOption.IsSet) + writer.WriteString("string", formatTest.String); + + if (formatTest.UnsignedIntegerOption.IsSet) + writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); + + if (formatTest.UnsignedLongOption.IsSet) + writer.WriteNumber("unsigned_long", formatTest.UnsignedLongOption.Value.Value); + + if (formatTest.UuidOption.IsSet) + writer.WriteString("uuid", formatTest.UuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..0302533cd2f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -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 + * 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 +{ + /// + /// Fruit + /// + public partial class Fruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Apple apple, Option color = default) + { + Apple = apple; + ColorOption = color; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// color + public Fruit(Banana banana, Option color = default) + { + Banana = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get; set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get; set; } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" Color: ").Append(Color).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 FruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Fruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class Fruit."); + + if (apple != null) + return new Fruit(apple, color); + + if (banana != null) + return new Fruit(banana, color); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (fruit.ColorOption.IsSet) + writer.WriteString("color", fruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 00000000000..1e72875d4d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// FruitReq + /// + public partial class FruitReq : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(AppleReq appleReq) + { + AppleReq = appleReq; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FruitReq(BananaReq bananaReq) + { + BananaReq = bananaReq; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AppleReq + /// + public AppleReq AppleReq { get; set; } + + /// + /// Gets or Sets BananaReq + /// + public BananaReq BananaReq { 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 FruitReq {\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 FruitReqJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override FruitReq 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; + + AppleReq appleReq = default; + BananaReq bananaReq = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderAppleReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderAppleReq, jsonSerializerOptions, out appleReq); + + Utf8JsonReader utf8JsonReaderBananaReq = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBananaReq, jsonSerializerOptions, out bananaReq); + } + } + + 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) + { + default: + break; + } + } + } + + if (appleReq != null) + return new FruitReq(appleReq); + + if (bananaReq != null) + return new FruitReq(bananaReq); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, fruitReq, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 00000000000..e2eb2c897a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,235 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// GmFruit + /// + public partial class GmFruit : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// color + public GmFruit(Option apple, Option banana, Option color = default) + { + AppleOption = apple; + BananaOption = banana; + ColorOption = color; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Apple + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AppleOption { get; private set; } + + /// + /// Gets or Sets Apple + /// + public Apple Apple { get { return this.AppleOption; } set { this.AppleOption = new Option(value); } } + + /// + /// Used to track the state of Banana + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BananaOption { get; private set; } + + /// + /// Gets or Sets Banana + /// + public Banana Banana { get { return this.BananaOption; } set { this.BananaOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Gets or Sets Color + /// + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" Color: ").Append(Color).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 GmFruitJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GmFruit 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 color = default; + + Apple apple = default; + Banana banana = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderApple = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderApple, jsonSerializerOptions, out apple); + + Utf8JsonReader utf8JsonReaderBanana = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBanana, jsonSerializerOptions, out banana); + } + } + + 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 "color": + color = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class GmFruit."); + + Option appleParsedValue = apple == null + ? default + : new Option(apple); + Option bananaParsedValue = banana == null + ? default + : new Option(banana); + + return new GmFruit(appleParsedValue, bananaParsedValue, color); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) + { + AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); + 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(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, gmFruit, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (gmFruit.ColorOption.IsSet) + writer.WriteString("color", gmFruit.Color); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 00000000000..838cae14f98 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -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 + * 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 +{ + /// + /// GrandparentAnimal + /// + public partial class GrandparentAnimal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + public GrandparentAnimal() + { + OnCreated(); + } + + partial void OnCreated(); + + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; + + /// + /// 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 GrandparentAnimal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class GrandparentAnimalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override GrandparentAnimal 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class GrandparentAnimal.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); + + return new GrandparentAnimal(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + 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(writer, grandparentAnimal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", grandparentAnimal.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..680ead387fb --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,244 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// HasOnlyReadOnly + /// + public partial class HasOnlyReadOnly : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// foo + [JsonConstructor] + internal HasOnlyReadOnly(Option bar = default, Option foo = default) + { + BarOption = bar; + FooOption = foo; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Foo + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FooOption { get; } + + /// + /// Gets or Sets Foo + /// + [JsonPropertyName("foo")] + public string Foo { get { return this.FooOption; } } + + /// + /// 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 HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + if (Foo != null) + hashCode = (hashCode * 59) + Foo.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 HasOnlyReadOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HasOnlyReadOnly 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 bar = default; + Option foo = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "foo": + foo = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class HasOnlyReadOnly."); + + if (foo.IsSet && foo.Value == null) + throw new ArgumentNullException(nameof(foo), "Property is not nullable for class HasOnlyReadOnly."); + + return new HasOnlyReadOnly(bar, foo); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (hasOnlyReadOnly.FooOption.IsSet && hasOnlyReadOnly.Foo == null) + throw new ArgumentNullException(nameof(hasOnlyReadOnly.Foo), "Property is required for class HasOnlyReadOnly."); + + if (hasOnlyReadOnly.BarOption.IsSet) + writer.WriteString("bar", hasOnlyReadOnly.Bar); + + if (hasOnlyReadOnly.FooOption.IsSet) + writer.WriteString("foo", hasOnlyReadOnly.Foo); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 00000000000..112f55c9ab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -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 + * 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 +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + public partial class HealthCheckResult : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage + [JsonConstructor] + public HealthCheckResult(Option nullableMessage = default) + { + NullableMessageOption = nullableMessage; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of NullableMessage + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NullableMessageOption { get; private set; } + + /// + /// Gets or Sets NullableMessage + /// + [JsonPropertyName("NullableMessage")] + public string NullableMessage { get { return this.NullableMessageOption; } set { this.NullableMessageOption = 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 HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).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 HealthCheckResultJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override HealthCheckResult 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 nullableMessage = 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 "NullableMessage": + nullableMessage = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + return new HealthCheckResult(nullableMessage); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + { + if (healthCheckResult.NullableMessageOption.IsSet) + if (healthCheckResult.NullableMessageOption.Value != null) + writer.WriteString("NullableMessage", healthCheckResult.NullableMessage); + else + writer.WriteNull("NullableMessage"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 00000000000..cce85952411 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -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 + * 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 +{ + /// + /// IsoscelesTriangle + /// + public partial class IsoscelesTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public IsoscelesTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { 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 IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 IsoscelesTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override IsoscelesTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class IsoscelesTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class IsoscelesTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class IsoscelesTriangle."); + + return new IsoscelesTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (isoscelesTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(isoscelesTriangle.TriangleType), "Property is required for class IsoscelesTriangle."); + + writer.WriteString("shapeType", isoscelesTriangle.ShapeType); + + writer.WriteString("triangleType", isoscelesTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 00000000000..acadb2f2842 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// List + /// + public partial class List : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// var123List + [JsonConstructor] + public List(Option var123List = default) + { + Var123ListOption = var123List; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Var123List + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123ListOption { get; private set; } + + /// + /// Gets or Sets Var123List + /// + [JsonPropertyName("123-list")] + public string Var123List { get { return this.Var123ListOption; } set { this.Var123ListOption = 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 List {\n"); + sb.Append(" Var123List: ").Append(Var123List).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 ListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override List 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 var123List = 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 "123-list": + var123List = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (var123List.IsSet && var123List.Value == null) + throw new ArgumentNullException(nameof(var123List), "Property is not nullable for class List."); + + return new List(var123List); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, list, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (list.Var123ListOption.IsSet) + writer.WriteString("123-list", list.Var123List); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..bfcbb4465fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,203 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(Option escapedLiteralString = default, Option unescapedLiteralString = default) + { + EscapedLiteralStringOption = escapedLiteralString; + UnescapedLiteralStringOption = unescapedLiteralString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of EscapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EscapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get { return this.EscapedLiteralStringOption; } set { this.EscapedLiteralStringOption = new Option(value); } } + + /// + /// Used to track the state of UnescapedLiteralString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnescapedLiteralStringOption { get; private set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get { return this.UnescapedLiteralStringOption; } set { this.UnescapedLiteralStringOption = 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 LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).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 LiteralStringClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override LiteralStringClass 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 escapedLiteralString = default; + Option unescapedLiteralString = 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 "escapedLiteralString": + escapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + case "unescapedLiteralString": + unescapedLiteralString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (escapedLiteralString.IsSet && escapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + if (unescapedLiteralString.IsSet && unescapedLiteralString.Value == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is not nullable for class LiteralStringClass."); + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, literalStringClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet && literalStringClass.UnescapedLiteralString == null) + throw new ArgumentNullException(nameof(literalStringClass.UnescapedLiteralString), "Property is required for class LiteralStringClass."); + + if (literalStringClass.EscapedLiteralStringOption.IsSet) + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + + if (literalStringClass.UnescapedLiteralStringOption.IsSet) + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 00000000000..267ac8769d3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mammal + /// + public partial class Mammal : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Whale whale) + { + Whale = whale; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Zebra zebra) + { + Zebra = zebra; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Mammal(Pig pig) + { + Pig = pig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Whale + /// + public Whale Whale { get; set; } + + /// + /// Gets or Sets Zebra + /// + public Zebra Zebra { get; set; } + + /// + /// Gets or Sets Pig + /// + public Pig Pig { get; set; } + + /// + /// 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 Mammal {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Mammal 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 className = default; + + Pig pig = null; + Whale whale = null; + Zebra zebra = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Pig")) + { + Utf8JsonReader utf8JsonReaderPig = utf8JsonReader; + pig = JsonSerializer.Deserialize(ref utf8JsonReaderPig, jsonSerializerOptions); + } + if (discriminator.Equals("whale")) + { + Utf8JsonReader utf8JsonReaderWhale = utf8JsonReader; + whale = JsonSerializer.Deserialize(ref utf8JsonReaderWhale, jsonSerializerOptions); + } + if (discriminator.Equals("zebra")) + { + Utf8JsonReader utf8JsonReaderZebra = utf8JsonReader; + zebra = JsonSerializer.Deserialize(ref utf8JsonReaderZebra, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Mammal.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); + + if (pig != null) + return new Mammal(pig); + + if (whale != null) + return new Mammal(whale); + + if (zebra != null) + return new Mammal(zebra); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mammal.Whale != null) + { + WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); + } + + if (mammal.Zebra != null) + { + ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); + } + + if (mammal.Pig != null) + { + PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); + } + + WriteProperties(writer, mammal, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 00000000000..3ea97b6d839 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,340 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MapTest + /// + public partial class MapTest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// directMap + /// indirectMap + /// mapMapOfString + /// mapOfEnumString + [JsonConstructor] + public MapTest(Option> directMap = default, Option> indirectMap = default, Option>> mapMapOfString = default, Option> mapOfEnumString = default) + { + DirectMapOption = directMap; + IndirectMapOption = indirectMap; + MapMapOfStringOption = mapMapOfString; + MapOfEnumStringOption = mapOfEnumString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines Inner + /// + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static InnerEnum InnerEnumFromString(string value) + { + if (value.Equals("UPPER")) + return InnerEnum.UPPER; + + if (value.Equals("lower")) + return InnerEnum.Lower; + + throw new NotImplementedException($"Could not convert value to type InnerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static InnerEnum? InnerEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return InnerEnum.UPPER; + + if (value.Equals("lower")) + return InnerEnum.Lower; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string InnerEnumToJsonValue(InnerEnum value) + { + if (value == InnerEnum.UPPER) + return "UPPER"; + + if (value == InnerEnum.Lower) + return "lower"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of DirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> DirectMapOption { get; private set; } + + /// + /// Gets or Sets DirectMap + /// + [JsonPropertyName("direct_map")] + public Dictionary DirectMap { get { return this.DirectMapOption; } set { this.DirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of IndirectMap + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> IndirectMapOption { get; private set; } + + /// + /// Gets or Sets IndirectMap + /// + [JsonPropertyName("indirect_map")] + public Dictionary IndirectMap { get { return this.IndirectMapOption; } set { this.IndirectMapOption = new Option>(value); } } + + /// + /// Used to track the state of MapMapOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option>> MapMapOfStringOption { get; private set; } + + /// + /// Gets or Sets MapMapOfString + /// + [JsonPropertyName("map_map_of_string")] + public Dictionary> MapMapOfString { get { return this.MapMapOfStringOption; } set { this.MapMapOfStringOption = new Option>>(value); } } + + /// + /// Used to track the state of MapOfEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOfEnumStringOption { get; private set; } + + /// + /// Gets or Sets MapOfEnumString + /// + [JsonPropertyName("map_of_enum_string")] + public Dictionary MapOfEnumString { get { return this.MapOfEnumStringOption; } set { this.MapOfEnumStringOption = 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 MapTest {\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).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 MapTestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MapTest 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> directMap = default; + Option> indirectMap = default; + Option>> mapMapOfString = default; + Option> mapOfEnumString = 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 "direct_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "indirect_map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_map_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map_of_enum_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (directMap.IsSet && directMap.Value == null) + throw new ArgumentNullException(nameof(directMap), "Property is not nullable for class MapTest."); + + if (indirectMap.IsSet && indirectMap.Value == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is not nullable for class MapTest."); + + if (mapMapOfString.IsSet && mapMapOfString.Value == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is not nullable for class MapTest."); + + if (mapOfEnumString.IsSet && mapOfEnumString.Value == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is not nullable for class MapTest."); + + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mapTest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mapTest.IndirectMapOption.IsSet && mapTest.IndirectMap == null) + throw new ArgumentNullException(nameof(mapTest.IndirectMap), "Property is required for class MapTest."); + + if (mapTest.MapMapOfStringOption.IsSet && mapTest.MapMapOfString == null) + throw new ArgumentNullException(nameof(mapTest.MapMapOfString), "Property is required for class MapTest."); + + if (mapTest.MapOfEnumStringOption.IsSet && mapTest.MapOfEnumString == null) + throw new ArgumentNullException(nameof(mapTest.MapOfEnumString), "Property is required for class MapTest."); + + if (mapTest.DirectMapOption.IsSet) + { + writer.WritePropertyName("direct_map"); + JsonSerializer.Serialize(writer, mapTest.DirectMap, jsonSerializerOptions); + } + if (mapTest.IndirectMapOption.IsSet) + { + writer.WritePropertyName("indirect_map"); + JsonSerializer.Serialize(writer, mapTest.IndirectMap, jsonSerializerOptions); + } + if (mapTest.MapMapOfStringOption.IsSet) + { + writer.WritePropertyName("map_map_of_string"); + JsonSerializer.Serialize(writer, mapTest.MapMapOfString, jsonSerializerOptions); + } + if (mapTest.MapOfEnumStringOption.IsSet) + { + writer.WritePropertyName("map_of_enum_string"); + JsonSerializer.Serialize(writer, mapTest.MapOfEnumString, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..0f3a07debfe --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/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/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..74047904b27 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..b335b252782 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new Option(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..7b435033f6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..d3cb505539d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -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 + * 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 +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + public partial class MixedPropertiesAndAdditionalPropertiesClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// dateTime + /// map + /// uuid + /// uuidWithPattern + [JsonConstructor] + public MixedPropertiesAndAdditionalPropertiesClass(Option dateTime = default, Option> map = default, Option uuid = default, Option uuidWithPattern = default) + { + DateTimeOption = dateTime; + MapOption = map; + UuidOption = uuid; + UuidWithPatternOption = uuidWithPattern; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of DateTime + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DateTimeOption { get; private set; } + + /// + /// Gets or Sets DateTime + /// + [JsonPropertyName("dateTime")] + public DateTime? DateTime { get { return this.DateTimeOption; } set { this.DateTimeOption = new Option(value); } } + + /// + /// Used to track the state of Map + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> MapOption { get; private set; } + + /// + /// Gets or Sets Map + /// + [JsonPropertyName("map")] + public Dictionary Map { get { return this.MapOption; } set { this.MapOption = new Option>(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = new Option(value); } } + + /// + /// Used to track the state of UuidWithPattern + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidWithPatternOption { get; private set; } + + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid? UuidWithPattern { get { return this.UuidWithPatternOption; } set { this.UuidWithPatternOption = 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 MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).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) + { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + + if (this.UuidWithPatternOption.Value != null &&!regexUuidWithPattern.Match(this.UuidWithPatternOption.Value.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixedPropertiesAndAdditionalPropertiesClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateTime + /// + public static string DateTimeFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedPropertiesAndAdditionalPropertiesClass 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 dateTime = default; + Option> map = default; + Option uuid = default; + Option uuidWithPattern = 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 "dateTime": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "map": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + case "uuid_with_pattern": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (dateTime.IsSet && dateTime.Value == null) + throw new ArgumentNullException(nameof(dateTime), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map.IsSet && map.Value == null) + throw new ArgumentNullException(nameof(map), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuidWithPattern.IsSet && uuidWithPattern.Value == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is not nullable for class MixedPropertiesAndAdditionalPropertiesClass."); + + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.IsSet) + writer.WriteString("dateTime", mixedPropertiesAndAdditionalPropertiesClass.DateTimeOption.Value.Value.ToString(DateTimeFormat)); + + if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet) + { + writer.WritePropertyName("map"); + JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); + } + if (mixedPropertiesAndAdditionalPropertiesClass.UuidOption.IsSet) + writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.UuidOption.Value.Value); + + if (mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.IsSet) + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPatternOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..1af8feed0a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 00000000000..30ee980fae9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name starting with number + /// + public partial class Model200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// class + /// name + [JsonConstructor] + public Model200Response(Option @class = default, Option name = default) + { + ClassOption = @class; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Class + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ClassOption { get; private set; } + + /// + /// Gets or Sets Class + /// + [JsonPropertyName("class")] + public string Class { get { return this.ClassOption; } set { this.ClassOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public int? Name { get { return this.NameOption; } set { this.NameOption = 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 Model200Response {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append(" Name: ").Append(Name).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 Model200ResponseJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Model200Response 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 varClass = default; + Option name = 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 "class": + varClass = new Option(utf8JsonReader.GetString()); + break; + case "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (varClass.IsSet && varClass.Value == null) + throw new ArgumentNullException(nameof(varClass), "Property is not nullable for class Model200Response."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Model200Response."); + + return new Model200Response(varClass, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, model200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (model200Response.ClassOption.IsSet) + writer.WriteString("class", model200Response.Class); + + if (model200Response.NameOption.IsSet) + writer.WriteNumber("name", model200Response.NameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 00000000000..28da419bb21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ModelClient + /// + public partial class ModelClient : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varClient + [JsonConstructor] + public ModelClient(Option varClient = default) + { + VarClientOption = varClient; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarClient + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarClientOption { get; private set; } + + /// + /// Gets or Sets VarClient + /// + [JsonPropertyName("client")] + public string VarClient { get { return this.VarClientOption; } set { this.VarClientOption = 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 ModelClient {\n"); + sb.Append(" VarClient: ").Append(VarClient).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 ModelClientJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ModelClient 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 varClient = 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 "client": + varClient = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (varClient.IsSet && varClient.Value == null) + throw new ArgumentNullException(nameof(varClient), "Property is not nullable for class ModelClient."); + + return new ModelClient(varClient); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, modelClient, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (modelClient.VarClientOption.IsSet) + writer.WriteString("client", modelClient.VarClient); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 00000000000..f353f694fb2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,291 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing model name same as property name + /// + public partial class Name : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varName + /// property + /// snakeCase + /// var123Number + [JsonConstructor] + public Name(int varName, Option property = default, Option snakeCase = default, Option var123Number = default) + { + VarName = varName; + PropertyOption = property; + SnakeCaseOption = snakeCase; + Var123NumberOption = var123Number; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets VarName + /// + [JsonPropertyName("name")] + public int VarName { get; set; } + + /// + /// Used to track the state of Property + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PropertyOption { get; private set; } + + /// + /// Gets or Sets Property + /// + [JsonPropertyName("property")] + public string Property { get { return this.PropertyOption; } set { this.PropertyOption = new Option(value); } } + + /// + /// Used to track the state of SnakeCase + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SnakeCaseOption { get; } + + /// + /// Gets or Sets SnakeCase + /// + [JsonPropertyName("snake_case")] + public int? SnakeCase { get { return this.SnakeCaseOption; } } + + /// + /// Used to track the state of Var123Number + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Var123NumberOption { get; } + + /// + /// Gets or Sets Var123Number + /// + [JsonPropertyName("123Number")] + public int? Var123Number { get { return this.Var123NumberOption; } } + + /// + /// 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 Name {\n"); + sb.Append(" VarName: ").Append(VarName).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Var123Number: ").Append(Var123Number).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name 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 (SnakeCase != null) + hashCode = (hashCode * 59) + SnakeCase.GetHashCode(); + + if (Var123Number != null) + hashCode = (hashCode * 59) + Var123Number.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 NameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Name 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 varName = default; + Option property = default; + Option snakeCase = default; + Option var123Number = 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 "name": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varName = new Option(utf8JsonReader.GetInt32()); + break; + case "property": + property = new Option(utf8JsonReader.GetString()); + break; + case "snake_case": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = new Option(utf8JsonReader.GetInt32()); + break; + case "123Number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + var123Number = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!varName.IsSet) + throw new ArgumentException("Property is required for class Name.", nameof(varName)); + + if (varName.IsSet && varName.Value == null) + throw new ArgumentNullException(nameof(varName), "Property is not nullable for class Name."); + + if (property.IsSet && property.Value == null) + throw new ArgumentNullException(nameof(property), "Property is not nullable for class Name."); + + if (snakeCase.IsSet && snakeCase.Value == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is not nullable for class Name."); + + if (var123Number.IsSet && var123Number.Value == null) + throw new ArgumentNullException(nameof(var123Number), "Property is not nullable for class Name."); + + return new Name(varName.Value.Value, property, snakeCase, var123Number); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, name, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteNumber("name", name.VarName); + + if (name.PropertyOption.IsSet) + writer.WriteString("property", name.Property); + + if (name.SnakeCaseOption.IsSet) + writer.WriteNumber("snake_case", name.SnakeCaseOption.Value.Value); + + if (name.Var123NumberOption.IsSet) + writer.WriteNumber("123Number", name.Var123NumberOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs new file mode 100644 index 00000000000..ea8abdda0d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -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 + * 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 +{ + /// + /// NotificationtestGetElementsV1ResponseMPayload + /// + public partial class NotificationtestGetElementsV1ResponseMPayload : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// aObjVariableobject + /// pkiNotificationtestID + [JsonConstructor] + public NotificationtestGetElementsV1ResponseMPayload(List> aObjVariableobject, int pkiNotificationtestID) + { + AObjVariableobject = aObjVariableobject; + PkiNotificationtestID = pkiNotificationtestID; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets AObjVariableobject + /// + [JsonPropertyName("a_objVariableobject")] + public List> AObjVariableobject { get; set; } + + /// + /// Gets or Sets PkiNotificationtestID + /// + [JsonPropertyName("pkiNotificationtestID")] + public int PkiNotificationtestID { get; set; } + + /// + /// 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 NotificationtestGetElementsV1ResponseMPayload {\n"); + sb.Append(" AObjVariableobject: ").Append(AObjVariableobject).Append("\n"); + sb.Append(" PkiNotificationtestID: ").Append(PkiNotificationtestID).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 NotificationtestGetElementsV1ResponseMPayloadJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NotificationtestGetElementsV1ResponseMPayload 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>> aObjVariableobject = default; + Option pkiNotificationtestID = 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 "a_objVariableobject": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "pkiNotificationtestID": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + break; + default: + break; + } + } + } + + if (!aObjVariableobject.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(aObjVariableobject)); + + if (!pkiNotificationtestID.IsSet) + throw new ArgumentException("Property is required for class NotificationtestGetElementsV1ResponseMPayload.", nameof(pkiNotificationtestID)); + + if (aObjVariableobject.IsSet && aObjVariableobject.Value == null) + throw new ArgumentNullException(nameof(aObjVariableobject), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + if (pkiNotificationtestID.IsSet && pkiNotificationtestID.Value == null) + throw new ArgumentNullException(nameof(pkiNotificationtestID), "Property is not nullable for class NotificationtestGetElementsV1ResponseMPayload."); + + return new NotificationtestGetElementsV1ResponseMPayload(aObjVariableobject.Value, pkiNotificationtestID.Value.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WritePropertyName("a_objVariableobject"); + JsonSerializer.Serialize(writer, notificationtestGetElementsV1ResponseMPayload.AObjVariableobject, jsonSerializerOptions); + writer.WriteNumber("pkiNotificationtestID", notificationtestGetElementsV1ResponseMPayload.PkiNotificationtestID); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 00000000000..ff026f1fbb4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,496 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// NullableClass + /// + public partial class NullableClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// arrayAndItemsNullableProp + /// arrayItemsNullable + /// arrayNullableProp + /// booleanProp + /// dateProp + /// datetimeProp + /// integerProp + /// numberProp + /// objectAndItemsNullableProp + /// objectItemsNullable + /// objectNullableProp + /// stringProp + [JsonConstructor] + public NullableClass(Option> arrayAndItemsNullableProp = default, Option> arrayItemsNullable = default, Option> arrayNullableProp = default, Option booleanProp = default, Option dateProp = default, Option datetimeProp = default, Option integerProp = default, Option numberProp = default, Option> objectAndItemsNullableProp = default, Option> objectItemsNullable = default, Option> objectNullableProp = default, Option stringProp = default) + { + ArrayAndItemsNullablePropOption = arrayAndItemsNullableProp; + ArrayItemsNullableOption = arrayItemsNullable; + ArrayNullablePropOption = arrayNullableProp; + BooleanPropOption = booleanProp; + DatePropOption = dateProp; + DatetimePropOption = datetimeProp; + IntegerPropOption = integerProp; + NumberPropOption = numberProp; + ObjectAndItemsNullablePropOption = objectAndItemsNullableProp; + ObjectItemsNullableOption = objectItemsNullable; + ObjectNullablePropOption = objectNullableProp; + StringPropOption = stringProp; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of ArrayAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [JsonPropertyName("array_and_items_nullable_prop")] + public List ArrayAndItemsNullableProp { get { return this.ArrayAndItemsNullablePropOption; } set { this.ArrayAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [JsonPropertyName("array_items_nullable")] + public List ArrayItemsNullable { get { return this.ArrayItemsNullableOption; } set { this.ArrayItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ArrayNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ArrayNullablePropOption { get; private set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [JsonPropertyName("array_nullable_prop")] + public List ArrayNullableProp { get { return this.ArrayNullablePropOption; } set { this.ArrayNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of BooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BooleanPropOption { get; private set; } + + /// + /// Gets or Sets BooleanProp + /// + [JsonPropertyName("boolean_prop")] + public bool? BooleanProp { get { return this.BooleanPropOption; } set { this.BooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of DateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatePropOption { get; private set; } + + /// + /// Gets or Sets DateProp + /// + [JsonPropertyName("date_prop")] + public DateTime? DateProp { get { return this.DatePropOption; } set { this.DatePropOption = new Option(value); } } + + /// + /// Used to track the state of DatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DatetimePropOption { get; private set; } + + /// + /// Gets or Sets DatetimeProp + /// + [JsonPropertyName("datetime_prop")] + public DateTime? DatetimeProp { get { return this.DatetimePropOption; } set { this.DatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of IntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntegerPropOption { get; private set; } + + /// + /// Gets or Sets IntegerProp + /// + [JsonPropertyName("integer_prop")] + public int? IntegerProp { get { return this.IntegerPropOption; } set { this.IntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NumberProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NumberPropOption { get; private set; } + + /// + /// Gets or Sets NumberProp + /// + [JsonPropertyName("number_prop")] + public decimal? NumberProp { get { return this.NumberPropOption; } set { this.NumberPropOption = new Option(value); } } + + /// + /// Used to track the state of ObjectAndItemsNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectAndItemsNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [JsonPropertyName("object_and_items_nullable_prop")] + public Dictionary ObjectAndItemsNullableProp { get { return this.ObjectAndItemsNullablePropOption; } set { this.ObjectAndItemsNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectItemsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectItemsNullableOption { get; private set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [JsonPropertyName("object_items_nullable")] + public Dictionary ObjectItemsNullable { get { return this.ObjectItemsNullableOption; } set { this.ObjectItemsNullableOption = new Option>(value); } } + + /// + /// Used to track the state of ObjectNullableProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> ObjectNullablePropOption { get; private set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [JsonPropertyName("object_nullable_prop")] + public Dictionary ObjectNullableProp { get { return this.ObjectNullablePropOption; } set { this.ObjectNullablePropOption = new Option>(value); } } + + /// + /// Used to track the state of StringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringPropOption { get; private set; } + + /// + /// Gets or Sets StringProp + /// + [JsonPropertyName("string_prop")] + public string StringProp { get { return this.StringPropOption; } set { this.StringPropOption = 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 NullableClass {\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).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 NullableClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize DateProp + /// + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize DatetimeProp + /// + public static string DatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableClass 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> arrayAndItemsNullableProp = default; + Option> arrayItemsNullable = default; + Option> arrayNullableProp = default; + Option booleanProp = default; + Option dateProp = default; + Option datetimeProp = default; + Option integerProp = default; + Option numberProp = default; + Option> objectAndItemsNullableProp = default; + Option> objectItemsNullable = default; + Option> objectNullableProp = default; + Option stringProp = 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 "array_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "array_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "number_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + numberProp = new Option(utf8JsonReader.GetDecimal()); + break; + case "object_and_items_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_items_nullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "object_nullable_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "string_prop": + stringProp = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (arrayItemsNullable.IsSet && arrayItemsNullable.Value == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is not nullable for class NullableClass."); + + if (objectItemsNullable.IsSet && objectItemsNullable.Value == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is not nullable for class NullableClass."); + + return new NullableClass(arrayAndItemsNullableProp, arrayItemsNullable, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectItemsNullable, objectNullableProp, stringProp); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (nullableClass.ObjectItemsNullableOption.IsSet && nullableClass.ObjectItemsNullable == null) + throw new ArgumentNullException(nameof(nullableClass.ObjectItemsNullable), "Property is required for class NullableClass."); + + if (nullableClass.ArrayAndItemsNullablePropOption.IsSet) + if (nullableClass.ArrayAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("array_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_and_items_nullable_prop"); + if (nullableClass.ArrayItemsNullableOption.IsSet) + { + writer.WritePropertyName("array_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ArrayItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ArrayNullablePropOption.IsSet) + if (nullableClass.ArrayNullablePropOption.Value != null) + { + writer.WritePropertyName("array_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ArrayNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("array_nullable_prop"); + if (nullableClass.BooleanPropOption.IsSet) + if (nullableClass.BooleanPropOption.Value != null) + writer.WriteBoolean("boolean_prop", nullableClass.BooleanPropOption.Value.Value); + else + writer.WriteNull("boolean_prop"); + + if (nullableClass.DatePropOption.IsSet) + if (nullableClass.DatePropOption.Value != null) + writer.WriteString("date_prop", nullableClass.DatePropOption.Value.Value.ToString(DatePropFormat)); + else + writer.WriteNull("date_prop"); + + if (nullableClass.DatetimePropOption.IsSet) + if (nullableClass.DatetimePropOption.Value != null) + writer.WriteString("datetime_prop", nullableClass.DatetimePropOption.Value.Value.ToString(DatetimePropFormat)); + else + writer.WriteNull("datetime_prop"); + + if (nullableClass.IntegerPropOption.IsSet) + if (nullableClass.IntegerPropOption.Value != null) + writer.WriteNumber("integer_prop", nullableClass.IntegerPropOption.Value.Value); + else + writer.WriteNull("integer_prop"); + + if (nullableClass.NumberPropOption.IsSet) + if (nullableClass.NumberPropOption.Value != null) + writer.WriteNumber("number_prop", nullableClass.NumberPropOption.Value.Value); + else + writer.WriteNull("number_prop"); + + if (nullableClass.ObjectAndItemsNullablePropOption.IsSet) + if (nullableClass.ObjectAndItemsNullablePropOption.Value != null) + { + writer.WritePropertyName("object_and_items_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectAndItemsNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_and_items_nullable_prop"); + if (nullableClass.ObjectItemsNullableOption.IsSet) + { + writer.WritePropertyName("object_items_nullable"); + JsonSerializer.Serialize(writer, nullableClass.ObjectItemsNullable, jsonSerializerOptions); + } + if (nullableClass.ObjectNullablePropOption.IsSet) + if (nullableClass.ObjectNullablePropOption.Value != null) + { + writer.WritePropertyName("object_nullable_prop"); + JsonSerializer.Serialize(writer, nullableClass.ObjectNullableProp, jsonSerializerOptions); + } + else + writer.WriteNull("object_nullable_prop"); + if (nullableClass.StringPropOption.IsSet) + if (nullableClass.StringPropOption.Value != null) + writer.WriteString("string_prop", nullableClass.StringProp); + else + writer.WriteNull("string_prop"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs new file mode 100644 index 00000000000..8c52be7e14a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -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 + * 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 +{ + /// + /// NullableGuidClass + /// + public partial class NullableGuidClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// uuid + [JsonConstructor] + public NullableGuidClass(Option uuid = default) + { + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("uuid")] + public Guid? Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 NullableGuidClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).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 NullableGuidClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableGuidClass 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 uuid = 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 "uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + return new NullableGuidClass(uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + { + if (nullableGuidClass.UuidOption.IsSet) + if (nullableGuidClass.UuidOption.Value != null) + writer.WriteString("uuid", nullableGuidClass.UuidOption.Value.Value); + else + writer.WriteNull("uuid"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 00000000000..9a93cb734e9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + public partial class NullableShape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public NullableShape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 NullableShape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NullableShape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class NullableShape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); + + if (quadrilateral != null) + return new NullableShape(quadrilateral); + + if (triangle != null) + return new NullableShape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (nullableShape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); + } + + if (nullableShape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, nullableShape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 00000000000..923180c653b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -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 + * 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 +{ + /// + /// NumberOnly + /// + public partial class NumberOnly : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber + [JsonConstructor] + public NumberOnly(Option justNumber = default) + { + JustNumberOption = justNumber; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of JustNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option JustNumberOption { get; private set; } + + /// + /// Gets or Sets JustNumber + /// + [JsonPropertyName("JustNumber")] + public decimal? JustNumber { get { return this.JustNumberOption; } set { this.JustNumberOption = 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 NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).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 NumberOnlyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NumberOnly 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 justNumber = 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 "JustNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = new Option(utf8JsonReader.GetDecimal()); + break; + default: + break; + } + } + } + + if (justNumber.IsSet && justNumber.Value == null) + throw new ArgumentNullException(nameof(justNumber), "Property is not nullable for class NumberOnly."); + + return new NumberOnly(justNumber); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, numberOnly, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 00000000000..e25bbf00940 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,268 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ObjectWithDeprecatedFields + /// + public partial class ObjectWithDeprecatedFields : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bars + /// deprecatedRef + /// id + /// uuid + [JsonConstructor] + public ObjectWithDeprecatedFields(Option> bars = default, Option deprecatedRef = default, Option id = default, Option uuid = default) + { + BarsOption = bars; + DeprecatedRefOption = deprecatedRef; + IdOption = id; + UuidOption = uuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bars + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> BarsOption { get; private set; } + + /// + /// Gets or Sets Bars + /// + [JsonPropertyName("bars")] + [Obsolete] + public List Bars { get { return this.BarsOption; } set { this.BarsOption = new Option>(value); } } + + /// + /// Used to track the state of DeprecatedRef + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeprecatedRefOption { get; private set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [JsonPropertyName("deprecatedRef")] + [Obsolete] + public DeprecatedObject DeprecatedRef { get { return this.DeprecatedRefOption; } set { this.DeprecatedRefOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + [Obsolete] + public decimal? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Uuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UuidOption { get; private set; } + + /// + /// Gets or Sets Uuid + /// + [JsonPropertyName("uuid")] + public string Uuid { get { return this.UuidOption; } set { this.UuidOption = 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 ObjectWithDeprecatedFields {\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).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 ObjectWithDeprecatedFieldsJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ObjectWithDeprecatedFields 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> bars = default; + Option deprecatedRef = default; + Option id = default; + Option uuid = 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 "bars": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "deprecatedRef": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetDecimal()); + break; + case "uuid": + uuid = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bars.IsSet && bars.Value == null) + throw new ArgumentNullException(nameof(bars), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (deprecatedRef.IsSet && deprecatedRef.Value == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class ObjectWithDeprecatedFields."); + + if (uuid.IsSet && uuid.Value == null) + throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class ObjectWithDeprecatedFields."); + + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet && objectWithDeprecatedFields.DeprecatedRef == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.DeprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.UuidOption.IsSet && objectWithDeprecatedFields.Uuid == null) + throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (objectWithDeprecatedFields.BarsOption.IsSet) + { + writer.WritePropertyName("bars"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.Bars, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.DeprecatedRefOption.IsSet) + { + writer.WritePropertyName("deprecatedRef"); + JsonSerializer.Serialize(writer, objectWithDeprecatedFields.DeprecatedRef, jsonSerializerOptions); + } + if (objectWithDeprecatedFields.IdOption.IsSet) + writer.WriteNumber("id", objectWithDeprecatedFields.IdOption.Value.Value); + + if (objectWithDeprecatedFields.UuidOption.IsSet) + writer.WriteString("uuid", objectWithDeprecatedFields.Uuid); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs new file mode 100644 index 00000000000..c89963f55a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -0,0 +1,157 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OneOfString + /// + public partial class OneOfString : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal OneOfString(string @string) + { + String = @string; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// 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 OneOfString {\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 OneOfStringJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OneOfString 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; + + string varString = 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) + { + default: + break; + } + } + } + + if (varString != null) + return new OneOfString(varString); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, oneOfString, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 00000000000..f12f2affef3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,396 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Order + /// + public partial class Order : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// complete (default to false) + /// id + /// petId + /// quantity + /// shipDate + /// Order Status + [JsonConstructor] + public Order(Option complete = default, Option id = default, Option petId = default, Option quantity = default, Option shipDate = default, Option status = default) + { + CompleteOption = complete; + IdOption = id; + PetIdOption = petId; + QuantityOption = quantity; + ShipDateOption = shipDate; + StatusOption = status; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Order Status + /// + /// Order Status + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("placed")) + return StatusEnum.Placed; + + if (value.Equals("approved")) + return StatusEnum.Approved; + + if (value.Equals("delivered")) + return StatusEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("placed")) + return StatusEnum.Placed; + + if (value.Equals("approved")) + return StatusEnum.Approved; + + if (value.Equals("delivered")) + return StatusEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Placed) + return "placed"; + + if (value == StatusEnum.Approved) + return "approved"; + + if (value == StatusEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// Order Status + /// + /// Order Status + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Used to track the state of Complete + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CompleteOption { get; private set; } + + /// + /// Gets or Sets Complete + /// + [JsonPropertyName("complete")] + public bool? Complete { get { return this.CompleteOption; } set { this.CompleteOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of PetId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PetIdOption { get; private set; } + + /// + /// Gets or Sets PetId + /// + [JsonPropertyName("petId")] + public long? PetId { get { return this.PetIdOption; } set { this.PetIdOption = new Option(value); } } + + /// + /// Used to track the state of Quantity + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option QuantityOption { get; private set; } + + /// + /// Gets or Sets Quantity + /// + [JsonPropertyName("quantity")] + public int? Quantity { get { return this.QuantityOption; } set { this.QuantityOption = new Option(value); } } + + /// + /// Used to track the state of ShipDate + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShipDateOption { get; private set; } + + /// + /// Gets or Sets ShipDate + /// + /// 2020-02-02T20:20:20.000222Z + [JsonPropertyName("shipDate")] + public DateTime? ShipDate { get { return this.ShipDateOption; } set { this.ShipDateOption = 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 Order {\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).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 OrderJsonConverter : JsonConverter + { + /// + /// The format to use to serialize ShipDate + /// + public static string ShipDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Order 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 complete = default; + Option id = default; + Option petId = default; + Option quantity = default; + Option shipDate = default; + Option status = 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 "complete": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = new Option(utf8JsonReader.GetBoolean()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "petId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = new Option(utf8JsonReader.GetInt64()); + break; + case "quantity": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = new Option(utf8JsonReader.GetInt32()); + break; + case "shipDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(Order.StatusEnumFromStringOrDefault(statusRawValue)); + break; + default: + break; + } + } + } + + if (complete.IsSet && complete.Value == null) + throw new ArgumentNullException(nameof(complete), "Property is not nullable for class Order."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Order."); + + if (petId.IsSet && petId.Value == null) + throw new ArgumentNullException(nameof(petId), "Property is not nullable for class Order."); + + if (quantity.IsSet && quantity.Value == null) + throw new ArgumentNullException(nameof(quantity), "Property is not nullable for class Order."); + + if (shipDate.IsSet && shipDate.Value == null) + throw new ArgumentNullException(nameof(shipDate), "Property is not nullable for class Order."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Order."); + + return new Order(complete, id, petId, quantity, shipDate, status); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, order, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + { + if (order.CompleteOption.IsSet) + writer.WriteBoolean("complete", order.CompleteOption.Value.Value); + + if (order.IdOption.IsSet) + writer.WriteNumber("id", order.IdOption.Value.Value); + + if (order.PetIdOption.IsSet) + writer.WriteNumber("petId", order.PetIdOption.Value.Value); + + if (order.QuantityOption.IsSet) + writer.WriteNumber("quantity", order.QuantityOption.Value.Value); + + if (order.ShipDateOption.IsSet) + writer.WriteString("shipDate", order.ShipDateOption.Value.Value.ToString(ShipDateFormat)); + + var statusRawValue = Order.StatusEnumToJsonValue(order.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 00000000000..dbf262b28c3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,228 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// OuterComposite + /// + public partial class OuterComposite : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// myBoolean + /// myNumber + /// myString + [JsonConstructor] + public OuterComposite(Option myBoolean = default, Option myNumber = default, Option myString = default) + { + MyBooleanOption = myBoolean; + MyNumberOption = myNumber; + MyStringOption = myString; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of MyBoolean + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyBooleanOption { get; private set; } + + /// + /// Gets or Sets MyBoolean + /// + [JsonPropertyName("my_boolean")] + public bool? MyBoolean { get { return this.MyBooleanOption; } set { this.MyBooleanOption = new Option(value); } } + + /// + /// Used to track the state of MyNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyNumberOption { get; private set; } + + /// + /// Gets or Sets MyNumber + /// + [JsonPropertyName("my_number")] + public decimal? MyNumber { get { return this.MyNumberOption; } set { this.MyNumberOption = new Option(value); } } + + /// + /// Used to track the state of MyString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MyStringOption { get; private set; } + + /// + /// Gets or Sets MyString + /// + [JsonPropertyName("my_string")] + public string MyString { get { return this.MyStringOption; } set { this.MyStringOption = 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 OuterComposite {\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).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 OuterCompositeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override OuterComposite 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 myBoolean = default; + Option myNumber = default; + Option myString = 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 "my_boolean": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = new Option(utf8JsonReader.GetBoolean()); + break; + case "my_number": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = new Option(utf8JsonReader.GetDecimal()); + break; + case "my_string": + myString = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (myBoolean.IsSet && myBoolean.Value == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is not nullable for class OuterComposite."); + + if (myNumber.IsSet && myNumber.Value == null) + throw new ArgumentNullException(nameof(myNumber), "Property is not nullable for class OuterComposite."); + + if (myString.IsSet && myString.Value == null) + throw new ArgumentNullException(nameof(myString), "Property is not nullable for class OuterComposite."); + + return new OuterComposite(myBoolean, myNumber, myString); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, outerComposite, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (outerComposite.MyBooleanOption.IsSet) + writer.WriteBoolean("my_boolean", outerComposite.MyBooleanOption.Value.Value); + + if (outerComposite.MyNumberOption.IsSet) + writer.WriteNumber("my_number", outerComposite.MyNumberOption.Value.Value); + + if (outerComposite.MyStringOption.IsSet) + writer.WriteString("my_string", outerComposite.MyString); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 00000000000..47bb6793c6a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnum + /// + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum FromString(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnum? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnum.Placed; + + if (value.Equals("approved")) + return OuterEnum.Approved; + + if (value.Equals("delivered")) + return OuterEnum.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnum value) + { + if (value == OuterEnum.Placed) + return "placed"; + + if (value == OuterEnum.Approved) + return "approved"; + + if (value == OuterEnum.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnum from the Json object + /// + /// + /// + /// + /// + public override OuterEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnum? result = rawValue == null + ? null + : OuterEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnum? outerEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 00000000000..136fb4c54c4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines OuterEnumDefaultValue + /// + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + Delivered = 3 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue FromString(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + throw new NotImplementedException($"Could not convert value to type OuterEnumDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals("placed")) + return OuterEnumDefaultValue.Placed; + + if (value.Equals("approved")) + return OuterEnumDefaultValue.Approved; + + if (value.Equals("delivered")) + return OuterEnumDefaultValue.Delivered; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumDefaultValue value) + { + if (value == OuterEnumDefaultValue.Placed) + return "placed"; + + if (value == OuterEnumDefaultValue.Approved) + return "approved"; + + if (value == OuterEnumDefaultValue.Delivered) + return "delivered"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumDefaultValue? result = rawValue == null + ? null + : OuterEnumDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumDefaultValue? outerEnumDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 00000000000..2ed4f18a657 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumInteger: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumInteger? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumInteger.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumInteger.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumInteger.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumInteger value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumInteger to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumInteger from the Json object + /// + /// + /// + /// + /// + public override OuterEnumInteger? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumInteger? result = rawValue == null + ? null + : OuterEnumIntegerValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumInteger? outerEnumInteger, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumInteger?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 00000000000..c6a470cc64d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -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 + * 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 +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumIntegerDefaultValueValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue FromString(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumIntegerDefaultValue: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumIntegerDefaultValue? FromStringOrDefault(string value) + { + if (value.Equals((0).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_0; + + if (value.Equals((1).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_1; + + if (value.Equals((2).ToString())) + return OuterEnumIntegerDefaultValue.NUMBER_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static int ToJsonValue(OuterEnumIntegerDefaultValue value) + { + return (int) value; + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumIntegerDefaultValueJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumIntegerDefaultValue to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumIntegerDefaultValueNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumIntegerDefaultValue from the Json object + /// + /// + /// + /// + /// + public override OuterEnumIntegerDefaultValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumIntegerDefaultValue? result = rawValue == null + ? null + : OuterEnumIntegerDefaultValueValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumIntegerDefaultValue?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs new file mode 100644 index 00000000000..a2e789f2ede --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterEnumTest.cs @@ -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 + * 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 +{ + /// + /// Defines Outer_Enum_Test + /// + public enum OuterEnumTest + { + /// + /// 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 + } + + /// + /// Converts to and from the JSON value + /// + public static class OuterEnumTestValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest FromString(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type OuterEnumTest: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static OuterEnumTest? FromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return OuterEnumTest.UPPER; + + if (value.Equals("lower")) + return OuterEnumTest.Lower; + + if (value.Equals("")) + return OuterEnumTest.Empty; + + if (value.Equals("Value\twith tab")) + return OuterEnumTest.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return OuterEnumTest.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return OuterEnumTest.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return OuterEnumTest.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return OuterEnumTest.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(OuterEnumTest value) + { + if (value == OuterEnumTest.UPPER) + return "UPPER"; + + if (value == OuterEnumTest.Lower) + return "lower"; + + if (value == OuterEnumTest.Empty) + return ""; + + if (value == OuterEnumTest.ValuewithTab) + return "Value\twith tab"; + + if (value == OuterEnumTest.ValueWithQuote) + return "Value with \" quote"; + + if (value == OuterEnumTest.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == OuterEnumTest.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == OuterEnumTest.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class OuterEnumTestJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the OuterEnumTest to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class OuterEnumTestNullableJsonConverter : JsonConverter + { + /// + /// Returns a OuterEnumTest from the Json object + /// + /// + /// + /// + /// + public override OuterEnumTest? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + OuterEnumTest? result = rawValue == null + ? null + : OuterEnumTestValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, OuterEnumTest? outerEnumTest, JsonSerializerOptions options) + { + writer.WriteStringValue(outerEnumTest?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 00000000000..5d1cab769fa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -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 + * 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 +{ + /// + /// ParentPet + /// + public partial class ParentPet : GrandparentAnimal, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructor] + 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 + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + } + + /// + /// A Json converter for type + /// + public class ParentPetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ParentPet 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 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) + 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 "pet_type": + petType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!petType.IsSet) + throw new ArgumentException("Property is required for class ParentPet.", nameof(petType)); + + if (petType.IsSet && petType.Value == null) + throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); + + return new ParentPet(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + writer.WriteStartObject(); + + WriteProperties(writer, parentPet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("pet_type", parentPet.PetType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 00000000000..ef5f3c898b6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,396 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pet + /// + public partial class Pet : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + /// photoUrls + /// category + /// id + /// pet status in the store + /// tags + [JsonConstructor] + public Pet(string name, List photoUrls, Option category = default, Option id = default, Option status = default, Option> tags = default) + { + Name = name; + PhotoUrls = photoUrls; + CategoryOption = category; + IdOption = id; + StatusOption = status; + TagsOption = tags; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// pet status in the store + /// + /// pet status in the store + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + Available = 1, + + /// + /// Enum Pending for value: pending + /// + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + Sold = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static StatusEnum StatusEnumFromString(string value) + { + if (value.Equals("available")) + return StatusEnum.Available; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("sold")) + return StatusEnum.Sold; + + throw new NotImplementedException($"Could not convert value to type StatusEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static StatusEnum? StatusEnumFromStringOrDefault(string value) + { + if (value.Equals("available")) + return StatusEnum.Available; + + if (value.Equals("pending")) + return StatusEnum.Pending; + + if (value.Equals("sold")) + return StatusEnum.Sold; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string StatusEnumToJsonValue(StatusEnum? value) + { + if (value == StatusEnum.Available) + return "available"; + + if (value == StatusEnum.Pending) + return "pending"; + + if (value == StatusEnum.Sold) + return "sold"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Status + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StatusOption { get; private set; } + + /// + /// pet status in the store + /// + /// pet status in the store + [JsonPropertyName("status")] + public StatusEnum? Status { get { return this.StatusOption; } set { this.StatusOption = new Option(value); } } + + /// + /// Gets or Sets Name + /// + /// doggie + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [JsonPropertyName("photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Used to track the state of Category + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryOption { get; private set; } + + /// + /// Gets or Sets Category + /// + [JsonPropertyName("category")] + public Category Category { get { return this.CategoryOption; } set { this.CategoryOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Tags + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TagsOption { get; private set; } + + /// + /// Gets or Sets Tags + /// + [JsonPropertyName("tags")] + public List Tags { get { return this.TagsOption; } set { this.TagsOption = 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 Pet {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Tags: ").Append(Tags).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 PetJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pet 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 name = default; + Option> photoUrls = default; + Option category = default; + Option id = default; + Option status = default; + Option> tags = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + case "photoUrls": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "category": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "status": + string statusRawValue = utf8JsonReader.GetString(); + if (statusRawValue != null) + status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); + break; + case "tags": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (!name.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(name)); + + if (!photoUrls.IsSet) + throw new ArgumentException("Property is required for class Pet.", nameof(photoUrls)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Pet."); + + if (photoUrls.IsSet && photoUrls.Value == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is not nullable for class Pet."); + + if (category.IsSet && category.Value == null) + throw new ArgumentNullException(nameof(category), "Property is not nullable for class Pet."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Pet."); + + if (status.IsSet && status.Value == null) + throw new ArgumentNullException(nameof(status), "Property is not nullable for class Pet."); + + if (tags.IsSet && tags.Value == null) + throw new ArgumentNullException(nameof(tags), "Property is not nullable for class Pet."); + + return new Pet(name.Value, photoUrls.Value, category, id, status, tags); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, pet, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (pet.PhotoUrls == null) + throw new ArgumentNullException(nameof(pet.PhotoUrls), "Property is required for class Pet."); + + if (pet.CategoryOption.IsSet && pet.Category == null) + throw new ArgumentNullException(nameof(pet.Category), "Property is required for class Pet."); + + if (pet.TagsOption.IsSet && pet.Tags == null) + throw new ArgumentNullException(nameof(pet.Tags), "Property is required for class Pet."); + + writer.WriteString("name", pet.Name); + + writer.WritePropertyName("photoUrls"); + JsonSerializer.Serialize(writer, pet.PhotoUrls, jsonSerializerOptions); + if (pet.CategoryOption.IsSet) + { + writer.WritePropertyName("category"); + JsonSerializer.Serialize(writer, pet.Category, jsonSerializerOptions); + } + if (pet.IdOption.IsSet) + writer.WriteNumber("id", pet.IdOption.Value.Value); + + var statusRawValue = Pet.StatusEnumToJsonValue(pet.StatusOption.Value.Value); + writer.WriteString("status", statusRawValue); + if (pet.TagsOption.IsSet) + { + writer.WritePropertyName("tags"); + JsonSerializer.Serialize(writer, pet.Tags, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 00000000000..b6f300c9440 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Pig + /// + public partial class Pig : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(BasquePig basquePig) + { + BasquePig = basquePig; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Pig(DanishPig danishPig) + { + DanishPig = danishPig; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets BasquePig + /// + public BasquePig BasquePig { get; set; } + + /// + /// Gets or Sets DanishPig + /// + public DanishPig DanishPig { get; set; } + + /// + /// 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 Pig {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class PigJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Pig 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 className = default; + + BasquePig basquePig = null; + DanishPig danishPig = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("className")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("BasquePig")) + { + Utf8JsonReader utf8JsonReaderBasquePig = utf8JsonReader; + basquePig = JsonSerializer.Deserialize(ref utf8JsonReaderBasquePig, jsonSerializerOptions); + } + if (discriminator.Equals("DanishPig")) + { + Utf8JsonReader utf8JsonReaderDanishPig = utf8JsonReader; + danishPig = JsonSerializer.Deserialize(ref utf8JsonReaderDanishPig, jsonSerializerOptions); + } + } + } + } + + 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Pig.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); + + if (basquePig != null) + return new Pig(basquePig); + + if (danishPig != null) + return new Pig(danishPig); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (pig.BasquePig != null) + { + BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); + } + + if (pig.DanishPig != null) + { + DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); + } + + WriteProperties(writer, pig, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs new file mode 100644 index 00000000000..ddea47edf40 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// PolymorphicProperty + /// + public partial class PolymorphicProperty : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(Object @object) + { + Object = @object; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + internal PolymorphicProperty(List list) + { + List = list; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Object + /// + public Object Object { get; set; } + + /// + /// Gets or Sets List + /// + public List List { get; set; } + + /// + /// 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 PolymorphicProperty {\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 PolymorphicPropertyJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override PolymorphicProperty 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; + + bool? varBool = default; + string varString = default; + Object varObject = default; + List list = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); + + Utf8JsonReader utf8JsonReaderList = utf8JsonReader; + ClientUtils.TryDeserialize>(ref utf8JsonReaderList, jsonSerializerOptions, out list); + } + } + + 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) + { + default: + break; + } + } + } + + if (varBool != null) + return new PolymorphicProperty(varBool.Value); + + if (varString != null) + return new PolymorphicProperty(varString); + + if (varObject != null) + return new PolymorphicProperty(varObject); + + if (list != null) + return new PolymorphicProperty(list); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 00000000000..e8a2e243997 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Quadrilateral + /// + public partial class Quadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) + { + SimpleQuadrilateral = simpleQuadrilateral; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) + { + ComplexQuadrilateral = complexQuadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets SimpleQuadrilateral + /// + public SimpleQuadrilateral SimpleQuadrilateral { get; set; } + + /// + /// Gets or Sets ComplexQuadrilateral + /// + public ComplexQuadrilateral ComplexQuadrilateral { get; set; } + + /// + /// 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 Quadrilateral {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Quadrilateral 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 quadrilateralType = default; + + ComplexQuadrilateral complexQuadrilateral = null; + SimpleQuadrilateral simpleQuadrilateral = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("quadrilateralType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("ComplexQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderComplexQuadrilateral = utf8JsonReader; + complexQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderComplexQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("SimpleQuadrilateral")) + { + Utf8JsonReader utf8JsonReaderSimpleQuadrilateral = utf8JsonReader; + simpleQuadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderSimpleQuadrilateral, jsonSerializerOptions); + } + } + } + } + + 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class Quadrilateral.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); + + if (complexQuadrilateral != null) + return new Quadrilateral(complexQuadrilateral); + + if (simpleQuadrilateral != null) + return new Quadrilateral(simpleQuadrilateral); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (quadrilateral.SimpleQuadrilateral != null) + { + SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + } + + if (quadrilateral.ComplexQuadrilateral != null) + { + ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, quadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 00000000000..519ed66393c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// QuadrilateralInterface + /// + public partial class QuadrilateralInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + [JsonConstructor] + public QuadrilateralInterface(string quadrilateralType) + { + QuadrilateralType = quadrilateralType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// 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 QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).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 QuadrilateralInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override QuadrilateralInterface 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 quadrilateralType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class QuadrilateralInterface.", nameof(quadrilateralType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class QuadrilateralInterface."); + + return new QuadrilateralInterface(quadrilateralType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("quadrilateralType", quadrilateralInterface.QuadrilateralType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..afb58fb0e41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -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 + * 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 +{ + /// + /// ReadOnlyFirst + /// + public partial class ReadOnlyFirst : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// bar + /// baz + [JsonConstructor] + public ReadOnlyFirst(Option bar = default, Option baz = default) + { + BarOption = bar; + BazOption = baz; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Bar + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BarOption { get; } + + /// + /// Gets or Sets Bar + /// + [JsonPropertyName("bar")] + public string Bar { get { return this.BarOption; } } + + /// + /// Used to track the state of Baz + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BazOption { get; private set; } + + /// + /// Gets or Sets Baz + /// + [JsonPropertyName("baz")] + public string Baz { get { return this.BazOption; } set { this.BazOption = 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 ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst 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 (Bar != null) + hashCode = (hashCode * 59) + Bar.GetHashCode(); + + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); + + return hashCode; + } + } + + /// + /// 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 ReadOnlyFirstJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ReadOnlyFirst 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 bar = default; + Option baz = 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 "bar": + bar = new Option(utf8JsonReader.GetString()); + break; + case "baz": + baz = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (bar.IsSet && bar.Value == null) + throw new ArgumentNullException(nameof(bar), "Property is not nullable for class ReadOnlyFirst."); + + if (baz.IsSet && baz.Value == null) + throw new ArgumentNullException(nameof(baz), "Property is not nullable for class ReadOnlyFirst."); + + return new ReadOnlyFirst(bar, baz); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (readOnlyFirst.BazOption.IsSet && readOnlyFirst.Baz == null) + throw new ArgumentNullException(nameof(readOnlyFirst.Baz), "Property is required for class ReadOnlyFirst."); + + if (readOnlyFirst.BarOption.IsSet) + writer.WriteString("bar", readOnlyFirst.Bar); + + if (readOnlyFirst.BazOption.IsSet) + writer.WriteString("baz", readOnlyFirst.Baz); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs new file mode 100644 index 00000000000..fdc63ca701d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -0,0 +1,2378 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RequiredClass + /// + public partial class RequiredClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// requiredNotNullableDateProp + /// requiredNotnullableArrayOfString + /// requiredNotnullableBooleanProp + /// requiredNotnullableDatetimeProp + /// requiredNotnullableEnumInteger + /// requiredNotnullableEnumIntegerOnly + /// requiredNotnullableEnumString + /// requiredNotnullableOuterEnumDefaultValue + /// requiredNotnullableStringProp + /// requiredNotnullableUuid + /// requiredNotnullableintegerProp + /// notRequiredNotnullableDateProp + /// notRequiredNotnullableintegerProp + /// notRequiredNullableDateProp + /// notRequiredNullableIntegerProp + /// notrequiredNotnullableArrayOfString + /// notrequiredNotnullableBooleanProp + /// notrequiredNotnullableDatetimeProp + /// notrequiredNotnullableEnumInteger + /// notrequiredNotnullableEnumIntegerOnly + /// notrequiredNotnullableEnumString + /// notrequiredNotnullableOuterEnumDefaultValue + /// notrequiredNotnullableStringProp + /// notrequiredNotnullableUuid + /// notrequiredNullableArrayOfString + /// notrequiredNullableBooleanProp + /// notrequiredNullableDatetimeProp + /// notrequiredNullableEnumInteger + /// notrequiredNullableEnumIntegerOnly + /// notrequiredNullableEnumString + /// 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, 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; + RequiredNotnullableBooleanProp = requiredNotnullableBooleanProp; + RequiredNotnullableDatetimeProp = requiredNotnullableDatetimeProp; + RequiredNotnullableEnumInteger = requiredNotnullableEnumInteger; + RequiredNotnullableEnumIntegerOnly = requiredNotnullableEnumIntegerOnly; + RequiredNotnullableEnumString = requiredNotnullableEnumString; + RequiredNotnullableOuterEnumDefaultValue = requiredNotnullableOuterEnumDefaultValue; + RequiredNotnullableStringProp = requiredNotnullableStringProp; + RequiredNotnullableUuid = requiredNotnullableUuid; + RequiredNotnullableintegerProp = requiredNotnullableintegerProp; + NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; + NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; + NotRequiredNullableDatePropOption = notRequiredNullableDateProp; + NotRequiredNullableIntegerPropOption = notRequiredNullableIntegerProp; + NotrequiredNotnullableArrayOfStringOption = notrequiredNotnullableArrayOfString; + NotrequiredNotnullableBooleanPropOption = notrequiredNotnullableBooleanProp; + NotrequiredNotnullableDatetimePropOption = notrequiredNotnullableDatetimeProp; + NotrequiredNotnullableEnumIntegerOption = notrequiredNotnullableEnumInteger; + NotrequiredNotnullableEnumIntegerOnlyOption = notrequiredNotnullableEnumIntegerOnly; + NotrequiredNotnullableEnumStringOption = notrequiredNotnullableEnumString; + NotrequiredNotnullableOuterEnumDefaultValueOption = notrequiredNotnullableOuterEnumDefaultValue; + NotrequiredNotnullableStringPropOption = notrequiredNotnullableStringProp; + NotrequiredNotnullableUuidOption = notrequiredNotnullableUuid; + NotrequiredNullableArrayOfStringOption = notrequiredNullableArrayOfString; + NotrequiredNullableBooleanPropOption = notrequiredNullableBooleanProp; + NotrequiredNullableDatetimePropOption = notrequiredNullableDatetimeProp; + NotrequiredNullableEnumIntegerOption = notrequiredNullableEnumInteger; + NotrequiredNullableEnumIntegerOnlyOption = notrequiredNullableEnumIntegerOnly; + NotrequiredNullableEnumStringOption = notrequiredNullableEnumString; + 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(); + } + + partial void OnCreated(); + + /// + /// Defines RequiredNotnullableEnumInteger + /// + public enum RequiredNotnullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNotnullableEnumIntegerEnum RequiredNotnullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumIntegerEnum? RequiredNotnullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNotnullableEnumIntegerEnumToJsonValue(RequiredNotnullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNotnullableEnumInteger + /// + [JsonPropertyName("required_notnullable_enum_integer")] + public RequiredNotnullableEnumIntegerEnum RequiredNotnullableEnumInteger { get; set; } + + /// + /// Defines RequiredNotnullableEnumIntegerOnly + /// + public enum RequiredNotnullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNotnullableEnumIntegerOnlyEnum RequiredNotnullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumIntegerOnlyEnum? RequiredNotnullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(RequiredNotnullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("required_notnullable_enum_integer_only")] + public RequiredNotnullableEnumIntegerOnlyEnum RequiredNotnullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNotnullableEnumString + /// + public enum RequiredNotnullableEnumStringEnum + { + /// + /// 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 RequiredNotnullableEnumStringEnum RequiredNotnullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNotnullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNotnullableEnumStringEnum? RequiredNotnullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNotnullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RequiredNotnullableEnumStringEnumToJsonValue(RequiredNotnullableEnumStringEnum value) + { + if (value == RequiredNotnullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNotnullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNotnullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNotnullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNotnullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNotnullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNotnullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNotnullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNotnullableEnumString + /// + [JsonPropertyName("required_notnullable_enum_string")] + public RequiredNotnullableEnumStringEnum RequiredNotnullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } + + /// + /// Defines NotrequiredNotnullableEnumInteger + /// + public enum NotrequiredNotnullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerEnum NotrequiredNotnullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerEnum? NotrequiredNotnullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNotnullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNotnullableEnumIntegerEnumToJsonValue(NotrequiredNotnullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumInteger + /// + [JsonPropertyName("notrequired_notnullable_enum_integer")] + public NotrequiredNotnullableEnumIntegerEnum? NotrequiredNotnullableEnumInteger { get { return this.NotrequiredNotnullableEnumIntegerOption; } set { this.NotrequiredNotnullableEnumIntegerOption = new Option(value); } } + + /// + /// Defines NotrequiredNotnullableEnumIntegerOnly + /// + public enum NotrequiredNotnullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerOnlyEnum NotrequiredNotnullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumIntegerOnlyEnum? NotrequiredNotnullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNotnullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(NotrequiredNotnullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_notnullable_enum_integer_only")] + public NotrequiredNotnullableEnumIntegerOnlyEnum? NotrequiredNotnullableEnumIntegerOnly { get { return this.NotrequiredNotnullableEnumIntegerOnlyOption; } set { this.NotrequiredNotnullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines NotrequiredNotnullableEnumString + /// + public enum NotrequiredNotnullableEnumStringEnum + { + /// + /// 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 NotrequiredNotnullableEnumStringEnum NotrequiredNotnullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNotnullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNotnullableEnumStringEnum? NotrequiredNotnullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNotnullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNotnullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNotnullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNotnullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNotnullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string NotrequiredNotnullableEnumStringEnumToJsonValue(NotrequiredNotnullableEnumStringEnum? value) + { + if (value == NotrequiredNotnullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == NotrequiredNotnullableEnumStringEnum.Lower) + return "lower"; + + if (value == NotrequiredNotnullableEnumStringEnum.Empty) + return ""; + + if (value == NotrequiredNotnullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == NotrequiredNotnullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == NotrequiredNotnullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == NotrequiredNotnullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == NotrequiredNotnullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of NotrequiredNotnullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableEnumString + /// + [JsonPropertyName("notrequired_notnullable_enum_string")] + public NotrequiredNotnullableEnumStringEnum? NotrequiredNotnullableEnumString { get { return this.NotrequiredNotnullableEnumStringOption; } set { this.NotrequiredNotnullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableOuterEnumDefaultValue + /// + [JsonPropertyName("notrequired_notnullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? NotrequiredNotnullableOuterEnumDefaultValue { get { return this.NotrequiredNotnullableOuterEnumDefaultValueOption; } set { this.NotrequiredNotnullableOuterEnumDefaultValueOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumInteger + /// + public enum NotrequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNullableEnumIntegerEnum NotrequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumIntegerEnum? NotrequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return NotrequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNullableEnumIntegerEnumToJsonValue(NotrequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNullableEnumInteger + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumInteger + /// + [JsonPropertyName("notrequired_nullable_enum_integer")] + public NotrequiredNullableEnumIntegerEnum? NotrequiredNullableEnumInteger { get { return this.NotrequiredNullableEnumIntegerOption; } set { this.NotrequiredNullableEnumIntegerOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumIntegerOnly + /// + public enum NotrequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static NotrequiredNullableEnumIntegerOnlyEnum NotrequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumIntegerOnlyEnum? NotrequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return NotrequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(NotrequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Used to track the state of NotrequiredNullableEnumIntegerOnly + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumIntegerOnlyOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("notrequired_nullable_enum_integer_only")] + public NotrequiredNullableEnumIntegerOnlyEnum? NotrequiredNullableEnumIntegerOnly { get { return this.NotrequiredNullableEnumIntegerOnlyOption; } set { this.NotrequiredNullableEnumIntegerOnlyOption = new Option(value); } } + + /// + /// Defines NotrequiredNullableEnumString + /// + public enum NotrequiredNullableEnumStringEnum + { + /// + /// 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 NotrequiredNullableEnumStringEnum NotrequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type NotrequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static NotrequiredNullableEnumStringEnum? NotrequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return NotrequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return NotrequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return NotrequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return NotrequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return NotrequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string NotrequiredNullableEnumStringEnumToJsonValue(NotrequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == NotrequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == NotrequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == NotrequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == NotrequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == NotrequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == NotrequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == NotrequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == NotrequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of NotrequiredNullableEnumString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableEnumStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableEnumString + /// + [JsonPropertyName("notrequired_nullable_enum_string")] + public NotrequiredNullableEnumStringEnum? NotrequiredNullableEnumString { get { return this.NotrequiredNullableEnumStringOption; } set { this.NotrequiredNullableEnumStringOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableOuterEnumDefaultValue + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableOuterEnumDefaultValueOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableOuterEnumDefaultValue + /// + [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 + /// + [JsonPropertyName("required_not_nullable_date_prop")] + public DateTime RequiredNotNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableArrayOfString + /// + [JsonPropertyName("required_notnullable_array_of_string")] + public List RequiredNotnullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNotnullableBooleanProp + /// + [JsonPropertyName("required_notnullable_boolean_prop")] + public bool RequiredNotnullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableDatetimeProp + /// + [JsonPropertyName("required_notnullable_datetime_prop")] + public DateTime RequiredNotnullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableStringProp + /// + [JsonPropertyName("required_notnullable_string_prop")] + public string RequiredNotnullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_notnullable_uuid")] + public Guid RequiredNotnullableUuid { get; set; } + + /// + /// Gets or Sets RequiredNotnullableintegerProp + /// + [JsonPropertyName("required_notnullableinteger_prop")] + public int RequiredNotnullableintegerProp { get; set; } + + /// + /// Used to track the state of NotRequiredNotnullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableDateProp + /// + [JsonPropertyName("not_required_notnullable_date_prop")] + public DateTime? NotRequiredNotnullableDateProp { get { return this.NotRequiredNotnullableDatePropOption; } set { this.NotRequiredNotnullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNotnullableintegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNotnullableintegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNotnullableintegerProp + /// + [JsonPropertyName("not_required_notnullableinteger_prop")] + public int? NotRequiredNotnullableintegerProp { get { return this.NotRequiredNotnullableintegerPropOption; } set { this.NotRequiredNotnullableintegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableDateProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableDatePropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableDateProp + /// + [JsonPropertyName("not_required_nullable_date_prop")] + public DateTime? NotRequiredNullableDateProp { get { return this.NotRequiredNullableDatePropOption; } set { this.NotRequiredNullableDatePropOption = new Option(value); } } + + /// + /// Used to track the state of NotRequiredNullableIntegerProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotRequiredNullableIntegerPropOption { get; private set; } + + /// + /// Gets or Sets NotRequiredNullableIntegerProp + /// + [JsonPropertyName("not_required_nullable_integer_prop")] + public int? NotRequiredNullableIntegerProp { get { return this.NotRequiredNullableIntegerPropOption; } set { this.NotRequiredNullableIntegerPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNotnullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableArrayOfString + /// + [JsonPropertyName("notrequired_notnullable_array_of_string")] + public List NotrequiredNotnullableArrayOfString { get { return this.NotrequiredNotnullableArrayOfStringOption; } set { this.NotrequiredNotnullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableBooleanProp + /// + [JsonPropertyName("notrequired_notnullable_boolean_prop")] + public bool? NotrequiredNotnullableBooleanProp { get { return this.NotrequiredNotnullableBooleanPropOption; } set { this.NotrequiredNotnullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableDatetimeProp + /// + [JsonPropertyName("notrequired_notnullable_datetime_prop")] + public DateTime? NotrequiredNotnullableDatetimeProp { get { return this.NotrequiredNotnullableDatetimePropOption; } set { this.NotrequiredNotnullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableStringProp + /// + [JsonPropertyName("notrequired_notnullable_string_prop")] + public string NotrequiredNotnullableStringProp { get { return this.NotrequiredNotnullableStringPropOption; } set { this.NotrequiredNotnullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNotnullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNotnullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNotnullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("notrequired_notnullable_uuid")] + public Guid? NotrequiredNotnullableUuid { get { return this.NotrequiredNotnullableUuidOption; } set { this.NotrequiredNotnullableUuidOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableArrayOfString + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> NotrequiredNullableArrayOfStringOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableArrayOfString + /// + [JsonPropertyName("notrequired_nullable_array_of_string")] + public List NotrequiredNullableArrayOfString { get { return this.NotrequiredNullableArrayOfStringOption; } set { this.NotrequiredNullableArrayOfStringOption = new Option>(value); } } + + /// + /// Used to track the state of NotrequiredNullableBooleanProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableBooleanPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableBooleanProp + /// + [JsonPropertyName("notrequired_nullable_boolean_prop")] + public bool? NotrequiredNullableBooleanProp { get { return this.NotrequiredNullableBooleanPropOption; } set { this.NotrequiredNullableBooleanPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableDatetimeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableDatetimePropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableDatetimeProp + /// + [JsonPropertyName("notrequired_nullable_datetime_prop")] + public DateTime? NotrequiredNullableDatetimeProp { get { return this.NotrequiredNullableDatetimePropOption; } set { this.NotrequiredNullableDatetimePropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableStringProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableStringPropOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableStringProp + /// + [JsonPropertyName("notrequired_nullable_string_prop")] + public string NotrequiredNullableStringProp { get { return this.NotrequiredNullableStringPropOption; } set { this.NotrequiredNullableStringPropOption = new Option(value); } } + + /// + /// Used to track the state of NotrequiredNullableUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NotrequiredNullableUuidOption { get; private set; } + + /// + /// Gets or Sets NotrequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [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 + /// + [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 RequiredClass {\n"); + sb.Append(" RequiredNotNullableDateProp: ").Append(RequiredNotNullableDateProp).Append("\n"); + sb.Append(" RequiredNotnullableArrayOfString: ").Append(RequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" RequiredNotnullableBooleanProp: ").Append(RequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" RequiredNotnullableDatetimeProp: ").Append(RequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNotnullableEnumInteger: ").Append(RequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" RequiredNotnullableEnumIntegerOnly: ").Append(RequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNotnullableEnumString: ").Append(RequiredNotnullableEnumString).Append("\n"); + sb.Append(" RequiredNotnullableOuterEnumDefaultValue: ").Append(RequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); + sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); + sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); + sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); + sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); + sb.Append(" NotRequiredNullableIntegerProp: ").Append(NotRequiredNullableIntegerProp).Append("\n"); + sb.Append(" NotrequiredNotnullableArrayOfString: ").Append(NotrequiredNotnullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNotnullableBooleanProp: ").Append(NotrequiredNotnullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNotnullableDatetimeProp: ").Append(NotrequiredNotnullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumInteger: ").Append(NotrequiredNotnullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumIntegerOnly: ").Append(NotrequiredNotnullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNotnullableEnumString: ").Append(NotrequiredNotnullableEnumString).Append("\n"); + sb.Append(" NotrequiredNotnullableOuterEnumDefaultValue: ").Append(NotrequiredNotnullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" NotrequiredNotnullableStringProp: ").Append(NotrequiredNotnullableStringProp).Append("\n"); + sb.Append(" NotrequiredNotnullableUuid: ").Append(NotrequiredNotnullableUuid).Append("\n"); + sb.Append(" NotrequiredNullableArrayOfString: ").Append(NotrequiredNullableArrayOfString).Append("\n"); + sb.Append(" NotrequiredNullableBooleanProp: ").Append(NotrequiredNullableBooleanProp).Append("\n"); + sb.Append(" NotrequiredNullableDatetimeProp: ").Append(NotrequiredNullableDatetimeProp).Append("\n"); + sb.Append(" NotrequiredNullableEnumInteger: ").Append(NotrequiredNullableEnumInteger).Append("\n"); + sb.Append(" NotrequiredNullableEnumIntegerOnly: ").Append(NotrequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" NotrequiredNullableEnumString: ").Append(NotrequiredNullableEnumString).Append("\n"); + 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(); + } + + /// + /// 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 RequiredClassJsonConverter : JsonConverter + { + /// + /// The format to use to serialize RequiredNotNullableDateProp + /// + public static string RequiredNotNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNotnullableDatetimeProp + /// + public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotRequiredNotnullableDateProp + /// + public static string NotRequiredNotnullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotRequiredNullableDateProp + /// + public static string NotRequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize NotrequiredNotnullableDatetimeProp + /// + public static string NotrequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize NotrequiredNullableDatetimeProp + /// + 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 + /// + /// + /// + /// + /// + /// + public override RequiredClass 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 requiredNotNullableDateProp = default; + Option> requiredNotnullableArrayOfString = default; + Option requiredNotnullableBooleanProp = default; + Option requiredNotnullableDatetimeProp = default; + Option requiredNotnullableEnumInteger = default; + Option requiredNotnullableEnumIntegerOnly = default; + Option requiredNotnullableEnumString = default; + Option requiredNotnullableOuterEnumDefaultValue = default; + Option requiredNotnullableStringProp = default; + Option requiredNotnullableUuid = default; + Option requiredNotnullableintegerProp = 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; + 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()) + { + 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 "required_not_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_notnullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_notnullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_notnullable_enum_string": + string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableEnumStringRawValue != null) + requiredNotnullableEnumString = new Option(RequiredClass.RequiredNotnullableEnumStringEnumFromStringOrDefault(requiredNotnullableEnumStringRawValue)); + break; + case "required_notnullable_outerEnumDefaultValue": + string requiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNotnullableOuterEnumDefaultValueRawValue != null) + requiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "required_notnullable_string_prop": + requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_notnullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_notnullableinteger_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "not_required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "not_required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_notnullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_notnullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_notnullable_enum_string": + string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableEnumStringRawValue != null) + notrequiredNotnullableEnumString = new Option(RequiredClass.NotrequiredNotnullableEnumStringEnumFromStringOrDefault(notrequiredNotnullableEnumStringRawValue)); + break; + case "notrequired_notnullable_outerEnumDefaultValue": + string notrequiredNotnullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNotnullableOuterEnumDefaultValueRawValue != null) + notrequiredNotnullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNotnullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_notnullable_string_prop": + notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_notnullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + break; + case "notrequired_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "notrequired_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "notrequired_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "notrequired_nullable_enum_string": + string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableEnumStringRawValue != null) + notrequiredNullableEnumString = new Option(RequiredClass.NotrequiredNullableEnumStringEnumFromStringOrDefault(notrequiredNullableEnumStringRawValue)); + break; + case "notrequired_nullable_outerEnumDefaultValue": + string notrequiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (notrequiredNullableOuterEnumDefaultValueRawValue != null) + notrequiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(notrequiredNullableOuterEnumDefaultValueRawValue)); + break; + case "notrequired_nullable_string_prop": + notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "notrequired_nullable_uuid": + 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; + } + } + } + + if (!requiredNotNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotNullableDateProp)); + + if (!requiredNotnullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableArrayOfString)); + + if (!requiredNotnullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableBooleanProp)); + + if (!requiredNotnullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableDatetimeProp)); + + if (!requiredNotnullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumInteger)); + + if (!requiredNotnullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumIntegerOnly)); + + if (!requiredNotnullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableEnumString)); + + if (!requiredNotnullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableOuterEnumDefaultValue)); + + if (!requiredNotnullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableStringProp)); + + if (!requiredNotnullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableUuid)); + + if (!requiredNotnullableintegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNotnullableintegerProp)); + + if (!requiredNullableArrayOfString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableArrayOfString)); + + if (!requiredNullableBooleanProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableBooleanProp)); + + if (!requiredNullableDateProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDateProp)); + + if (!requiredNullableDatetimeProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableDatetimeProp)); + + if (!requiredNullableEnumInteger.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumInteger)); + + if (!requiredNullableEnumIntegerOnly.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumIntegerOnly)); + + if (!requiredNullableEnumString.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableEnumString)); + + if (!requiredNullableIntegerProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableIntegerProp)); + + if (!requiredNullableOuterEnumDefaultValue.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableOuterEnumDefaultValue)); + + if (!requiredNullableStringProp.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableStringProp)); + + if (!requiredNullableUuid.IsSet) + throw new ArgumentException("Property is required for class RequiredClass.", nameof(requiredNullableUuid)); + + if (requiredNotNullableDateProp.IsSet && requiredNotNullableDateProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotNullableDateProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableArrayOfString.IsSet && requiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableBooleanProp.IsSet && requiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableDatetimeProp.IsSet && requiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumInteger.IsSet && requiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumIntegerOnly.IsSet && requiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableEnumString.IsSet && requiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableOuterEnumDefaultValue.IsSet && requiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableStringProp.IsSet && requiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableUuid.IsSet && requiredNotnullableUuid.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableUuid), "Property is not nullable for class RequiredClass."); + + if (requiredNotnullableintegerProp.IsSet && requiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(requiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableDateProp.IsSet && notRequiredNotnullableDateProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableDateProp), "Property is not nullable for class RequiredClass."); + + if (notRequiredNotnullableintegerProp.IsSet && notRequiredNotnullableintegerProp.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotnullableintegerProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableArrayOfString.IsSet && notrequiredNotnullableArrayOfString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableArrayOfString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableBooleanProp.IsSet && notrequiredNotnullableBooleanProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableBooleanProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableDatetimeProp.IsSet && notrequiredNotnullableDatetimeProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableDatetimeProp), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumInteger.IsSet && notrequiredNotnullableEnumInteger.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumInteger), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumIntegerOnly.IsSet && notrequiredNotnullableEnumIntegerOnly.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumIntegerOnly), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableEnumString.IsSet && notrequiredNotnullableEnumString.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableEnumString), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableOuterEnumDefaultValue.IsSet && notrequiredNotnullableOuterEnumDefaultValue.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableOuterEnumDefaultValue), "Property is not nullable for class RequiredClass."); + + if (notrequiredNotnullableStringProp.IsSet && notrequiredNotnullableStringProp.Value == null) + throw new ArgumentNullException(nameof(notrequiredNotnullableStringProp), "Property is not nullable for class RequiredClass."); + + 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, 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); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, requiredClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (requiredClass.RequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet && requiredClass.NotrequiredNotnullableArrayOfString == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); + + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet && requiredClass.NotrequiredNotnullableStringProp == null) + throw new ArgumentNullException(nameof(requiredClass.NotrequiredNotnullableStringProp), "Property is required for class RequiredClass."); + + writer.WriteString("required_not_nullable_date_prop", requiredClass.RequiredNotNullableDateProp.ToString(RequiredNotNullableDatePropFormat)); + + writer.WritePropertyName("required_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNotnullableArrayOfString, jsonSerializerOptions); + writer.WriteBoolean("required_notnullable_boolean_prop", requiredClass.RequiredNotnullableBooleanProp); + + writer.WriteString("required_notnullable_datetime_prop", requiredClass.RequiredNotnullableDatetimeProp.ToString(RequiredNotnullableDatetimePropFormat)); + + writer.WriteNumber("required_notnullable_enum_integer", RequiredClass.RequiredNotnullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNotnullableEnumInteger)); + + writer.WriteNumber("required_notnullable_enum_integer_only", RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNotnullableEnumIntegerOnly)); + + var requiredNotnullableEnumStringRawValue = RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClass.RequiredNotnullableEnumString); + writer.WriteString("required_notnullable_enum_string", requiredNotnullableEnumStringRawValue); + var requiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNotnullableOuterEnumDefaultValue); + writer.WriteString("required_notnullable_outerEnumDefaultValue", requiredNotnullableOuterEnumDefaultValueRawValue); + + writer.WriteString("required_notnullable_string_prop", requiredClass.RequiredNotnullableStringProp); + + writer.WriteString("required_notnullable_uuid", requiredClass.RequiredNotnullableUuid); + + writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); + + if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) + writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); + + if (requiredClass.NotRequiredNotnullableintegerPropOption.IsSet) + writer.WriteNumber("not_required_notnullableinteger_prop", requiredClass.NotRequiredNotnullableintegerPropOption.Value.Value); + + if (requiredClass.NotRequiredNullableDatePropOption.IsSet) + if (requiredClass.NotRequiredNullableDatePropOption.Value != null) + writer.WriteString("not_required_nullable_date_prop", requiredClass.NotRequiredNullableDatePropOption.Value.Value.ToString(NotRequiredNullableDatePropFormat)); + else + writer.WriteNull("not_required_nullable_date_prop"); + + if (requiredClass.NotRequiredNullableIntegerPropOption.IsSet) + if (requiredClass.NotRequiredNullableIntegerPropOption.Value != null) + writer.WriteNumber("not_required_nullable_integer_prop", requiredClass.NotRequiredNullableIntegerPropOption.Value.Value); + else + writer.WriteNull("not_required_nullable_integer_prop"); + + if (requiredClass.NotrequiredNotnullableArrayOfStringOption.IsSet) + { + writer.WritePropertyName("notrequired_notnullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNotnullableArrayOfString, jsonSerializerOptions); + } + if (requiredClass.NotrequiredNotnullableBooleanPropOption.IsSet) + writer.WriteBoolean("notrequired_notnullable_boolean_prop", requiredClass.NotrequiredNotnullableBooleanPropOption.Value.Value); + + if (requiredClass.NotrequiredNotnullableDatetimePropOption.IsSet) + writer.WriteString("notrequired_notnullable_datetime_prop", requiredClass.NotrequiredNotnullableDatetimePropOption.Value.Value.ToString(NotrequiredNotnullableDatetimePropFormat)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOption.IsSet) + writer.WriteNumber("notrequired_notnullable_enum_integer", RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOption.Value.Value)); + + if (requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.IsSet) + writer.WriteNumber("notrequired_notnullable_enum_integer_only", RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumIntegerOnlyOption.Value.Value)); + + var notrequiredNotnullableEnumStringRawValue = RequiredClass.NotrequiredNotnullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNotnullableEnumStringOption.Value.Value); + writer.WriteString("notrequired_notnullable_enum_string", notrequiredNotnullableEnumStringRawValue); + if (requiredClass.NotrequiredNotnullableOuterEnumDefaultValueOption.IsSet) + { + var notrequiredNotnullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNotnullableOuterEnumDefaultValue.Value); + writer.WriteString("notrequired_notnullable_outerEnumDefaultValue", notrequiredNotnullableOuterEnumDefaultValueRawValue); + } + if (requiredClass.NotrequiredNotnullableStringPropOption.IsSet) + writer.WriteString("notrequired_notnullable_string_prop", requiredClass.NotrequiredNotnullableStringProp); + + if (requiredClass.NotrequiredNotnullableUuidOption.IsSet) + writer.WriteString("notrequired_notnullable_uuid", requiredClass.NotrequiredNotnullableUuidOption.Value.Value); + + if (requiredClass.NotrequiredNullableArrayOfStringOption.IsSet) + if (requiredClass.NotrequiredNullableArrayOfStringOption.Value != null) + { + writer.WritePropertyName("notrequired_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.NotrequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("notrequired_nullable_array_of_string"); + if (requiredClass.NotrequiredNullableBooleanPropOption.IsSet) + if (requiredClass.NotrequiredNullableBooleanPropOption.Value != null) + writer.WriteBoolean("notrequired_nullable_boolean_prop", requiredClass.NotrequiredNullableBooleanPropOption.Value.Value); + else + writer.WriteNull("notrequired_nullable_boolean_prop"); + + if (requiredClass.NotrequiredNullableDatetimePropOption.IsSet) + if (requiredClass.NotrequiredNullableDatetimePropOption.Value != null) + writer.WriteString("notrequired_nullable_datetime_prop", requiredClass.NotrequiredNullableDatetimePropOption.Value.Value.ToString(NotrequiredNullableDatetimePropFormat)); + else + writer.WriteNull("notrequired_nullable_datetime_prop"); + + if (requiredClass.NotrequiredNullableEnumIntegerOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOption.Value != null) + writer.WriteNumber("notrequired_nullable_enum_integer", RequiredClass.NotrequiredNullableEnumIntegerEnumToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOption.Value.Value)); + else + writer.WriteNull("notrequired_nullable_enum_integer"); + + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.IsSet) + if (requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value != null) + writer.WriteNumber("notrequired_nullable_enum_integer_only", RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.NotrequiredNullableEnumIntegerOnlyOption.Value.Value)); + else + writer.WriteNull("notrequired_nullable_enum_integer_only"); + + var notrequiredNullableEnumStringRawValue = RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClass.NotrequiredNullableEnumStringOption.Value.Value); + if (notrequiredNullableEnumStringRawValue != null) + writer.WriteString("notrequired_nullable_enum_string", notrequiredNullableEnumStringRawValue); + else + writer.WriteNull("notrequired_nullable_enum_string"); + + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.IsSet) + if (requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value != null) + { + var notrequiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.NotrequiredNullableOuterEnumDefaultValueOption.Value.Value); + writer.WriteString("notrequired_nullable_outerEnumDefaultValue", notrequiredNullableOuterEnumDefaultValueRawValue); + } + else + writer.WriteNull("notrequired_nullable_outerEnumDefaultValue"); + if (requiredClass.NotrequiredNullableStringPropOption.IsSet) + if (requiredClass.NotrequiredNullableStringPropOption.Value != null) + writer.WriteString("notrequired_nullable_string_prop", requiredClass.NotrequiredNullableStringProp); + else + writer.WriteNull("notrequired_nullable_string_prop"); + + if (requiredClass.NotrequiredNullableUuidOption.IsSet) + if (requiredClass.NotrequiredNullableUuidOption.Value != null) + 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/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 00000000000..25b3b73e9c0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,246 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Model for testing reserved words + /// + public partial class Return : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// lock + /// abstract + /// varReturn + /// unsafe + [JsonConstructor] + public Return(string @lock, string @abstract = default, Option varReturn = default, Option @unsafe = default) + { + Lock = @lock; + Abstract = @abstract; + VarReturnOption = varReturn; + UnsafeOption = @unsafe; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Lock + /// + [JsonPropertyName("lock")] + public string Lock { get; set; } + + /// + /// Gets or Sets Abstract + /// + [JsonPropertyName("abstract")] + public string Abstract { get; set; } + + /// + /// Used to track the state of VarReturn + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarReturnOption { get; private set; } + + /// + /// Gets or Sets VarReturn + /// + [JsonPropertyName("return")] + public int? VarReturn { get { return this.VarReturnOption; } set { this.VarReturnOption = new Option(value); } } + + /// + /// Used to track the state of Unsafe + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UnsafeOption { get; private set; } + + /// + /// Gets or Sets Unsafe + /// + [JsonPropertyName("unsafe")] + public string Unsafe { get { return this.UnsafeOption; } set { this.UnsafeOption = 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 Return {\n"); + sb.Append(" Lock: ").Append(Lock).Append("\n"); + sb.Append(" Abstract: ").Append(Abstract).Append("\n"); + sb.Append(" VarReturn: ").Append(VarReturn).Append("\n"); + sb.Append(" Unsafe: ").Append(Unsafe).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 ReturnJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Return 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 varLock = default; + Option varAbstract = default; + Option varReturn = default; + Option varUnsafe = 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 "lock": + varLock = new Option(utf8JsonReader.GetString()); + break; + case "abstract": + varAbstract = new Option(utf8JsonReader.GetString()); + break; + case "return": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + varReturn = new Option(utf8JsonReader.GetInt32()); + break; + case "unsafe": + varUnsafe = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!varLock.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varLock)); + + if (!varAbstract.IsSet) + throw new ArgumentException("Property is required for class Return.", nameof(varAbstract)); + + if (varLock.IsSet && varLock.Value == null) + throw new ArgumentNullException(nameof(varLock), "Property is not nullable for class Return."); + + if (varReturn.IsSet && varReturn.Value == null) + throw new ArgumentNullException(nameof(varReturn), "Property is not nullable for class Return."); + + if (varUnsafe.IsSet && varUnsafe.Value == null) + throw new ArgumentNullException(nameof(varUnsafe), "Property is not nullable for class Return."); + + return new Return(varLock.Value, varAbstract.Value, varReturn, varUnsafe); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, varReturn, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (varReturn.UnsafeOption.IsSet && varReturn.Unsafe == null) + throw new ArgumentNullException(nameof(varReturn.Unsafe), "Property is required for class Return."); + + writer.WriteString("lock", varReturn.Lock); + + if (varReturn.Abstract != null) + writer.WriteString("abstract", varReturn.Abstract); + else + writer.WriteNull("abstract"); + + if (varReturn.VarReturnOption.IsSet) + writer.WriteNumber("return", varReturn.VarReturnOption.Value.Value); + + if (varReturn.UnsafeOption.IsSet) + writer.WriteString("unsafe", varReturn.Unsafe); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..1adc0bbf76b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,204 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(Option role = default, Option roleUuid = default) + { + RoleOption = role; + RoleUuidOption = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Role + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleOption { get; private set; } + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get { return this.RoleOption; } set { this.RoleOption = new Option(value); } } + + /// + /// Used to track the state of RoleUuid + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option RoleUuidOption { get; private set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid? RoleUuid { get { return this.RoleUuidOption; } set { this.RoleUuidOption = 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 RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).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 RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash 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 role = default; + Option roleUuid = 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 "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = new Option(utf8JsonReader.GetGuid()); + break; + default: + break; + } + } + } + + if (role.IsSet && role.Value == null) + throw new ArgumentNullException(nameof(role), "Property is not nullable for class RolesReportsHash."); + + if (roleUuid.IsSet && roleUuid.Value == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is not nullable for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHash.RoleOption.IsSet) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + } + if (rolesReportsHash.RoleUuidOption.IsSet) + writer.WriteString("role_uuid", rolesReportsHash.RoleUuidOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..866b9fa4871 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(Option name = default) + { + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).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 RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole 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 name = 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 "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (rolesReportsHashRole.NameOption.IsSet) + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 00000000000..5c960eb5474 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -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 + * 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 +{ + /// + /// ScaleneTriangle + /// + public partial class ScaleneTriangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + /// triangleType + [JsonConstructor] + public ScaleneTriangle(string shapeType, string triangleType) + { + ShapeType = shapeType; + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 ScaleneTriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ScaleneTriangle 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 shapeType = default; + Option triangleType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + case "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(shapeType)); + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class ScaleneTriangle.", nameof(triangleType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ScaleneTriangle."); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class ScaleneTriangle."); + + return new ScaleneTriangle(shapeType.Value, triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (scaleneTriangle.TriangleType == null) + throw new ArgumentNullException(nameof(scaleneTriangle.TriangleType), "Property is required for class ScaleneTriangle."); + + writer.WriteString("shapeType", scaleneTriangle.ShapeType); + + writer.WriteString("triangleType", scaleneTriangle.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 00000000000..c651ac7d245 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Shape + /// + public partial class Shape : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Shape(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 Shape {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Shape 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class Shape.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); + + if (quadrilateral != null) + return new Shape(quadrilateral); + + if (triangle != null) + return new Shape(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shape.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); + } + + if (shape.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shape, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 00000000000..37db5df6490 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ShapeInterface + /// + public partial class ShapeInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// shapeType + [JsonConstructor] + public ShapeInterface(string shapeType) + { + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 ShapeInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeInterface 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 shapeType = 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeInterface.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeInterface."); + + return new ShapeInterface(shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, shapeInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("shapeType", shapeInterface.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 00000000000..1f0b2203007 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + public partial class ShapeOrNull : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Triangle triangle) + { + Triangle = triangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public ShapeOrNull(Quadrilateral quadrilateral) + { + Quadrilateral = quadrilateral; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Triangle + /// + public Triangle Triangle { get; set; } + + /// + /// Gets or Sets Quadrilateral + /// + public Quadrilateral Quadrilateral { get; set; } + + /// + /// 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 ShapeOrNull {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ShapeOrNull 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 shapeType = default; + + Quadrilateral quadrilateral = null; + Triangle triangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("shapeType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("Quadrilateral")) + { + Utf8JsonReader utf8JsonReaderQuadrilateral = utf8JsonReader; + quadrilateral = JsonSerializer.Deserialize(ref utf8JsonReaderQuadrilateral, jsonSerializerOptions); + } + if (discriminator.Equals("Triangle")) + { + Utf8JsonReader utf8JsonReaderTriangle = utf8JsonReader; + triangle = JsonSerializer.Deserialize(ref utf8JsonReaderTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class ShapeOrNull.", nameof(shapeType)); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); + + if (quadrilateral != null) + return new ShapeOrNull(quadrilateral); + + if (triangle != null) + return new ShapeOrNull(triangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (shapeOrNull.Triangle != null) + { + TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); + } + + if (shapeOrNull.Quadrilateral != null) + { + QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + } + + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 00000000000..ffa68d1e75d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -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 + * 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 +{ + /// + /// SimpleQuadrilateral + /// + public partial class SimpleQuadrilateral : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType + /// shapeType + [JsonConstructor] + public SimpleQuadrilateral(string quadrilateralType, string shapeType) + { + QuadrilateralType = quadrilateralType; + ShapeType = shapeType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets QuadrilateralType + /// + [JsonPropertyName("quadrilateralType")] + public string QuadrilateralType { get; set; } + + /// + /// Gets or Sets ShapeType + /// + [JsonPropertyName("shapeType")] + public string ShapeType { get; set; } + + /// + /// 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 SimpleQuadrilateral {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append(" ShapeType: ").Append(ShapeType).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 SimpleQuadrilateralJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SimpleQuadrilateral 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 quadrilateralType = default; + Option shapeType = 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 "quadrilateralType": + quadrilateralType = new Option(utf8JsonReader.GetString()); + break; + case "shapeType": + shapeType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!quadrilateralType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(quadrilateralType)); + + if (!shapeType.IsSet) + throw new ArgumentException("Property is required for class SimpleQuadrilateral.", nameof(shapeType)); + + if (quadrilateralType.IsSet && quadrilateralType.Value == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class SimpleQuadrilateral."); + + if (shapeType.IsSet && shapeType.Value == null) + throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class SimpleQuadrilateral."); + + return new SimpleQuadrilateral(quadrilateralType.Value, shapeType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (simpleQuadrilateral.ShapeType == null) + throw new ArgumentNullException(nameof(simpleQuadrilateral.ShapeType), "Property is required for class SimpleQuadrilateral."); + + writer.WriteString("quadrilateralType", simpleQuadrilateral.QuadrilateralType); + + writer.WriteString("shapeType", simpleQuadrilateral.ShapeType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 00000000000..8f3593c5f41 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// SpecialModelName + /// + public partial class SpecialModelName : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// varSpecialModelName + /// specialPropertyName + [JsonConstructor] + public SpecialModelName(Option varSpecialModelName = default, Option specialPropertyName = default) + { + VarSpecialModelNameOption = varSpecialModelName; + SpecialPropertyNameOption = specialPropertyName; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of VarSpecialModelName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option VarSpecialModelNameOption { get; private set; } + + /// + /// Gets or Sets VarSpecialModelName + /// + [JsonPropertyName("_special_model.name_")] + public string VarSpecialModelName { get { return this.VarSpecialModelNameOption; } set { this.VarSpecialModelNameOption = new Option(value); } } + + /// + /// Used to track the state of SpecialPropertyName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SpecialPropertyNameOption { get; private set; } + + /// + /// Gets or Sets SpecialPropertyName + /// + [JsonPropertyName("$special[property.name]")] + public long? SpecialPropertyName { get { return this.SpecialPropertyNameOption; } set { this.SpecialPropertyNameOption = 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 SpecialModelName {\n"); + sb.Append(" VarSpecialModelName: ").Append(VarSpecialModelName).Append("\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).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 SpecialModelNameJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override SpecialModelName 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 varSpecialModelName = default; + Option specialPropertyName = 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 "_special_model.name_": + varSpecialModelName = new Option(utf8JsonReader.GetString()); + break; + case "$special[property.name]": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = new Option(utf8JsonReader.GetInt64()); + break; + default: + break; + } + } + } + + if (varSpecialModelName.IsSet && varSpecialModelName.Value == null) + throw new ArgumentNullException(nameof(varSpecialModelName), "Property is not nullable for class SpecialModelName."); + + if (specialPropertyName.IsSet && specialPropertyName.Value == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is not nullable for class SpecialModelName."); + + return new SpecialModelName(varSpecialModelName, specialPropertyName); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, specialModelName, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (specialModelName.VarSpecialModelNameOption.IsSet) + writer.WriteString("_special_model.name_", specialModelName.VarSpecialModelName); + + if (specialModelName.SpecialPropertyNameOption.IsSet) + writer.WriteNumber("$special[property.name]", specialModelName.SpecialPropertyNameOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 00000000000..e1678abe491 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Tag + /// + public partial class Tag : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + /// name + [JsonConstructor] + public Tag(Option id = default, Option name = default) + { + IdOption = id; + NameOption = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of Name + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NameOption { get; private set; } + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get { return this.NameOption; } set { this.NameOption = 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 Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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 TagJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Tag 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 id = default; + Option name = 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 "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "name": + name = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class Tag."); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name), "Property is not nullable for class Tag."); + + return new Tag(id, name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, tag, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (tag.IdOption.IsSet) + writer.WriteNumber("id", tag.IdOption.Value.Value); + + if (tag.NameOption.IsSet) + writer.WriteString("name", tag.Name); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..f4fca096217 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(Option value = default) + { + ValueOption = value; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Value + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ValueOption { get; private set; } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get { return this.ValueOption; } set { this.ValueOption = 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 TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).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 TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList 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 value = 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 "value": + value = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (value.IsSet && value.Value == null) + throw new ArgumentNullException(nameof(value), "Property is not nullable for class TestCollectionEndingWithWordList."); + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordList.ValueOption.IsSet) + writer.WriteString("value", testCollectionEndingWithWordList.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..6c324e6ef4f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -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 + * 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 +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(Option> testCollectionEndingWithWordList = default) + { + TestCollectionEndingWithWordListOption = testCollectionEndingWithWordList; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of TestCollectionEndingWithWordList + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option> TestCollectionEndingWithWordListOption { get; private set; } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get { return this.TestCollectionEndingWithWordListOption; } set { this.TestCollectionEndingWithWordListOption = 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 TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).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 TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject 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> testCollectionEndingWithWordList = 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 "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (testCollectionEndingWithWordList.IsSet && testCollectionEndingWithWordList.Value == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is not nullable for class TestCollectionEndingWithWordListObject."); + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet) + { + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs new file mode 100644 index 00000000000..3bf95d67c57 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TestInlineFreeformAdditionalPropertiesRequest + /// + public partial class TestInlineFreeformAdditionalPropertiesRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// someProperty + [JsonConstructor] + public TestInlineFreeformAdditionalPropertiesRequest(Option someProperty = default) + { + SomePropertyOption = someProperty; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of SomeProperty + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomePropertyOption { get; private set; } + + /// + /// Gets or Sets SomeProperty + /// + [JsonPropertyName("someProperty")] + public string SomeProperty { get { return this.SomePropertyOption; } set { this.SomePropertyOption = 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 TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.Append(" SomeProperty: ").Append(SomeProperty).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 TestInlineFreeformAdditionalPropertiesRequestJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TestInlineFreeformAdditionalPropertiesRequest 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 someProperty = 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 "someProperty": + someProperty = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (someProperty.IsSet && someProperty.Value == null) + throw new ArgumentNullException(nameof(someProperty), "Property is not nullable for class TestInlineFreeformAdditionalPropertiesRequest."); + + return new TestInlineFreeformAdditionalPropertiesRequest(someProperty); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet) + writer.WriteString("someProperty", testInlineFreeformAdditionalPropertiesRequest.SomeProperty); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 00000000000..cf22051519a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,269 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Triangle + /// + public partial class Triangle : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(EquilateralTriangle equilateralTriangle) + { + EquilateralTriangle = equilateralTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(IsoscelesTriangle isoscelesTriangle) + { + IsoscelesTriangle = isoscelesTriangle; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public Triangle(ScaleneTriangle scaleneTriangle) + { + ScaleneTriangle = scaleneTriangle; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets EquilateralTriangle + /// + public EquilateralTriangle EquilateralTriangle { get; set; } + + /// + /// Gets or Sets IsoscelesTriangle + /// + public IsoscelesTriangle IsoscelesTriangle { get; set; } + + /// + /// Gets or Sets ScaleneTriangle + /// + public ScaleneTriangle ScaleneTriangle { get; set; } + + /// + /// 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 Triangle {\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) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Triangle 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 triangleType = default; + + EquilateralTriangle equilateralTriangle = null; + IsoscelesTriangle isoscelesTriangle = null; + ScaleneTriangle scaleneTriangle = null; + + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName.Equals("triangleType")) + { + string discriminator = utf8JsonReaderDiscriminator.GetString(); + if (discriminator.Equals("EquilateralTriangle")) + { + Utf8JsonReader utf8JsonReaderEquilateralTriangle = utf8JsonReader; + equilateralTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderEquilateralTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("IsoscelesTriangle")) + { + Utf8JsonReader utf8JsonReaderIsoscelesTriangle = utf8JsonReader; + isoscelesTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderIsoscelesTriangle, jsonSerializerOptions); + } + if (discriminator.Equals("ScaleneTriangle")) + { + Utf8JsonReader utf8JsonReaderScaleneTriangle = utf8JsonReader; + scaleneTriangle = JsonSerializer.Deserialize(ref utf8JsonReaderScaleneTriangle, jsonSerializerOptions); + } + } + } + } + + 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class Triangle.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); + + if (equilateralTriangle != null) + return new Triangle(equilateralTriangle); + + if (isoscelesTriangle != null) + return new Triangle(isoscelesTriangle); + + if (scaleneTriangle != null) + return new Triangle(scaleneTriangle); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (triangle.EquilateralTriangle != null) + { + EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); + } + + if (triangle.IsoscelesTriangle != null) + { + IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + } + + if (triangle.ScaleneTriangle != null) + { + ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); + } + + WriteProperties(writer, triangle, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 00000000000..0f13b0e7745 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,169 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// TriangleInterface + /// + public partial class TriangleInterface : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// triangleType + [JsonConstructor] + public TriangleInterface(string triangleType) + { + TriangleType = triangleType; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets TriangleType + /// + [JsonPropertyName("triangleType")] + public string TriangleType { get; set; } + + /// + /// 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 TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).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 TriangleInterfaceJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override TriangleInterface 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 triangleType = 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 "triangleType": + triangleType = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (!triangleType.IsSet) + throw new ArgumentException("Property is required for class TriangleInterface.", nameof(triangleType)); + + if (triangleType.IsSet && triangleType.Value == null) + throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class TriangleInterface."); + + return new TriangleInterface(triangleType.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, triangleInterface, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("triangleType", triangleInterface.TriangleType); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 00000000000..21eff6d47a0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,497 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// User + /// + public partial class User : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// email + /// firstName + /// id + /// lastName + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// password + /// phone + /// User Status + /// username + [JsonConstructor] + public User(Option anyTypeProp = default, Option anyTypePropNullable = default, Option email = default, Option firstName = default, Option id = default, Option lastName = default, Option objectWithNoDeclaredProps = default, Option objectWithNoDeclaredPropsNullable = default, Option password = default, Option phone = default, Option userStatus = default, Option username = default) + { + AnyTypePropOption = anyTypeProp; + AnyTypePropNullableOption = anyTypePropNullable; + EmailOption = email; + FirstNameOption = firstName; + IdOption = id; + LastNameOption = lastName; + ObjectWithNoDeclaredPropsOption = objectWithNoDeclaredProps; + ObjectWithNoDeclaredPropsNullableOption = objectWithNoDeclaredPropsNullable; + PasswordOption = password; + PhoneOption = phone; + UserStatusOption = userStatus; + UsernameOption = username; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of AnyTypeProp + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [JsonPropertyName("anyTypeProp")] + public Object AnyTypeProp { get { return this.AnyTypePropOption; } set { this.AnyTypePropOption = new Option(value); } } + + /// + /// Used to track the state of AnyTypePropNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option AnyTypePropNullableOption { get; private set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [JsonPropertyName("anyTypePropNullable")] + public Object AnyTypePropNullable { get { return this.AnyTypePropNullableOption; } set { this.AnyTypePropNullableOption = new Option(value); } } + + /// + /// Used to track the state of Email + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option EmailOption { get; private set; } + + /// + /// Gets or Sets Email + /// + [JsonPropertyName("email")] + public string Email { get { return this.EmailOption; } set { this.EmailOption = new Option(value); } } + + /// + /// Used to track the state of FirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option FirstNameOption { get; private set; } + + /// + /// Gets or Sets FirstName + /// + [JsonPropertyName("firstName")] + public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } } + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public long? Id { get { return this.IdOption; } set { this.IdOption = new Option(value); } } + + /// + /// Used to track the state of LastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option LastNameOption { get; private set; } + + /// + /// Gets or Sets LastName + /// + [JsonPropertyName("lastName")] + public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredProps + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsOption { get; private set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [JsonPropertyName("objectWithNoDeclaredProps")] + public Object ObjectWithNoDeclaredProps { get { return this.ObjectWithNoDeclaredPropsOption; } set { this.ObjectWithNoDeclaredPropsOption = new Option(value); } } + + /// + /// Used to track the state of ObjectWithNoDeclaredPropsNullable + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ObjectWithNoDeclaredPropsNullableOption { get; private set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [JsonPropertyName("objectWithNoDeclaredPropsNullable")] + public Object ObjectWithNoDeclaredPropsNullable { get { return this.ObjectWithNoDeclaredPropsNullableOption; } set { this.ObjectWithNoDeclaredPropsNullableOption = new Option(value); } } + + /// + /// Used to track the state of Password + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PasswordOption { get; private set; } + + /// + /// Gets or Sets Password + /// + [JsonPropertyName("password")] + public string Password { get { return this.PasswordOption; } set { this.PasswordOption = new Option(value); } } + + /// + /// Used to track the state of Phone + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PhoneOption { get; private set; } + + /// + /// Gets or Sets Phone + /// + [JsonPropertyName("phone")] + public string Phone { get { return this.PhoneOption; } set { this.PhoneOption = new Option(value); } } + + /// + /// Used to track the state of UserStatus + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UserStatusOption { get; private set; } + + /// + /// User Status + /// + /// User Status + [JsonPropertyName("userStatus")] + public int? UserStatus { get { return this.UserStatusOption; } set { this.UserStatusOption = new Option(value); } } + + /// + /// Used to track the state of Username + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option UsernameOption { get; private set; } + + /// + /// Gets or Sets Username + /// + [JsonPropertyName("username")] + public string Username { get { return this.UsernameOption; } set { this.UsernameOption = 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 User {\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" Username: ").Append(Username).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 UserJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override User 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 anyTypeProp = default; + Option anyTypePropNullable = default; + Option email = default; + Option firstName = default; + Option id = default; + Option lastName = default; + Option objectWithNoDeclaredProps = default; + Option objectWithNoDeclaredPropsNullable = default; + Option password = default; + Option phone = default; + Option userStatus = default; + Option username = 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 "anyTypeProp": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "anyTypePropNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "email": + email = new Option(utf8JsonReader.GetString()); + break; + case "firstName": + firstName = new Option(utf8JsonReader.GetString()); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetInt64()); + break; + case "lastName": + lastName = new Option(utf8JsonReader.GetString()); + break; + case "objectWithNoDeclaredProps": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "objectWithNoDeclaredPropsNullable": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "password": + password = new Option(utf8JsonReader.GetString()); + break; + case "phone": + phone = new Option(utf8JsonReader.GetString()); + break; + case "userStatus": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = new Option(utf8JsonReader.GetInt32()); + break; + case "username": + username = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (email.IsSet && email.Value == null) + throw new ArgumentNullException(nameof(email), "Property is not nullable for class User."); + + if (firstName.IsSet && firstName.Value == null) + throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class User."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class User."); + + if (lastName.IsSet && lastName.Value == null) + throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class User."); + + if (objectWithNoDeclaredProps.IsSet && objectWithNoDeclaredProps.Value == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is not nullable for class User."); + + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password), "Property is not nullable for class User."); + + if (phone.IsSet && phone.Value == null) + throw new ArgumentNullException(nameof(phone), "Property is not nullable for class User."); + + if (userStatus.IsSet && userStatus.Value == null) + throw new ArgumentNullException(nameof(userStatus), "Property is not nullable for class User."); + + if (username.IsSet && username.Value == null) + throw new ArgumentNullException(nameof(username), "Property is not nullable for class User."); + + return new User(anyTypeProp, anyTypePropNullable, email, firstName, id, lastName, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, password, phone, userStatus, username); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, user, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + if (user.FirstNameOption.IsSet && user.FirstName == null) + throw new ArgumentNullException(nameof(user.FirstName), "Property is required for class User."); + + if (user.LastNameOption.IsSet && user.LastName == null) + throw new ArgumentNullException(nameof(user.LastName), "Property is required for class User."); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet && user.ObjectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(user.ObjectWithNoDeclaredProps), "Property is required for class User."); + + if (user.PasswordOption.IsSet && user.Password == null) + throw new ArgumentNullException(nameof(user.Password), "Property is required for class User."); + + if (user.PhoneOption.IsSet && user.Phone == null) + throw new ArgumentNullException(nameof(user.Phone), "Property is required for class User."); + + if (user.UsernameOption.IsSet && user.Username == null) + throw new ArgumentNullException(nameof(user.Username), "Property is required for class User."); + + if (user.AnyTypePropOption.IsSet) + if (user.AnyTypePropOption.Value != null) + { + writer.WritePropertyName("anyTypeProp"); + JsonSerializer.Serialize(writer, user.AnyTypeProp, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypeProp"); + if (user.AnyTypePropNullableOption.IsSet) + if (user.AnyTypePropNullableOption.Value != null) + { + writer.WritePropertyName("anyTypePropNullable"); + JsonSerializer.Serialize(writer, user.AnyTypePropNullable, jsonSerializerOptions); + } + else + writer.WriteNull("anyTypePropNullable"); + if (user.EmailOption.IsSet) + writer.WriteString("email", user.Email); + + if (user.FirstNameOption.IsSet) + writer.WriteString("firstName", user.FirstName); + + if (user.IdOption.IsSet) + writer.WriteNumber("id", user.IdOption.Value.Value); + + if (user.LastNameOption.IsSet) + writer.WriteString("lastName", user.LastName); + + if (user.ObjectWithNoDeclaredPropsOption.IsSet) + { + writer.WritePropertyName("objectWithNoDeclaredProps"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredProps, jsonSerializerOptions); + } + if (user.ObjectWithNoDeclaredPropsNullableOption.IsSet) + if (user.ObjectWithNoDeclaredPropsNullableOption.Value != null) + { + writer.WritePropertyName("objectWithNoDeclaredPropsNullable"); + JsonSerializer.Serialize(writer, user.ObjectWithNoDeclaredPropsNullable, jsonSerializerOptions); + } + else + writer.WriteNull("objectWithNoDeclaredPropsNullable"); + if (user.PasswordOption.IsSet) + writer.WriteString("password", user.Password); + + if (user.PhoneOption.IsSet) + writer.WriteString("phone", user.Phone); + + if (user.UserStatusOption.IsSet) + writer.WriteNumber("userStatus", user.UserStatusOption.Value.Value); + + if (user.UsernameOption.IsSet) + writer.WriteString("username", user.Username); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 00000000000..6d1afa8b592 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,223 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Whale + /// + public partial class Whale : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// hasBaleen + /// hasTeeth + [JsonConstructor] + public Whale(string className, Option hasBaleen = default, Option hasTeeth = default) + { + ClassName = className; + HasBaleenOption = hasBaleen; + HasTeethOption = hasTeeth; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// Used to track the state of HasBaleen + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasBaleenOption { get; private set; } + + /// + /// Gets or Sets HasBaleen + /// + [JsonPropertyName("hasBaleen")] + public bool? HasBaleen { get { return this.HasBaleenOption; } set { this.HasBaleenOption = new Option(value); } } + + /// + /// Used to track the state of HasTeeth + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option HasTeethOption { get; private set; } + + /// + /// Gets or Sets HasTeeth + /// + [JsonPropertyName("hasTeeth")] + public bool? HasTeeth { get { return this.HasTeethOption; } set { this.HasTeethOption = 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 Whale {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).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 WhaleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Whale 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 className = default; + Option hasBaleen = default; + Option hasTeeth = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "hasBaleen": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = new Option(utf8JsonReader.GetBoolean()); + break; + case "hasTeeth": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = new Option(utf8JsonReader.GetBoolean()); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Whale.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Whale."); + + if (hasBaleen.IsSet && hasBaleen.Value == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is not nullable for class Whale."); + + if (hasTeeth.IsSet && hasTeeth.Value == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is not nullable for class Whale."); + + return new Whale(className.Value, hasBaleen, hasTeeth); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, whale, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", whale.ClassName); + + if (whale.HasBaleenOption.IsSet) + writer.WriteBoolean("hasBaleen", whale.HasBaleenOption.Value.Value); + + if (whale.HasTeethOption.IsSet) + writer.WriteBoolean("hasTeeth", whale.HasTeethOption.Value.Value); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 00000000000..5463ed953c9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -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 + * 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 +{ + /// + /// Zebra + /// + public partial class Zebra : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// className + /// type + [JsonConstructor] + public Zebra(string className, Option type = default) + { + ClassName = className; + TypeOption = type; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines Type + /// + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + Grevys = 3 + } + + /// + /// Returns a + /// + /// + /// + /// + public static TypeEnum TypeEnumFromString(string value) + { + if (value.Equals("plains")) + return TypeEnum.Plains; + + if (value.Equals("mountain")) + return TypeEnum.Mountain; + + if (value.Equals("grevys")) + return TypeEnum.Grevys; + + throw new NotImplementedException($"Could not convert value to type TypeEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static TypeEnum? TypeEnumFromStringOrDefault(string value) + { + if (value.Equals("plains")) + return TypeEnum.Plains; + + if (value.Equals("mountain")) + return TypeEnum.Mountain; + + if (value.Equals("grevys")) + return TypeEnum.Grevys; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string TypeEnumToJsonValue(TypeEnum? value) + { + if (value == TypeEnum.Plains) + return "plains"; + + if (value == TypeEnum.Mountain) + return "mountain"; + + if (value == TypeEnum.Grevys) + return "grevys"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of Type + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TypeOption { get; private set; } + + /// + /// Gets or Sets Type + /// + [JsonPropertyName("type")] + public TypeEnum? Type { get { return this.TypeOption; } set { this.TypeOption = new Option(value); } } + + /// + /// Gets or Sets ClassName + /// + [JsonPropertyName("className")] + public string ClassName { get; set; } + + /// + /// 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 Zebra {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Type: ").Append(Type).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 ZebraJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override Zebra 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 className = default; + Option type = 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 "className": + className = new Option(utf8JsonReader.GetString()); + break; + case "type": + string typeRawValue = utf8JsonReader.GetString(); + if (typeRawValue != null) + type = new Option(Zebra.TypeEnumFromStringOrDefault(typeRawValue)); + break; + default: + break; + } + } + } + + if (!className.IsSet) + throw new ArgumentException("Property is required for class Zebra.", nameof(className)); + + if (className.IsSet && className.Value == null) + throw new ArgumentNullException(nameof(className), "Property is not nullable for class Zebra."); + + if (type.IsSet && type.Value == null) + throw new ArgumentNullException(nameof(type), "Property is not nullable for class Zebra."); + + return new Zebra(className.Value, type); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zebra, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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."); + + writer.WriteString("className", zebra.ClassName); + + var typeRawValue = Zebra.TypeEnumToJsonValue(zebra.TypeOption.Value.Value); + writer.WriteString("type", typeRawValue); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs new file mode 100644 index 00000000000..34a044fb8b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Converts to and from the JSON value + /// + public static class ZeroBasedEnumValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum FromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnum: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static ZeroBasedEnum? FromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ToJsonValue(ZeroBasedEnum value) + { + if (value == ZeroBasedEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + } + + /// + /// A Json converter for type + /// + /// + public class ZeroBasedEnumJsonConverter : JsonConverter + { + /// + /// Returns a from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the ZeroBasedEnum to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class ZeroBasedEnumNullableJsonConverter : JsonConverter + { + /// + /// Returns a ZeroBasedEnum from the Json object + /// + /// + /// + /// + /// + public override ZeroBasedEnum? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string rawValue = reader.GetString(); + + ZeroBasedEnum? result = rawValue == null + ? null + : ZeroBasedEnumValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnum? zeroBasedEnum, JsonSerializerOptions options) + { + writer.WriteStringValue(zeroBasedEnum?.ToString() ?? "null"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs new file mode 100644 index 00000000000..e7431416064 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -0,0 +1,239 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// ZeroBasedEnumClass + /// + public partial class ZeroBasedEnumClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// zeroBasedEnum + [JsonConstructor] + public ZeroBasedEnumClass(Option zeroBasedEnum = default) + { + ZeroBasedEnumOption = zeroBasedEnum; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Defines ZeroBasedEnum + /// + public enum ZeroBasedEnumEnum + { + /// + /// Enum Unknown for value: unknown + /// + Unknown, + + /// + /// Enum NotUnknown for value: notUnknown + /// + NotUnknown + } + + /// + /// Returns a + /// + /// + /// + /// + public static ZeroBasedEnumEnum ZeroBasedEnumEnumFromString(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumEnum.NotUnknown; + + throw new NotImplementedException($"Could not convert value to type ZeroBasedEnumEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static ZeroBasedEnumEnum? ZeroBasedEnumEnumFromStringOrDefault(string value) + { + if (value.Equals("unknown")) + return ZeroBasedEnumEnum.Unknown; + + if (value.Equals("notUnknown")) + return ZeroBasedEnumEnum.NotUnknown; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string ZeroBasedEnumEnumToJsonValue(ZeroBasedEnumEnum? value) + { + if (value == ZeroBasedEnumEnum.Unknown) + return "unknown"; + + if (value == ZeroBasedEnumEnum.NotUnknown) + return "notUnknown"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Used to track the state of ZeroBasedEnum + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ZeroBasedEnumOption { get; private set; } + + /// + /// Gets or Sets ZeroBasedEnum + /// + [JsonPropertyName("ZeroBasedEnum")] + public ZeroBasedEnumEnum? ZeroBasedEnum { get { return this.ZeroBasedEnumOption; } set { this.ZeroBasedEnumOption = 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 ZeroBasedEnumClass {\n"); + sb.Append(" ZeroBasedEnum: ").Append(ZeroBasedEnum).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 ZeroBasedEnumClassJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override ZeroBasedEnumClass 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 zeroBasedEnum = 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 "ZeroBasedEnum": + string zeroBasedEnumRawValue = utf8JsonReader.GetString(); + if (zeroBasedEnumRawValue != null) + zeroBasedEnum = new Option(ZeroBasedEnumClass.ZeroBasedEnumEnumFromStringOrDefault(zeroBasedEnumRawValue)); + break; + default: + break; + } + } + } + + if (zeroBasedEnum.IsSet && zeroBasedEnum.Value == null) + throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is not nullable for class ZeroBasedEnumClass."); + + return new ZeroBasedEnumClass(zeroBasedEnum); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + 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/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..73a85280057 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,33 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..003f9f4268e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/README.md @@ -0,0 +1,223 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=false', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + Call123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo"); + ModelClient model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## 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**: Bearer Authentication + + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Petstore +- appVersion: 1.0.0 +- appDescription: This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: false +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: false +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {321C8C3F-0156-40C1-AE42-D59761FB9B6C} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.gitignore b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator-ignore b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.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/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/FILES new file mode 100644 index 00000000000..5abbcf46f35 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.gitignore +Org.OpenAPITools.sln +README.md +api/openapi.yaml +appveyor.yml +docs/apis/DefaultApi.md +docs/models/NowGet200Response.md +docs/scripts/git_push.ps1 +docs/scripts/git_push.sh +src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/README.md +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/IApi.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiFactory.cs +src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs +src/Org.OpenAPITools/Client/ApiResponse`1.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/CookieContainer.cs +src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +src/Org.OpenAPITools/Client/ExceptionEventArgs.cs +src/Org.OpenAPITools/Client/HostConfiguration.cs +src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs +src/Org.OpenAPITools/Client/Option.cs +src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +src/Org.OpenAPITools/Client/TokenBase.cs +src/Org.OpenAPITools/Client/TokenContainer`1.cs +src/Org.OpenAPITools/Client/TokenProvider`1.cs +src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs +src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs +src/Org.OpenAPITools/Model/NowGet200Response.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/README.md diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/VERSION b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/Org.OpenAPITools.sln b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/Org.OpenAPITools.sln new file mode 100644 index 00000000000..547505a9856 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/Org.OpenAPITools.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Test", "src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/README.md b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/README.md new file mode 100644 index 00000000000..f9c1c7f7462 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/README.md @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/api/openapi.yaml new file mode 100644 index 00000000000..a84e041a00f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/api/openapi.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.0 +info: + description: Thic spec contains endpoints with dates in different formats + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Dates + version: 1.0.0 +servers: +- url: / +paths: + /now: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_now_get_200_response' + description: now dates +components: + schemas: + _now_get_200_response: + example: + today: 2000-01-23 + now: 2000-01-23T04:56:07.000+00:00 + properties: + today: + format: date + type: string + now: + format: date-time + type: string + type: object + diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/appveyor.yml b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/appveyor.yml new file mode 100644 index 00000000000..f76f63cee50 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/apis/DefaultApi.md new file mode 100644 index 00000000000..6b1991021ac --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/apis/DefaultApi.md @@ -0,0 +1,90 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**NowGet**](DefaultApi.md#nowget) | **GET** /now | | + + +# **NowGet** +> NowGet200Response NowGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class NowGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + var apiInstance = new DefaultApi(config); + + try + { + NowGet200Response result = apiInstance.NowGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.NowGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the NowGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.NowGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.NowGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NowGet200Response**](NowGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | now dates | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/models/NowGet200Response.md b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/models/NowGet200Response.md new file mode 100644 index 00000000000..58b6c7c79f0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/models/NowGet200Response.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.NowGet200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Now** | **DateTime** | | [optional] +**Today** | **DateTime** | | [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/net4.8/UseDateTimeForDate/docs/scripts/git_push.ps1 b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/scripts/git_push.ps1 new file mode 100644 index 00000000000..73ed35c2bb1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/scripts/git_push.ps1 @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "github.com", + [Parameter()][Alias("u")][String]$GitUserId = "GIT_USER_ID", + [Parameter()][Alias("r")][String]$GitRepoId = "GIT_REPO_ID", + [Parameter()][Alias("m")][string]$Message = "Minor update", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your preferred git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/scripts/git_push.sh b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/scripts/git_push.sh new file mode 100644 index 00000000000..88210492218 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/docs/scripts/git_push.sh @@ -0,0 +1,49 @@ +#!/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_USER_ID} +git_repo_id=${2:-GIT_REPO_ID} +release_note=${3:-Minor update} +git_host=${4:-github.com} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs new file mode 100644 index 00000000000..40e1298ee62 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/ApiTestsBase.cs @@ -0,0 +1,58 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Extensions; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, services, options) => + { + + }); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..05dc933c03b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + + +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ + + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + public sealed class DefaultApiTests : ApiTestsBase + { + private readonly IDefaultApi _instance; + + public DefaultApiTests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService(); + } + + /// + /// Test NowGet + /// + [Fact (Skip = "not implemented")] + public async Task NowGetAsyncTest() + { + var response = await _instance.NowGetAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs new file mode 100644 index 00000000000..3b09a6314ed --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs @@ -0,0 +1,103 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Extensions; +using Xunit; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureApi((context, services, options) => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.AddApi(options => + { + + options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + var defaultApi = _hostUsingAddWithAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService(); + Assert.True(defaultApi.HttpClient.BaseAddress != null); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs new file mode 100644 index 00000000000..920dfd9700e --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Model/NowGet200ResponseTests.cs @@ -0,0 +1,74 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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 NowGet200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NowGet200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NowGet200Response + //private NowGet200Response instance; + + public NowGet200ResponseTests() + { + // TODO uncomment below to create an instance of NowGet200Response + //instance = new NowGet200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NowGet200Response + /// + [Fact] + public void NowGet200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" NowGet200Response + //Assert.IsType(instance); + } + + /// + /// Test the property 'Now' + /// + [Fact] + public void NowTest() + { + // TODO unit test for the property 'Now' + } + + /// + /// Test the property 'Today' + /// + [Fact] + public void TodayTest() + { + // TODO unit test for the property 'Today' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj new file mode 100644 index 00000000000..66afad92ec4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -0,0 +1,19 @@ + + + + Org.OpenAPITools.Test + Org.OpenAPITools.Test + net48 + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/README.md b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools.Test/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..adb94299d24 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,329 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +using System.Diagnostics.CodeAnalysis; + +namespace Org.OpenAPITools.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. + /// + public interface IDefaultApi : IApi + { + /// + /// The class containing the events + /// + DefaultApiEvents Events { get; } + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task NowGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task NowGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + } + + /// + /// The + /// + public interface INowGetApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class DefaultApiEvents + { + /// + /// The event raised after the server response + /// + public event EventHandler OnNowGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorNowGet; + + internal void ExecuteOnNowGet(DefaultApi.NowGetApiResponse apiResponse) + { + OnNowGet?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorNowGet(Exception exception) + { + OnErrorNowGet?.Invoke(this, new ExceptionEventArgs(exception)); + } + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public sealed partial class DefaultApi : IDefaultApi + { + private JsonSerializerOptions _jsonSerializerOptions; + + /// + /// The logger factory + /// + public ILoggerFactory LoggerFactory { get; } + + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public DefaultApiEvents Events { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public DefaultApi(ILogger logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, DefaultApiEvents defaultApiEvents) + { + _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger(); + HttpClient = httpClient; + Events = defaultApiEvents; + } + + /// + /// Processes the server response + /// + /// + private void AfterNowGetDefaultImplementation(INowGetApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterNowGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterNowGet(ref bool suppressDefaultLog, INowGetApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorNowGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorNowGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorNowGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task NowGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await NowGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task NowGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/now"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + NowGetApiResponse apiResponseLocalVar = new NowGetApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/now", requestedAtLocalVar, _jsonSerializerOptions); + + AfterNowGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnNowGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorNowGetDefaultImplementation(e, "/now", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorNowGet(e); + throw; + } + } + + /// + /// The + /// + public partial class NowGetApiResponse : Org.OpenAPITools.Client.ApiResponse, INowGetApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public NowGetApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.NowGet200Response Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.NowGet200Response result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs new file mode 100644 index 00000000000..28520f043f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Api/IApi.cs @@ -0,0 +1,15 @@ +using System.Net.Http; + +namespace Org.OpenAPITools.Api +{ + /// + /// Any Api client + /// + public interface IApi + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..cf39d3c11d7 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,50 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the response + /// + /// + /// + /// + public ApiException(string reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs new file mode 100644 index 00000000000..b9b27c613f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiFactory.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; + +namespace Org.OpenAPITools.Client +{ + /// + /// An IApiFactory interface + /// + public interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + public class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs new file mode 100644 index 00000000000..3cb65e5adc0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponseEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs new file mode 100644 index 00000000000..c67dab81c94 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiResponse`1.cs @@ -0,0 +1,170 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public partial interface IApiResponse + { + /// + /// The IsSuccessStatusCode from the api response + /// + bool IsSuccessStatusCode { get; } + + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response. + /// + string RawContent { get; } + + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } + + /// + /// The headers contained in the api response + /// + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The path used when making the request. + /// + string Path { get; } + + /// + /// The reason phrase contained in the api response + /// + string ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri RequestUri { get; } + } + + /// + /// API Response + /// + public partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The raw data + /// + public string RawContent { get; protected set; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } + + /// + /// The Uri used when making the request. + /// + public Uri RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + + /// + /// An interface for responses of type + /// + /// + public interface IOk : IApiResponse + { + /// + /// Deserializes the response if the response is Ok + /// + /// + TType Ok(); + + /// + /// Returns true if the response is Ok and the deserialized response is not null + /// + /// + /// + bool TryOk(out TType result); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..fc501e40444 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,314 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.RegularExpressions; +using Org.OpenAPITools.Model; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Org.OpenAPITools.Test")] + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(string json, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(json, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Returns true when deserialization succeeds. + /// + /// + /// + /// + /// + /// + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, out T result) + { + try + { + result = JsonSerializer.Deserialize(ref reader, options); + return result != null; + } + catch (Exception) + { + result = default; + return false; + } + } + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string ParameterToString(object obj, string format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + 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 + /// + public const string BASE_ADDRESS = "http://localhost"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "http"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = ""; + + /// + /// The host of the API + /// + public const string HOST = "localhost"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs new file mode 100644 index 00000000000..da94287dab8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/CookieContainer.cs @@ -0,0 +1,18 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A class containing a CookieContainer + /// + public sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs new file mode 100644 index 00000000000..52e971d082a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -0,0 +1,77 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs new file mode 100644 index 00000000000..968d29161b1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -0,0 +1,82 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' and 'date-time' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + "yyyy'-'MM'-'dd", + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + "yyyyMMdd" + + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(); + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs new file mode 100644 index 00000000000..dcfab667823 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ExceptionEventArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Useful for tracking server health + /// + public class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs new file mode 100644 index 00000000000..2eaac444e5c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -0,0 +1,129 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides hosting configuration for Org.OpenAPITools + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services; + _jsonOptions.Converters.Add(new JsonStringEnumConverter()); + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + _jsonOptions.Converters.Add(new NowGet200ResponseJsonConverter()); + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + _services.AddSingleton(); + _services.AddSingleton(); + _services.AddTransient(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration AddApiHttpClients + ( + Action client = null, Action builder = null) + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + builders.Add(_services.AddHttpClient(client)); + + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(_jsonOptions); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs new file mode 100644 index 00000000000..8fd6b68578f --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/JsonSerializerOptionsProvider.cs @@ -0,0 +1,25 @@ +// + +using System.Text.Json; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides the JsonSerializerOptions + /// + public class JsonSerializerOptionsProvider + { + /// + /// the JsonSerializerOptions + /// + public JsonSerializerOptions Options { get; } + + /// + /// Instantiates a JsonSerializerOptionsProvider + /// + public JsonSerializerOptionsProvider(JsonSerializerOptions options) + { + Options = options; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs new file mode 100644 index 00000000000..2b34371084b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/Option.cs @@ -0,0 +1,51 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs new file mode 100644 index 00000000000..cddb8405886 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -0,0 +1,55 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Channels; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Dictionary> AvailableTokens { get; } = new Dictionary>(); + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + { + if (!AvailableTokens.TryGetValue(header, out Channel tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs new file mode 100644 index 00000000000..ec843104caf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -0,0 +1,69 @@ +// + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs new file mode 100644 index 00000000000..ab372352e21 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenContainer`1.cs @@ -0,0 +1,35 @@ +// + +using System.Linq; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs new file mode 100644 index 00000000000..069d5230868 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -0,0 +1,42 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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.Collections.Generic; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs new file mode 100644 index 00000000000..480524ee9c1 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHostBuilderExtensions.cs @@ -0,0 +1,57 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + public static class IHostBuilderExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder ConfigureApi(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.AddApi(services, config); + }); + + return builder; + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs new file mode 100644 index 00000000000..2e45faf4463 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IHttpClientBuilderExtensions.cs @@ -0,0 +1,77 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + public static class IHttpClientBuilderExtensions + { + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs new file mode 100644 index 00000000000..d469c015da9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Extensions/IServiceCollectionExtensions.cs @@ -0,0 +1,71 @@ +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + public static class IServiceCollectionExtensions + { + /// + /// Add the api to your host builder. + /// + /// + public static void AddApi(this IServiceCollection services) + { + HostConfiguration config = new HostConfiguration(services); + AddApi(services, config); + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void AddApi(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + AddApi(services, config); + } + + internal static void AddApi(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.AddApiHttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs new file mode 100644 index 00000000000..e30105d1acf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -0,0 +1,201 @@ +// +/* + * OpenAPI Dates + * + * Thic spec contains endpoints with dates in different formats + * + * 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 Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// NowGet200Response + /// + public partial class NowGet200Response : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// now + /// today + [JsonConstructor] + public NowGet200Response(Option now = default, Option today = default) + { + NowOption = now; + TodayOption = today; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Now + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option NowOption { get; private set; } + + /// + /// Gets or Sets Now + /// + [JsonPropertyName("now")] + public DateTime? Now { get { return this.NowOption; } set { this.NowOption = new Option(value); } } + + /// + /// Used to track the state of Today + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TodayOption { get; private set; } + + /// + /// Gets or Sets Today + /// + [JsonPropertyName("today")] + public DateTime? Today { get { return this.TodayOption; } set { this.TodayOption = new Option(value); } } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NowGet200Response {\n"); + sb.Append(" Now: ").Append(Now).Append("\n"); + sb.Append(" Today: ").Append(Today).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 NowGet200ResponseJsonConverter : JsonConverter + { + /// + /// The format to use to serialize Now + /// + public static string NowFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize Today + /// + public static string TodayFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override NowGet200Response 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 now = default; + Option today = 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 "now": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "today": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (now.IsSet && now.Value == null) + throw new ArgumentNullException(nameof(now), "Property is not nullable for class NowGet200Response."); + + if (today.IsSet && today.Value == null) + throw new ArgumentNullException(nameof(today), "Property is not nullable for class NowGet200Response."); + + return new NowGet200Response(now, today); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, nowGet200Response, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) + { + if (nowGet200Response.NowOption.IsSet) + writer.WriteString("now", nowGet200Response.NowOption.Value.Value.ToString(NowFormat)); + + if (nowGet200Response.TodayOption.IsSet) + writer.WriteString("today", nowGet200Response.TodayOption.Value.Value.ToString(TodayFormat)); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..82bb1c228e8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,32 @@ + + + + true + net48 + Org.OpenAPITools + Org.OpenAPITools + Library + OpenAPI + OpenAPI + OpenAPI Library + A library generated from a OpenAPI doc + No Copyright + Org.OpenAPITools + 1.0.0 + bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update + false + + + + + + + + + + + + diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/README.md new file mode 100644 index 00000000000..d11674004ef --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/README.md @@ -0,0 +1,176 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName=Api', + 'targetFramework=net48', + 'validatable=true', + 'nullableReferenceTypes=', + 'hideGenerationTimestamp=true', + 'packageVersion=1.0.0', + 'packageAuthors=OpenAPI', + 'packageCompany=OpenAPI', + 'packageCopyright=No Copyright', + 'packageDescription=A library generated from a OpenAPI doc', + 'packageName=Org.OpenAPITools', + 'packageTags=', + 'packageTitle=OpenAPI Library' +) -join "," + +$global = @( + 'apiDocs=true', + 'modelDocs=true', + 'apiTests=true', + 'modelTests=true' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "github.com" ` + --git-repo-id "GIT_REPO_ID" ` + --git-user-id "GIT_USER_ID" ` + --release-note "Minor update" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build(); + var api = host.Services.GetRequiredService(); + NowGetApiResponse apiResponse = await api.NowGetAsync("todo"); + NowGet200Response model = apiResponse.Ok(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .ConfigureApi((context, options) => + { + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.AddApiHttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace Org.OpenAPITools.Rest.DefaultApi. + Or provide your own class by using the generic ConfigureApi method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Build +- SDK version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen + +## Api Information +- appName: OpenAPI Dates +- appVersion: 1.0.0 +- appDescription: Thic spec contains endpoints with dates in different formats + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: +- supportingFiles: +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: true +- modelDocs: true +- apiTests: true +- modelTests: true + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: +- apiName: Api +- caseInsensitiveResponseHeaders: +- conditionalSerialization: false +- disallowAdditionalPropertiesIfNotPresent: +- gitHost: github.com +- gitRepoId: GIT_REPO_ID +- gitUserId: GIT_USER_ID +- hideGenerationTimestamp: true +- interfacePrefix: I +- library: generichost +- licenseId: +- modelPropertyNaming: +- netCoreProjectFile: false +- nonPublicApi: false +- nullableReferenceTypes: +- optionalAssemblyInfo: +- optionalEmitDefaultValues: false +- optionalMethodArgument: true +- optionalProjectFile: +- packageAuthors: OpenAPI +- packageCompany: OpenAPI +- packageCopyright: No Copyright +- packageDescription: A library generated from a OpenAPI doc +- packageGuid: {2E60EF87-DB0B-4D01-A36E-F5E90F7EC757} +- packageName: Org.OpenAPITools +- packageTags: +- packageTitle: OpenAPI Library +- packageVersion: 1.0.0 +- releaseNote: Minor update +- returnICollection: false +- sortParamsByRequiredFlag: +- sourceFolder: src +- targetFramework: net48 +- useCollection: false +- useDateTimeOffset: false +- useOneOfDiscriminatorLookup: false +- validatable: true + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. 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 7acde5f926c..73d27ba28c6 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 @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 c887090b6ca..e39d4b5fb43 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ad5d19ad12d..5c8fb556972 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fde1dab0272..b74e3d9d31d 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 @@ -109,7 +109,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 abd80a48180..50c5b47011d 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0425d779223..2c18c7b167b 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 415bc63ab43..63cea0ea755 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 @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 deef0a5de48..bc72f8c05ba 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES @@ -63,7 +63,12 @@ docs/models/Mammal.md docs/models/MapTest.md docs/models/MapTestMapOfEnumStringValue.md docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md docs/models/Model200Response.md docs/models/ModelClient.md docs/models/Name.md @@ -217,7 +222,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 b4ab1bc2b81..c64890a0634 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1182,6 +1182,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2528,6 +2554,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2950,6 +2992,26 @@ components: - unknown - notUnknown type: string + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/apis/FakeApi.md index 187a580b89a..47134bd4322 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/apis/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedSubId.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 090238dc8cb..86a438a3ec9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -121,6 +121,28 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + /// /// Test TestAdditionalPropertiesReference /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index 218bb51d7b4..0dc06a0c06e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -169,6 +169,48 @@ namespace Org.OpenAPITools.Api /// <> Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// /// test referenced additionalProperties /// @@ -588,6 +630,30 @@ namespace Org.OpenAPITools.Api bool IsOk { get; } } + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// The /// @@ -869,6 +935,46 @@ namespace Org.OpenAPITools.Api OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2483,6 +2589,394 @@ namespace Org.OpenAPITools.Api partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); /// 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 4a6a9ad0907..f35ca51d2d2 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 @@ -103,7 +103,12 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueJsonConverter()); _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueNullableJsonConverter()); _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); _jsonOptions.Converters.Add(new NameJsonConverter()); 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 b746b781c3e..dea066bc9c8 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3afdabfc6d5..5a20bfce9ea 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b422890b171..73011ad0e15 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 @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 aea74905748..c8af515bcb5 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 02c11a9a77e..fef38dd97ac 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 59e078d0a8d..0806409d5ea 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.ColorCodeOption.Value != null) { // ColorCode (string) pattern 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 9801b197763..c05a71a1ef2 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7decd736dd6..a1f82072d23 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d9c4bbd05e4..a5661cc57cc 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0d5cf364c0b..456330e7c30 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5deb7b3cabb..c9d71a15894 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1ead980e60a..6a8fa3d0cf8 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 863cc82bc78..9938d89e008 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5ee27d790d1..7d9ac6bd3c5 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 @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 646d804623a..66fca18f231 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 @@ -89,7 +89,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3740f80f7c4..959ead0c820 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1a42f967ca9..3023a45610e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9eb8b733358..14b2ed3b153 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4f3c74c26d9..be19d9a21b6 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1ffcd1e09a8..220aae8ef81 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e5f2fb7e025..d6bc0862ba3 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 427a3cd1ffc..9f02706d45a 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 47fbc662772..66fd5877e1c 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 @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b84f89b531d..d65c7740e5e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 49cc4b73830..933241ae7da 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c22995b605..998ccf67eb9 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2b59206330a..6843d1ad025 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 42d40f715ec..e5ec399125f 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 545fe1a83b6..9113c366efe 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 @@ -346,78 +346,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } // Double (double) maximum if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } // Float (float) maximum if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Int32 (int) maximum if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } if (this.PatternWithBackslashOption.Value != null) { @@ -463,13 +463,13 @@ namespace Org.OpenAPITools.Model // UnsignedInteger (uint) maximum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } yield break; 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 d39d2a29ad8..95256dd8679 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f5dd6d56278..1e72875d4d3 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 @@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 95772b5635b..0617e3bb527 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 86246ae5457..838cae14f98 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 @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 88c5d4274ea..680ead387fb 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 @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0c916b0a208..1ec9d943c6a 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 384e48f3a15..cce85952411 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b4f4f31b7fd..fa661c7894e 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9e1a7878ad5..5df92e1f974 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1be5661d993..267ac8769d3 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (mammal.Whale != null) { + if (mammal.Whale != null) + { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } - if (mammal.Zebra != null) { + if (mammal.Zebra != null) + { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } - if (mammal.Pig != null) { + if (mammal.Pig != null) + { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } 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 e99895fbeda..16def07aaa9 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 44130823a00..59504c5b809 100644 --- 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 @@ -529,7 +529,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..7646b8dee22 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..c9a21684216 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..41b31b7dcf3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} 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 ae423667629..574b19d52a5 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..57eb6fc5b82 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} 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 f503204de20..cbcf8a0ca57 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 cac0963a201..4da46fdcac5 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 86bbf24f53a..2c04de9eff8 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 @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d10268f2927..ea8abdda0d7 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fcafbb94744..40b9c48b30e 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 @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4b5f815656a..02f7d52273e 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 10061a2c228..9a93cb734e9 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (nullableShape.Triangle != null) { + if (nullableShape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } - if (nullableShape.Quadrilateral != null) { + if (nullableShape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } 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 15c9e5cbfcb..8bc04902737 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b25d9e5fd87..50cfe4acf50 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 @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0f4f13f311b..c89963f55a3 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 @@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a0d820562b4..64feb6fc14f 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 @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 daa467e228b..bf502a66a77 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 43fb8d49cc2..91369cf61b9 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 @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 19e395f1de4..b6f300c9440 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (pig.BasquePig != null) { + if (pig.BasquePig != null) + { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } - if (pig.DanishPig != null) { + if (pig.DanishPig != null) + { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } 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 30edd0b77d2..ddea47edf40 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3d333d7958f..e8a2e243997 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (quadrilateral.SimpleQuadrilateral != null) { + if (quadrilateral.SimpleQuadrilateral != null) + { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } - if (quadrilateral.ComplexQuadrilateral != null) { + if (quadrilateral.ComplexQuadrilateral != null) + { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } 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 610005a0540..519ed66393c 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5ef0b044807..e31cd106e9b 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 @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5e3108fbe63..22a79cc54c5 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 @@ -618,7 +618,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 30c6b4d7fe9..be6613f51ba 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 14e2d9ee12f..3aa505a85a8 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1e19e81e55c..8438c92cd00 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 47081ede38e..5c960eb5474 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d4883a363a2..c651ac7d245 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shape.Triangle != null) { + if (shape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } - if (shape.Quadrilateral != null) { + if (shape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } 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 3027d9142ba..37db5df6490 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2d9fb2cbb33..1f0b2203007 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shapeOrNull.Triangle != null) { + if (shapeOrNull.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } - if (shapeOrNull.Quadrilateral != null) { + if (shapeOrNull.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } 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 3fa8bdc1917..ffa68d1e75d 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0cc19a946de..46b1736614e 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5c64df495c1..534cf1792d7 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c5e4293dca4..86465fcc356 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 798a4b835c9..6b6e9d68ebc 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e6590dd351d..24953ff398c 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d31d2948c65..cf22051519a 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (triangle.EquilateralTriangle != null) { + if (triangle.EquilateralTriangle != null) + { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } - if (triangle.IsoscelesTriangle != null) { + if (triangle.IsoscelesTriangle != null) + { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } - if (triangle.ScaleneTriangle != null) { + if (triangle.ScaleneTriangle != null) + { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } 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 aa6d31b9190..0f13b0e7745 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ea5842d39f4..5b32ca28ab2 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 @@ -261,7 +261,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 258c1713bcc..2efd4b74790 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 @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5479d7346cd..c272f254390 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 @@ -89,7 +89,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a8d79997472..b56f33fbfd5 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a94acc41bff..afb25a1c17e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES @@ -55,7 +55,12 @@ docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md docs/models/Model200Response.md docs/models/ModelClient.md docs/models/Name.md @@ -186,7 +191,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 e4713d2621c..f772773afef 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/apis/FakeApi.md index 94cf293ed11..65edbb26576 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/apis/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedSubId.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index fe8397be218..fba8b26855c 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,28 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + /// /// Test TestAdditionalPropertiesReference /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} 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 new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 2bb291f16f5..1f45ab88e83 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -171,6 +171,48 @@ namespace Org.OpenAPITools.Api /// <?> Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <?> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <?> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// /// test referenced additionalProperties /// @@ -590,6 +632,30 @@ namespace Org.OpenAPITools.Api bool IsOk { get; } } + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// The /// @@ -871,6 +937,46 @@ namespace Org.OpenAPITools.Api OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler? OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler? OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2485,6 +2591,394 @@ namespace Org.OpenAPITools.Api partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedAnyOf? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedOneOf? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); /// 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 d96b864d782..8be0791ee4f 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 @@ -89,7 +89,12 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); _jsonOptions.Converters.Add(new NameJsonConverter()); 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 4ad0fb2c59a..1367613de33 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 61ce42cec0f..cadabfbb0ea 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7e193b97f89..d33480c1143 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 @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b6321f8a5fd..288b04352a8 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 @@ -89,7 +89,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 6224f2e1d3b..b0302e19b8f 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 407c1858d9a..fc5d8b5add1 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.ColorCodeOption.Value != null) { // ColorCode (string) pattern 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 422ed7a6308..b01d43ff4dd 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 cf54e27c98e..f1ab2a1f00e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f8311fd47da..cef3724efef 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 10b89278cf4..9a1ce07c813 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1b9d4ad4b6d..3c454a95d3f 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 48f8d06506d..2b3dc43728c 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f523f75bffc..7eaeac5cde6 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0209e0ec34f..02512d4b9cd 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 @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4e71363b8e6..fba4670f6dd 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 @@ -91,7 +91,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 41acdb363b3..c33d8f4852c 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 629d2072a7c..018f49af861 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a3c590d56ce..c0042b4d884 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f28b51344de..5d4ce453bff 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 33b840488f4..da5eeab1277 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 768e72260b5..9632758d2a0 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 @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f5dd6f17edf..e1461b3a632 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 @@ -230,7 +230,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 043c5900459..c38c46267f5 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 @@ -687,7 +687,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 15e0e9658b5..12983d68a09 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 83a46bd772f..2556bcdd0cf 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1aacce8091e..867eb6fa77e 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ca885a9ae07..e551e3d0a8c 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1eb9f5b611c..92a99c89724 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 03a96c36410..340a84ca1e2 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 @@ -348,78 +348,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } // Double (double) maximum if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } // Float (float) maximum if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Int32 (int) maximum if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } if (this.PatternWithBackslashOption.Value != null) { @@ -465,13 +465,13 @@ namespace Org.OpenAPITools.Model // UnsignedInteger (uint) maximum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } yield break; 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 6f71ce3a1e2..0f4ab760a74 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 30390ff4efa..357be438844 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ff9c67c07d8..327a2dff916 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 @@ -102,7 +102,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d92add7536e..3402b6896cf 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 4d44dedfd4a..444aa641cc7 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 @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 aeeb1a06d61..39aed7aff9d 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d32a7e6d99b..8aca45893e6 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 @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 da1f349c9bd..ebacd00369d 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 64a2eb499d1..a5ed58dd002 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f80ef9bd3eb..132f1e462ce 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 @@ -102,7 +102,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -234,17 +234,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (mammal.Whale != null) { + if (mammal.Whale != null) + { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } - if (mammal.Zebra != null) { + if (mammal.Zebra != null) + { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } - if (mammal.Pig != null) { + if (mammal.Pig != null) + { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } 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 fdb5cd9a373..9886514d697 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 @@ -196,7 +196,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 7beb5db0dd4..408f7c05763 100644 --- 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 @@ -531,7 +531,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..ec5b00f39aa --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -0,0 +1,180 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent? Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..a1e9f4755dc --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,285 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId? MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string? varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId? mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..041e7f0b578 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -0,0 +1,180 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent? Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..15e011ce091 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -0,0 +1,263 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string? String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId? MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string? varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId? mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} 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 01ef25c69ce..9c6ad803325 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 @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..a23ae7a62d9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,176 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string? Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()!); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} 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 4cec514e74a..27091c48a93 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c59b5d68c7..82f76946b1b 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a21af022df6..fab80276470 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 @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f1322013ba8..f7e59fb345a 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c674ba10f1b..e4d089e7905 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 @@ -258,7 +258,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 6d21b7213d1..c28c1cca3ea 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5cb7a024bb8..a06afa2a9be 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -210,12 +210,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (nullableShape.Triangle != null) { + if (nullableShape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } - if (nullableShape.Quadrilateral != null) { + if (nullableShape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } 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 639f9226a10..b4a05ee7391 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 8798637d31e..a5d71f299ec 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 @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a2ab3d33880..5471f08f519 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 @@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 6fa4f95a8d9..66a53133db7 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 @@ -245,7 +245,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 8827863e100..0c3fc816014 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 02c14e86b3d..e6c55a62ebf 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 @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0a26dc0fb34..2cd41f15027 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -210,12 +210,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (pig.BasquePig != null) { + if (pig.BasquePig != null) + { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } - if (pig.DanishPig != null) { + if (pig.DanishPig != null) + { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } 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 4466ad3cfe8..3c1b978da7f 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 @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 bb00a21cf69..5c7aa541ffc 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -210,12 +210,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (quadrilateral.SimpleQuadrilateral != null) { + if (quadrilateral.SimpleQuadrilateral != null) + { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } - if (quadrilateral.ComplexQuadrilateral != null) { + if (quadrilateral.ComplexQuadrilateral != null) + { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } 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 bc88c7d5919..c535142bde6 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ad4b61f5e02..a04317601e0 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 @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d62124ac11e..5e312a74a8d 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 @@ -1698,7 +1698,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 858b9afb4f5..dd35324099a 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 @@ -116,7 +116,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a542e79114b..7025591e6a3 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b7e2f743a1d..2eae4badded 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3cec323bc5d..926b431dda3 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c19f3a8af06..c608b7288d9 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -210,12 +210,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shape.Triangle != null) { + if (shape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } - if (shape.Quadrilateral != null) { + if (shape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } 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 449c74ed596..15777abac01 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e6d8735bd1b..3fc9f273509 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -210,12 +210,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shapeOrNull.Triangle != null) { + if (shapeOrNull.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } - if (shapeOrNull.Quadrilateral != null) { + if (shapeOrNull.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } 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 1ccbce2b791..bab36d28f5e 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3af779a4e60..fda88f0eee3 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 8878770aede..e2427afab24 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 @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9b7baf9d290..9b0bc3774b5 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1ec54dc3f9a..a29c881d98c 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b1ff0c9f49d..bb539730abf 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4d8f03d60a0..f34f2cf6013 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 @@ -102,7 +102,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -234,17 +234,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (triangle.EquilateralTriangle != null) { + if (triangle.EquilateralTriangle != null) + { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } - if (triangle.IsoscelesTriangle != null) { + if (triangle.IsoscelesTriangle != null) + { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } - if (triangle.ScaleneTriangle != null) { + if (triangle.ScaleneTriangle != null) + { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } 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 056926c5eda..6ccbe196f3d 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 384fc9e1cc5..7ebcf47e874 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 @@ -263,7 +263,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b30219575b8..24a9abfa8ea 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 @@ -107,7 +107,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 06b58fe1955..33c9d64a321 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 @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 bb38eafb468..f5b0a1a3110 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 @@ -148,7 +148,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c887090b6ca..e39d4b5fb43 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ad5d19ad12d..5c8fb556972 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c39e0c72912..d1a7d56110f 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 @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a94acc41bff..afb25a1c17e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES @@ -55,7 +55,12 @@ docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md docs/models/Model200Response.md docs/models/ModelClient.md docs/models/Name.md @@ -186,7 +191,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 e4713d2621c..f772773afef 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/apis/FakeApi.md index 94cf293ed11..65edbb26576 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/apis/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedSubId.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index e982dbf36e3..73bf47831d1 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,28 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + /// /// Test TestAdditionalPropertiesReference /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} 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 new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 987454df7ee..c47a501885e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -169,6 +169,48 @@ namespace Org.OpenAPITools.Api /// <> Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// /// test referenced additionalProperties /// @@ -588,6 +630,30 @@ namespace Org.OpenAPITools.Api bool IsOk { get; } } + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// The /// @@ -869,6 +935,46 @@ namespace Org.OpenAPITools.Api OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2483,6 +2589,394 @@ namespace Org.OpenAPITools.Api partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); /// 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 968f832b045..cb0e43c8527 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 @@ -87,7 +87,12 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); _jsonOptions.Converters.Add(new NameJsonConverter()); 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 b746b781c3e..dea066bc9c8 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3afdabfc6d5..5a20bfce9ea 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b422890b171..73011ad0e15 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 @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 aea74905748..c8af515bcb5 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 02c11a9a77e..fef38dd97ac 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 59e078d0a8d..0806409d5ea 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.ColorCodeOption.Value != null) { // ColorCode (string) pattern 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 9801b197763..c05a71a1ef2 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7decd736dd6..a1f82072d23 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d9c4bbd05e4..a5661cc57cc 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0d5cf364c0b..456330e7c30 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5deb7b3cabb..c9d71a15894 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1ead980e60a..6a8fa3d0cf8 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 863cc82bc78..9938d89e008 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5ee27d790d1..7d9ac6bd3c5 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 @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 646d804623a..66fca18f231 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 @@ -89,7 +89,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3740f80f7c4..959ead0c820 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1a42f967ca9..3023a45610e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9eb8b733358..14b2ed3b153 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4f3c74c26d9..be19d9a21b6 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1ffcd1e09a8..220aae8ef81 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e5f2fb7e025..d6bc0862ba3 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5a16d41c18a..129f218f786 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 @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7d899ce5232..4bc60ff6724 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 @@ -685,7 +685,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b84f89b531d..d65c7740e5e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 49cc4b73830..933241ae7da 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c22995b605..998ccf67eb9 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2b59206330a..6843d1ad025 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 42d40f715ec..e5ec399125f 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 545fe1a83b6..9113c366efe 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 @@ -346,78 +346,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } // Double (double) maximum if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } // Float (float) maximum if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Int32 (int) maximum if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } if (this.PatternWithBackslashOption.Value != null) { @@ -463,13 +463,13 @@ namespace Org.OpenAPITools.Model // UnsignedInteger (uint) maximum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } yield break; 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 d39d2a29ad8..95256dd8679 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f5dd6d56278..1e72875d4d3 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 @@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 95772b5635b..0617e3bb527 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 86246ae5457..838cae14f98 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 @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 88c5d4274ea..680ead387fb 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 @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0c916b0a208..1ec9d943c6a 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 384e48f3a15..cce85952411 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b4f4f31b7fd..fa661c7894e 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9e1a7878ad5..5df92e1f974 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1be5661d993..267ac8769d3 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (mammal.Whale != null) { + if (mammal.Whale != null) + { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } - if (mammal.Zebra != null) { + if (mammal.Zebra != null) + { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } - if (mammal.Pig != null) { + if (mammal.Pig != null) + { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } 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 6fa8d54e7f7..622678488ad 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 @@ -194,7 +194,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 44130823a00..59504c5b809 100644 --- 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 @@ -529,7 +529,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..7646b8dee22 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..c9a21684216 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..41b31b7dcf3 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} 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 ae423667629..574b19d52a5 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..57eb6fc5b82 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} 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 f503204de20..cbcf8a0ca57 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 cac0963a201..4da46fdcac5 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 86bbf24f53a..2c04de9eff8 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 @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d10268f2927..ea8abdda0d7 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fcafbb94744..40b9c48b30e 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 @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4b5f815656a..02f7d52273e 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 10061a2c228..9a93cb734e9 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (nullableShape.Triangle != null) { + if (nullableShape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } - if (nullableShape.Quadrilateral != null) { + if (nullableShape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } 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 15c9e5cbfcb..8bc04902737 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b25d9e5fd87..50cfe4acf50 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 @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0f4f13f311b..c89963f55a3 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 @@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 96177e75bb7..0c303bc782d 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 @@ -243,7 +243,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 daa467e228b..bf502a66a77 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 bc11d7e054d..a2c348cec20 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 @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 19e395f1de4..b6f300c9440 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (pig.BasquePig != null) { + if (pig.BasquePig != null) + { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } - if (pig.DanishPig != null) { + if (pig.DanishPig != null) + { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } 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 30edd0b77d2..ddea47edf40 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3d333d7958f..e8a2e243997 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (quadrilateral.SimpleQuadrilateral != null) { + if (quadrilateral.SimpleQuadrilateral != null) + { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } - if (quadrilateral.ComplexQuadrilateral != null) { + if (quadrilateral.ComplexQuadrilateral != null) + { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } 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 610005a0540..519ed66393c 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5ef0b044807..e31cd106e9b 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 @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 55c14ff4d5f..b210eda17b3 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 @@ -1696,7 +1696,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 30c6b4d7fe9..be6613f51ba 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 14e2d9ee12f..3aa505a85a8 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1e19e81e55c..8438c92cd00 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 47081ede38e..5c960eb5474 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d4883a363a2..c651ac7d245 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shape.Triangle != null) { + if (shape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } - if (shape.Quadrilateral != null) { + if (shape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } 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 3027d9142ba..37db5df6490 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2d9fb2cbb33..1f0b2203007 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shapeOrNull.Triangle != null) { + if (shapeOrNull.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } - if (shapeOrNull.Quadrilateral != null) { + if (shapeOrNull.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } 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 3fa8bdc1917..ffa68d1e75d 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0cc19a946de..46b1736614e 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5c64df495c1..534cf1792d7 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c5e4293dca4..86465fcc356 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 798a4b835c9..6b6e9d68ebc 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e6590dd351d..24953ff398c 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d31d2948c65..cf22051519a 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (triangle.EquilateralTriangle != null) { + if (triangle.EquilateralTriangle != null) + { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } - if (triangle.IsoscelesTriangle != null) { + if (triangle.IsoscelesTriangle != null) + { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } - if (triangle.ScaleneTriangle != null) { + if (triangle.ScaleneTriangle != null) + { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } 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 aa6d31b9190..0f13b0e7745 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ea5842d39f4..5b32ca28ab2 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 @@ -261,7 +261,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 258c1713bcc..2efd4b74790 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 @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 496d18a90ea..2d09b0683de 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 @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d2b2ebeeb83..56ffa075097 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 @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a94acc41bff..afb25a1c17e 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES @@ -55,7 +55,12 @@ docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md docs/models/Model200Response.md docs/models/ModelClient.md docs/models/Name.md @@ -186,7 +191,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 e4713d2621c..f772773afef 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/apis/FakeApi.md index 94cf293ed11..65edbb26576 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/apis/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedOneOf.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedSubId.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index fe8397be218..fba8b26855c 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -121,6 +121,28 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + /// /// Test TestAdditionalPropertiesReference /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 2bb291f16f5..1f45ab88e83 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -171,6 +171,48 @@ namespace Org.OpenAPITools.Api /// <?> Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <?> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <?> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// /// test referenced additionalProperties /// @@ -590,6 +632,30 @@ namespace Org.OpenAPITools.Api bool IsOk { get; } } + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// The /// @@ -871,6 +937,46 @@ namespace Org.OpenAPITools.Api OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler? OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler? OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2485,6 +2591,394 @@ namespace Org.OpenAPITools.Api partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedAnyOf? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf? Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : null; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk([NotNullWhen(true)]out Org.OpenAPITools.Model.MixedOneOf? result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); /// 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 bb5e0663eb8..03e2cd6ecb8 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 @@ -89,7 +89,12 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); _jsonOptions.Converters.Add(new NameJsonConverter()); @@ -190,7 +195,12 @@ namespace Org.OpenAPITools.Client new MammalSerializationContext(), new MapTestSerializationContext(), new MixLogSerializationContext(), + new MixedAnyOfSerializationContext(), + new MixedAnyOfContentSerializationContext(), + new MixedOneOfSerializationContext(), + new MixedOneOfContentSerializationContext(), new MixedPropertiesAndAdditionalPropertiesClassSerializationContext(), + new MixedSubIdSerializationContext(), new Model200ResponseSerializationContext(), new ModelClientSerializationContext(), new NameSerializationContext(), 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 5b176f5847b..a3c5140abd6 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c1d4719e88..9dd5a864a2c 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 6213c117b3d..542352a31e1 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 @@ -196,7 +196,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 950bb12e8ce..29470ef10dc 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 @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 fe7efa6f1aa..cb696effdaa 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 71ef8c147c4..7549badbe8b 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.ColorCodeOption.Value != null) { // ColorCode (string) pattern 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 7e88ecdde6b..dc1b92a5210 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b19b1457e95..8c008410362 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 db1e09392db..3a7e1a974b9 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d2b761acf71..5f3ffe4d7a5 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 57ed00dc715..2c7bab3cc69 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c3b455b4d8..e3ff7239bbe 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 51068cfa79a..cdd31db8f50 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 @@ -76,7 +76,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 052c859a180..e36470f2b81 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 @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 90e66ff54e4..4778d98285d 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 @@ -92,7 +92,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0a3fdbfb454..6a6b3130575 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 07c7479edd9..acf1f351fe7 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e1f21a8c8d4..c54e2bd3ea8 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 @@ -76,7 +76,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c6c77d2d6a8..27fc2601fbe 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f2fecb27023..bf3e1f51f96 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f748a54b972..03e32665de1 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 @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 da63470bbc7..293722d5ad4 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 @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d7d03540d33..dbd6205c64d 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 @@ -688,7 +688,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 39b32f1ba22..ca7a8101de8 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 cc0ffd3e033..de91aef9d16 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c48ca22ddc8..d63c1057d8e 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 65826736eb9..54251b882ce 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ca7d6abeade..c3649d3e68a 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2274b53efdf..5c1aad8e009 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 @@ -349,78 +349,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } // Double (double) maximum if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } // Float (float) maximum if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Int32 (int) maximum if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } if (this.PatternWithBackslashOption.Value != null) { @@ -466,13 +466,13 @@ namespace Org.OpenAPITools.Model // UnsignedInteger (uint) maximum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } yield break; 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 3331b736cfc..81a28a49154 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c2942aea0f4..1f75be50f94 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 112112a55b5..b42ed4be5b6 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 @@ -103,7 +103,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 12a7ac828e2..aecc4dfbc8f 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 @@ -74,7 +74,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 4b3fca9fef5..add0331748c 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 @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 cff257a9cb5..62ac63ae401 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fdc2bd927d0..df5fac5540b 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 @@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e188a49d3f5..3ca232e632c 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5fa48501291..7a36a5eb8b1 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 15c63b5d785..fe273665e2c 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 @@ -103,7 +103,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -113,7 +113,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -235,17 +235,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (mammal.Whale != null) { + if (mammal.Whale != null) + { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } - if (mammal.Zebra != null) { + if (mammal.Zebra != null) + { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } - if (mammal.Pig != null) { + if (mammal.Pig != null) + { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } 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 ce7434b68fa..33e76d1ec1c 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 @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 2b06f1ac25c..cd2caeeb460 100644 --- 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 @@ -532,7 +532,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..8ffd3984ece --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent? Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } + + /// + /// The MixedAnyOfSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixedAnyOf))] + public partial class MixedAnyOfSerializationContext : JsonSerializerContext { } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..d2aacd99196 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,293 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId? MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string? varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId? mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } + + /// + /// The MixedAnyOfContentSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixedAnyOfContent))] + public partial class MixedAnyOfContentSerializationContext : JsonSerializerContext { } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..0fc4606a026 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -0,0 +1,188 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent? Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } + + /// + /// The MixedOneOfSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixedOneOf))] + public partial class MixedOneOfSerializationContext : JsonSerializerContext { } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..8ea30fde6f8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -0,0 +1,271 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string? String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId? MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string? varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId? mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } + + /// + /// The MixedOneOfContentSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixedOneOfContent))] + public partial class MixedOneOfContentSerializationContext : 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 f91b244db08..ca911a253c5 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 @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..609e8d8975a --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,184 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string? Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()!); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } + + /// + /// The MixedSubIdSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixedSubId))] + public partial class MixedSubIdSerializationContext : JsonSerializerContext { } +} 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 de2a2d525d2..ce2d9847434 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fd3eb29a78f..b3593a4f13f 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2ded0896855..dd8ffd5fbe2 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 @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c74bf13f6d0..e3a042f07ea 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ab7911eb6cf..f3977fa9159 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 @@ -259,7 +259,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d037c1a335c..beeb70f886e 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 @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 db1d9df8102..25248c75ffa 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 @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -211,12 +211,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (nullableShape.Triangle != null) { + if (nullableShape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } - if (nullableShape.Quadrilateral != null) { + if (nullableShape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } 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 7bd636d8289..bb83e5ce0ae 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 38f7842d561..5f539ba4ca5 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 @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 fd4bc86610d..269f97ae4fd 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 56e17adb08d..c8a0ba99fae 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 @@ -246,7 +246,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0fbfdb54577..9cd06cdea47 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 59d97689491..6cf611c0c26 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 @@ -232,7 +232,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 88ffcca1004..57c4f9a9121 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 @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -211,12 +211,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (pig.BasquePig != null) { + if (pig.BasquePig != null) + { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } - if (pig.DanishPig != null) { + if (pig.DanishPig != null) + { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } 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 d61a3a66921..9e1aaafe221 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 @@ -118,7 +118,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 21f614134e6..8e308392490 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 @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -211,12 +211,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (quadrilateral.SimpleQuadrilateral != null) { + if (quadrilateral.SimpleQuadrilateral != null) + { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } - if (quadrilateral.ComplexQuadrilateral != null) { + if (quadrilateral.ComplexQuadrilateral != null) + { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } 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 31c5940d678..3d15636fda9 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 @@ -76,7 +76,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 8bd857e6615..1de8c9245ac 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 @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4c6f513d242..441b3c0f879 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 @@ -1699,7 +1699,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9a55385c9e0..a5c58d328fc 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 @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ea51c691836..bb1fee26ad8 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 77edc76a3bd..9d38127abb6 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 907253b6f63..6ce8c2b68a1 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 329de390e64..71620d915bb 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 @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -211,12 +211,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shape.Triangle != null) { + if (shape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } - if (shape.Quadrilateral != null) { + if (shape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } 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 d7f2f03ff8f..3070f52be3a 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 @@ -76,7 +76,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 01c4ee1e1ee..37b5fddee5e 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 @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -211,12 +211,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shapeOrNull.Triangle != null) { + if (shapeOrNull.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } - if (shapeOrNull.Quadrilateral != null) { + if (shapeOrNull.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } 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 e90f8b8b619..61ff978f3c2 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4d1c3620090..4341901b005 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 43fe662b51c..d3b5318845a 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 @@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 323771bb32f..0de18814ed6 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a854b4855ce..ac6370d9908 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b95a9882657..93af1b2eaa5 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 @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b450383d335..5c249041025 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 @@ -103,7 +103,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -113,7 +113,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -235,17 +235,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (triangle.EquilateralTriangle != null) { + if (triangle.EquilateralTriangle != null) + { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } - if (triangle.IsoscelesTriangle != null) { + if (triangle.IsoscelesTriangle != null) + { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } - if (triangle.ScaleneTriangle != null) { + if (triangle.ScaleneTriangle != null) + { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } 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 d88f6c5af41..a2ef4da28f5 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 @@ -76,7 +76,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 018dfd66521..b428f67faa2 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 @@ -264,7 +264,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0e794d7a1a6..1ed56657bd6 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 @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d481b0386d8..a139b2aadf2 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 @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f108e118e0f..72282fc6b0b 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 @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 00986383cd2..eb0c0a2b6fd 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 @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 be38ed26d98..0bf16fb19b7 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 @@ -55,7 +55,12 @@ docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixLog.md +docs/models/MixedAnyOf.md +docs/models/MixedAnyOfContent.md +docs/models/MixedOneOf.md +docs/models/MixedOneOfContent.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/MixedSubId.md docs/models/Model200Response.md docs/models/ModelClient.md docs/models/Name.md @@ -184,7 +189,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 e4713d2621c..f772773afef 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 @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/apis/FakeApi.md index 46abf3716ff..959c6b75e78 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/apis/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedAnyOf.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedAnyOf.md new file mode 100644 index 00000000000..2e9a2ca23f6 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/MixedAnyOfContent.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedAnyOfContent.md new file mode 100644 index 00000000000..141ffe5a41d --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedAnyOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedOneOf.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedOneOf.md new file mode 100644 index 00000000000..6cb1d5adff0 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/MixedOneOfContent.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedOneOfContent.md new file mode 100644 index 00000000000..168d5ee8362 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedOneOfContent.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../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/MixedSubId.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedSubId.md new file mode 100644 index 00000000000..1df3d4002bf --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index ee61aa92963..0cabe51ed28 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,28 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test GetMixedAnyOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedAnyOfAsyncTest() + { + var response = await _instance.GetMixedAnyOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + + /// + /// Test GetMixedOneOf + /// + [Fact (Skip = "not implemented")] + public async Task GetMixedOneOfAsyncTest() + { + var response = await _instance.GetMixedOneOfAsync(); + var model = response.Ok(); + Assert.IsType(model); + } + /// /// Test TestAdditionalPropertiesReference /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..4ce302d1d04 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..53b28cc0658 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..781b7202500 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //Assert.IsType(instance); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..ee8b73d44f2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} 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 new file mode 100644 index 00000000000..2ed728a41b8 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs @@ -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 + * 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/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index ad69a02434e..e386a6d5809 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -168,6 +168,48 @@ namespace Org.OpenAPITools.Api /// <> Task GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> + Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + /// /// test referenced additionalProperties /// @@ -587,6 +629,30 @@ namespace Org.OpenAPITools.Api bool IsOk { get; } } + /// + /// The + /// + public interface IGetMixedAnyOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + + /// + /// The + /// + public interface IGetMixedOneOfApiResponse : Org.OpenAPITools.Client.IApiResponse, IOk + { + /// + /// Returns true if the response is 200 Ok + /// + /// + bool IsOk { get; } + } + /// /// The /// @@ -868,6 +934,46 @@ namespace Org.OpenAPITools.Api OnErrorGetArrayOfEnums?.Invoke(this, new ExceptionEventArgs(exception)); } + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedAnyOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedAnyOf; + + internal void ExecuteOnGetMixedAnyOf(FakeApi.GetMixedAnyOfApiResponse apiResponse) + { + OnGetMixedAnyOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedAnyOf(Exception exception) + { + OnErrorGetMixedAnyOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + + /// + /// The event raised after the server response + /// + public event EventHandler OnGetMixedOneOf; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorGetMixedOneOf; + + internal void ExecuteOnGetMixedOneOf(FakeApi.GetMixedOneOfApiResponse apiResponse) + { + OnGetMixedOneOf?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnErrorGetMixedOneOf(Exception exception) + { + OnErrorGetMixedOneOf?.Invoke(this, new ExceptionEventArgs(exception)); + } + /// /// The event raised after the server response /// @@ -2476,6 +2582,392 @@ namespace Org.OpenAPITools.Api partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); } + /// + /// Processes the server response + /// + /// + private void AfterGetMixedAnyOfDefaultImplementation(IGetMixedAnyOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedAnyOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedAnyOf(ref bool suppressDefaultLog, IGetMixedAnyOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedAnyOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedAnyOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedAnyOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type anyOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedAnyOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/anyOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedAnyOfApiResponse apiResponseLocalVar = new GetMixedAnyOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/anyOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedAnyOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedAnyOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedAnyOfDefaultImplementation(e, "/fake/mixed/anyOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedAnyOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedAnyOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedAnyOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedAnyOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedAnyOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedAnyOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + + /// + /// Processes the server response + /// + /// + private void AfterGetMixedOneOfDefaultImplementation(IGetMixedOneOfApiResponse apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterGetMixedOneOf(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterGetMixedOneOf(ref bool suppressDefaultLog, IGetMixedOneOfApiResponse apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorGetMixedOneOfDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorGetMixedOneOf(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorGetMixedOneOf(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// Test mixed type oneOf deserialization + /// + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await GetMixedOneOfAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/mixed/oneOf"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ILogger apiResponseLoggerLocalVar = LoggerFactory.CreateLogger(); + + GetMixedOneOfApiResponse apiResponseLocalVar = new GetMixedOneOfApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/mixed/oneOf", requestedAtLocalVar, _jsonSerializerOptions); + + AfterGetMixedOneOfDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnGetMixedOneOf(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorGetMixedOneOfDefaultImplementation(e, "/fake/mixed/oneOf", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorGetMixedOneOf(e); + throw; + } + } + + /// + /// The + /// + public partial class GetMixedOneOfApiResponse : Org.OpenAPITools.Client.ApiResponse, IGetMixedOneOfApiResponse + { + /// + /// The logger + /// + public ILogger Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public GetMixedOneOfApiResponse(ILogger logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Returns true if the response is 200 Ok + /// + /// + public bool IsOk => 200 == (int)StatusCode; + + /// + /// Deserializes the response if the response is 200 Ok + /// + /// + public Org.OpenAPITools.Model.MixedOneOf Ok() + { + // This logic may be modified with the AsModel.mustache template + return IsOk + ? System.Text.Json.JsonSerializer.Deserialize(RawContent, _jsonSerializerOptions) + : default; + } + + /// + /// Returns true if the response is 200 Ok and the deserialized response is not null + /// + /// + /// + public bool TryOk(out Org.OpenAPITools.Model.MixedOneOf result) + { + result = null; + + try + { + result = Ok(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode)200); + } + + return result != null; + } + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + } + partial void FormatTestAdditionalPropertiesReference(Dictionary requestBody); /// 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 8ea6690254f..e12f1ae9779 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 @@ -85,7 +85,12 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixLogJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedAnyOfContentJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfJsonConverter()); + _jsonOptions.Converters.Add(new MixedOneOfContentJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); + _jsonOptions.Converters.Add(new MixedSubIdJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); _jsonOptions.Converters.Add(new NameJsonConverter()); 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 2e4d5cb3bb8..428d69dd8ea 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b24ba867898..8ae65f50c23 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 dcc268fc3a8..d7857e4aad8 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 @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 29362b0ca36..6abbd41a281 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 @@ -87,7 +87,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 f63a202f397..f6fa613cbbb 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 87e58a00021..e0c09dbf5f6 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.ColorCodeOption.Value != null) { // ColorCode (string) pattern 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 6a2e8b75f6d..7f69b627038 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d66d69222da..9f6f55f4bc9 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7ec6a05f242..3e38c89877d 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0ae28dc07d5..8ddbe4d6309 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f8f25778428..8fc9c71c574 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 848e8164b4a..e4a3a99aafa 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 863cc82bc78..9938d89e008 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f24497e3ad6..ddf4f67e04c 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 @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 667e094c6ff..1708429172a 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 @@ -89,7 +89,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9e254109cfc..cf37657bf45 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1a42f967ca9..3023a45610e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9eb8b733358..14b2ed3b153 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c82942faae7..62bd07a9513 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 064985cce43..661b1e7c2c4 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 13fe9ec2c1a..70ff3517f49 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a0b7504e9d2..1e0b0d1c226 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 @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 dc39f92290d..0d657779fdc 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 @@ -685,7 +685,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b84f89b531d..d65c7740e5e 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 95403fdaf96..8d88c790110 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4906accc7ed..8610cbae21d 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a78d7a84f34..659b93c0913 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4564148c4d9..205b2f3f897 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 09b13bde9f7..3fc88d4d403 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 @@ -346,78 +346,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } // Double (double) maximum if (this.DoubleOption.IsSet && this.DoubleOption.Value > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.DoubleOption.IsSet && this.DoubleOption.Value < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } // Float (float) maximum if (this.FloatOption.IsSet && this.FloatOption.Value > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.FloatOption.IsSet && this.FloatOption.Value < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Int32 (int) maximum if (this.Int32Option.IsSet && this.Int32Option.Value > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32Option.IsSet && this.Int32Option.Value < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.IntegerOption.IsSet && this.IntegerOption.Value < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } if (this.PatternWithBackslashOption.Value != null) { @@ -463,13 +463,13 @@ namespace Org.OpenAPITools.Model // UnsignedInteger (uint) maximum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedIntegerOption.IsSet && this.UnsignedIntegerOption.Value < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } yield break; 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 8e650b7b07c..0302533cd2f 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f5dd6d56278..1e72875d4d3 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 @@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 14d47fa3293..e2eb2c897a9 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 86246ae5457..838cae14f98 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 @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } 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 88c5d4274ea..680ead387fb 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 @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4f9c831edc2..112f55c9ab8 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 384e48f3a15..cce85952411 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 @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 07fcd017a68..acadb2f2842 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c5fc2e2e77c..bfcbb4465fa 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1be5661d993..267ac8769d3 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (mammal.Whale != null) { + if (mammal.Whale != null) + { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } - if (mammal.Zebra != null) { + if (mammal.Zebra != null) + { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } - if (mammal.Pig != null) { + if (mammal.Pig != null) + { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } 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 6be561e42f1..3ea97b6d839 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 @@ -194,7 +194,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 75cdeb1ec5b..0f3a07debfe 100644 --- 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 @@ -529,7 +529,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..74047904b27 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + public partial class MixedAnyOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedAnyOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedAnyOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedAnyOf."); + + return new MixedAnyOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedAnyOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOf mixedAnyOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedAnyOf.ContentOption.IsSet && mixedAnyOf.Content == null) + throw new ArgumentNullException(nameof(mixedAnyOf.Content), "Property is required for class MixedAnyOf."); + + if (mixedAnyOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedAnyOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..b335b252782 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,283 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// Mixed anyOf types for testing + /// + public partial class MixedAnyOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public MixedAnyOfContent(Option @string, Option @bool, Option @int, Option @decimal, Option mixedSubId) + { + StringOption = @string; + BoolOption = @bool; + IntOption = @int; + DecimalOption = @decimal; + MixedSubIdOption = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of String + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option StringOption { get; private set; } + + /// + /// Gets or Sets String + /// + public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + + /// + /// Used to track the state of Bool + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BoolOption { get; private set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get { return this.BoolOption; } set { this.BoolOption = new Option(value); } } + + /// + /// Used to track the state of Int + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IntOption { get; private set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get { return this.IntOption; } set { this.IntOption = new Option(value); } } + + /// + /// Used to track the state of Decimal + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DecimalOption { get; private set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get { return this.DecimalOption; } set { this.DecimalOption = new Option(value); } } + + /// + /// Used to track the state of MixedSubId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option MixedSubIdOption { get; private set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get { return this.MixedSubIdOption; } set { this.MixedSubIdOption = 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 MixedAnyOfContent {\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 MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedAnyOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + Option varStringParsedValue = varString == null + ? default + : new Option(varString); + Option varBoolParsedValue = varBool == null + ? default + : new Option(varBool); + Option varIntParsedValue = varInt == null + ? default + : new Option(varInt); + Option varDecimalParsedValue = varDecimal == null + ? default + : new Option(varDecimal); + Option mixedSubIdParsedValue = mixedSubId == null + ? default + : new Option(mixedSubId); + + return new MixedAnyOfContent(varStringParsedValue, varBoolParsedValue, varIntParsedValue, varDecimalParsedValue, mixedSubIdParsedValue); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + if (mixedAnyOfContent.StringOption.IsSet && mixedAnyOfContent.StringOption.Value != null) + writer.WriteString("content", mixedAnyOfContent.StringOption.Value); + + if (mixedAnyOfContent.BoolOption.IsSet && mixedAnyOfContent.BoolOption.Value != null) + writer.WriteBoolean("content", mixedAnyOfContent.BoolOption.Value.Value); + + if (mixedAnyOfContent.IntOption.IsSet && mixedAnyOfContent.IntOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.IntOption.Value.Value); + + if (mixedAnyOfContent.DecimalOption.IsSet && mixedAnyOfContent.DecimalOption.Value != null) + writer.WriteNumber("content", mixedAnyOfContent.DecimalOption.Value.Value); + + if (mixedAnyOfContent.MixedSubIdOption.IsSet && mixedAnyOfContent.MixedSubIdOption.Value != null) + { + MixedSubIdJsonConverter MixedSubIdJsonConverter = (MixedSubIdJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mixedAnyOfContent.MixedSubIdOption.Value.GetType())); + MixedSubIdJsonConverter.WriteProperties(writer, mixedAnyOfContent.MixedSubIdOption.Value, jsonSerializerOptions); + } + + WriteProperties(writer, mixedAnyOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedAnyOfContent mixedAnyOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..7b435033f6c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + public partial class MixedOneOf : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content + [JsonConstructor] + public MixedOneOf(Option content = default) + { + ContentOption = content; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Content + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ContentOption { get; private set; } + + /// + /// Gets or Sets Content + /// + [JsonPropertyName("content")] + public MixedOneOfContent Content { get { return this.ContentOption; } set { this.ContentOption = 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOfJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOf 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 content = 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 "content": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + default: + break; + } + } + } + + if (content.IsSet && content.Value == null) + throw new ArgumentNullException(nameof(content), "Property is not nullable for class MixedOneOf."); + + return new MixedOneOf(content); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOf, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOf mixedOneOf, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedOneOf.ContentOption.IsSet && mixedOneOf.Content == null) + throw new ArgumentNullException(nameof(mixedOneOf.Content), "Property is required for class MixedOneOf."); + + if (mixedOneOf.ContentOption.IsSet) + { + writer.WritePropertyName("content"); + JsonSerializer.Serialize(writer, mixedOneOf.Content, jsonSerializerOptions); + } + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..4cb69dae28c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -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 + * 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 +{ + /// + /// Mixed oneOf types for testing + /// + public partial class MixedOneOfContent : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(string @string) + { + String = @string; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(bool @bool) + { + Bool = @bool; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(int @int) + { + Int = @int; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(decimal @decimal) + { + Decimal = @decimal; + OnCreated(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + public MixedOneOfContent(MixedSubId mixedSubId) + { + MixedSubId = mixedSubId; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets String + /// + public string String { get; set; } + + /// + /// Gets or Sets Bool + /// + public bool? Bool { get; set; } + + /// + /// Gets or Sets Int + /// + public int? Int { get; set; } + + /// + /// Gets or Sets Decimal + /// + public decimal? Decimal { get; set; } + + /// + /// Gets or Sets MixedSubId + /// + public MixedSubId MixedSubId { get; set; } + + /// + /// 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 MixedOneOfContent {\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 MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedOneOfContent 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; + + string varString = default; + bool? varBool = default; + int? varInt = default; + decimal? varDecimal = default; + MixedSubId mixedSubId = default; + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) + { + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); + + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); + + Utf8JsonReader utf8JsonReaderInt = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderInt, jsonSerializerOptions, out varInt); + + Utf8JsonReader utf8JsonReaderDecimal = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderDecimal, jsonSerializerOptions, out varDecimal); + + Utf8JsonReader utf8JsonReaderMixedSubId = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderMixedSubId, jsonSerializerOptions, out mixedSubId); + } + } + + 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) + { + default: + break; + } + } + } + + if (varString != null) + return new MixedOneOfContent(varString); + + if (varBool != null) + return new MixedOneOfContent(varBool.Value); + + if (varInt != null) + return new MixedOneOfContent(varInt.Value); + + if (varDecimal != null) + return new MixedOneOfContent(varDecimal.Value); + + if (mixedSubId != null) + return new MixedOneOfContent(mixedSubId); + + throw new JsonException(); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedOneOfContent, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedOneOfContent mixedOneOfContent, JsonSerializerOptions jsonSerializerOptions) + { + + } + } +} 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 095c00f4562..d3cb505539d 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 @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..1af8feed0a9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -0,0 +1,174 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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 +{ + /// + /// MixedSubId + /// + public partial class MixedSubId : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id + [JsonConstructor] + public MixedSubId(Option id = default) + { + IdOption = id; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Used to track the state of Id + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option IdOption { get; private set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public string Id { get { return this.IdOption; } set { this.IdOption = 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubIdJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixedSubId 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 id = 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 "id": + id = new Option(utf8JsonReader.GetString()); + break; + default: + break; + } + } + } + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixedSubId."); + + return new MixedSubId(id); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixedSubId, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixedSubId mixedSubId, JsonSerializerOptions jsonSerializerOptions) + { + if (mixedSubId.IdOption.IsSet && mixedSubId.Id == null) + throw new ArgumentNullException(nameof(mixedSubId.Id), "Property is required for class MixedSubId."); + + if (mixedSubId.IdOption.IsSet) + writer.WriteString("id", mixedSubId.Id); + } + } +} 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 8c0a59ace8b..30ee980fae9 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 e8cca355d28..28da419bb21 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 90a80bda881..f353f694fb2 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 @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d10268f2927..ea8abdda0d7 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 f844fec808c..ff026f1fbb4 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 @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ef86eb595ac..8c52be7e14a 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 @@ -81,7 +81,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 10061a2c228..9a93cb734e9 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (nullableShape.Triangle != null) { + if (nullableShape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } - if (nullableShape.Quadrilateral != null) { + if (nullableShape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } 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 2b602ec80d7..923180c653b 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 5cc97e836da..e25bbf00940 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 @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 0f4f13f311b..c89963f55a3 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 @@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 8d0ff121213..f12f2affef3 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 @@ -243,7 +243,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 bb1af321865..dbf262b28c3 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 @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ec63640215f..ef5f3c898b6 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 @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 19e395f1de4..b6f300c9440 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (pig.BasquePig != null) { + if (pig.BasquePig != null) + { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } - if (pig.DanishPig != null) { + if (pig.DanishPig != null) + { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } 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 30edd0b77d2..ddea47edf40 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 @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 3d333d7958f..e8a2e243997 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (quadrilateral.SimpleQuadrilateral != null) { + if (quadrilateral.SimpleQuadrilateral != null) + { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } - if (quadrilateral.ComplexQuadrilateral != null) { + if (quadrilateral.ComplexQuadrilateral != null) + { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } 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 610005a0540..519ed66393c 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 87358abb827..afb58fb0e41 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 @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 dda8b3ba8a8..fdc63ca701d 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 @@ -1696,7 +1696,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b294720b331..25b3b73e9c0 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 @@ -114,7 +114,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 494ee791a24..1adc0bbf76b 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 4d0df8c9fc4..866b9fa4871 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 47081ede38e..5c960eb5474 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d4883a363a2..c651ac7d245 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shape.Triangle != null) { + if (shape.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } - if (shape.Quadrilateral != null) { + if (shape.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } 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 3027d9142ba..37db5df6490 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2d9fb2cbb33..1f0b2203007 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 @@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -208,12 +208,14 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (shapeOrNull.Triangle != null) { + if (shapeOrNull.Triangle != null) + { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } - if (shapeOrNull.Quadrilateral != null) { + if (shapeOrNull.Quadrilateral != null) + { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } 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 3fa8bdc1917..ffa68d1e75d 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 @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 9b44556fcb0..8f3593c5f41 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 91ee6000335..e1678abe491 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 @@ -96,7 +96,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1821b112bfb..f4fca096217 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 433bfa41bae..6c324e6ef4f 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1cb26beb934..3bf95d67c57 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 @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 d31d2948c65..cf22051519a 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 @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -110,7 +110,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } @@ -232,17 +232,20 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - if (triangle.EquilateralTriangle != null) { + if (triangle.EquilateralTriangle != null) + { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } - if (triangle.IsoscelesTriangle != null) { + if (triangle.IsoscelesTriangle != null) + { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } - if (triangle.ScaleneTriangle != null) { + if (triangle.ScaleneTriangle != null) + { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } 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 aa6d31b9190..0f13b0e7745 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 @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 a2f3e4a18a6..21eff6d47a0 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 @@ -261,7 +261,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b93046c5457..6d1afa8b592 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 @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 c09d71736d1..5463ed953c9 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 @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 6e6bf0004c2..e7431416064 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 @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 1eeeb080e6f..8ad42be271f 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 @@ -52,7 +52,12 @@ docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixLog.md +docs/MixedAnyOf.md +docs/MixedAnyOfContent.md +docs/MixedOneOf.md +docs/MixedOneOfContent.md docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/MixedSubId.md docs/Model200Response.md docs/ModelClient.md docs/Name.md @@ -173,7 +178,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 98d0095933e..590ccf31607 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md @@ -141,6 +141,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**GetMixedAnyOf**](docs/FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization +*FakeApi* | [**GetMixedOneOf**](docs/FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization *FakeApi* | [**TestAdditionalPropertiesReference**](docs/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -225,7 +227,12 @@ Class | Method | HTTP request | Description - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixLog](docs/MixLog.md) + - [Model.MixedAnyOf](docs/MixedAnyOf.md) + - [Model.MixedAnyOfContent](docs/MixedAnyOfContent.md) + - [Model.MixedOneOf](docs/MixedOneOf.md) + - [Model.MixedOneOfContent](docs/MixedOneOfContent.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.MixedSubId](docs/MixedSubId.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.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 e4713d2621c..f772773afef 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 @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FakeApi.md b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FakeApi.md index 754a08ec027..bedc98a6492 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -573,6 +575,182 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new FakeApi(httpClient, config, httpClientHandler); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new FakeApi(httpClient, config, httpClientHandler); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 84983f84495..93f2fed8009 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -146,6 +146,38 @@ namespace Org.OpenAPITools.Api /// ApiResponse of List<OuterEnum> ApiResponse> GetArrayOfEnumsWithHttpInfo(); /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// MixedAnyOf + MixedAnyOf GetMixedAnyOf(); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedAnyOf + ApiResponse GetMixedAnyOfWithHttpInfo(); + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// MixedOneOf + MixedOneOf GetMixedOneOf(); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedOneOf + ApiResponse GetMixedOneOfWithHttpInfo(); + /// /// test referenced additionalProperties /// /// Thrown when fails to make API call @@ -595,6 +627,48 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (List<OuterEnum>) System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + System.Threading.Tasks.Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + System.Threading.Tasks.Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test referenced additionalProperties /// /// @@ -1797,6 +1871,208 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// MixedAnyOf + public MixedAnyOf GetMixedAnyOf() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedAnyOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedAnyOf + public Org.OpenAPITools.Client.ApiResponse GetMixedAnyOfWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + public async System.Threading.Tasks.Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedAnyOfWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + public async System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// MixedOneOf + public MixedOneOf GetMixedOneOf() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedOneOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedOneOf + public Org.OpenAPITools.Client.ApiResponse GetMixedOneOfWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + public async System.Threading.Tasks.Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedOneOfWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + public async System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// test referenced additionalProperties /// diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs index f80ff387681..b56f6881505 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 383824e58c7..cf1bbf23cea 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 78209b634de..7db32a24579 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs index b770a965366..80bf3adb7aa 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 78d6bab5e0e..296753574ed 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 2728aa9a25a..546300d9857 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index ba8e82f6561..85ba742ea8e 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,7 +132,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index df188f37a56..158143cec18 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 81c92eaa9e3..a103c5b9f76 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 8a23557a185..521f6e10d68 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 451d86897cc..55a7b982dfd 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 56437177c9b..7afbe08ac12 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 715b02a0cb5..dd5b5d07b0a 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index 39630f97eee..10031dc7568 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 29f8e087632..cec47afe1f2 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -144,7 +144,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs index 92158e22999..0057441d885 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 8b003f6b9af..96a00c78f2f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 385c0f087a8..36b14908818 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 15f0ce0a64f..1cef53d2c8a 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index e10104c287d..5a777565eb3 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index c5acaa19ec4..92a3adc8c27 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 3e364cc0c6f..e6791fbe07a 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 79791c62e40..ffd89a5334e 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 29446e5dc84..73b84634c4d 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 646fecaa4df..ad688b4d11b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 496b0cf08f9..3309623635c 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -370,7 +370,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 0220beeae23..1972d8ba56b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs index 089499517dc..ca5877d2f8e 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index ff5e44d98a4..2e37282c600 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 0622c6e23b5..10c97e7ed29 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index e491ad5a235..2619543bb53 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index ebaad5a1e0d..5781be7cf5b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -356,78 +356,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -442,13 +442,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index d85751aa172..97f474eab71 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 8e04deec3f3..20413cb2d86 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index f71696c08ae..737cd420ac3 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -42,9 +42,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -54,9 +54,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -75,11 +75,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -95,7 +95,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -105,7 +105,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -116,7 +116,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -127,7 +127,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -201,8 +201,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index fcbed17b423..ff2b810c644 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -141,7 +141,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 79815e1812e..8ac3489e8b7 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index c65fbeef844..fc344e4373f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index efdc5b988c8..2bcb331dedd 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs index a2363749c39..b84038f9fcf 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index eaa4c72410f..db0dc595908 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index c7adc58517c..71ae8a22185 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -86,15 +86,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 0961fd54d04..5255a249aba 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 8ac07408897..31e0e4e46e3 100644 --- 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 @@ -534,7 +534,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index a24d6d59d78..889b927982c 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index 9246bd37981..b8d4fffa4b5 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -42,9 +42,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -54,9 +54,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -66,9 +66,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -78,9 +78,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -90,9 +90,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -111,23 +111,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -183,7 +183,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -194,7 +194,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -205,7 +205,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -315,8 +315,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index a849aa8eefe..576cb29d578 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index b077d0a7b6a..241a53bfbe4 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -109,23 +109,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 7aae060d7a4..254ccb20d12 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs index a12a31aa13a..a644d274480 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index 284b5b4f6e3..34aee45d4c8 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index f13e61a7ea5..2523c65536f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs index 0a5d1bb7ac4..47c0de87811 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index 8cd4fc939ad..a08db8b6648 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index bb695d4dfb2..8508046165f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -268,7 +268,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index f6f5c162ae3..ef4df456bd1 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index b4a865094f0..9342811826c 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -83,11 +83,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index 8b4bd992e77..a287358b015 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 34c6090d7fb..db530572625 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index 9da14f87d7e..46b9d6f16c7 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -61,7 +61,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs index 983eab2864a..c995bf5d39b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -202,7 +202,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 2950ad95a56..91a61870eea 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -144,7 +144,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index 9f866c87f8b..98e7574e092 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs index ede740371eb..2d13379fd74 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs index 55f89cc00b0..9003f3a19ef 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index a6f17110c4f..8315c6ddb7b 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -97,19 +97,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index e88706b57c5..673969c6ec9 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index f198bec3257..8e87f3b369f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 89f41da2fbe..8fd8dcd0dce 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 919ae3fc0fe..3d5eaf99a7d 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1034,7 +1034,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs index f85c7ed35e7..6a9590cc8f4 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index b442fc8ccd9..43f205a0529 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 8b489e260da..217f538e0a9 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 3d10531a27b..be7027373c7 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs index 2db1b667941..baf7c736005 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index 096d9e7b33c..41366a1d82d 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 785941e64e2..77cc69fcdf3 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -83,11 +83,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 811b72e4cdd..f775230a9b1 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 514b1d9c077..e1e27974a67 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs index de31cf796c3..ab8f5e0db09 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index e2d620fa1c5..ca1cb65fcb2 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 36ebfc80f52..b5a65aac025 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index db14de1df9c..7b15b134045 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index f1e8edba835..bd8e6abfd66 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -86,15 +86,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index be6a19dd7a7..acdf3e8a050 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs index 1185416ea8b..2356f9020cc 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -266,7 +266,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 27581a3e514..1a6e079fdab 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index ebb1e730433..08064bb5591 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 01599f032cd..3dbc0012d59 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs index 4482bbdbfbc..7d3e7d96adf 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,13 +22,16 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -69,10 +72,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +120,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +131,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,13 +153,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +206,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +263,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +378,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +388,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,31 +439,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -463,6 +474,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -473,27 +485,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -551,104 +550,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -661,7 +636,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -676,7 +651,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -691,7 +666,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -706,7 +681,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -721,7 +696,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -736,7 +711,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -751,7 +726,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index b0da60f1df6..516b93d2f6a 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Configuration.cs index b79f1a1a38c..26df7661dd5 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Configuration.cs @@ -294,6 +294,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -622,6 +628,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index cc6fc6c592c..063daeb1b56 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/ApiResponse.cs index 5fabc42ec82..ef964fd4e87 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Category.cs index 968c28f9a2c..663e49f1b1c 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Category.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Name != null) { // Name (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Order.cs index 28e758d60ff..4c049227f84 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Order.cs @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Pet.cs index 237cff84e24..f42bc15e455 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Pet.cs @@ -214,7 +214,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Tag.cs index 4f4f4949eb1..8ac7c07be0a 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/Tag.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/User.cs index ba02e3d2f79..91ba71b2274 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Model/User.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index b10e49166a6..a55d7f34afc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,8 +28,10 @@ using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -70,10 +72,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -118,7 +120,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -129,7 +131,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -151,13 +153,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -204,7 +206,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -261,14 +263,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -376,7 +378,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -386,6 +388,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -430,31 +439,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -464,6 +474,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -474,27 +485,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -552,104 +550,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -662,7 +636,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -677,7 +651,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -692,7 +666,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -707,7 +681,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -722,7 +696,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -737,7 +711,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -752,7 +726,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..d7fb1293b34 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index f27abb3d78b..b213df44c00 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -399,6 +399,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -736,6 +742,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..8713a816f35 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs index 3c5a860dd89..08a39249cb8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 0640bc68500..dce3f9134db 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ddec6a58568..c83597fc607 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs index 78077d2bed4..9ddb56ebad6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 6d70e97a51c..e55d523aad1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 5ff006145c2..8d3f9af56df 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 16df556db5d..3eef221be3e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 06e930e774c..3e1666ca90f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index da8a65b26f5..f2946f435b5 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3e823100067..343e486f657 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 70aeea02471..04d69550656 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 6a4edb3394d..360cb5281e8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 838f5741cf6..868cba98eee 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index bd317ad8747..f46fffa0ad6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 49a0dc8ada3..a427b55727d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs index 2313431e4d6..5edb4edfea4 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 8e76f168a65..a5d404bd17d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 61119cfffe0..7a0846aec4e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 4c1b999c7f1..bbed2128374 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index 3c1138fe977..3c81f50d00d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index d618b5ba110..9933ec57ea9 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1a6841a713c..2895d518a81 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 32f2bbd7fa7..44f95fa0fe0 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 1d18a58b117..98c683539e6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 61591e9174d..2bec93345bb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index de9905a5d94..27d1193954e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -369,7 +369,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ab16133fe4b..7fb0e209454 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs index cf3b18a81c8..72b34e49262 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index ae9d8e1c05a..cd75dba4a92 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 570e3de7f65..3108c8a8691 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index fbed359747a..1ce81eece3e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 58d398101c8..7158640c24e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -355,78 +355,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -441,13 +441,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 8ca8d20eb0e..75285a73f6c 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 2d4a1cd404f..3c6298d7d8d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 77ad8860aec..6fe07490776 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3d5a1ff7ad8..acf86063d05 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs index f02af3b0449..e06a3f381f1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 3efdf123845..57cc8110fbb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index fdd59ea3787..49a7e091c23 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 3c36c57d1c9..691f128ea5f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -181,7 +181,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 6618a26476f..2b62d597547 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index a81b6df0419..49e94cc5e5d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -77,9 +77,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -89,9 +89,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -110,23 +110,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -314,8 +314,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 6d208f3d9f6..bd0255888b8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 83fe641b56a..e2527cc3c31 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ec3e8e7b68c..5f51e31aa03 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs index 313d4f8a5f1..1906ce0b270 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index b5046d917fd..a023e3c3e75 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 59c8be24d66..69089499494 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs index e741caa493d..f34052aa706 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index b2573f9bb53..3fbd6e83ef2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 5c7b13e9b78..6e4a6ef50e7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 63046e82052..8a3011986ec 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index 9387dcff85e..3c760b3abdd 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index d25f420362e..7218451d9fb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 14022ef06ef..76faa5154c8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs index d9507325385..e9471d3ba02 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 42ddbc5c56f..47d598a27e6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index 769c3612f3b..7a742134990 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 4f2f095a85a..e4722f4a537 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs index fda1f010d9a..53b52bce70f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index b3c52fb39de..1e12804ecd2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9f2f3d60b1f..3a364f98c1e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 233a10492f3..46ed3b3948c 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 90e0c44b40b..d040204ece3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1033,7 +1033,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs index aaab21dc58c..fec56c44fa8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 50995f4a505..4523238ad38 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index a2aa2f39a49..ef21c6091f3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index f50d01492be..1510bd5c512 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs index a3c9ca29a4b..12e4af15148 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index c03107d52ee..9f8b4dd35b3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index bdf09a757ac..6d8279a8bed 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index f589c821c40..266dcfee794 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index ca5adcd816b..33320b76cf1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs index ec78b91f125..58eb2c605d1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index b89ff43ced7..f7782b6fd5a 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 54d4db6cf28..8498a5eca78 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index c56b9e33651..457b88ac9c7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 61991533230..37729a43816 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 1c85da68ec7..34fa15105dc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs index 8744ceac5ba..b7911507a70 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs index c4ae8981958..50119ed39e7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index 58ec23be816..314fae589fc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 239e8a16b64..617dcd5f7a0 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index b10e49166a6..a55d7f34afc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,8 +28,10 @@ using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -70,10 +72,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -118,7 +120,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -129,7 +131,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -151,13 +153,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -204,7 +206,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -261,14 +263,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -376,7 +378,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -386,6 +388,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -430,31 +439,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -464,6 +474,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -474,27 +485,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -552,104 +550,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -662,7 +636,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -677,7 +651,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -692,7 +666,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -707,7 +681,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -722,7 +696,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -737,7 +711,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -752,7 +726,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..d7fb1293b34 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index f27abb3d78b..b213df44c00 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -399,6 +399,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -736,6 +742,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..8713a816f35 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs index 3c5a860dd89..08a39249cb8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 0640bc68500..dce3f9134db 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ddec6a58568..c83597fc607 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs index 78077d2bed4..9ddb56ebad6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 6d70e97a51c..e55d523aad1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 5ff006145c2..8d3f9af56df 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 16df556db5d..3eef221be3e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 06e930e774c..3e1666ca90f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index da8a65b26f5..f2946f435b5 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3e823100067..343e486f657 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 70aeea02471..04d69550656 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 6a4edb3394d..360cb5281e8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 838f5741cf6..868cba98eee 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index bd317ad8747..f46fffa0ad6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 49a0dc8ada3..a427b55727d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs index 2313431e4d6..5edb4edfea4 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 8e76f168a65..a5d404bd17d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 61119cfffe0..7a0846aec4e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 4c1b999c7f1..bbed2128374 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index 3c1138fe977..3c81f50d00d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index d618b5ba110..9933ec57ea9 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1a6841a713c..2895d518a81 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 32f2bbd7fa7..44f95fa0fe0 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 1d18a58b117..98c683539e6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 61591e9174d..2bec93345bb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index de9905a5d94..27d1193954e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -369,7 +369,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ab16133fe4b..7fb0e209454 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs index cf3b18a81c8..72b34e49262 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index ae9d8e1c05a..cd75dba4a92 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 570e3de7f65..3108c8a8691 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index fbed359747a..1ce81eece3e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 58d398101c8..7158640c24e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -355,78 +355,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -441,13 +441,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 8ca8d20eb0e..75285a73f6c 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 2d4a1cd404f..3c6298d7d8d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 77ad8860aec..6fe07490776 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3d5a1ff7ad8..acf86063d05 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs index f02af3b0449..e06a3f381f1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 3efdf123845..57cc8110fbb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index fdd59ea3787..49a7e091c23 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 3c36c57d1c9..691f128ea5f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -181,7 +181,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 6618a26476f..2b62d597547 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index a81b6df0419..49e94cc5e5d 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -77,9 +77,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -89,9 +89,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -110,23 +110,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -314,8 +314,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 6d208f3d9f6..bd0255888b8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 83fe641b56a..e2527cc3c31 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ec3e8e7b68c..5f51e31aa03 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs index 313d4f8a5f1..1906ce0b270 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index b5046d917fd..a023e3c3e75 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 59c8be24d66..69089499494 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs index e741caa493d..f34052aa706 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index b2573f9bb53..3fbd6e83ef2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 5c7b13e9b78..6e4a6ef50e7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 63046e82052..8a3011986ec 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index 9387dcff85e..3c760b3abdd 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index d25f420362e..7218451d9fb 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 14022ef06ef..76faa5154c8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs index d9507325385..e9471d3ba02 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 42ddbc5c56f..47d598a27e6 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index 769c3612f3b..7a742134990 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 4f2f095a85a..e4722f4a537 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs index fda1f010d9a..53b52bce70f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index b3c52fb39de..1e12804ecd2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9f2f3d60b1f..3a364f98c1e 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 233a10492f3..46ed3b3948c 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 90e0c44b40b..d040204ece3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1033,7 +1033,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs index aaab21dc58c..fec56c44fa8 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 50995f4a505..4523238ad38 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index a2aa2f39a49..ef21c6091f3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index f50d01492be..1510bd5c512 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs index a3c9ca29a4b..12e4af15148 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index c03107d52ee..9f8b4dd35b3 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index bdf09a757ac..6d8279a8bed 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index f589c821c40..266dcfee794 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index ca5adcd816b..33320b76cf1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs index ec78b91f125..58eb2c605d1 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index b89ff43ced7..f7782b6fd5a 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 54d4db6cf28..8498a5eca78 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index c56b9e33651..457b88ac9c7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 61991533230..37729a43816 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 1c85da68ec7..34fa15105dc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs index 8744ceac5ba..b7911507a70 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs index c4ae8981958..50119ed39e7 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index 58ec23be816..314fae589fc 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 239e8a16b64..617dcd5f7a0 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs index 6c224944b4c..fe40f39ad5b 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,13 +22,14 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -69,10 +70,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +118,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +129,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,13 +151,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +204,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +261,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +376,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +386,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,57 +437,45 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -537,90 +533,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + Func> getResponse = (client) => { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -633,7 +619,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -648,7 +634,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -663,7 +649,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -678,7 +664,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -693,7 +679,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -708,7 +694,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -723,7 +709,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/Env.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/Env.cs index 4d30dcc37ec..ea3d938c159 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/Env.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/Env.cs @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/PropertyNameMapping.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/PropertyNameMapping.cs index 16b683c3ccc..597e015588f 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/PropertyNameMapping.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Model/PropertyNameMapping.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 51c96d7c8ea..422cb105a62 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 @@ -29,9 +29,7 @@ - - diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs index b10e49166a6..05e2ddb4de8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,14 +22,15 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -70,10 +71,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -118,7 +119,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -129,7 +130,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -151,13 +152,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -204,7 +205,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -261,14 +262,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -376,7 +377,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -386,6 +387,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -430,31 +438,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -464,6 +473,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -474,27 +484,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -552,104 +549,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -662,7 +635,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -677,7 +650,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -692,7 +665,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -707,7 +680,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -722,7 +695,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -737,7 +710,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -752,7 +725,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..ce6261390c3 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string? _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string? scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs index f27abb3d78b..ee437ae11e5 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Configuration.cs @@ -399,6 +399,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string? OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -736,6 +742,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..986123acb8c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string? OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs index 3c5a860dd89..08a39249cb8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 0640bc68500..dce3f9134db 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ddec6a58568..c83597fc607 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs index 78077d2bed4..9ddb56ebad6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Animal.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs index 6d70e97a51c..e55d523aad1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs index 5ff006145c2..8d3f9af56df 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Apple.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs index 16df556db5d..3eef221be3e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 06e930e774c..3e1666ca90f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index da8a65b26f5..f2946f435b5 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs index 3e823100067..343e486f657 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs index 70aeea02471..04d69550656 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs index 6a4edb3394d..360cb5281e8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs index 838f5741cf6..868cba98eee 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs index bd317ad8747..f46fffa0ad6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs index 49a0dc8ada3..a427b55727d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Cat.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Category.cs index 2313431e4d6..5edb4edfea4 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Category.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs index 8e76f168a65..a5d404bd17d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ChildCat.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs index 61119cfffe0..7a0846aec4e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 4c1b999c7f1..bbed2128374 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs index 3c1138fe977..3c81f50d00d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 6fcef7bd704..0ae21e98fd8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -47,7 +47,6 @@ namespace Org.OpenAPITools.Model /// /// Fri Jul 21 00:00:00 UTC 2017 [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly DateOnlyProperty { get; set; } /// @@ -125,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1a6841a713c..2895d518a81 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs index 32f2bbd7fa7..44f95fa0fe0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Dog.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs index 1d18a58b117..98c683539e6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Drawing.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs index 61591e9174d..2bec93345bb 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs index de9905a5d94..27d1193954e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EnumTest.cs @@ -369,7 +369,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ab16133fe4b..7fb0e209454 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/File.cs index cf3b18a81c8..72b34e49262 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index ae9d8e1c05a..cd75dba4a92 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs index 570e3de7f65..3108c8a8691 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Foo.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index fbed359747a..1ce81eece3e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs index 80756709cda..8cac7d740ff 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FormatTest.cs @@ -178,7 +178,6 @@ namespace Org.OpenAPITools.Model /// /// Sun Feb 02 00:00:00 UTC 2020 [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly Date { get; set; } /// @@ -360,78 +359,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -446,13 +445,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 8ca8d20eb0e..75285a73f6c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 2d4a1cd404f..3c6298d7d8d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 77ad8860aec..6fe07490776 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3d5a1ff7ad8..acf86063d05 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/List.cs index f02af3b0449..e06a3f381f1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 3efdf123845..57cc8110fbb 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs index fdd59ea3787..49a7e091c23 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs index 3c36c57d1c9..691f128ea5f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MapTest.cs @@ -181,7 +181,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 6618a26476f..2b62d597547 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index a81b6df0419..49e94cc5e5d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -77,9 +77,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -89,9 +89,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -110,23 +110,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -314,8 +314,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs index 6d208f3d9f6..bd0255888b8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 83fe641b56a..e2527cc3c31 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ec3e8e7b68c..5f51e31aa03 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs index 313d4f8a5f1..1906ce0b270 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs index b5046d917fd..a023e3c3e75 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs index 59c8be24d66..69089499494 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Name.cs index e741caa493d..f34052aa706 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index b2573f9bb53..3fbd6e83ef2 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs index 43fe8c92103..1ae27f1846d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableClass.cs @@ -92,7 +92,6 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DateProp /// [DataMember(Name = "date_prop", EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly DateProp { get; set; } /// @@ -267,7 +266,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 63046e82052..8a3011986ec 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs index 9387dcff85e..3c760b3abdd 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs index d25f420362e..7218451d9fb 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 14022ef06ef..76faa5154c8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Order.cs index 0bd55810cdf..22c7153ace7 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Order.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs index 42ddbc5c56f..47d598a27e6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs index 769c3612f3b..7a742134990 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ParentPet.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs index 4f2f095a85a..e4722f4a537 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pet.cs @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs index fda1f010d9a..53b52bce70f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs index b3c52fb39de..1e12804ecd2 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9f2f3d60b1f..3a364f98c1e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 233a10492f3..46ed3b3948c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs index a1c904a838f..d8230f42317 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -708,28 +708,24 @@ namespace Org.OpenAPITools.Model /// Gets or Sets RequiredNullableDateProp /// [DataMember(Name = "required_nullable_date_prop", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly RequiredNullableDateProp { get; set; } /// /// Gets or Sets RequiredNotNullableDateProp /// [DataMember(Name = "required_not_nullable_date_prop", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly RequiredNotNullableDateProp { get; set; } /// /// Gets or Sets NotRequiredNullableDateProp /// [DataMember(Name = "not_required_nullable_date_prop", EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly NotRequiredNullableDateProp { get; set; } /// /// Gets or Sets NotRequiredNotnullableDateProp /// [DataMember(Name = "not_required_notnullable_date_prop", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly NotRequiredNotnullableDateProp { get; set; } /// @@ -1038,7 +1034,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Return.cs index aaab21dc58c..fec56c44fa8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 50995f4a505..4523238ad38 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index a2aa2f39a49..ef21c6091f3 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index f50d01492be..1510bd5c512 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs index a3c9ca29a4b..12e4af15148 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs index c03107d52ee..9f8b4dd35b3 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs index bdf09a757ac..6d8279a8bed 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index f589c821c40..266dcfee794 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs index ca5adcd816b..33320b76cf1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs index ec78b91f125..58eb2c605d1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index b89ff43ced7..f7782b6fd5a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 54d4db6cf28..8498a5eca78 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index c56b9e33651..457b88ac9c7 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs index 61991533230..37729a43816 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs index 1c85da68ec7..34fa15105dc 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/User.cs index 8744ceac5ba..b7911507a70 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs index c4ae8981958..50119ed39e7 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs index 58ec23be816..314fae589fc 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/Zebra.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 239e8a16b64..617dcd5f7a0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 b380debad30..87fdf922469 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 @@ -30,9 +30,7 @@ - - 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 e918fe15600..1149d7663f8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES @@ -52,7 +52,12 @@ docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixLog.md +docs/MixedAnyOf.md +docs/MixedAnyOfContent.md +docs/MixedOneOf.md +docs/MixedOneOfContent.md docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/MixedSubId.md docs/Model200Response.md docs/ModelClient.md docs/Name.md @@ -175,7 +180,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.cs diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md b/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md index 9d4fea5304c..0a9bd3f0080 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md @@ -128,6 +128,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**GetMixedAnyOf**](docs/FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization +*FakeApi* | [**GetMixedOneOf**](docs/FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization *FakeApi* | [**TestAdditionalPropertiesReference**](docs/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -212,7 +214,12 @@ Class | Method | HTTP request | Description - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixLog](docs/MixLog.md) + - [Model.MixedAnyOf](docs/MixedAnyOf.md) + - [Model.MixedAnyOfContent](docs/MixedAnyOfContent.md) + - [Model.MixedOneOf](docs/MixedOneOf.md) + - [Model.MixedOneOfContent](docs/MixedOneOfContent.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.MixedSubId](docs/MixedSubId.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.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 e4713d2621c..f772773afef 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FakeApi.md b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FakeApi.md index 788c4017bba..933fb1c7cad 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index fda76f972ea..d2863e79474 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -158,6 +158,42 @@ namespace Org.OpenAPITools.Api /// ApiResponse of List<OuterEnum> ApiResponse> GetArrayOfEnumsWithHttpInfo(int operationIndex = 0); /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedAnyOf + MixedAnyOf GetMixedAnyOf(int operationIndex = 0); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedAnyOf + ApiResponse GetMixedAnyOfWithHttpInfo(int operationIndex = 0); + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedOneOf + MixedOneOf GetMixedOneOf(int operationIndex = 0); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedOneOf + ApiResponse GetMixedOneOfWithHttpInfo(int operationIndex = 0); + /// /// test referenced additionalProperties /// /// Thrown when fails to make API call @@ -643,6 +679,52 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (List<OuterEnum>) System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + System.Threading.Tasks.Task GetMixedAnyOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + System.Threading.Tasks.Task GetMixedOneOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test referenced additionalProperties /// /// @@ -1926,6 +2008,258 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedAnyOf + public MixedAnyOf GetMixedAnyOf(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedAnyOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedAnyOf + public Org.OpenAPITools.Client.ApiResponse GetMixedAnyOfWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedAnyOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + public async System.Threading.Tasks.Task GetMixedAnyOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedAnyOfWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + public async System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedAnyOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedOneOf + public MixedOneOf GetMixedOneOf(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedOneOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedOneOf + public Org.OpenAPITools.Client.ApiResponse GetMixedOneOfWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedOneOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + public async System.Threading.Tasks.Task GetMixedOneOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedOneOfWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + public async System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedOneOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test referenced additionalProperties /// diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index b10e49166a6..05e2ddb4de8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,14 +22,15 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -70,10 +71,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -118,7 +119,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -129,7 +130,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -151,13 +152,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -204,7 +205,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -261,14 +262,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -376,7 +377,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -386,6 +387,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -430,31 +438,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -464,6 +473,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -474,27 +484,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -552,104 +549,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -662,7 +635,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -677,7 +650,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -692,7 +665,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -707,7 +680,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -722,7 +695,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -737,7 +710,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -752,7 +725,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..ce6261390c3 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string? _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string? scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index f27abb3d78b..ee437ae11e5 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -399,6 +399,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string? OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -736,6 +742,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..986123acb8c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string? OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Activity.cs index 8541bd1bcaa..0c81e65fdc1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index ff72bd6fa13..61656615b13 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 1c79d469e91..6f73dd2a107 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -203,7 +203,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Animal.cs index c2d35120baa..e19658cee18 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 57b0b557c53..b11aff203a7 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 120c4643d81..5d0bdb98c30 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 16df556db5d..3eef221be3e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 5769a9d7ed1..b75b0792d61 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index bf45340005d..e3a0602189b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index a6592af0db6..02ead047372 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Banana.cs index c9e64f85434..dffda1bedc2 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 6a4edb3394d..360cb5281e8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index c8f4b3d1f30..f362ad71dd0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index 290a87a828c..78a9791fcd6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 40d854f191e..8bec3551ae9 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -118,7 +118,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Category.cs index 72048b10c7e..85ea41da1a6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index fcfcb93317e..dada42c5f3f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 044376ac818..f8060109b1a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index c2b743d09c1..e399bfda566 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index 6f9f7cf853c..686dab1558e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 4b9ee8fe482..a8f04b3453d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -46,7 +46,6 @@ namespace Org.OpenAPITools.Model /// /// Fri Jul 21 00:00:00 UTC 2017 [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly DateOnlyProperty { get; set; } /// @@ -113,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index c112dd03a8b..a852e8c459a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 9a84f0354c3..e2339cfb20b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 1d18a58b117..98c683539e6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 5157fa3fa68..55dab0b979f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 7c4204dbf5e..bf17521990c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -354,7 +354,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 8985aa619d4..738f9450e1d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/File.cs index ea4c623b45b..328601f24b6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 1ee36c96866..d3f9f7cba77 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 7d665273f1d..9691b484810 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index b1f469b334c..3069deb125e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 6e53c579379..4ca4eff5ca4 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -174,7 +174,6 @@ namespace Org.OpenAPITools.Model /// /// Sun Feb 02 00:00:00 UTC 2020 [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly Date { get; set; } /// @@ -345,78 +344,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -431,13 +430,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index eb781c032e4..369b95edbd1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -135,7 +135,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 952e3eac26e..712d33733e8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index c047628a77b..ec05e7c4c85 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3d5a1ff7ad8..acf86063d05 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/List.cs index 17ed6ce4159..67e6c5a616a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index eb7c8d83ab6..15b6f0eabba 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index 7ad628d2395..b70d2d9c769 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 88f1b6ffc87..70075c576b1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 3a847cecd05..6dbe8fdadda 100644 --- 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 @@ -518,7 +518,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index f6680350498..9d7d88aea93 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index a81b6df0419..49e94cc5e5d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -77,9 +77,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -89,9 +89,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -110,23 +110,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -314,8 +314,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 91a4a75726b..2cb289fae17 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 83fe641b56a..e2527cc3c31 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 0ecaac953c3..f081d281959 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs index 629e16dab53..c56e0ada331 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index bddc2e77666..11efe092a28 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 456ffa485e4..7b75059cad1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Name.cs index 70b9b5b1eed..2021a006659 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index 1172a3440ba..e2e5ff34b2a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 43fe8c92103..1ae27f1846d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -92,7 +92,6 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DateProp /// [DataMember(Name = "date_prop", EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly DateProp { get; set; } /// @@ -267,7 +266,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index a720d81d42c..b54d16ae116 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index 404fd0328dc..28f25c1899a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index 696be60a644..f38cf7d6aff 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 1b8f6f32e25..e2f9be14b2e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Order.cs index be6941c110e..fa33759c2b1 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index c09babfd818..1a8d974b060 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index 805eb998332..4d15a2a962f 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -118,7 +118,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pet.cs index aa5ea747b45..4c5c9105661 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pig.cs index d0a1b2d1423..05b7cb09188 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index 30cd6dbcde3..68c147e5e24 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 57d3ee6cb81..e0f4761e191 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index b37143a767b..7551b621ebd 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 93e4c273108..5005d284a8e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -704,28 +704,24 @@ namespace Org.OpenAPITools.Model /// Gets or Sets RequiredNullableDateProp /// [DataMember(Name = "required_nullable_date_prop", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly RequiredNullableDateProp { get; set; } /// /// Gets or Sets RequiredNotNullableDateProp /// [DataMember(Name = "required_not_nullable_date_prop", IsRequired = true, EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly RequiredNotNullableDateProp { get; set; } /// /// Gets or Sets NotRequiredNullableDateProp /// [DataMember(Name = "not_required_nullable_date_prop", EmitDefaultValue = true)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly NotRequiredNullableDateProp { get; set; } /// /// Gets or Sets NotRequiredNotnullableDateProp /// [DataMember(Name = "not_required_notnullable_date_prop", EmitDefaultValue = false)] - [JsonConverter(typeof(OpenAPIDateConverter))] public DateOnly NotRequiredNotnullableDateProp { get; set; } /// @@ -1023,7 +1019,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Return.cs index 354376dd037..9d08c25bbd0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index be4188cbdcf..ebe5562ffe6 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 3104bca1342..60e2f9e50c0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 5b9c3e44188..03a8cd46f5e 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Shape.cs index 5451b271ad8..e8921143b0b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index 964b8694dfa..b850b88b4fc 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index ec7d3c7aec8..df972c1b66a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 33370c48f51..eebd8034750 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index c240cb7f00a..867d43acaf4 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Tag.cs index c234b5281e5..a9dd75cb5cb 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index f0ef7c92d2e..bb23b1f5245 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 4a611063e1c..715365c48c0 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index c56b9e33651..457b88ac9c7 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 482c52b104c..9ec9fd6e4f9 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index c920365754d..cb7847498ff 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/User.cs index 5d0ea337223..0b191345773 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -253,7 +253,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 6658f0098dc..cd6eb8c0b1b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -141,7 +141,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index 58ec23be816..314fae589fc 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 10b001f04b6..7036e9fdc82 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -127,7 +127,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + 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 b380debad30..87fdf922469 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 @@ -30,9 +30,7 @@ - - diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs index 594bf890cb8..9190dbea600 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,13 +22,14 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -69,10 +70,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +118,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +129,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,13 +151,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +204,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +261,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +376,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +386,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,57 +437,45 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + using (RestClient client = new RestClient(clientOptions, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -537,90 +533,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + Func> getResponse = (client) => { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -633,7 +619,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -648,7 +634,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -663,7 +649,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -678,7 +664,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -693,7 +679,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -708,7 +694,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -723,7 +709,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index 08559efc770..84c9909059a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -83,7 +83,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 ca1bceca626..8633da2ba75 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 @@ -29,9 +29,7 @@ - - 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 afe863b77d7..2a5dbfbe6e6 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 @@ -52,7 +52,12 @@ docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixLog.md +docs/MixedAnyOf.md +docs/MixedAnyOfContent.md +docs/MixedOneOf.md +docs/MixedOneOfContent.md docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/MixedSubId.md docs/Model200Response.md docs/ModelClient.md docs/Name.md @@ -176,7 +181,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 54bd7223abf..d794f16e98d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md @@ -116,6 +116,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**GetArrayOfEnums**](docs/FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**GetMixedAnyOf**](docs/FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization +*FakeApi* | [**GetMixedOneOf**](docs/FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization *FakeApi* | [**TestAdditionalPropertiesReference**](docs/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -200,7 +202,12 @@ Class | Method | HTTP request | Description - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixLog](docs/MixLog.md) + - [Model.MixedAnyOf](docs/MixedAnyOf.md) + - [Model.MixedAnyOfContent](docs/MixedAnyOfContent.md) + - [Model.MixedOneOf](docs/MixedOneOf.md) + - [Model.MixedOneOfContent](docs/MixedOneOfContent.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.MixedSubId](docs/MixedSubId.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.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 e4713d2621c..f772773afef 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 @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FakeApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FakeApi.md index 356154a4b99..06309f31e8a 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FakeApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedAnyOf.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedAnyOf.md new file mode 100644 index 00000000000..6a6aa093beb --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedAnyOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedAnyOfContent**](MixedAnyOfContent.md) | | [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/docs/MixedAnyOfContent.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedAnyOfContent.md new file mode 100644 index 00000000000..9af972f3219 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedAnyOfContent.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.MixedAnyOfContent +Mixed anyOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/docs/MixedOneOf.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedOneOf.md new file mode 100644 index 00000000000..dc9650a8e3a --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedOneOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [**MixedOneOfContent**](MixedOneOfContent.md) | | [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/docs/MixedOneOfContent.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedOneOfContent.md new file mode 100644 index 00000000000..8468f9024f7 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedOneOfContent.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.MixedOneOfContent +Mixed oneOf types for testing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/docs/MixedSubId.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedSubId.md new file mode 100644 index 00000000000..b9268e37cba --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixedSubId.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.MixedSubId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [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/MixedAnyOfContentTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs new file mode 100644 index 00000000000..ab5a04a3632 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedAnyOfContentTests.cs @@ -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 + * 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 MixedAnyOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOfContent + //private MixedAnyOfContent instance; + + public MixedAnyOfContentTests() + { + // TODO uncomment below to create an instance of MixedAnyOfContent + //instance = new MixedAnyOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOfContent + /// + [Fact] + public void MixedAnyOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOfContent + //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/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs new file mode 100644 index 00000000000..9cddd4adcb0 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedAnyOfTests.cs @@ -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 + * 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 MixedAnyOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedAnyOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedAnyOf + //private MixedAnyOf instance; + + public MixedAnyOfTests() + { + // TODO uncomment below to create an instance of MixedAnyOf + //instance = new MixedAnyOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedAnyOf + /// + [Fact] + public void MixedAnyOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedAnyOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs new file mode 100644 index 00000000000..4d4a29901c8 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfContentTests.cs @@ -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 + * 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 MixedOneOfContent + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfContentTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOfContent + //private MixedOneOfContent instance; + + public MixedOneOfContentTests() + { + // TODO uncomment below to create an instance of MixedOneOfContent + //instance = new MixedOneOfContent(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOfContent + /// + [Fact] + public void MixedOneOfContentInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOfContent + //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/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs new file mode 100644 index 00000000000..4be8482614d --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixedOneOfTests.cs @@ -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 + * 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 MixedOneOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedOneOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedOneOf + //private MixedOneOf instance; + + public MixedOneOfTests() + { + // TODO uncomment below to create an instance of MixedOneOf + //instance = new MixedOneOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedOneOf + /// + [Fact] + public void MixedOneOfInstanceTest() + { + // TODO uncomment below to test "IsType" MixedOneOf + //Assert.IsType(instance); + } + + /// + /// Test the property 'Content' + /// + [Fact] + public void ContentTest() + { + // TODO unit test for the property 'Content' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs index bc6276012d1..82d3054c5a9 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs @@ -158,6 +158,42 @@ namespace Org.OpenAPITools.Api /// ApiResponse of List<OuterEnum> ApiResponse> GetArrayOfEnumsWithHttpInfo(int operationIndex = 0); /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedAnyOf + MixedAnyOf GetMixedAnyOf(int operationIndex = 0); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedAnyOf + ApiResponse GetMixedAnyOfWithHttpInfo(int operationIndex = 0); + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedOneOf + MixedOneOf GetMixedOneOf(int operationIndex = 0); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedOneOf + ApiResponse GetMixedOneOfWithHttpInfo(int operationIndex = 0); + /// /// test referenced additionalProperties /// /// Thrown when fails to make API call @@ -643,6 +679,52 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (List<OuterEnum>) System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + System.Threading.Tasks.Task GetMixedAnyOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + System.Threading.Tasks.Task GetMixedOneOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test referenced additionalProperties /// /// @@ -1926,6 +2008,258 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedAnyOf + public MixedAnyOf GetMixedAnyOf(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedAnyOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedAnyOf + public Org.OpenAPITools.Client.ApiResponse GetMixedAnyOfWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedAnyOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + public async System.Threading.Tasks.Task GetMixedAnyOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedAnyOfWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + public async System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedAnyOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// MixedOneOf + public MixedOneOf GetMixedOneOf(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedOneOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of MixedOneOf + public Org.OpenAPITools.Client.ApiResponse GetMixedOneOfWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedOneOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + public async System.Threading.Tasks.Task GetMixedOneOfAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetMixedOneOfWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + public async System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FakeApi.GetMixedOneOf"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// test referenced additionalProperties /// diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs index 3c0762f5539..a55d7f34afc 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,13 +22,16 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -69,10 +72,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +120,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +131,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,13 +153,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +206,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +263,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +378,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +388,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,31 +439,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -463,6 +474,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -473,27 +485,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -551,104 +550,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -661,7 +636,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -676,7 +651,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -691,7 +666,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -706,7 +681,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -721,7 +696,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -736,7 +711,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -751,7 +726,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..d7fb1293b34 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Configuration.cs index 672bff291b8..513d074d882 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Configuration.cs @@ -394,6 +394,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -731,6 +737,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..8713a816f35 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs index 637dce49d4c..3bcf6d5f664 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index e1920e20d8a..2381b5f5ddc 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b005c28e326..2cfd7dde8a8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -391,7 +391,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs index 652a0df9259..d87e7264700 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs index e1f52990262..440c5810db5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs index 031f318ee0e..1e7afc9dbb0 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs index b94dcf102a9..02fb1150966 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 193c10bb3f8..02324a9b534 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index f8dad465958..f124f50a69d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs index 75497d4a83f..b62c42c722c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs index cb351f94bb2..cc328cf2d95 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs index e5c63d320e9..163080fc7a5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs index 8dcb3eb95cb..fa252d7c73c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs index c9711efcee0..5759368bc58 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs @@ -321,7 +321,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs index 6619281fd6c..2cbd436c91e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs index ffe96e0f991..fb7f24b243f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs index 2db03d53e05..ff34516f9e2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs @@ -199,7 +199,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs index 81ab1409283..ed73f3d6e7f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index c280a8974d5..ba076494b12 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs index d3c569e876a..20667677434 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 21cd5b9410c..ee3c8904509 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 2fc41119de4..c55a037d201 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs index f360181923f..f18adc07b2b 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs index de3cbafa9e3..5792b78f798 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs @@ -250,7 +250,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs index 906ffa6c622..35222bdac3b 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -217,7 +217,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs index 2f4b55d241b..8f0ea67b780 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs @@ -581,7 +581,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 72beac2a696..d248b913aad 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs index 28c03a1168e..bd9c895894d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index eea3c2b0d8c..71277521b4d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs index 05dbdea1c07..7558351cafa 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index f5826e02c5d..a2d3d6cb223 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index 11ec8be6fd3..c31adf8c301 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -757,78 +757,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -843,13 +843,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index e188accf045..6208ebb4ca2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 2d4a1cd404f..3c6298d7d8d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs index be78dcda54e..cdcf9c79a89 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 9506ad4eeb4..bd932742333 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs index 7c1e4e03854..68363d5d71d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs index ddfb8b005d2..aca243cc3c5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Mammal.cs index fdd59ea3787..49a7e091c23 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs index a44a9389159..f2f2f90a2f9 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs @@ -269,7 +269,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 index 3fa1c7d095b..a698b135146 100644 --- 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 @@ -1205,7 +1205,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedAnyOf.cs new file mode 100644 index 00000000000..11c452ea3a1 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -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 + * 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 +{ + /// + /// MixedAnyOf + /// + [DataContract(Name = "MixedAnyOf")] + public partial class MixedAnyOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content. + public MixedAnyOf(MixedAnyOfContent content = default(MixedAnyOfContent)) + { + this._Content = content; + if (this.Content != null) + { + this._flagContent = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + public MixedAnyOfContent Content + { + get{ return _Content;} + set + { + _Content = value; + _flagContent = true; + } + } + private MixedAnyOfContent _Content; + private bool _flagContent; + + /// + /// Returns false as Content should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeContent() + { + return _flagContent; + } + /// + /// 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 MixedAnyOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedAnyOf).AreEqual; + } + + /// + /// Returns true if MixedAnyOf instances are equal + /// + /// Instance of MixedAnyOf to be compared + /// Boolean + public bool Equals(MixedAnyOf 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.Content != null) + { + hashCode = (hashCode * 59) + this.Content.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/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs new file mode 100644 index 00000000000..49e94cc5e5d --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -0,0 +1,390 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mixed anyOf types for testing + /// + [JsonConverter(typeof(MixedAnyOfContentJsonConverter))] + [DataContract(Name = "MixedAnyOf_content")] + public partial class MixedAnyOfContent : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of string. + public MixedAnyOfContent(string actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of bool. + public MixedAnyOfContent(bool actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of int. + public MixedAnyOfContent(int actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of decimal. + public MixedAnyOfContent(decimal actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MixedSubId. + public MixedAnyOfContent(MixedSubId actualInstance) + { + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(MixedSubId)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(bool)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(decimal)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(int)) + { + _actualInstance = value; + } + else if (value.GetType() == typeof(string)) + { + _actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: MixedSubId, bool, decimal, int, string"); + } + } + } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string GetString() + { + return (string)ActualInstance; + } + + /// + /// Get the actual instance of `bool`. If the actual instance is not `bool`, + /// the InvalidClassException will be thrown + /// + /// An instance of bool + public bool GetBool() + { + return (bool)ActualInstance; + } + + /// + /// Get the actual instance of `int`. If the actual instance is not `int`, + /// the InvalidClassException will be thrown + /// + /// An instance of int + public int GetInt() + { + return (int)ActualInstance; + } + + /// + /// Get the actual instance of `decimal`. If the actual instance is not `decimal`, + /// the InvalidClassException will be thrown + /// + /// An instance of decimal + public decimal GetDecimal() + { + return (decimal)ActualInstance; + } + + /// + /// Get the actual instance of `MixedSubId`. If the actual instance is not `MixedSubId`, + /// the InvalidClassException will be thrown + /// + /// An instance of MixedSubId + public MixedSubId GetMixedSubId() + { + return (MixedSubId)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedAnyOfContent {\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of MixedAnyOfContent + /// + /// JSON string + /// An instance of MixedAnyOfContent + public static MixedAnyOfContent FromJson(string jsonString) + { + MixedAnyOfContent newMixedAnyOfContent = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMixedAnyOfContent; + } + + try + { + newMixedAnyOfContent = new MixedAnyOfContent(JsonConvert.DeserializeObject(jsonString, MixedAnyOfContent.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedAnyOfContent; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MixedSubId: {1}", jsonString, exception.ToString())); + } + + try + { + newMixedAnyOfContent = new MixedAnyOfContent(JsonConvert.DeserializeObject(jsonString, MixedAnyOfContent.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedAnyOfContent; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into bool: {1}", jsonString, exception.ToString())); + } + + try + { + newMixedAnyOfContent = new MixedAnyOfContent(JsonConvert.DeserializeObject(jsonString, MixedAnyOfContent.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedAnyOfContent; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into decimal: {1}", jsonString, exception.ToString())); + } + + try + { + newMixedAnyOfContent = new MixedAnyOfContent(JsonConvert.DeserializeObject(jsonString, MixedAnyOfContent.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedAnyOfContent; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into int: {1}", jsonString, exception.ToString())); + } + + try + { + newMixedAnyOfContent = new MixedAnyOfContent(JsonConvert.DeserializeObject(jsonString, MixedAnyOfContent.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedAnyOfContent; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedAnyOfContent).AreEqual; + } + + /// + /// Returns true if MixedAnyOfContent instances are equal + /// + /// Instance of MixedAnyOfContent to be compared + /// Boolean + public bool Equals(MixedAnyOfContent 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 (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for MixedAnyOfContent + /// + public class MixedAnyOfContentJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(MixedAnyOfContent).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.String: + return new MixedAnyOfContent(Convert.ToString(reader.Value)); + case JsonToken.Boolean: + return new MixedAnyOfContent(Convert.ToBoolean(reader.Value)); + case JsonToken.Integer: + return new MixedAnyOfContent(Convert.ToInt32(reader.Value)); + case JsonToken.Float: + return new MixedAnyOfContent(Convert.ToDecimal(reader.Value)); + case JsonToken.StartObject: + return MixedAnyOfContent.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return MixedAnyOfContent.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedOneOf.cs new file mode 100644 index 00000000000..b1b6f56518c --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -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 + * 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 +{ + /// + /// MixedOneOf + /// + [DataContract(Name = "MixedOneOf")] + public partial class MixedOneOf : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// content. + public MixedOneOf(MixedOneOfContent content = default(MixedOneOfContent)) + { + this._Content = content; + if (this.Content != null) + { + this._flagContent = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + public MixedOneOfContent Content + { + get{ return _Content;} + set + { + _Content = value; + _flagContent = true; + } + } + private MixedOneOfContent _Content; + private bool _flagContent; + + /// + /// Returns false as Content should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeContent() + { + return _flagContent; + } + /// + /// 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 MixedOneOf {\n"); + sb.Append(" Content: ").Append(Content).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 MixedOneOf).AreEqual; + } + + /// + /// Returns true if MixedOneOf instances are equal + /// + /// Instance of MixedOneOf to be compared + /// Boolean + public bool Equals(MixedOneOf 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.Content != null) + { + hashCode = (hashCode * 59) + this.Content.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/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedOneOfContent.cs new file mode 100644 index 00000000000..e2527cc3c31 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -0,0 +1,441 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and 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; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mixed oneOf types for testing + /// + [JsonConverter(typeof(MixedOneOfContentJsonConverter))] + [DataContract(Name = "MixedOneOf_content")] + public partial class MixedOneOfContent : AbstractOpenAPISchema, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of string. + public MixedOneOfContent(string actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of bool. + public MixedOneOfContent(bool actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of int. + public MixedOneOfContent(int actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of decimal. + public MixedOneOfContent(decimal actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MixedSubId. + public MixedOneOfContent(MixedSubId actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(bool) || value is bool) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(decimal) || value is decimal) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(int) || value is int) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(string) || value is string) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: MixedSubId, bool, decimal, int, string"); + } + } + } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string GetString() + { + return (string)this.ActualInstance; + } + + /// + /// Get the actual instance of `bool`. If the actual instance is not `bool`, + /// the InvalidClassException will be thrown + /// + /// An instance of bool + public bool GetBool() + { + return (bool)this.ActualInstance; + } + + /// + /// Get the actual instance of `int`. If the actual instance is not `int`, + /// the InvalidClassException will be thrown + /// + /// An instance of int + public int GetInt() + { + return (int)this.ActualInstance; + } + + /// + /// Get the actual instance of `decimal`. If the actual instance is not `decimal`, + /// the InvalidClassException will be thrown + /// + /// An instance of decimal + public decimal GetDecimal() + { + return (decimal)this.ActualInstance; + } + + /// + /// Get the actual instance of `MixedSubId`. If the actual instance is not `MixedSubId`, + /// the InvalidClassException will be thrown + /// + /// An instance of MixedSubId + public MixedSubId GetMixedSubId() + { + return (MixedSubId)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MixedOneOfContent {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, MixedOneOfContent.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of MixedOneOfContent + /// + /// JSON string + /// An instance of MixedOneOfContent + public static MixedOneOfContent FromJson(string jsonString) + { + MixedOneOfContent newMixedOneOfContent = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMixedOneOfContent; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(MixedSubId).GetProperty("AdditionalProperties") == null) + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.SerializerSettings)); + } + else + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("MixedSubId"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MixedSubId: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(bool).GetProperty("AdditionalProperties") == null) + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.SerializerSettings)); + } + else + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("bool"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into bool: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(decimal).GetProperty("AdditionalProperties") == null) + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.SerializerSettings)); + } + else + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("decimal"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into decimal: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(int).GetProperty("AdditionalProperties") == null) + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.SerializerSettings)); + } + else + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("int"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into int: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(string).GetProperty("AdditionalProperties") == null) + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.SerializerSettings)); + } + else + { + newMixedOneOfContent = new MixedOneOfContent(JsonConvert.DeserializeObject(jsonString, MixedOneOfContent.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("string"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newMixedOneOfContent; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedOneOfContent).AreEqual; + } + + /// + /// Returns true if MixedOneOfContent instances are equal + /// + /// Instance of MixedOneOfContent to be compared + /// Boolean + public bool Equals(MixedOneOfContent 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.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for MixedOneOfContent + /// + public class MixedOneOfContentJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(MixedOneOfContent).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + switch(reader.TokenType) + { + case JsonToken.String: + return new MixedOneOfContent(Convert.ToString(reader.Value)); + case JsonToken.Boolean: + return new MixedOneOfContent(Convert.ToBoolean(reader.Value)); + case JsonToken.Integer: + return new MixedOneOfContent(Convert.ToInt32(reader.Value)); + case JsonToken.Float: + return new MixedOneOfContent(Convert.ToDecimal(reader.Value)); + case JsonToken.StartObject: + return MixedOneOfContent.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return MixedOneOfContent.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; + } + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 7f449dad8a6..63fbf7fba85 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -250,7 +250,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedSubId.cs new file mode 100644 index 00000000000..917dee7e353 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -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 + * 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 +{ + /// + /// MixedSubId + /// + [DataContract(Name = "MixedSubId")] + public partial class MixedSubId : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + public MixedSubId(string id = default(string)) + { + this._Id = id; + if (this.Id != null) + { + this._flagId = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id + { + get{ return _Id;} + set + { + _Id = value; + _flagId = true; + } + } + private string _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 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 MixedSubId {\n"); + sb.Append(" Id: ").Append(Id).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 MixedSubId).AreEqual; + } + + /// + /// Returns true if MixedSubId instances are equal + /// + /// Instance of MixedSubId to be compared + /// Boolean + public bool Equals(MixedSubId 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.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/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs index 0d87a0e8110..48815cd9730 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs index f82051d775b..1a51de5f744 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs index cce9dcfc9e1..8fa808d911c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index 59d313b70e1..072a590b779 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs index 66a80d29a0a..817623db2e3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs @@ -531,7 +531,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 7aa134fd91f..0f52b9962cd 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableShape.cs index 9387dcff85e..3c760b3abdd 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs index 961b7abff84..ce6120813da 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 4b0cb91fae1..7f494556527 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -250,7 +250,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs index 464a0b43943..435540a69ef 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs @@ -330,7 +330,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs index aa9774cb4db..066dc26dbe1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs index 769c3612f3b..7a742134990 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs index 28a9701e02a..ccfaf5892e5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs @@ -354,7 +354,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pig.cs index fda1f010d9a..53b52bce70f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Quadrilateral.cs index b3c52fb39de..1e12804ecd2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index e0b72eab7ee..f875a0c461b 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 384dd874ec1..76afb32b0d8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RequiredClass.cs index a3bfdf70206..30769914909 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1945,7 +1945,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs index b9d31ec4707..e255b357996 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs index ecb81e4314f..39c65b7da19 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 56b5260d906..48d21628ea7 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index ca4361588ff..4be5f3b852b 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Shape.cs index a3c9ca29a4b..12e4af15148 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs index 10ec59fceb6..d0f237740cf 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeOrNull.cs index bdf09a757ac..6d8279a8bed 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 8902d281127..abb6ed2a1e2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs index 6fa07bb2639..0a0faf3cba3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs index 7e585a09d97..b631ebc9616 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 649c68cec4a..0ab53418b5d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ae18b47cd80..29a0deb13ec 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index 599df081178..92995d8b5ca 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Triangle.cs index 61991533230..37729a43816 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs index 9032c9cdbb0..ee631710fb6 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs index 72b23434c90..21c819cf09a 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs @@ -529,7 +529,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs index 91d3f6b6c87..24659725b63 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs index 6efb81987a8..bb8efe4f45d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 10d41d47ba6..5d5ab2efcd3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 3c0762f5539..a55d7f34afc 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -22,13 +22,16 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; using Org.OpenAPITools.Client.Auth; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -69,10 +72,10 @@ namespace Org.OpenAPITools.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +120,7 @@ namespace Org.OpenAPITools.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +131,7 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,13 +153,13 @@ namespace Org.OpenAPITools.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public ContentType ContentType { get; set; } = RestSharp.ContentType.Json; + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -203,7 +206,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient() { - _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -260,14 +263,14 @@ namespace Org.OpenAPITools.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -375,7 +378,7 @@ namespace Org.OpenAPITools.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -385,6 +388,13 @@ namespace Org.OpenAPITools.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -429,31 +439,32 @@ namespace Org.OpenAPITools.Client return transformed; } - private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private ApiResponse ExecClient(Func> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && @@ -463,6 +474,7 @@ namespace Org.OpenAPITools.Client configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, configuration); @@ -473,27 +485,14 @@ namespace Org.OpenAPITools.Client { InterceptRequest(request); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(request); - } + RestResponse response = getResponse(client); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { try { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } catch (Exception ex) { @@ -551,104 +550,80 @@ namespace Org.OpenAPITools.Client } } - private async Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent, - UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + return client.Deserialize(policyResult.Result); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; }; - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + Func> getResponse = (client) => { - clientOptions.Authenticator = new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration); - } - - using (RestClient client = new RestClient(clientOptions, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) - { - InterceptRequest(request); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } else { - response = await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + return client.Execute(request); } + }; - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } + return ExecClient(getResponse, setOptions, request, options, configuration); + } - InterceptResponse(request, response); + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + Func> getResponse = (client) => + { + Func>> action = async () => { - result.ErrorText = response.ErrorMessage; - } - - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; - } + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + return action().Result; + }; + + return Task.FromResult>(ExecClient(getResponse, setOptions, request, options, configuration)); } #region IAsynchronousClient @@ -661,7 +636,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -676,7 +651,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -691,7 +666,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -706,7 +681,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -721,7 +696,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -736,7 +711,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -751,7 +726,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index f900e716ae8..d7fb1293b34 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -24,6 +24,7 @@ namespace Org.OpenAPITools.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -35,6 +36,7 @@ namespace Org.OpenAPITools.Client.Auth string tokenUrl, string clientId, string clientSecret, + string scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -42,6 +44,7 @@ namespace Org.OpenAPITools.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -88,6 +91,12 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + var response = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index 672bff291b8..513d074d882 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -394,6 +394,12 @@ namespace Org.OpenAPITools.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -731,6 +737,7 @@ namespace Org.OpenAPITools.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 90ec4a6f193..8713a816f35 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -46,6 +46,12 @@ namespace Org.OpenAPITools.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string OAuthScope { get; } + /// /// Gets the OAuth flow. /// diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs index 3c5a860dd89..08a39249cb8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 0640bc68500..dce3f9134db 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ddec6a58568..c83597fc607 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs index 78077d2bed4..9ddb56ebad6 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 6d70e97a51c..e55d523aad1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 5ff006145c2..8d3f9af56df 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { // Cultivar (string) pattern diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 16df556db5d..3eef221be3e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 06e930e774c..3e1666ca90f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index da8a65b26f5..f2946f435b5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3e823100067..343e486f657 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 70aeea02471..04d69550656 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 6a4edb3394d..360cb5281e8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 838f5741cf6..868cba98eee 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index bd317ad8747..f46fffa0ad6 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 49a0dc8ada3..a427b55727d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs index 2313431e4d6..5edb4edfea4 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 8e76f168a65..a5d404bd17d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 61119cfffe0..7a0846aec4e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 4c1b999c7f1..bbed2128374 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index 3c1138fe977..3c81f50d00d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index d618b5ba110..9933ec57ea9 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1a6841a713c..2895d518a81 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 32f2bbd7fa7..44f95fa0fe0 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 1d18a58b117..98c683539e6 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 61591e9174d..2bec93345bb 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index de9905a5d94..27d1193954e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -369,7 +369,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index ab16133fe4b..7fb0e209454 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs index cf3b18a81c8..72b34e49262 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index ae9d8e1c05a..cd75dba4a92 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 570e3de7f65..3108c8a8691 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index fbed359747a..1ce81eece3e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 58d398101c8..7158640c24e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -355,78 +355,78 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum if (this.Integer < (int)10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); + yield return new ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum if (this.Int32 > (int)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum if (this.Int32 < (int)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); + yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); } // UnsignedInteger (uint) minimum if (this.UnsignedInteger < (uint)20) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + yield return new ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); } // Number (decimal) maximum if (this.Number > (decimal)543.2) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum if (this.Number < (decimal)32.1) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); + yield return new ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum if (this.Float > (float)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum if (this.Float < (float)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); + yield return new ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum if (this.Double > (double)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum if (this.Double < (double)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); + yield return new ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } if (this.String != null) { @@ -441,13 +441,13 @@ namespace Org.OpenAPITools.Model // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength if (this.Password != null && this.Password.Length < 10) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); + yield return new ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } if (this.PatternWithDigits != null) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 5441a63ab70..5e0d760c369 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 08e3b38bc37..3772b99bdb4 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -81,11 +81,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index 9907589d707..c22ccd6ebb5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -74,11 +74,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -94,7 +94,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -104,7 +104,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -115,7 +115,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -200,8 +200,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 8ca8d20eb0e..75285a73f6c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 2d4a1cd404f..3c6298d7d8d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 77ad8860aec..6fe07490776 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3d5a1ff7ad8..acf86063d05 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs index f02af3b0449..e06a3f381f1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 3efdf123845..57cc8110fbb 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index fdd59ea3787..49a7e091c23 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 3c36c57d1c9..691f128ea5f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -181,7 +181,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 6618a26476f..2b62d597547 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index a81b6df0419..49e94cc5e5d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -41,9 +41,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -53,9 +53,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -77,9 +77,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -89,9 +89,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -110,23 +110,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -193,7 +193,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -314,8 +314,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 6d208f3d9f6..bd0255888b8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 83fe641b56a..e2527cc3c31 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ec3e8e7b68c..5f51e31aa03 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { // UuidWithPattern (Guid) pattern diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs index 313d4f8a5f1..1906ce0b270 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedSubId.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index b5046d917fd..a023e3c3e75 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 59c8be24d66..69089499494 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs index e741caa493d..f34052aa706 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index b2573f9bb53..3fbd6e83ef2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 5c7b13e9b78..6e4a6ef50e7 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 63046e82052..8a3011986ec 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index 9387dcff85e..3c760b3abdd 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index d25f420362e..7218451d9fb 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 14022ef06ef..76faa5154c8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index b9b38efe7d2..b7278bd5600 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs index d9507325385..e9471d3ba02 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 42ddbc5c56f..47d598a27e6 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index 769c3612f3b..7a742134990 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in base.BaseValidate(validationContext)) { diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 4f2f095a85a..e4722f4a537 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs index fda1f010d9a..53b52bce70f 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 813b60a703f..5e447211814 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -96,19 +96,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index b3c52fb39de..1e12804ecd2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9f2f3d60b1f..3a364f98c1e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 233a10492f3..46ed3b3948c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 90e0c44b40b..d040204ece3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1033,7 +1033,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs index aaab21dc58c..fec56c44fa8 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 50995f4a505..4523238ad38 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index a2aa2f39a49..ef21c6091f3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index f50d01492be..1510bd5c512 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs index a3c9ca29a4b..12e4af15148 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -73,11 +73,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index c03107d52ee..9f8b4dd35b3 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index bdf09a757ac..6d8279a8bed 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -82,11 +82,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index f589c821c40..266dcfee794 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index ca5adcd816b..33320b76cf1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs index ec78b91f125..58eb2c605d1 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index b89ff43ced7..f7782b6fd5a 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 54d4db6cf28..8498a5eca78 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index c56b9e33651..457b88ac9c7 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 61991533230..37729a43816 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -85,15 +85,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 1c85da68ec7..34fa15105dc 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs index 8744ceac5ba..b7911507a70 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs index c4ae8981958..50119ed39e7 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index 58ec23be816..314fae589fc 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 239e8a16b64..617dcd5f7a0 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 2b84fd7b3a0..a465aeaf1e0 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 @@ -50,7 +50,12 @@ docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixLog.md +docs/MixedAnyOf.md +docs/MixedAnyOfContent.md +docs/MixedOneOf.md +docs/MixedOneOfContent.md docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/MixedSubId.md docs/Model200Response.md docs/ModelClient.md docs/Name.md @@ -172,7 +177,12 @@ 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/MixedAnyOf.cs +src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +src/Org.OpenAPITools/Model/MixedOneOf.cs +src/Org.OpenAPITools/Model/MixedOneOfContent.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/MixedSubId.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs src/Org.OpenAPITools/Model/Name.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 17bca178772..c5374468418 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md @@ -102,6 +102,8 @@ Class | Method | HTTP request | Description *FakeApi* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization +*FakeApi* | [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization *FakeApi* | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties *FakeApi* | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | @@ -186,7 +188,12 @@ Class | Method | HTTP request | Description - [Model.Mammal](Mammal.md) - [Model.MapTest](MapTest.md) - [Model.MixLog](MixLog.md) + - [Model.MixedAnyOf](MixedAnyOf.md) + - [Model.MixedAnyOfContent](MixedAnyOfContent.md) + - [Model.MixedOneOf](MixedOneOf.md) + - [Model.MixedOneOfContent](MixedOneOfContent.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.MixedSubId](MixedSubId.md) - [Model.Model200Response](Model200Response.md) - [Model.ModelClient](ModelClient.md) - [Model.Name](Name.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 e4713d2621c..f772773afef 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 @@ -1213,6 +1213,32 @@ paths: summary: Array of Enums tags: - fake + /fake/mixed/anyOf: + get: + operationId: getMixedAnyOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + description: Got mixed anyOf + summary: Test mixed type anyOf deserialization + tags: + - fake + /fake/mixed/oneOf: + get: + operationId: getMixedOneOf + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + description: Got mixed oneOf + summary: Test mixed type oneOf deserialization + tags: + - fake /country: post: operationId: getCountry @@ -2706,6 +2732,22 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixedOneOf: + example: + content: MixedOneOf_content + properties: + content: + $ref: '#/components/schemas/MixedOneOf_content' + MixedAnyOf: + example: + content: MixedAnyOf_content + properties: + content: + $ref: '#/components/schemas/MixedAnyOf_content' + MixedSubId: + properties: + id: + type: string MixLog: properties: id: @@ -2974,6 +3016,26 @@ components: name: type: string type: object + MixedOneOf_content: + description: Mixed oneOf types for testing + oneOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + MixedAnyOf_content: + anyOf: + - type: string + - type: boolean + - format: uint8 + type: integer + - format: float32 + type: number + - $ref: '#/components/schemas/MixedSubId' + description: Mixed anyOf types for testing securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FakeApi.md b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FakeApi.md index 356154a4b99..06309f31e8a 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FakeApi.md @@ -10,6 +10,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | | | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | | | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**GetMixedAnyOf**](FakeApi.md#getmixedanyof) | **GET** /fake/mixed/anyOf | Test mixed type anyOf deserialization | +| [**GetMixedOneOf**](FakeApi.md#getmixedoneof) | **GET** /fake/mixed/oneOf | Test mixed type oneOf deserialization | | [**TestAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | | | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | | @@ -549,6 +551,174 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetMixedAnyOf** +> MixedAnyOf GetMixedAnyOf () + +Test mixed type anyOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedAnyOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type anyOf deserialization + MixedAnyOf result = apiInstance.GetMixedAnyOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedAnyOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedAnyOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type anyOf deserialization + ApiResponse response = apiInstance.GetMixedAnyOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedAnyOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedAnyOf**](MixedAnyOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed anyOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetMixedOneOf** +> MixedOneOf GetMixedOneOf () + +Test mixed type oneOf deserialization + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class GetMixedOneOfExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Test mixed type oneOf deserialization + MixedOneOf result = apiInstance.GetMixedOneOf(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetMixedOneOf: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetMixedOneOfWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Test mixed type oneOf deserialization + ApiResponse response = apiInstance.GetMixedOneOfWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetMixedOneOfWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**MixedOneOf**](MixedOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got mixed oneOf | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestAdditionalPropertiesReference** > void TestAdditionalPropertiesReference (Dictionary requestBody) diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index 4f6ee8fad05..59ce0a9e7b1 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -145,6 +145,38 @@ namespace Org.OpenAPITools.Api /// ApiResponse of List<OuterEnum> ApiResponse> GetArrayOfEnumsWithHttpInfo(); /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// MixedAnyOf + MixedAnyOf GetMixedAnyOf(); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedAnyOf + ApiResponse GetMixedAnyOfWithHttpInfo(); + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// MixedOneOf + MixedOneOf GetMixedOneOf(); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedOneOf + ApiResponse GetMixedOneOfWithHttpInfo(); + /// /// test referenced additionalProperties /// /// Thrown when fails to make API call @@ -594,6 +626,48 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (List<OuterEnum>) System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + System.Threading.Tasks.Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type anyOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + System.Threading.Tasks.Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Test mixed type oneOf deserialization + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// test referenced additionalProperties /// /// @@ -1793,6 +1867,230 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// MixedAnyOf + public MixedAnyOf GetMixedAnyOf() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedAnyOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedAnyOf + public Org.OpenAPITools.Client.ApiResponse GetMixedAnyOfWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedAnyOf + public async System.Threading.Tasks.Task GetMixedAnyOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetMixedAnyOfWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test mixed type anyOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedAnyOf) + public async System.Threading.Tasks.Task> GetMixedAnyOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/fake/mixed/anyOf", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedAnyOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// MixedOneOf + public MixedOneOf GetMixedOneOf() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetMixedOneOfWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// ApiResponse of MixedOneOf + public Org.OpenAPITools.Client.ApiResponse GetMixedOneOfWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of MixedOneOf + public async System.Threading.Tasks.Task GetMixedOneOfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetMixedOneOfWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test mixed type oneOf deserialization + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (MixedOneOf) + public async System.Threading.Tasks.Task> GetMixedOneOfWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/fake/mixed/oneOf", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetMixedOneOf", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// test referenced additionalProperties /// diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 03f2371fcb7..57ca71f8a5c 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Apple)) + if (value.GetType() == typeof(Apple) || value is Apple) { this._actualInstance = value; } - else if (value.GetType() == typeof(Banana)) + else if (value.GetType() == typeof(Banana) || value is Banana) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 9ff316c8233..0b96c2fd9a7 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(AppleReq)) + if (value.GetType() == typeof(AppleReq) || value is AppleReq) { this._actualInstance = value; } - else if (value.GetType() == typeof(BananaReq)) + else if (value.GetType() == typeof(BananaReq) || value is BananaReq) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index 6d20d5d8d6c..fa2a72f1185 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -39,9 +39,9 @@ namespace Org.OpenAPITools.Model /// An instance of Apple. public GmFruit(Apple actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -51,9 +51,9 @@ namespace Org.OpenAPITools.Model /// An instance of Banana. public GmFruit(Banana actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -72,11 +72,11 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(Apple)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(Banana)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -92,7 +92,7 @@ namespace Org.OpenAPITools.Model /// An instance of Apple public Apple GetApple() { - return (Apple)this.ActualInstance; + return (Apple)ActualInstance; } /// @@ -102,7 +102,7 @@ namespace Org.OpenAPITools.Model /// An instance of Banana public Banana GetBanana() { - return (Banana)this.ActualInstance; + return (Banana)ActualInstance; } /// @@ -113,7 +113,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class GmFruit {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, GmFruit.SerializerSettings); } /// @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as GmFruit); + return Equals(input as GmFruit); } /// @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model if (input == null) return false; - return this.ActualInstance.Equals(input.ActualInstance); + return ActualInstance.Equals(input.ActualInstance); } /// @@ -201,8 +201,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index 19865bd1475..7510f4a229b 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -82,15 +82,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Pig)) + if (value.GetType() == typeof(Pig) || value is Pig) { this._actualInstance = value; } - else if (value.GetType() == typeof(Whale)) + else if (value.GetType() == typeof(Whale) || value is Whale) { this._actualInstance = value; } - else if (value.GetType() == typeof(Zebra)) + else if (value.GetType() == typeof(Zebra) || value is Zebra) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs index 11a86288d93..7a79e22bec7 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOfContent.cs @@ -39,9 +39,9 @@ namespace Org.OpenAPITools.Model /// An instance of string. public MixedAnyOfContent(string actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } /// @@ -51,9 +51,9 @@ namespace Org.OpenAPITools.Model /// An instance of bool. public MixedAnyOfContent(bool actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -63,9 +63,9 @@ namespace Org.OpenAPITools.Model /// An instance of int. public MixedAnyOfContent(int actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -75,9 +75,9 @@ namespace Org.OpenAPITools.Model /// An instance of decimal. public MixedAnyOfContent(decimal actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance; + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance; } /// @@ -87,9 +87,9 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId. public MixedAnyOfContent(MixedSubId actualInstance) { - this.IsNullable = false; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + IsNullable = false; + SchemaType= "anyOf"; + ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } @@ -108,23 +108,23 @@ namespace Org.OpenAPITools.Model { if (value.GetType() == typeof(MixedSubId)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(bool)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(decimal)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(int)) { - this._actualInstance = value; + _actualInstance = value; } else if (value.GetType() == typeof(string)) { - this._actualInstance = value; + _actualInstance = value; } else { @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// An instance of string public string GetString() { - return (string)this.ActualInstance; + return (string)ActualInstance; } /// @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// An instance of bool public bool GetBool() { - return (bool)this.ActualInstance; + return (bool)ActualInstance; } /// @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// An instance of int public int GetInt() { - return (int)this.ActualInstance; + return (int)ActualInstance; } /// @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// An instance of decimal public decimal GetDecimal() { - return (decimal)this.ActualInstance; + return (decimal)ActualInstance; } /// @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// An instance of MixedSubId public MixedSubId GetMixedSubId() { - return (MixedSubId)this.ActualInstance; + return (MixedSubId)ActualInstance; } /// @@ -191,7 +191,7 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class MixedAnyOfContent {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -202,7 +202,7 @@ namespace Org.OpenAPITools.Model /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, MixedAnyOfContent.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, MixedAnyOfContent.SerializerSettings); } /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as MixedAnyOfContent); + return Equals(input as MixedAnyOfContent); } /// @@ -303,7 +303,7 @@ namespace Org.OpenAPITools.Model if (input == null) return false; - return this.ActualInstance.Equals(input.ActualInstance); + return ActualInstance.Equals(input.ActualInstance); } /// @@ -315,8 +315,8 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs index 07b45a2ac7e..316352a3fed 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOfContent.cs @@ -106,23 +106,23 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(MixedSubId)) + if (value.GetType() == typeof(MixedSubId) || value is MixedSubId) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(decimal)) + else if (value.GetType() == typeof(decimal) || value is decimal) { this._actualInstance = value; } - else if (value.GetType() == typeof(int)) + else if (value.GetType() == typeof(int) || value is int) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index 2bc6b083fb0..756e0a75a51 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index 594bf54530e..da1a30c06ec 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(string)) + if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs index 2f94a3d1de2..4497aa54fc7 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(BasquePig)) + if (value.GetType() == typeof(BasquePig) || value is BasquePig) { this._actualInstance = value; } - else if (value.GetType() == typeof(DanishPig)) + else if (value.GetType() == typeof(DanishPig) || value is DanishPig) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index d632083ea5e..ca7b920a8d6 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -94,19 +94,19 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(List)) + if (value.GetType() == typeof(List) || value is List) { this._actualInstance = value; } - else if (value.GetType() == typeof(Object)) + else if (value.GetType() == typeof(Object) || value is Object) { this._actualInstance = value; } - else if (value.GetType() == typeof(bool)) + else if (value.GetType() == typeof(bool) || value is bool) { this._actualInstance = value; } - else if (value.GetType() == typeof(string)) + else if (value.GetType() == typeof(string) || value is string) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index 232eb3359b3..8a9c02ec490 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(ComplexQuadrilateral)) + if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(SimpleQuadrilateral)) + else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs index 59c1774706f..33161dd544a 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d04647a12a5..4a94799d97c 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(Quadrilateral)) + if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral) { this._actualInstance = value; } - else if (value.GetType() == typeof(Triangle)) + else if (value.GetType() == typeof(Triangle) || value is Triangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 2e9eb6ae394..6896dff7853 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -82,15 +82,15 @@ namespace Org.OpenAPITools.Model } set { - if (value.GetType() == typeof(EquilateralTriangle)) + if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(IsoscelesTriangle)) + else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle) { this._actualInstance = value; } - else if (value.GetType() == typeof(ScaleneTriangle)) + else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle) { this._actualInstance = value; } diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 3bffe996a62..230daa41983 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -288,7 +288,7 @@ defmodule OpenapiPetstore.Api.Fake do - `{:ok, nil}` on success - `{:error, Tesla.Env.t}` on failure """ - @spec test_additional_properties_reference(Tesla.Env.client, %{optional(String.t) => AnyType.t}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + @spec test_additional_properties_reference(Tesla.Env.client, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_additional_properties_reference(connection, request_body, _opts \\ []) do request = %{} diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex index 0f56ac1cb4c..e4de26d1460 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex @@ -93,7 +93,7 @@ defmodule OpenapiPetstore.Api.Pet do - `{:ok, [%Pet{}, ...]}` on success - `{:error, Tesla.Env.t}` on failure """ - @spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, list(OpenapiPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + @spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, [OpenapiPetstore.Model.Pet.t]} | {:error, Tesla.Env.t} def find_pets_by_status(connection, status, _opts \\ []) do request = %{} @@ -125,7 +125,7 @@ defmodule OpenapiPetstore.Api.Pet do - `{:ok, [%Pet{}, ...]}` on success - `{:error, Tesla.Env.t}` on failure """ - @spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, list(OpenapiPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + @spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, [OpenapiPetstore.Model.Pet.t]} | {:error, Tesla.Env.t} def find_pets_by_tags(connection, tags, _opts \\ []) do request = %{} diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index c56879d3aca..ec2ac351d05 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -525,18 +525,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index d2cb7e88a33..0dddb61a87a 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -29,8 +29,8 @@ type FormatTest struct { Number float32 `json:"number"` Float *float32 `json:"float,omitempty"` Double *float64 `json:"double,omitempty"` - String *string `json:"string,omitempty"` - Byte string `json:"byte"` + String *string `json:"string,omitempty" validate:"regexp=[a-z]/i"` + Byte string `json:"byte" validate:"regexp=^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$"` Binary **os.File `json:"binary,omitempty"` Date string `json:"date"` DateTime *time.Time `json:"dateTime,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/utils.go b/samples/client/petstore/go/go-petstore/utils.go index 5e3318857b3..a2dcd6eac4b 100644 --- a/samples/client/petstore/go/go-petstore/utils.go +++ b/samples/client/petstore/go/go-petstore/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package petstore import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index 0ee22c086e7..28c8b726cd8 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -28,8 +28,8 @@ repositories { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.9.10" - jackson_databind_version = "2.9.10.8" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" } dependencies { diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs index 9062b81abfc..b94edcc7757 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Core.hs @@ -23,6 +23,7 @@ Module : OpenAPIPetstore.Core {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e35aa70a930..c97882e37d4 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesAnyType extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index d06f2277cfc..9fd264eb08c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesArray extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 020fe5ebd46..35ea5894497 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesBoolean extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 5b03dacb07f..d71ac3c89e4 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -96,7 +96,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,7 +126,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,7 +156,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,7 +216,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,7 +246,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,7 +276,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -306,7 +306,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -328,7 +328,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,7 +350,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -372,7 +372,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 2ace085ef0e..af9aa565ae7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesInteger extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 4cd69b8e35c..45127d36183 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -48,7 +48,7 @@ public class AdditionalPropertiesNumber extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ff6403683b9..d0e44cd0e35 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesObject extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 014ed4d019a..491cf7067f7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -47,7 +47,7 @@ public class AdditionalPropertiesString extends HashMap { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java index cd684ce6481..709ffdb1cf9 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java @@ -62,7 +62,7 @@ public class Animal { /** * Get className * @return className - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -84,7 +84,7 @@ public class Animal { /** * Get color * @return color - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 88f0ca7ceff..2153613e782 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index df01b71e972..c9930ea3a2a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -56,7 +56,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java index 66b248bbf5a..d82d91dd574 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java @@ -64,7 +64,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -94,7 +94,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,7 +124,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java index 67922356e41..82b7333ddcc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java @@ -81,7 +81,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java index 190591384a2..584c81ddb15 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java @@ -64,7 +64,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,7 +86,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,7 +108,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,7 +130,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -152,7 +152,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,7 +174,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java index 2276c96b7fa..f6f1bda6a31 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java @@ -46,7 +46,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java index d3dd23589e2..1721dcb3e18 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java @@ -48,7 +48,7 @@ public class Category { /** * Get id * @return id - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,7 +70,7 @@ public class Category { /** * Get name * @return name - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java index b40c692586e..2053923f2c2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java @@ -44,7 +44,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java index 7613bf238d7..467f4ab9cdc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java @@ -46,7 +46,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java index fd5552ded7d..9f3956151fd 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java @@ -117,7 +117,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,7 +147,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java index 14b880b570b..0628d31f525 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java @@ -196,7 +196,7 @@ public class EnumTest { /** * Get enumString * @return enumString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -240,7 +240,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,7 +262,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,7 +284,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 6f8167af816..06bfec0e2f3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -52,7 +52,7 @@ public class FileSchemaTestClass { /** * Get _file * @return _file - **/ + */ @Valid @Nullable @JsonProperty(JSON_PROPERTY_FILE) @@ -83,7 +83,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java index 3ac81d8e742..4f250c7cf9a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java @@ -104,7 +104,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - **/ + */ @Nullable @Min(10) @Max(100) @@ -130,7 +130,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @Nullable @Min(20) @Max(200) @@ -154,7 +154,7 @@ public class FormatTest { /** * Get int64 * @return int64 - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -178,7 +178,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @NotNull @DecimalMin("32.1") @DecimalMax("543.2") @@ -204,7 +204,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @Nullable @DecimalMin("54.3") @DecimalMax("987.6") @@ -230,7 +230,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @Nullable @DecimalMin("67.8") @DecimalMax("123.4") @@ -254,7 +254,7 @@ public class FormatTest { /** * Get string * @return string - **/ + */ @Nullable @Pattern(regexp="/[a-z]/i") @JsonProperty(JSON_PROPERTY_STRING) @@ -277,7 +277,7 @@ public class FormatTest { /** * Get _byte * @return _byte - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -299,7 +299,7 @@ public class FormatTest { /** * Get binary * @return binary - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,7 +321,7 @@ public class FormatTest { /** * Get date * @return date - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -345,7 +345,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,7 +369,7 @@ public class FormatTest { /** * Get uuid * @return uuid - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -391,7 +391,7 @@ public class FormatTest { /** * Get password * @return password - **/ + */ @NotNull @Size(min=10, max=64) @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -414,7 +414,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index ff98e508577..2ccc33a4467 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -44,7 +44,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java index a7c9f10c6f6..1d549d7ee7c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java @@ -99,7 +99,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,7 +129,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -159,7 +159,7 @@ public class MapTest { /** * Get directMap * @return directMap - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,7 +189,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d6f714b2f1f..699fd1c8190 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -57,7 +57,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,7 +79,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -111,7 +111,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java index 676f7c1cd35..a29295edf3a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java @@ -49,7 +49,7 @@ public class Model200Response { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,7 +71,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java index ac8c662124c..5902d5e02da 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -53,7 +53,7 @@ public class ModelApiResponse { /** * Get code * @return code - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,7 +75,7 @@ public class ModelApiResponse { /** * Get type * @return type - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,7 +97,7 @@ public class ModelApiResponse { /** * Get message * @return message - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java index 750e61dc372..a3f2ad5baea 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java @@ -45,7 +45,7 @@ public class ModelClient { /** * Get _client * @return _client - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java index 5b3efb79fa6..534d2044f11 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -45,7 +45,7 @@ public class ModelFile { /** * Test capitalization * @return sourceURI - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java index 56167275922..c8774c2be36 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -45,7 +45,7 @@ public class ModelList { /** * Get _123list * @return _123list - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java index 905b0d27b69..ecbc038d2ad 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java @@ -45,7 +45,7 @@ public class ModelReturn { /** * Get _return * @return _return - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java index 9261139deb3..db0979dc2dc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java @@ -56,7 +56,7 @@ public class Name { /** * Get name * @return name - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -73,7 +73,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,7 +106,7 @@ public class Name { /** * Get _123number * @return _123number - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java index bfd2e1b1c9a..6d7d2dbb40e 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java @@ -45,7 +45,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java index cf88b4b6f57..031652e3ae5 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java @@ -99,7 +99,7 @@ public class Order { /** * Get id * @return id - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,7 +121,7 @@ public class Order { /** * Get petId * @return petId - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -143,7 +143,7 @@ public class Order { /** * Get quantity * @return quantity - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,7 +165,7 @@ public class Order { /** * Get shipDate * @return shipDate - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,7 +189,7 @@ public class Order { /** * Order Status * @return status - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -211,7 +211,7 @@ public class Order { /** * Get complete * @return complete - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java index 09e17d40aa2..979e231358f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java @@ -53,7 +53,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,7 +75,7 @@ public class OuterComposite { /** * Get myString * @return myString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,7 +97,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index 23f591febeb..58d64c77b71 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -106,7 +106,7 @@ public class Pet { /** * Get id * @return id - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,7 +128,7 @@ public class Pet { /** * Get category * @return category - **/ + */ @Valid @Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -151,7 +151,7 @@ public class Pet { /** * Get name * @return name - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -178,7 +178,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,7 +209,7 @@ public class Pet { /** * Get tags * @return tags - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -231,7 +231,7 @@ public class Pet { /** * pet status in the store * @return status - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 3d27baadb88..3bec1dbec87 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -43,7 +43,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -59,7 +59,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java index e5405deb496..441752daee2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java @@ -45,7 +45,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java index 0faae4e9fff..e8ddb95ad8f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java @@ -48,7 +48,7 @@ public class Tag { /** * Get id * @return id - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,7 +70,7 @@ public class Tag { /** * Get name * @return name - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7abbf13b6a3..bd8051e1a6d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -64,7 +64,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,7 +86,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,7 +108,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,7 +130,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -157,7 +157,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java index 4153768282d..11ea7647ced 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -68,7 +68,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -90,7 +90,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -112,7 +112,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -134,7 +134,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,7 +156,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -183,7 +183,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - **/ + */ @NotNull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java index a2624029cef..0e3720071a8 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java @@ -72,7 +72,7 @@ public class User { /** * Get id * @return id - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -94,7 +94,7 @@ public class User { /** * Get username * @return username - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,7 +116,7 @@ public class User { /** * Get firstName * @return firstName - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,7 +138,7 @@ public class User { /** * Get lastName * @return lastName - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,7 +160,7 @@ public class User { /** * Get email * @return email - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,7 +182,7 @@ public class User { /** * Get password * @return password - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -204,7 +204,7 @@ public class User { /** * Get phone * @return phone - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,7 +226,7 @@ public class User { /** * User Status * @return userStatus - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java index 50bb3c9bef3..8847c18e13f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,7 +182,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -204,7 +204,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,7 +226,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,7 +256,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,7 +278,7 @@ public class XmlItem { /** * Get nameString * @return nameString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,7 +300,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -322,7 +322,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -344,7 +344,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -374,7 +374,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -404,7 +404,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -426,7 +426,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,7 +448,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,7 +470,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -492,7 +492,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,7 +522,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -552,7 +552,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -574,7 +574,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -618,7 +618,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -640,7 +640,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -670,7 +670,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -700,7 +700,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -722,7 +722,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -744,7 +744,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -766,7 +766,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -788,7 +788,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -818,7 +818,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -848,7 +848,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index ec2a9fb4114..1fa4cfce22c 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -114,8 +114,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.6" - jackson_version = "2.14.1" - jackson_databind_version = "2.14.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" httpclient_version = "5.1.3" diff --git a/samples/client/petstore/java/apache-httpclient/pom.xml b/samples/client/petstore/java/apache-httpclient/pom.xml index 487bc0bba13..32d6030cd62 100644 --- a/samples/client/petstore/java/apache-httpclient/pom.xml +++ b/samples/client/petstore/java/apache-httpclient/pom.xml @@ -270,8 +270,8 @@ UTF-8 5.2.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 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 9f66d5da617..c22d56226c2 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 @@ -56,6 +56,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -148,8 +149,8 @@ public class ApiClient extends JavaTimeFormatter { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -298,16 +299,18 @@ public class ApiClient extends JavaTimeFormatter { * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -874,6 +877,7 @@ public class ApiClient extends JavaTimeFormatter { // convert input stream to string return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", response.getCode(), @@ -1019,12 +1023,15 @@ public class ApiClient extends JavaTimeFormatter { } protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { - statusCode = response.getCode(); + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } 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 84de2a4f670..040c6e75c94 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 @@ -60,10 +60,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -93,10 +93,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 980be8ec243..6bc4826161c 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 @@ -51,10 +51,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,10 +76,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 30e7337ce5c..a1278cf0186 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 @@ -63,10 +63,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7a48e7f957a..1f32a41451f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -58,10 +58,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index cbabb402460..143352c33b7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -58,10 +58,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3bb3331b52d..2d690b04041 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 @@ -66,10 +66,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -99,10 +99,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,10 +132,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4851d3a039a..88c52258b87 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 @@ -66,10 +66,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -91,10 +91,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -141,10 +141,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,10 +191,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index 4ddf316dbf7..a7ac3b993b7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -57,10 +57,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 41b54c7ec7f..f01a7b54c88 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 @@ -50,10 +50,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java index abf1dfeeb4a..e92f1d9820b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -58,10 +58,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java index 1a7db0c0e98..7368ed0c0a1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -46,10 +46,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java index 5f06b467681..d39e497a124 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java @@ -46,10 +46,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index fef673deba1..603bee1350c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -48,10 +48,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java index 3f41b9c2b30..bba3ef95836 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java @@ -57,10 +57,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 695ca7dd9f0..1d02d7811b6 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 @@ -123,10 +123,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,10 +156,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4e7ba2a256e..1f0d09e454f 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 @@ -227,10 +227,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -252,10 +252,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -277,10 +277,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -302,10 +302,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,10 +327,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -360,10 +360,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -385,10 +385,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,10 +410,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e1de2fcf94f..c0be985af93 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 @@ -54,10 +54,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,10 +87,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7dec3c6b5c5..f4b00229817 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 @@ -54,10 +54,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,10 +87,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java index a47b0509553..bb6d8b62182 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java @@ -46,10 +46,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 10f615212cb..ccef5008767 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -48,10 +48,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ab205f9d34c..30f33028d36 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 @@ -112,12 +112,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +139,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +191,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -218,12 +218,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -245,12 +245,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -272,10 +272,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -297,10 +297,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -322,10 +322,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -347,10 +347,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -372,10 +372,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -397,10 +397,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,10 +422,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -447,10 +447,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -472,10 +472,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -497,10 +497,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 dde8ec31120..e5008d2a020 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 @@ -45,8 +45,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -57,10 +57,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index be75418687b..bb86802b79f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -50,10 +50,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 8288e44202d..0913afc5829 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 @@ -103,10 +103,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,10 +136,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -169,10 +169,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,10 +202,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 59d1e25e1da..be61b9c1582 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 @@ -59,10 +59,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -117,10 +117,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e81885ce408..001475394db 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 @@ -51,10 +51,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,10 +76,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ccea22fa758..aa6418cb154 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 @@ -55,10 +55,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,10 +105,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java index 6710d992bff..1e14f17ee02 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -47,10 +47,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java index e2440736c9d..414807a04df 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -47,10 +47,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java index cdf054a82c0..bd3dd3962e0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -47,10 +47,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9dbce4f2d3f..727f3f4507e 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 @@ -52,8 +52,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -70,10 +70,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -89,10 +89,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,10 +109,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ddd30b29fda..9894f8378b6 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 @@ -103,10 +103,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -136,10 +136,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -169,10 +169,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -202,10 +202,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -235,10 +235,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -268,10 +268,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -313,10 +313,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -358,10 +358,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -399,10 +399,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,10 +436,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -481,10 +481,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -522,10 +522,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java index b3d0f22955a..f8dea367f75 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -47,10 +47,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 2f20ee169ae..c25966916bf 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 @@ -63,10 +63,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,11 +88,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -115,11 +115,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -150,11 +150,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 f22051c7afb..5addea4dee2 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 @@ -104,10 +104,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -179,10 +179,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -204,10 +204,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -229,10 +229,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4a4ceb09ff8..50a3c5620e9 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 @@ -55,10 +55,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,10 +105,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 6e97cc6e35d..86cf7bfe524 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -47,10 +47,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 5e14211369a..d0cbb666f11 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 @@ -99,10 +99,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,10 +124,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 dd8a171628c..c3dba3165af 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 @@ -111,10 +111,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,10 +136,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -194,10 +194,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -228,10 +228,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -253,10 +253,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 b535252ceb7..9c33541fdb3 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 @@ -44,8 +44,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -54,10 +54,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 157ce0e9c11..7f61f2f6204 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -47,10 +47,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 54d7b3628d8..c0ecc59b92a 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 @@ -50,10 +50,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 78dd164411b..4ccfce702df 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -50,10 +50,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap${java.version} 13.2.1 3.8.0 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 1.3.5 5.10.0 1.0.0 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 1f99fd91828..df62d95a75a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -51,10 +51,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 7adfede99e1..22356d73e8a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -52,10 +52,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d6aa06ff7fa..0dfc457341b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -51,10 +51,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 6ca0f0cbf1d..4134c09160a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -96,10 +96,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,10 +164,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -198,10 +198,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,10 +232,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -266,10 +266,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,10 +300,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -334,10 +334,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -360,10 +360,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -386,10 +386,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -412,10 +412,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f4b498a85b9..ab7e0c8384b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -51,10 +51,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 96154065f5a..1fc83304a4d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -52,10 +52,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 3b453a608e9..5b1858762f0 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -51,10 +51,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 225ada298f6..c5d7a0e561d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -51,10 +51,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 21b0d5da0a8..0898227b886 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -62,10 +62,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 202edbcfa4f..27741ef018d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index fae15815884..fbffadccebd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 2947c382993..8ad411c71f9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,10 +132,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 6c586b433c4..fb66269364e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -94,10 +94,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index c127c675fac..068f85d566d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -64,10 +64,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,10 +142,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,10 +194,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 6550f2bc854..78d8eb69b19 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -58,10 +58,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 49a300e542d..b764099aae2 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -48,10 +48,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 0581ad55f5c..a3bd6901f18 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -44,10 +44,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 251fe6f05d2..f6433a5d19f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -44,10 +44,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 9c257617dd4..dcc093423db 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -55,10 +55,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 51077c8abeb..a8c3725dc7b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,10 +155,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 4144244439e..42e50d8c881 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -206,10 +206,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,10 +232,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -258,10 +258,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,10 +284,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,10 +310,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java index 3cf255ae5bc..6bfeb14a4f5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java @@ -44,10 +44,10 @@ public class File { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f6b2d4cb61d..124223d25e4 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get file * @return file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,10 +86,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 5f2a8df2148..6eb29e2a9cf 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -102,12 +102,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +130,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +184,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -212,12 +212,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +240,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,10 +268,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -320,10 +320,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -346,10 +346,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -372,10 +372,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -398,10 +398,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -424,10 +424,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -450,10 +450,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b6c691bdfcf..61f2c8671f4 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -53,10 +53,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index bec55d78233..5a5a2f9694c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -101,10 +101,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -169,10 +169,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,10 +203,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4673208d246..31d89d04ea9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -57,10 +57,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -117,10 +117,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 1310d87cf6e..681a2e87fbd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -49,10 +49,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index be131471802..a4e099a7092 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -53,10 +53,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,10 +105,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index aa981b5f1f3..ea3919f4bbc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -45,10 +45,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 8b1a1e690b1..b078104c1cf 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -45,10 +45,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index d9cc9f85e37..db8639e24c5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -66,10 +66,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,10 +127,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index cf7274e69d8..b8073b95759 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -45,10 +45,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 002a781b198..681d03aeba5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -102,10 +102,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,10 +180,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -206,10 +206,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,10 +232,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 9f487753d9a..091d120fc9c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -53,10 +53,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,10 +105,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index d43c9540fec..258d4d9dc45 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -195,10 +195,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -230,10 +230,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,10 +256,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 3b864383709..bc07fcc77b6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -50,10 +50,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 85882dae8b7..edee77c465b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -45,10 +45,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 8197f49c031..8a1fa66fe90 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -48,10 +48,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ffe05908e55..fee171fb91a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -64,10 +64,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -90,10 +90,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -116,10 +116,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -142,10 +142,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -176,10 +176,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ef171df21c8..f27456c6865 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -68,10 +68,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -94,10 +94,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -120,10 +120,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -146,10 +146,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -172,10 +172,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -206,10 +206,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index e329bca3dd8..0569f1061c1 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -72,10 +72,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,10 +124,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,10 +150,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,10 +202,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -228,10 +228,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -254,10 +254,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index f7875bae573..a86f52ae4dc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -160,10 +160,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,10 +186,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -212,10 +212,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,10 +238,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -272,10 +272,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -298,10 +298,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,10 +350,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,10 +376,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,10 +410,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,10 +470,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,10 +496,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,10 +522,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -548,10 +548,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -582,10 +582,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,10 +616,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,10 +642,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -668,10 +668,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -694,10 +694,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -720,10 +720,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,10 +754,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -788,10 +788,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -814,10 +814,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,10 +840,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -866,10 +866,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -892,10 +892,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -926,10 +926,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -960,10 +960,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 208a57b743a..756d3c28211 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -102,8 +102,8 @@ test { ext { swagger_annotations_version = "1.6.11" - jackson_version = "2.14.3" - jackson_databind_version = "2.14.3" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" feign_version = "10.12" @@ -123,8 +123,8 @@ dependencies { 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 "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 20373fa5917..43461088aab 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -16,11 +16,11 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.14.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.14.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index cac4893c0b7..59ae4c527f6 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -318,9 +318,9 @@ ${java.version} 13.2.1 3.8.0 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 - 2.15.2 1.3.5 5.10.0 1.0.0 diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 15c81f67304..64501e75d1b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -91,10 +91,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 4cd0c2c2275..38df466836e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index c46e19634f7..cf6e3054014 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 90cc118266d..163fa139e1b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 0e68868cc53..85655583b0f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 9fc572f5973..676103a3f77 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,10 +97,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +131,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index a319b3e0cdc..41ae4887e8e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -89,10 +89,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -115,10 +115,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -141,10 +141,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,10 +167,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -193,10 +193,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 5936ccfd6ee..45a6ff37fec 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index da916ec5c36..1c1c355ad71 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ChildWithNullable.java index d32ed4f48d0..3cc14f1a760 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index b9930b0635b..a37a999d63f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index ee89634719f..f078e497ee2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java index c5973f85aa4..86841317f71 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 64cface33c6..1229e6d4900 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index f4be953a198..baaee7fe509 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index 51a0fdd56b7..dde8a9f4523 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -276,10 +276,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -302,10 +302,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -328,10 +328,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -362,10 +362,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -388,10 +388,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -414,10 +414,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 7353952557f..76d6622e674 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java index 40b9548db32..8ef3e40f4aa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java @@ -43,10 +43,10 @@ public class File { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 604eb01717e..e5422f3f102 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get file * @return file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java index 52fd445a533..7cc2a934b3a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index e76d84e5ef7..c1e044dbf2f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 3e994904049..8b6f445b53b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,12 +137,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,10 +165,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +191,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -219,12 +219,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +247,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,10 +275,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,10 +301,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,10 +327,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -353,10 +353,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -379,10 +379,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -405,10 +405,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -431,10 +431,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -457,10 +457,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -483,10 +483,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -509,10 +509,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bcecb9ee453..6cc4c69acd1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -52,10 +52,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -67,10 +67,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java index d2bfc3e179c..fe26b809d0f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 64cedaf5f02..10a594fe94c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,10 +134,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,10 +202,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6e7b6f9d08c..6709b3a0018 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,10 +82,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index 9b665e9afb4..4b281c4a06c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9fbc829b99b..2f6574bab18 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,10 +78,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java index f4ca6236387..37efb8989f4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index 1e558d1a4e0..f511bf4a6a6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 6933f546d63..a355d3d22dc 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -65,10 +65,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index 1227710df63..bf367a6318d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -104,10 +104,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -138,10 +138,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -172,10 +172,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -206,10 +206,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -240,10 +240,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -274,10 +274,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -320,10 +320,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -366,10 +366,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -408,10 +408,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -446,10 +446,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -492,10 +492,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -534,10 +534,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 96300c93ccd..bf4cf5f9dd6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 07631903555..f2f8f697f93 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,11 +86,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -114,11 +114,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -150,11 +150,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 06adf4ad213..7ae6e4fb0ae 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,10 +127,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -179,10 +179,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -205,10 +205,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -231,10 +231,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index e0be1821707..4d378ce3a2f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,10 +78,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index fff7c348f00..d7f1d69feb6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 793e37fd082..93ce3d7bfea 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,10 +122,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 7b26c719a31..8c266753cb4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,10 +134,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,10 +160,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -194,10 +194,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -229,10 +229,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -255,10 +255,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f03e4afd6a8..f104ac98e77 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -49,10 +49,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,10 +70,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index 90cff2551c3..355206c22fd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index 68f8fe5655c..c7a0892f9fd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 030082e0c11..e61f98179af 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -51,10 +51,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapUTF-8 2.2.0 2.40 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 1.0.0 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index c44efb80b92..f5d6526054b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb5a34572ee..10f4788c75e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -47,10 +47,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index bc7b72a9c0f..8c97438fb92 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 07369d6cefd..333bf9cf868 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 @@ -95,10 +95,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +161,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,10 +194,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -227,10 +227,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,10 +260,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,10 +326,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,10 +351,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,10 +376,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -401,10 +401,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 9c71be2635d..d227fafd55c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b743d0c1369..48f234227fd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -47,10 +47,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 8410739124e..4697b13ff24 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 615abde4eae..b16b5272e25 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 711644819bf..bfeffbb42fd 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 @@ -61,10 +61,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b73a6b95c5b..0fb7c3ccf51 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ffb6c03113c..4261ff3c03b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 41b29a30249..ef4b636e71d 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index 58ffbf2d228..2676d86a37b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -93,10 +93,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 accb755a668..cd221f2a733 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 121bba4519c..fecf436ef92 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 @@ -57,10 +57,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed8e1e2da05..8a373c41fc1 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..3a22cce40b5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..d9eb667823f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..c026300889e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 58a77ffded8..f4de7bccc58 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 53ee553f740..f4813fef674 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 @@ -205,10 +205,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -230,10 +230,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -255,10 +255,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -280,10 +280,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,10 +305,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e149084b1a5..899d32a294d 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9ad002a3da0..21c552de700 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 @@ -101,12 +101,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,12 +128,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,10 +155,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,12 +180,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -207,12 +207,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +234,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,10 +261,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -286,10 +286,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -311,10 +311,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,10 +336,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -361,10 +361,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -386,10 +386,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -411,10 +411,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -436,10 +436,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9fc24a2b7f4..7cab692c045 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 136e37557dd..29f371af8b0 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4ec2bb53611..dd6f0ad59bb 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 517b2eb9f07..7c0af5e4781 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8f27c57192..4ca95892895 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..42e71d96a66 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..dd0d3fd9653 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..16728e09539 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 458314f0d83..fe05ad26482 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..436cd1f2ba1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 05dfbdaeefa..f8ab64dbb0a 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7045f92dd8f..1768fc9496d 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 180ee4787ba..a26c02589d1 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d585c01ecc3..08e36c5f03d 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index c445b6f653e..62f674ba6db 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 201029ba21a..181ed783218 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 579da79a3e7..8f9ea0c9110 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 @@ -63,10 +63,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -113,10 +113,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -138,10 +138,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,10 +171,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 4fb1973cb1b..f358d529562 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 @@ -67,10 +67,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -92,10 +92,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -117,10 +117,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -142,10 +142,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -167,10 +167,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -200,10 +200,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 b501d23345c..9dcf5d067a6 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 @@ -71,10 +71,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -146,10 +146,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -171,10 +171,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,10 +196,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,10 +221,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,10 +246,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 92837b71b1c..e65878cd49e 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 @@ -159,10 +159,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,10 +184,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,10 +209,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,10 +234,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,10 +267,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -292,10 +292,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -317,10 +317,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,10 +342,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,10 +367,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -400,10 +400,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -458,10 +458,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -483,10 +483,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -508,10 +508,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,10 +533,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -566,10 +566,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -599,10 +599,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -624,10 +624,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -649,10 +649,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -674,10 +674,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -699,10 +699,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -732,10 +732,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -765,10 +765,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -790,10 +790,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,10 +815,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,10 +840,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -865,10 +865,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -898,10 +898,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -931,10 +931,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index a8a3b39d2eb..457d15bc403 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt index 9619da28e00..3c54441eae1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index ae5adf25273..204486a2780 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -334,8 +334,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java index 77026bef2d2..6168b0e8045 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java @@ -193,7 +193,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -213,7 +213,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -234,7 +234,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -255,7 +255,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -276,7 +276,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -321,7 +321,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -369,7 +369,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -391,7 +391,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -423,7 +423,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -456,7 +456,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -521,7 +521,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -543,7 +543,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -555,7 +555,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -575,7 +575,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -597,7 +597,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -621,7 +621,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -643,7 +643,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -666,7 +666,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -687,7 +687,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java index 4cb6d2218fd..677a8b64f42 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java @@ -83,7 +83,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java index 2cf3383f0bc..33dc8d6bf09 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java @@ -201,7 +201,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -249,7 +249,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -386,7 +386,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 15335780fed..2cc1a9bbc58 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index a049ed2e305..58c54041946 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesAnyType { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 5f0a8b8836c..d722c0075d6 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesArray { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 9c73d890d34..a8c9dff0b81 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesBoolean { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 116758826e1..b4f7dd9a7f1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -97,10 +97,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,10 +196,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -229,10 +229,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,10 +262,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,10 +295,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -328,10 +328,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,10 +353,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -378,10 +378,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,10 +403,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index b48d0400584..b7a490cdf57 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesInteger { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 6aa11ca7e64..a891e7d249e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesNumber { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d7e76558abb..a8743dfb2f3 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 6a7205d7cb0..01a50740e5e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesString { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java index 49a62382e0d..6e53d3baec8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java @@ -63,10 +63,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8e681b33761..4cf0854cd9f 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4f6f32c16e1..138899b8719 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java index fefd82a02a8..4bfcf690407 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,10 +97,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java index 7b66a21470e..b83fece70ff 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java @@ -94,10 +94,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java index 88158f86a67..18d2b6cb2c2 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Capitalization.java @@ -65,10 +65,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -115,10 +115,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,10 +140,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java index b72c824a694..d04932d6587 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java @@ -58,10 +58,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java index 2eab9c20f34..79852f6f51b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Category.java @@ -49,10 +49,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java index 9a20e671038..91ed1c5728e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ClassModel.java @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java index 076a8a5b323..ff8cb2970a9 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Client.java @@ -45,10 +45,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java index ec796f0baa7..331c74cbd9c 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java @@ -55,10 +55,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java index 8068c291c86..f6cb5ffefa5 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java index 9e9fbc54975..f3c02c1dbca 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java @@ -207,10 +207,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,10 +232,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -257,10 +257,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -282,10 +282,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -307,10 +307,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eb1f8ababde..55076414fd4 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java index 0eb22552a66..d7a73495ad5 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FormatTest.java @@ -103,12 +103,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +130,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +182,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +209,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,12 +236,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -263,10 +263,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -288,10 +288,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -313,10 +313,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -338,10 +338,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -363,10 +363,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -388,10 +388,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -413,10 +413,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -438,10 +438,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 8a3fa9350cc..657166b59a1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -55,10 +55,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,10 +70,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java index 723696541fa..c03044c81f9 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MapTest.java @@ -102,10 +102,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 572c1b382dd..d8e5e17d7aa 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -58,10 +58,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java index d38a6bf453a..a0c1cf630d6 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Model200Response.java @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d41b65dd3f7..c821f25700a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -54,10 +54,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java index 90a694b50a7..133103caad8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java @@ -46,10 +46,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java index f3f7b550ee6..601bfa200fa 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java @@ -46,10 +46,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java index 23ca526f635..d7919c9d674 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java index 5665c45484a..6a81682684a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Name.java @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,10 +87,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,10 +127,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java index ee815a0182b..069be583d8c 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -46,10 +46,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java index d03ca882d31..7cbc489e308 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Order.java @@ -103,10 +103,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -178,10 +178,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,10 +203,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -228,10 +228,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java index 2b89f20e8e7..e64e063a440 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -54,10 +54,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java index ea78ae4c5c9..6e223b371a9 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,10 +134,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -159,10 +159,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -192,10 +192,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -226,10 +226,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,10 +251,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0c3ba6ce34e..893928438c7 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -52,10 +52,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java index 3bf951a8ff1..44017d0d721 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -46,10 +46,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java index aed85c4e82f..250788cbb19 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Tag.java @@ -49,10 +49,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8c03fbe8e1c..1a140b1d503 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -64,10 +64,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -89,10 +89,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -114,10 +114,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -139,10 +139,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -172,10 +172,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 04b89edc6a1..72ae317f168 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -68,10 +68,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -93,10 +93,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -118,10 +118,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -143,10 +143,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -168,10 +168,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -201,10 +201,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java index 33b74195d1e..1a261d34539 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/User.java @@ -73,10 +73,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,10 +123,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -198,10 +198,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,10 +223,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,10 +248,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java index ac33c541805..56c5828270e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java @@ -160,10 +160,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,10 +185,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,10 +210,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,10 +235,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,10 +268,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -318,10 +318,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -343,10 +343,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,10 +368,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -401,10 +401,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -434,10 +434,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -459,10 +459,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -484,10 +484,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -509,10 +509,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -534,10 +534,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -567,10 +567,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -600,10 +600,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -625,10 +625,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -650,10 +650,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -675,10 +675,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -700,10 +700,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -733,10 +733,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -766,10 +766,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -791,10 +791,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -816,10 +816,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,10 +841,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -866,10 +866,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -899,10 +899,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -932,10 +932,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 3b8cada1e29..ea38c707184 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 67a8cb45b67..990eb0f811e 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index b6f3f07c1e0..1a2acde66f4 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -334,8 +334,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 77026bef2d2..6168b0e8045 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -193,7 +193,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -213,7 +213,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -234,7 +234,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -255,7 +255,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -276,7 +276,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -321,7 +321,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -369,7 +369,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -391,7 +391,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -423,7 +423,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -456,7 +456,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -521,7 +521,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -543,7 +543,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -555,7 +555,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -575,7 +575,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -597,7 +597,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -621,7 +621,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -643,7 +643,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -666,7 +666,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -687,7 +687,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java index 4cb6d2218fd..677a8b64f42 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -83,7 +83,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index afe33817edc..339e1c3fb0a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -201,7 +201,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -249,7 +249,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -386,7 +386,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 15335780fed..2cc1a9bbc58 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index a049ed2e305..58c54041946 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesAnyType { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 5f0a8b8836c..d722c0075d6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesArray { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 9c73d890d34..a8c9dff0b81 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesBoolean { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 116758826e1..b4f7dd9a7f1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -97,10 +97,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,10 +196,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -229,10 +229,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,10 +262,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,10 +295,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -328,10 +328,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,10 +353,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -378,10 +378,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,10 +403,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index b48d0400584..b7a490cdf57 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesInteger { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 6aa11ca7e64..a891e7d249e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesNumber { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index d7e76558abb..a8743dfb2f3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -50,10 +50,10 @@ public class AdditionalPropertiesObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 6a7205d7cb0..01a50740e5e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesString { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 49a62382e0d..6e53d3baec8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -63,10 +63,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8e681b33761..4cf0854cd9f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4f6f32c16e1..138899b8719 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index fefd82a02a8..4bfcf690407 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,10 +97,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index 7b66a21470e..b83fece70ff 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -94,10 +94,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 88158f86a67..18d2b6cb2c2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -65,10 +65,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -115,10 +115,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,10 +140,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index b72c824a694..d04932d6587 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -58,10 +58,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 2eab9c20f34..79852f6f51b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -49,10 +49,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 9a20e671038..91ed1c5728e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 076a8a5b323..ff8cb2970a9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -45,10 +45,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index ec796f0baa7..331c74cbd9c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -55,10 +55,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 8068c291c86..f6cb5ffefa5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 9e9fbc54975..f3c02c1dbca 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -207,10 +207,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,10 +232,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -257,10 +257,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -282,10 +282,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -307,10 +307,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eb1f8ababde..55076414fd4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 07e644381c5..d131476eda7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -103,12 +103,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +130,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +182,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +209,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,12 +236,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -263,10 +263,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -288,10 +288,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -313,10 +313,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -338,10 +338,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -363,10 +363,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -388,10 +388,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -413,10 +413,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -438,10 +438,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 8a3fa9350cc..657166b59a1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -55,10 +55,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,10 +70,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 723696541fa..c03044c81f9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -102,10 +102,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 61259993f88..c88f952e6cb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -58,10 +58,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index d38a6bf453a..a0c1cf630d6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d41b65dd3f7..c821f25700a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -54,10 +54,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index 90a694b50a7..133103caad8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -46,10 +46,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index f3f7b550ee6..601bfa200fa 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -46,10 +46,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 23ca526f635..d7919c9d674 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 5665c45484a..6a81682684a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,10 +87,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,10 +127,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ee815a0182b..069be583d8c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -46,10 +46,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 100666a4a45..3d27edbe194 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -103,10 +103,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -178,10 +178,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,10 +203,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -228,10 +228,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 2b89f20e8e7..e64e063a440 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -54,10 +54,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index ea78ae4c5c9..6e223b371a9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,10 +134,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -159,10 +159,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -192,10 +192,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -226,10 +226,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,10 +251,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0c3ba6ce34e..893928438c7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -52,10 +52,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 3bf951a8ff1..44017d0d721 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -46,10 +46,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index aed85c4e82f..250788cbb19 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -49,10 +49,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8c03fbe8e1c..1a140b1d503 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -64,10 +64,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -89,10 +89,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -114,10 +114,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -139,10 +139,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -172,10 +172,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 04b89edc6a1..72ae317f168 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -68,10 +68,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -93,10 +93,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -118,10 +118,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -143,10 +143,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -168,10 +168,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -201,10 +201,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 33b74195d1e..1a261d34539 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -73,10 +73,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,10 +123,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -198,10 +198,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,10 +223,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,10 +248,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index ac33c541805..56c5828270e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -160,10 +160,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,10 +185,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,10 +210,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,10 +235,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,10 +268,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -318,10 +318,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -343,10 +343,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,10 +368,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -401,10 +401,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -434,10 +434,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -459,10 +459,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -484,10 +484,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -509,10 +509,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -534,10 +534,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -567,10 +567,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -600,10 +600,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -625,10 +625,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -650,10 +650,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -675,10 +675,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -700,10 +700,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -733,10 +733,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -766,10 +766,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -791,10 +791,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -816,10 +816,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,10 +841,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -866,10 +866,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -899,10 +899,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -932,10 +932,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/FILES b/samples/client/petstore/java/jersey3/.openapi-generator/FILES index 4fbcb8fd20b..78d8fe209b3 100644 --- a/samples/client/petstore/java/jersey3/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey3/.openapi-generator/FILES @@ -46,6 +46,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/Mammal.md +docs/MammalAnyof.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -158,6 +159,7 @@ 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/IsoscelesTriangle.java src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MammalAnyof.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 diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 04df96420fd..c806f0e3566 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -199,6 +199,7 @@ Class | Method | HTTP request | Description - [HealthCheckResult](docs/HealthCheckResult.md) - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Mammal](docs/Mammal.md) + - [MammalAnyof](docs/MammalAnyof.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index 86a4762bc48..25e78fa9e30 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -2059,6 +2059,13 @@ components: - $ref: '#/components/schemas/whale' - $ref: '#/components/schemas/zebra' - $ref: '#/components/schemas/Pig' + mammal_anyof: + anyOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className whale: properties: hasBaleen: diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 67ad82be464..66e463de413 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "2.1.0" bean_validation_version = "3.0.2" diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index 89a524fe004..f57389cc41f 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", diff --git a/samples/client/petstore/java/jersey3/docs/MammalAnyof.md b/samples/client/petstore/java/jersey3/docs/MammalAnyof.md new file mode 100644 index 00000000000..3fb117e293e --- /dev/null +++ b/samples/client/petstore/java/jersey3/docs/MammalAnyof.md @@ -0,0 +1,46 @@ + + +# MammalAnyof + +## anyOf schemas +* [Pig](Pig.md) +* [Whale](Whale.md) +* [Zebra](Zebra.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.MammalAnyof; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +public class Example { + public static void main(String[] args) { + MammalAnyof exampleMammalAnyof = new MammalAnyof(); + + // create a new Pig + Pig examplePig = new Pig(); + // set MammalAnyof to Pig + exampleMammalAnyof.setActualInstance(examplePig); + // to get back the Pig set earlier + Pig testPig = (Pig) exampleMammalAnyof.getActualInstance(); + + // create a new Whale + Whale exampleWhale = new Whale(); + // set MammalAnyof to Whale + exampleMammalAnyof.setActualInstance(exampleWhale); + // to get back the Whale set earlier + Whale testWhale = (Whale) exampleMammalAnyof.getActualInstance(); + + // create a new Zebra + Zebra exampleZebra = new Zebra(); + // set MammalAnyof to Zebra + exampleMammalAnyof.setActualInstance(exampleZebra); + // to get back the Zebra set earlier + Zebra testZebra = (Zebra) exampleMammalAnyof.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 2ca7372a999..11aaeb47b7f 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -346,8 +346,8 @@ UTF-8 3.1.1 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 3.0.2 diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 6f51b23193a..81aa94e1271 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -275,7 +275,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link jakarta.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -295,7 +295,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -316,7 +316,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -358,7 +358,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -403,7 +403,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -419,7 +419,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -435,7 +435,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -451,7 +451,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -522,7 +522,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -538,7 +538,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -555,7 +555,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -571,7 +571,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -587,7 +587,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -603,7 +603,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -625,7 +625,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -637,7 +637,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -657,7 +657,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -679,7 +679,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -703,7 +703,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -725,7 +725,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -748,7 +748,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -769,7 +769,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index 725e4da4748..4160a6bd977 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 420cd0ca53f..a60ac833d7c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -86,7 +86,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index 6b15ede6a63..baf96a146dd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -204,7 +204,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -252,7 +252,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -389,7 +389,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 5ca4423c62b..0ed4835a298 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 30c63abc575..bf64dcc67e5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -89,10 +89,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @@ -123,10 +123,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @jakarta.annotation.Nullable @Valid @@ -150,10 +150,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -184,10 +184,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) @@ -210,10 +210,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) @@ -244,10 +244,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) @@ -270,10 +270,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMPTY_MAP) @@ -304,10 +304,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index bd55ca359de..208e3cc6d35 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -64,10 +64,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -91,10 +91,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index e32d1d85dc0..41bd6d16409 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -52,10 +52,10 @@ public class Apple { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="^[a-zA-Z\\s]*$") @JsonProperty(JSON_PROPERTY_CULTIVAR) @@ -78,10 +78,10 @@ public class Apple { return this; } - /** + /** * Get origin * @return origin - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="/^[A-Z\\s]*$/i") @JsonProperty(JSON_PROPERTY_ORIGIN) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index f68b7d46c7d..04eb192a31d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -52,10 +52,10 @@ public class AppleReq { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -79,10 +79,10 @@ public class AppleReq { return this; } - /** + /** * Get mealy * @return mealy - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MEALY) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 301f64fd44d..a659ca077f5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -58,10 +58,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6d062640f09..3e975145537 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -58,10 +58,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index 90ed09ec455..6d219d6f85b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -66,10 +66,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @@ -100,10 +100,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @jakarta.annotation.Nullable @Valid @@ -135,10 +135,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java index 5411d049336..31971ec506f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java @@ -49,10 +49,10 @@ public class Banana { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java index cdec59abb41..26310f52768 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java @@ -53,10 +53,10 @@ public class BananaReq { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -81,10 +81,10 @@ public class BananaReq { return this; } - /** + /** * Get sweet * @return sweet - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SWEET) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java index 558f1d356ca..b3fd8087c3d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java @@ -47,10 +47,10 @@ public class BasquePig { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java index 9869e944223..dcd1fc6374f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -67,10 +67,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @@ -93,10 +93,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @@ -119,10 +119,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @@ -145,10 +145,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @@ -171,10 +171,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @@ -197,10 +197,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java index 31ebaaef48c..d379e8ddc0f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java @@ -62,10 +62,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index f15329304a9..b4f1b215a63 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -51,10 +51,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -77,10 +77,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index 6bc779f09b2..7eda341a304 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -67,10 +67,10 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @@ -101,10 +101,10 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get petType * @return petType - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_TYPE) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java index 3fb3af71e70..de9e7d1a7d3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -47,10 +47,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java index dd78f66d27f..025bc73f213 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java @@ -47,10 +47,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 6aca6e36bd9..04bfa6cd3ba 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -55,10 +55,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -82,10 +82,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java index 8da23101e83..16b98a94921 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -47,10 +47,10 @@ public class DanishPig { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 8d14b21707d..b38b6d13faa 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -49,10 +49,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index 2db2550795e..1f4f8853425 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -61,10 +61,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index e41566115f9..a28b6208650 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -73,10 +73,10 @@ public class Drawing { return this; } - /** + /** * Get mainShape * @return mainShape - **/ + */ @jakarta.annotation.Nullable @Valid @@ -100,10 +100,10 @@ public class Drawing { return this; } - /** + /** * Get shapeOrNull * @return shapeOrNull - **/ + */ @jakarta.annotation.Nullable @Valid @@ -135,10 +135,10 @@ public class Drawing { return this; } - /** + /** * Get nullableShape * @return nullableShape - **/ + */ @jakarta.annotation.Nullable @Valid @@ -178,10 +178,10 @@ public class Drawing { return this; } - /** + /** * Get shapes * @return shapes - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 71a8b9bfddd..00b29cc40e2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -123,10 +123,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @@ -157,10 +157,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index 72233491c90..9760ae0f212 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -267,10 +267,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @@ -293,10 +293,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -320,10 +320,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @@ -346,10 +346,10 @@ public class EnumTest { return this; } - /** + /** * Get enumIntegerOnly * @return enumIntegerOnly - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) @@ -372,10 +372,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @@ -398,10 +398,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @jakarta.annotation.Nullable @Valid @@ -433,10 +433,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @jakarta.annotation.Nullable @Valid @@ -460,10 +460,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @jakarta.annotation.Nullable @Valid @@ -487,10 +487,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 5d68078265e..bbfe4ea1d9a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -55,10 +55,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -82,10 +82,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index d0dcd68be2c..e34052fcfa3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -54,10 +54,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @jakarta.annotation.Nullable @Valid @@ -89,10 +89,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index de838e2a20b..0d9ce773a31 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -47,10 +47,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index bff8d72323d..1282ef01178 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -49,10 +49,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index 399700240ee..8e010734656 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -113,12 +113,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @jakarta.annotation.Nullable @Min(10) @Max(100) @JsonProperty(JSON_PROPERTY_INTEGER) @@ -141,12 +141,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @jakarta.annotation.Nullable @Min(20) @Max(200) @JsonProperty(JSON_PROPERTY_INT32) @@ -169,10 +169,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @@ -195,12 +195,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -225,12 +225,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @jakarta.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(JSON_PROPERTY_FLOAT) @@ -253,12 +253,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @jakarta.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(JSON_PROPERTY_DOUBLE) @@ -281,10 +281,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @jakarta.annotation.Nullable @Valid @@ -308,10 +308,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="/[a-z]/i") @JsonProperty(JSON_PROPERTY_STRING) @@ -334,10 +334,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -361,10 +361,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @jakarta.annotation.Nullable @Valid @@ -388,10 +388,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -416,10 +416,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Valid @@ -443,10 +443,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Valid @@ -470,10 +470,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nonnull @NotNull @Size(min=10,max=64) @@ -497,10 +497,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="^\\d{10}$") @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @@ -523,10 +523,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="/^image_\\d{1,3}$/i") @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index 07ff3374a5a..6411923b81a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -144,7 +144,7 @@ public class Fruit extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Fruit() { super("oneOf", Boolean.FALSE); @@ -169,7 +169,7 @@ public class Fruit extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Fruit.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index 71ac949b76c..fc6dff2feda 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -144,7 +144,7 @@ public class FruitReq extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public FruitReq() { super("oneOf", Boolean.TRUE); @@ -169,7 +169,7 @@ public class FruitReq extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return FruitReq.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 1a84c6e30a6..8ea0a56897a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -124,7 +124,7 @@ public class GmFruit extends AbstractOpenApiSchema { } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public GmFruit() { super("anyOf", Boolean.FALSE); @@ -149,7 +149,7 @@ public class GmFruit extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return GmFruit.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index f7fc61c27a3..ba5c82d749b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -60,10 +60,10 @@ public class GrandparentAnimal { return this; } - /** + /** * Get petType * @return petType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 66482fbbaf6..9ce87bd837b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -57,10 +57,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -73,10 +73,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 776309e0268..eb5bebb3239 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -51,10 +51,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @jakarta.annotation.Nullable @JsonIgnore diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index ac90c38de3c..0d66d36c2a6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -51,10 +51,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -78,10 +78,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index f9e03d6f45d..0e2f393c54e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -187,7 +187,7 @@ public class Mammal extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Mammal() { super("oneOf", Boolean.FALSE); @@ -275,7 +275,7 @@ public class Mammal extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Mammal.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java new file mode 100644 index 00000000000..ff81f7eef5a --- /dev/null +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.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.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +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 java.util.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +import org.openapitools.client.JSON; + + +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class) +@JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class) +public class MammalAnyof extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MammalAnyof.class.getName()); + + public static class MammalAnyofSerializer extends StdSerializer { + public MammalAnyofSerializer(Class t) { + super(t); + } + + public MammalAnyofSerializer() { + this(null); + } + + @Override + public void serialize(MammalAnyof value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class MammalAnyofDeserializer extends StdDeserializer { + public MammalAnyofDeserializer() { + this(MammalAnyof.class); + } + + public MammalAnyofDeserializer(Class vc) { + super(vc); + } + + @Override + public MammalAnyof deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + Class cls = JSON.getClassForElement(tree, new MammalAnyof().getClass()); + if (cls != null) { + // When the OAS schema includes a discriminator, use the discriminator value to + // discriminate the anyOf schemas. + // Get the discriminator mapping value to get the class. + deserialized = tree.traverse(jp.getCodec()).readValueAs(cls); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } + // deserialize Pig + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + // deserialize Whale + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + // deserialize Zebra + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + throw new IOException(String.format("Failed deserialization for MammalAnyof: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "MammalAnyof cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap<>(); + + public MammalAnyof() { + super("anyOf", Boolean.FALSE); + } + /** + * 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. + */ + @JsonAnySetter + public MammalAnyof 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. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this mammal_anyof object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } + public MammalAnyof(Pig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public MammalAnyof(Whale o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public MammalAnyof(Zebra o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Pig", new GenericType() { + }); + schemas.put("Whale", new GenericType() { + }); + schemas.put("Zebra", new GenericType() { + }); + JSON.registerDescendants(MammalAnyof.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Pig", Pig.class); + mappings.put("whale", Whale.class); + mappings.put("zebra", Zebra.class); + mappings.put("mammal_anyof", MammalAnyof.class); + JSON.registerDiscriminator(MammalAnyof.class, "className", mappings); + } + + @Override + public Map> getSchemas() { + return MammalAnyof.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Pig, Whale, Zebra + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + + /** + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + + /** + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index 156a25635c9..78811a83e22 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -104,10 +104,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @jakarta.annotation.Nullable @Valid @@ -139,10 +139,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @@ -173,10 +173,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @@ -207,10 +207,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8c843fd6d65..5e67887a601 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -60,10 +60,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Valid @@ -87,10 +87,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Valid @@ -122,10 +122,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index 5b3e97906e4..dd6a36acf7e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -52,10 +52,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @@ -78,10 +78,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 1606bf4d80d..9b76d5f47e5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -56,10 +56,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @@ -82,10 +82,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @@ -108,10 +108,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index 3441f54f03c..143ecadb700 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -48,10 +48,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index 09b706f66cb..a38103502f3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -48,10 +48,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index f47ca37780f..45e777b7d48 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -48,10 +48,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index 970e6b437a7..df1fa9bcfc7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -69,10 +69,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -91,10 +91,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @@ -112,10 +112,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @@ -133,10 +133,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index d633297a29e..9596af93d47 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -106,10 +106,10 @@ public class NullableClass { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -140,10 +140,10 @@ public class NullableClass { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @jakarta.annotation.Nullable @Valid @@ -175,10 +175,10 @@ public class NullableClass { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -209,10 +209,10 @@ public class NullableClass { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -243,10 +243,10 @@ public class NullableClass { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @jakarta.annotation.Nullable @Valid @@ -278,10 +278,10 @@ public class NullableClass { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @jakarta.annotation.Nullable @Valid @@ -325,10 +325,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -371,10 +371,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -413,10 +413,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @@ -451,10 +451,10 @@ public class NullableClass { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -497,10 +497,10 @@ public class NullableClass { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -539,10 +539,10 @@ public class NullableClass { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index f6b7be2e35c..25fbba22f3e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -166,7 +166,7 @@ public class NullableShape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public NullableShape() { super("oneOf", Boolean.TRUE); @@ -246,7 +246,7 @@ public class NullableShape extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return NullableShape.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 4bf22fcee1e..fa6a5393fb1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -48,10 +48,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index e6855170250..d55e700649c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -66,10 +66,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @@ -93,11 +93,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @Valid @@ -124,11 +124,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @Valid @@ -163,11 +163,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 28fdc63f626..2dc524d9e60 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -105,10 +105,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -131,10 +131,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -183,10 +183,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @Valid @@ -210,10 +210,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @@ -236,10 +236,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index 6d7c0e36a16..5a0bb7ef02e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -56,10 +56,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -83,10 +83,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @@ -109,10 +109,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index e99bab8a158..3f72532449a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -134,10 +134,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @Valid @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -196,10 +196,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -231,10 +231,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @Valid @@ -258,10 +258,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index 58e12564d53..53a4ed24e97 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -166,7 +166,7 @@ public class Pig extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Pig() { super("oneOf", Boolean.FALSE); @@ -246,7 +246,7 @@ public class Pig extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Pig.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index f8c81eb32df..305c630fbc7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -166,7 +166,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Quadrilateral() { super("oneOf", Boolean.FALSE); @@ -246,7 +246,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Quadrilateral.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index b42d69c1573..701bbb10325 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -47,10 +47,10 @@ public class QuadrilateralInterface { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index cbcba37f83c..db7da942daf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -54,10 +54,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -75,10 +75,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 7de03a5b092..c4ec5c646a0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -55,10 +55,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -82,10 +82,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index b5dadc51e61..0d859b4bd2e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -166,7 +166,7 @@ public class Shape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Shape() { super("oneOf", Boolean.FALSE); @@ -246,7 +246,7 @@ public class Shape extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Shape.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 7fbfc4728b9..f082904b46e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -47,10 +47,10 @@ public class ShapeInterface { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 809ea23ca8b..040913c86d5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -166,7 +166,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public ShapeOrNull() { super("oneOf", Boolean.TRUE); @@ -246,7 +246,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return ShapeOrNull.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 3acc4f789f2..a33e0df4e55 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -55,10 +55,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -82,10 +82,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index e2773b8f3e1..3617ba290ea 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -52,10 +52,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @@ -78,10 +78,10 @@ public class SpecialModelName { return this; } - /** + /** * Get specialModelName * @return specialModelName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index fb067d321b3..12f6b63aefb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -51,10 +51,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -77,10 +77,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index eeaf63dc922..6475fa88e45 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -52,10 +52,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest { return this; } - /** + /** * Get someProperty * @return someProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index fd846a97658..aaad35fbc4e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -187,7 +187,7 @@ public class Triangle extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Triangle() { super("oneOf", Boolean.FALSE); @@ -275,7 +275,7 @@ public class Triangle extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Triangle.schemas; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index da9854c93fe..b7bdc0bf07e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -47,10 +47,10 @@ public class TriangleInterface { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index baddf7b4fff..f02b825938c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -95,10 +95,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -121,10 +121,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @@ -147,10 +147,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -199,10 +199,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @@ -225,10 +225,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -251,10 +251,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @@ -277,10 +277,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @@ -303,10 +303,10 @@ public class User { return this; } - /** + /** * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. * @return objectWithNoDeclaredProps - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) @@ -329,10 +329,10 @@ public class User { return this; } - /** + /** * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. * @return objectWithNoDeclaredPropsNullable - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -363,10 +363,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 * @return anyTypeProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -397,10 +397,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. * @return anyTypePropNullable - **/ + */ @jakarta.annotation.Nullable @JsonIgnore diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index 360b212a38d..fa3c2c87ead 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -56,10 +56,10 @@ public class Whale { return this; } - /** + /** * Get hasBaleen * @return hasBaleen - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_BALEEN) @@ -82,10 +82,10 @@ public class Whale { return this; } - /** + /** * Get hasTeeth * @return hasTeeth - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_TEETH) @@ -108,10 +108,10 @@ public class Whale { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 0fe0b9de3ca..1d96681f53e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -93,10 +93,10 @@ public class Zebra { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @@ -119,10 +119,10 @@ public class Zebra { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/MammalAnyofTest.java b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/MammalAnyofTest.java new file mode 100644 index 00000000000..a14bb512803 --- /dev/null +++ b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/model/MammalAnyofTest.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.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 java.util.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MammalAnyof + */ +public class MammalAnyofTest { + private final MammalAnyof model = new MammalAnyof(); + + /** + * Model tests for MammalAnyof + */ + @Test + public void testMammalAnyof() { + // TODO: test MammalAnyof + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} 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 aaec1094017..d701aacddb7 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 @@ -157,8 +157,8 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 2.1.0 2.0.0 2.0.0 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 1bedcba64e4..c798b428fe2 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 @@ -23,34 +23,36 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "Category", propOrder = - { "id", "name" -}) +@XmlType(name = "Category", propOrder = + { "id", "name" } +) -@XmlRootElement(name="Category") + +@XmlRootElement(name = "Category") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Category") @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"; - @XmlElement(name="id") + @XmlElement(name = "id") private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @XmlElement(name="name") + @XmlElement(name = "name") private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -59,8 +61,8 @@ public class Category { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -73,10 +75,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "name") @@ -85,8 +87,8 @@ public class Category { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "name") @@ -101,8 +103,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ddfadbcf410..7ea582a1bec 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 @@ -23,12 +23,14 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "ModelApiResponse", propOrder = - { "code", "type", "message" -}) +@XmlType(name = "ModelApiResponse", propOrder = + { "code", "type", "message" } +) -@XmlRootElement(name="ModelApiResponse") + +@XmlRootElement(name = "ModelApiResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelApiResponse") @JsonPropertyOrder({ ModelApiResponse.JSON_PROPERTY_CODE, ModelApiResponse.JSON_PROPERTY_TYPE, @@ -37,26 +39,26 @@ import jakarta.xml.bind.annotation.adapters.*; @JsonTypeName("ApiResponse") /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @XmlElement(name="code") + @XmlElement(name = "code") private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @XmlElement(name="type") + @XmlElement(name = "type") private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @XmlElement(name="message") + @XmlElement(name = "message") private String message; - /** + /** * Get code * @return code - **/ + **/ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "code") @@ -65,8 +67,8 @@ public class ModelApiResponse { } /** - * Set code - **/ + * Set code + */ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "code") @@ -79,10 +81,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "type") @@ -91,8 +93,8 @@ public class ModelApiResponse { } /** - * Set type - **/ + * Set type + */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "type") @@ -105,10 +107,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "message") @@ -117,8 +119,8 @@ public class ModelApiResponse { } /** - * Set message - **/ + * Set message + */ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "message") @@ -133,8 +135,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b4fd65862e2..20efbf432c4 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 @@ -24,12 +24,14 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "Order", propOrder = - { "id", "petId", "quantity", "shipDate", "status", "complete" -}) +@XmlType(name = "Order", propOrder = + { "id", "petId", "quantity", "shipDate", "status", "complete" } +) -@XmlRootElement(name="Order") + +@XmlRootElement(name = "Order") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Order") @JsonPropertyOrder({ Order.JSON_PROPERTY_ID, Order.JSON_PROPERTY_PET_ID, @@ -40,24 +42,24 @@ import jakarta.xml.bind.annotation.adapters.*; }) /** * An order for a pets from the pet store - **/ + */ public class Order { public static final String JSON_PROPERTY_ID = "id"; - @XmlElement(name="id") + @XmlElement(name = "id") private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @XmlElement(name="petId") + @XmlElement(name = "petId") private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @XmlElement(name="quantity") + @XmlElement(name = "quantity") private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @XmlElement(name="shipDate") + @XmlElement(name = "shipDate") private Date shipDate; @XmlType(name="StatusEnum") @@ -94,20 +96,20 @@ public class Order { } public static final String JSON_PROPERTY_STATUS = "status"; - @XmlElement(name="status") + @XmlElement(name = "status") /** - * Order Status - **/ + * Order Status + */ private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @XmlElement(name="complete") + @XmlElement(name = "complete") private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -116,8 +118,8 @@ public class Order { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -130,10 +132,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "petId") @@ -142,8 +144,8 @@ public class Order { } /** - * Set petId - **/ + * Set petId + */ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "petId") @@ -156,10 +158,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "quantity") @@ -168,8 +170,8 @@ public class Order { } /** - * Set quantity - **/ + * Set quantity + */ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "quantity") @@ -182,10 +184,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "shipDate") @@ -194,8 +196,8 @@ public class Order { } /** - * Set shipDate - **/ + * Set shipDate + */ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "shipDate") @@ -208,10 +210,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "status") @@ -223,8 +225,8 @@ public class Order { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "status") @@ -237,10 +239,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "complete") @@ -249,8 +251,8 @@ public class Order { } /** - * Set complete - **/ + * Set complete + */ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "complete") @@ -265,8 +267,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 cc6ecbaceec..d0717134404 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 @@ -28,12 +28,14 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "Pet", propOrder = - { "id", "category", "name", "photoUrls", "tags", "status" -}) +@XmlType(name = "Pet", propOrder = + { "id", "category", "name", "photoUrls", "tags", "status" } +) -@XmlRootElement(name="Pet") + +@XmlRootElement(name = "Pet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pet") @JsonPropertyOrder({ Pet.JSON_PROPERTY_ID, Pet.JSON_PROPERTY_CATEGORY, @@ -44,28 +46,30 @@ import jakarta.xml.bind.annotation.adapters.*; }) /** * A pet for sale in the pet store - **/ + */ public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @XmlElement(name="id") + @XmlElement(name = "id") private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @XmlElement(name="category") + @XmlElement(name = "Category") private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @XmlElement(name="name", required = true) + @XmlElement(name = "name") private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @XmlElement(name="photoUrls", required = true) + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @XmlElement(name="tags") + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") private List tags = null; @XmlType(name="StatusEnum") @@ -102,16 +106,16 @@ public class Pet { } public static final String JSON_PROPERTY_STATUS = "status"; - @XmlElement(name="status") + @XmlElement(name = "status") /** - * pet status in the store - **/ + * pet status in the store + */ private StatusEnum status; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -120,8 +124,8 @@ public class Pet { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -134,10 +138,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "Category") @@ -146,8 +150,8 @@ public class Pet { } /** - * Set category - **/ + * Set category + */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "Category") @@ -160,10 +164,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @JacksonXmlProperty(localName = "name") @@ -172,8 +176,8 @@ public class Pet { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @JacksonXmlProperty(localName = "name") @@ -186,27 +190,25 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - // xmlName=photoUrl @JacksonXmlProperty(localName = "photoUrl") - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public List getPhotoUrls() { return photoUrls; } /** - * Set photoUrls - **/ + * Set photoUrls + */ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - // xmlName=photoUrl @JacksonXmlProperty(localName = "photoUrl") - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -224,27 +226,25 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - // xmlName=tag - @JacksonXmlProperty(localName = "tag") - @JacksonXmlElementWrapper(useWrapping = true, localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public List getTags() { return tags; } /** - * Set tags - **/ + * Set tags + */ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - // xmlName=tag - @JacksonXmlProperty(localName = "tag") - @JacksonXmlElementWrapper(useWrapping = true, localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public void setTags(List tags) { this.tags = tags; } @@ -262,11 +262,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -279,8 +279,8 @@ public class Pet { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "status") @@ -295,8 +295,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 488983ce94f..db5a74ca2be 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 @@ -23,34 +23,36 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "Tag", propOrder = - { "id", "name" -}) +@XmlType(name = "Tag", propOrder = + { "id", "name" } +) -@XmlRootElement(name="Tag") + +@XmlRootElement(name = "Tag") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Tag") @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"; - @XmlElement(name="id") + @XmlElement(name = "id") private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @XmlElement(name="name") + @XmlElement(name = "name") private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -59,8 +61,8 @@ public class Tag { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -73,10 +75,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "name") @@ -85,8 +87,8 @@ public class Tag { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "name") @@ -101,8 +103,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 2e70b010de3..9856bbcead5 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 @@ -23,12 +23,14 @@ import com.fasterxml.jackson.dataformat.xml.annotation.*; import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.adapters.*; -@XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "User", propOrder = - { "id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus" -}) +@XmlType(name = "User", propOrder = + { "id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus" } +) -@XmlRootElement(name="User") + +@XmlRootElement(name = "User") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "User") @JsonPropertyOrder({ User.JSON_PROPERTY_ID, User.JSON_PROPERTY_USERNAME, @@ -41,49 +43,49 @@ import jakarta.xml.bind.annotation.adapters.*; }) /** * A User who is purchasing from the pet store - **/ + */ public class User { public static final String JSON_PROPERTY_ID = "id"; - @XmlElement(name="id") + @XmlElement(name = "id") private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @XmlElement(name="username") + @XmlElement(name = "username") private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @XmlElement(name="firstName") + @XmlElement(name = "firstName") private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @XmlElement(name="lastName") + @XmlElement(name = "lastName") private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @XmlElement(name="email") + @XmlElement(name = "email") private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @XmlElement(name="password") + @XmlElement(name = "password") private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @XmlElement(name="phone") + @XmlElement(name = "phone") private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @XmlElement(name="userStatus") + @XmlElement(name = "userStatus") /** - * User Status - **/ + * User Status + */ private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -92,8 +94,8 @@ public class User { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "id") @@ -106,10 +108,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "username") @@ -118,8 +120,8 @@ public class User { } /** - * Set username - **/ + * Set username + */ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "username") @@ -132,10 +134,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "firstName") @@ -144,8 +146,8 @@ public class User { } /** - * Set firstName - **/ + * Set firstName + */ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "firstName") @@ -158,10 +160,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "lastName") @@ -170,8 +172,8 @@ public class User { } /** - * Set lastName - **/ + * Set lastName + */ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "lastName") @@ -184,10 +186,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "email") @@ -196,8 +198,8 @@ public class User { } /** - * Set email - **/ + * Set email + */ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "email") @@ -210,10 +212,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "password") @@ -222,8 +224,8 @@ public class User { } /** - * Set password - **/ + * Set password + */ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "password") @@ -236,10 +238,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "phone") @@ -248,8 +250,8 @@ public class User { } /** - * Set phone - **/ + * Set phone + */ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "phone") @@ -262,10 +264,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "userStatus") @@ -274,8 +276,8 @@ public class User { } /** - * Set userStatus - **/ + * Set userStatus + */ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "userStatus") @@ -290,8 +292,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fedd41b522c..e9b263491fe 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 @@ -146,8 +146,8 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 2.1.0 2.0.0 2.0.0 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 f90df1d1bf3..e08314ab682 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 @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A category for a pet - **/ + */ public class Category { @@ -38,10 +38,10 @@ public class Category { private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -49,8 +49,8 @@ public class Category { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -62,10 +62,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -73,8 +73,8 @@ public class Category { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { @@ -88,8 +88,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 d66986b5478..75df05dfaef 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 @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ApiResponse") /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { @@ -44,10 +44,10 @@ public class ModelApiResponse { private String message; - /** + /** * Get code * @return code - **/ + **/ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getCode() { @@ -55,8 +55,8 @@ public class ModelApiResponse { } /** - * Set code - **/ + * Set code + */ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(Integer code) { @@ -68,10 +68,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getType() { @@ -79,8 +79,8 @@ public class ModelApiResponse { } /** - * Set type - **/ + * Set type + */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { @@ -92,10 +92,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getMessage() { @@ -103,8 +103,8 @@ public class ModelApiResponse { } /** - * Set message - **/ + * Set message + */ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { @@ -118,8 +118,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b6c0aec0c23..eb683221585 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 @@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * An order for a pets from the pet store - **/ + */ public class Order { @@ -85,8 +85,8 @@ public class Order { public static final String JSON_PROPERTY_STATUS = "status"; /** - * Order Status - **/ + * Order Status + */ private StatusEnum status; @@ -94,10 +94,10 @@ public class Order { private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -105,8 +105,8 @@ public class Order { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -118,10 +118,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getPetId() { @@ -129,8 +129,8 @@ public class Order { } /** - * Set petId - **/ + * Set petId + */ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPetId(Long petId) { @@ -142,10 +142,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getQuantity() { @@ -153,8 +153,8 @@ public class Order { } /** - * Set quantity - **/ + * Set quantity + */ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQuantity(Integer quantity) { @@ -166,10 +166,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Date getShipDate() { @@ -177,8 +177,8 @@ public class Order { } /** - * Set shipDate - **/ + * Set shipDate + */ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipDate(Date shipDate) { @@ -190,10 +190,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StatusEnum getStatus() { @@ -201,8 +201,8 @@ public class Order { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getComplete() { @@ -225,8 +225,8 @@ public class Order { } /** - * Set complete - **/ + * Set complete + */ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setComplete(Boolean complete) { @@ -240,8 +240,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 defd4504bc7..0e0720b7714 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A pet for sale in the pet store - **/ + */ public class Pet { @@ -93,15 +93,15 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; /** - * pet status in the store - **/ + * 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() { @@ -109,8 +109,8 @@ public class Pet { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -122,10 +122,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Category getCategory() { @@ -133,8 +133,8 @@ public class Pet { } /** - * Set category - **/ + * Set category + */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(Category category) { @@ -146,10 +146,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { @@ -157,8 +157,8 @@ public class Pet { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(String name) { @@ -170,10 +170,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getPhotoUrls() { @@ -181,8 +181,8 @@ public class Pet { } /** - * Set photoUrls - **/ + * Set photoUrls + */ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(List photoUrls) { @@ -202,10 +202,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getTags() { @@ -213,8 +213,8 @@ public class Pet { } /** - * Set tags - **/ + * Set tags + */ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTags(List tags) { @@ -234,11 +234,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,8 +247,8 @@ public class Pet { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { @@ -262,8 +262,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 283def00e3e..b6f69349785 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 @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A tag for a pet - **/ + */ public class Tag { @@ -38,10 +38,10 @@ public class Tag { private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -49,8 +49,8 @@ public class Tag { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -62,10 +62,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -73,8 +73,8 @@ public class Tag { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { @@ -88,8 +88,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 26490077dd3..fda9ee53d14 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 @@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A User who is purchasing from the pet store - **/ + */ public class User { @@ -66,15 +66,15 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; /** - * User Status - **/ + * User Status + */ private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -82,8 +82,8 @@ public class User { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -95,10 +95,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getUsername() { @@ -106,8 +106,8 @@ public class User { } /** - * Set username - **/ + * Set username + */ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsername(String username) { @@ -119,10 +119,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getFirstName() { @@ -130,8 +130,8 @@ public class User { } /** - * Set firstName - **/ + * Set firstName + */ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { @@ -143,10 +143,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getLastName() { @@ -154,8 +154,8 @@ public class User { } /** - * Set lastName - **/ + * Set lastName + */ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getEmail() { @@ -178,8 +178,8 @@ public class User { } /** - * Set email - **/ + * Set email + */ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { @@ -191,10 +191,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPassword() { @@ -202,8 +202,8 @@ public class User { } /** - * Set password - **/ + * Set password + */ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassword(String password) { @@ -215,10 +215,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPhone() { @@ -226,8 +226,8 @@ public class User { } /** - * Set phone - **/ + * Set phone + */ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(String phone) { @@ -239,10 +239,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getUserStatus() { @@ -250,8 +250,8 @@ public class User { } /** - * Set userStatus - **/ + * Set userStatus + */ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUserStatus(Integer userStatus) { @@ -265,8 +265,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 0f3691d8ca9..a7f7382d994 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 @@ -155,7 +155,7 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 + 2.17.1 2.1.0 2.0.0 2.0.0 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 aa7007ad5d5..121589eaeb6 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A category for a pet - **/ + */ public class Category { @@ -35,17 +35,17 @@ public class Category { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 44eea59b3ee..c1df0dd408a 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { @@ -38,17 +38,17 @@ public class ModelApiResponse { @JsonbProperty("message") private String message; - /** + /** * Get code * @return code - **/ + **/ public Integer getCode() { return code; } /** - * Set code - **/ + * Set code + */ public void setCode(Integer code) { this.code = code; } @@ -58,17 +58,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ public String getType() { return type; } /** - * Set type - **/ + * Set type + */ public void setType(String type) { this.type = type; } @@ -78,17 +78,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ public String getMessage() { return message; } /** - * Set message - **/ + * Set message + */ public void setMessage(String message) { this.message = message; } @@ -100,8 +100,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 d378038fc30..489c7fc73c5 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 @@ -26,7 +26,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * An order for a pets from the pet store - **/ + */ public class Order { @@ -85,25 +85,25 @@ public class Order { } /** - * Order Status - **/ + * Order Status + */ @JsonbProperty("status") private StatusEnum status; @JsonbProperty("complete") private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -113,17 +113,17 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ public Long getPetId() { return petId; } /** - * Set petId - **/ + * Set petId + */ public void setPetId(Long petId) { this.petId = petId; } @@ -133,17 +133,17 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ public Integer getQuantity() { return quantity; } /** - * Set quantity - **/ + * Set quantity + */ public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -153,17 +153,17 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ public Date getShipDate() { return shipDate; } /** - * Set shipDate - **/ + * Set shipDate + */ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -173,17 +173,17 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -193,17 +193,17 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ public Boolean getComplete() { return complete; } /** - * Set complete - **/ + * Set complete + */ public void setComplete(Boolean complete) { this.complete = complete; } @@ -215,8 +215,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 822179523dc..5761ee105f1 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 @@ -30,7 +30,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A pet for sale in the pet store - **/ + */ public class Pet { @@ -92,22 +92,22 @@ public class Pet { } /** - * pet status in the store - **/ + * pet status in the store + */ @JsonbProperty("status") private StatusEnum status; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -117,17 +117,17 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ public Category getCategory() { return category; } /** - * Set category - **/ + * Set category + */ public void setCategory(Category category) { this.category = category; } @@ -137,17 +137,17 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -157,17 +157,17 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ public List getPhotoUrls() { return photoUrls; } /** - * Set photoUrls - **/ + * Set photoUrls + */ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -185,17 +185,17 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ public List getTags() { return tags; } /** - * Set tags - **/ + * Set tags + */ public void setTags(List tags) { this.tags = tags; } @@ -213,19 +213,19 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -237,8 +237,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fecc6943bff..28985a1f069 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A tag for a pet - **/ + */ public class Tag { @@ -35,17 +35,17 @@ public class Tag { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e4f99ba38d3..d9ebaeb284d 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A User who is purchasing from the pet store - **/ + */ public class User { @@ -51,22 +51,22 @@ public class User { private String phone; /** - * User Status - **/ + * User Status + */ @JsonbProperty("userStatus") private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -76,17 +76,17 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ public String getUsername() { return username; } /** - * Set username - **/ + * Set username + */ public void setUsername(String username) { this.username = username; } @@ -96,17 +96,17 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ public String getFirstName() { return firstName; } /** - * Set firstName - **/ + * Set firstName + */ public void setFirstName(String firstName) { this.firstName = firstName; } @@ -116,17 +116,17 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ public String getLastName() { return lastName; } /** - * Set lastName - **/ + * Set lastName + */ public void setLastName(String lastName) { this.lastName = lastName; } @@ -136,17 +136,17 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ public String getEmail() { return email; } /** - * Set email - **/ + * Set email + */ public void setEmail(String email) { this.email = email; } @@ -156,17 +156,17 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ public String getPassword() { return password; } /** - * Set password - **/ + * Set password + */ public void setPassword(String password) { this.password = password; } @@ -176,17 +176,17 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ public String getPhone() { return phone; } /** - * Set phone - **/ + * Set phone + */ public void setPhone(String phone) { this.phone = phone; } @@ -196,17 +196,17 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ public Integer getUserStatus() { return userStatus; } /** - * Set userStatus - **/ + * Set userStatus + */ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -218,8 +218,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator-ignore b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.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/microprofile-rest-client-outer-enum/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/FILES new file mode 100644 index 00000000000..697576c5e2f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +docs/Cat.md +docs/DefaultApi.md +docs/Dog.md +docs/Status.md +pom.xml +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/model/Cat.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/Status.java diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/README.md b/samples/client/petstore/java/microprofile-rest-client-outer-enum/README.md new file mode 100644 index 00000000000..310d4f98793 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/README.md @@ -0,0 +1,9 @@ +# Petstore API - MicroProfile Rest Client & MicroProfile Server + +API for managing pets in a pet store + +## 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. + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Cat.md b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Cat.md new file mode 100644 index 00000000000..45cd637aca0 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Cat.md @@ -0,0 +1,15 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | | +|**name** | **String** | | | +|**status** | **Status** | | | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/DefaultApi.md b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/DefaultApi.md new file mode 100644 index 00000000000..18e1a667f22 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/DefaultApi.md @@ -0,0 +1,130 @@ +# DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**listCats**](DefaultApi.md#listCats) | **GET** /cats | List all cats | +| [**listDogs**](DefaultApi.md#listDogs) | **GET** /dogs | List all dogs | + + + +## listCats + +> List<Cat> listCats() + +List all cats + +### 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.listCats(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#listCats"); + 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<Cat>**](Cat.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of cats | - | + + +## listDogs + +> List<Dog> listDogs() + +List all dogs + +### 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.listDogs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#listDogs"); + 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<Dog>**](Dog.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of dogs | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Dog.md b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Dog.md new file mode 100644 index 00000000000..150f5c27eb2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Dog.md @@ -0,0 +1,15 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | | +|**name** | **String** | | | +|**status** | **Status** | | | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Status.md b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Status.md new file mode 100644 index 00000000000..21c77693273 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/docs/Status.md @@ -0,0 +1,15 @@ + + +# Status + +## Enum + + +* `AVAILABLE` (value: `"available"`) + +* `PENDING` (value: `"pending"`) + +* `SOLD` (value: `"sold"`) + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/pom.xml b/samples/client/petstore/java/microprofile-rest-client-outer-enum/pom.xml new file mode 100644 index 00000000000..8d3d986ef9f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/pom.xml @@ -0,0 +1,177 @@ + + 4.0.0 + org.openapitools + microprofile-rest-client + jar + microprofile-rest-client + API for managing pets in a pet store + 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} + + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.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 + + + + + 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.17.1 + 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 + + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiException.java new file mode 100644 index 00000000000..16976e256ce --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiException.java @@ -0,0 +1,34 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class 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 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/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java new file mode 100644 index 00000000000..60b8f915a89 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class 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 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/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..247b26ac6c1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,61 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class 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.Cat; +import org.openapitools.client.model.Dog; + +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 org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * Petstore API + * + *

    API for managing pets in a pet store + * + */ + +@RegisterRestClient(configKey="default-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("") +public interface DefaultApi { + + /** + * List all cats + * + */ + @GET + @Path("/cats") + @Produces({ "application/json" }) + List listCats() throws ApiException, ProcessingException; + + /** + * List all dogs + * + */ + @GET + @Path("/dogs") + @Produces({ "application/json" }) + List listDogs() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..6d04b341acc --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,126 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.model.Status; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + + +public class Cat { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + @JsonbProperty("status") + private Status status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Cat 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 Cat name(String name) { + this.name = name; + return this; + } + + /** + * Get status + * @return status + **/ + public Status getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(Status status) { + this.status = status; + } + + public Cat status(Status status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..ae84137c036 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,126 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.model.Status; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + + +public class Dog { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + @JsonbProperty("status") + private Status status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Dog 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 Dog name(String name) { + this.name = name; + return this; + } + + /** + * Get status + * @return status + **/ + public Status getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(Status status) { + this.status = status; + } + + public Dog status(Status status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java new file mode 100644 index 00000000000..ec5a12d0b53 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/main/java/org/openapitools/client/model/Status.java @@ -0,0 +1,74 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + + +/** + * Gets or Sets Status + */ +@JsonbTypeSerializer(Status.Serializer.class) +@JsonbTypeDeserializer(Status.Deserializer.class) +public enum Status { + + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + Status(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public Status deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(Status obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + + public static Status fromValue(String text) { + for (Status b : Status.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..01185c52a5d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,81 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class 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.Cat; +import org.openapitools.client.model.Dog; +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; + +/** + * Petstore API Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private DefaultApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(DefaultApi.class); + } + + + /** + * List all cats + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void listCatsTest() { + // TODO: test validations + //List response = api.listCats(); + //Assertions.assertNotNull(response); + + + } + + /** + * List all dogs + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void listDogsTest() { + // TODO: test validations + //List response = api.listDogs(); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..4a9f33402c2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,59 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.model.Status; +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 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..fcab257e074 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,59 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.model.Status; +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 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/StatusTest.java b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/StatusTest.java new file mode 100644 index 00000000000..7838492b053 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-outer-enum/src/test/java/org/openapitools/client/model/StatusTest.java @@ -0,0 +1,32 @@ +/** + * Petstore API + * API for managing pets in a pet store + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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 Status + */ +class StatusTest { + /** + * Model tests for Status + */ + @Test + void testStatus() { + // TODO: test Status + } + +} 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 2f7a760809e..650e0a1d3c4 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 @@ -155,7 +155,7 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 + 2.17.1 2.1.0 2.0.0 2.0.0 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 aa7007ad5d5..121589eaeb6 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A category for a pet - **/ + */ public class Category { @@ -35,17 +35,17 @@ public class Category { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 44eea59b3ee..c1df0dd408a 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { @@ -38,17 +38,17 @@ public class ModelApiResponse { @JsonbProperty("message") private String message; - /** + /** * Get code * @return code - **/ + **/ public Integer getCode() { return code; } /** - * Set code - **/ + * Set code + */ public void setCode(Integer code) { this.code = code; } @@ -58,17 +58,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ public String getType() { return type; } /** - * Set type - **/ + * Set type + */ public void setType(String type) { this.type = type; } @@ -78,17 +78,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ public String getMessage() { return message; } /** - * Set message - **/ + * Set message + */ public void setMessage(String message) { this.message = message; } @@ -100,8 +100,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 d378038fc30..489c7fc73c5 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 @@ -26,7 +26,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * An order for a pets from the pet store - **/ + */ public class Order { @@ -85,25 +85,25 @@ public class Order { } /** - * Order Status - **/ + * Order Status + */ @JsonbProperty("status") private StatusEnum status; @JsonbProperty("complete") private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -113,17 +113,17 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ public Long getPetId() { return petId; } /** - * Set petId - **/ + * Set petId + */ public void setPetId(Long petId) { this.petId = petId; } @@ -133,17 +133,17 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ public Integer getQuantity() { return quantity; } /** - * Set quantity - **/ + * Set quantity + */ public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -153,17 +153,17 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ public Date getShipDate() { return shipDate; } /** - * Set shipDate - **/ + * Set shipDate + */ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -173,17 +173,17 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -193,17 +193,17 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ public Boolean getComplete() { return complete; } /** - * Set complete - **/ + * Set complete + */ public void setComplete(Boolean complete) { this.complete = complete; } @@ -215,8 +215,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 822179523dc..5761ee105f1 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 @@ -30,7 +30,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A pet for sale in the pet store - **/ + */ public class Pet { @@ -92,22 +92,22 @@ public class Pet { } /** - * pet status in the store - **/ + * pet status in the store + */ @JsonbProperty("status") private StatusEnum status; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -117,17 +117,17 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ public Category getCategory() { return category; } /** - * Set category - **/ + * Set category + */ public void setCategory(Category category) { this.category = category; } @@ -137,17 +137,17 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -157,17 +157,17 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ public List getPhotoUrls() { return photoUrls; } /** - * Set photoUrls - **/ + * Set photoUrls + */ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -185,17 +185,17 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ public List getTags() { return tags; } /** - * Set tags - **/ + * Set tags + */ public void setTags(List tags) { this.tags = tags; } @@ -213,19 +213,19 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -237,8 +237,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fecc6943bff..28985a1f069 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A tag for a pet - **/ + */ public class Tag { @@ -35,17 +35,17 @@ public class Tag { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e4f99ba38d3..d9ebaeb284d 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 @@ -25,7 +25,7 @@ import jakarta.json.bind.annotation.JsonbProperty; /** * A User who is purchasing from the pet store - **/ + */ public class User { @@ -51,22 +51,22 @@ public class User { private String phone; /** - * User Status - **/ + * User Status + */ @JsonbProperty("userStatus") private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -76,17 +76,17 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ public String getUsername() { return username; } /** - * Set username - **/ + * Set username + */ public void setUsername(String username) { this.username = username; } @@ -96,17 +96,17 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ public String getFirstName() { return firstName; } /** - * Set firstName - **/ + * Set firstName + */ public void setFirstName(String firstName) { this.firstName = firstName; } @@ -116,17 +116,17 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ public String getLastName() { return lastName; } /** - * Set lastName - **/ + * Set lastName + */ public void setLastName(String lastName) { this.lastName = lastName; } @@ -136,17 +136,17 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ public String getEmail() { return email; } /** - * Set email - **/ + * Set email + */ public void setEmail(String email) { this.email = email; } @@ -156,17 +156,17 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ public String getPassword() { return password; } /** - * Set password - **/ + * Set password + */ public void setPassword(String password) { this.password = password; } @@ -176,17 +176,17 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ public String getPhone() { return phone; } /** - * Set phone - **/ + * Set phone + */ public void setPhone(String phone) { this.phone = phone; } @@ -196,17 +196,17 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ public Integer getUserStatus() { return userStatus; } /** - * Set userStatus - **/ + * Set userStatus + */ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -218,8 +218,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/microprofile-rest-client/pom.xml b/samples/client/petstore/java/microprofile-rest-client/pom.xml index 3fd74e97414..6b4d20cb600 100644 --- a/samples/client/petstore/java/microprofile-rest-client/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client/pom.xml @@ -155,7 +155,7 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 + 2.17.1 1.2.2 1.3.5 1.0.2 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 d34db0dec2e..9b8e0cd7205 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 @@ -25,7 +25,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * A category for a pet - **/ + */ public class Category { @@ -35,17 +35,17 @@ public class Category { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 bb7520afb0b..6afa6830d98 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 @@ -25,7 +25,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { @@ -38,17 +38,17 @@ public class ModelApiResponse { @JsonbProperty("message") private String message; - /** + /** * Get code * @return code - **/ + **/ public Integer getCode() { return code; } /** - * Set code - **/ + * Set code + */ public void setCode(Integer code) { this.code = code; } @@ -58,17 +58,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ public String getType() { return type; } /** - * Set type - **/ + * Set type + */ public void setType(String type) { this.type = type; } @@ -78,17 +78,17 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ public String getMessage() { return message; } /** - * Set message - **/ + * Set message + */ public void setMessage(String message) { this.message = message; } @@ -100,8 +100,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 204dc0ceb79..a111215c674 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 @@ -26,7 +26,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * An order for a pets from the pet store - **/ + */ public class Order { @@ -85,25 +85,25 @@ public class Order { } /** - * Order Status - **/ + * Order Status + */ @JsonbProperty("status") private StatusEnum status; @JsonbProperty("complete") private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -113,17 +113,17 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ public Long getPetId() { return petId; } /** - * Set petId - **/ + * Set petId + */ public void setPetId(Long petId) { this.petId = petId; } @@ -133,17 +133,17 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ public Integer getQuantity() { return quantity; } /** - * Set quantity - **/ + * Set quantity + */ public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -153,17 +153,17 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ public Date getShipDate() { return shipDate; } /** - * Set shipDate - **/ + * Set shipDate + */ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -173,17 +173,17 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -193,17 +193,17 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ public Boolean getComplete() { return complete; } /** - * Set complete - **/ + * Set complete + */ public void setComplete(Boolean complete) { this.complete = complete; } @@ -215,8 +215,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 3efc500eec7..4da8d4dc763 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 @@ -30,7 +30,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * A pet for sale in the pet store - **/ + */ public class Pet { @@ -92,22 +92,22 @@ public class Pet { } /** - * pet status in the store - **/ + * pet status in the store + */ @JsonbProperty("status") private StatusEnum status; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -117,17 +117,17 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ public Category getCategory() { return category; } /** - * Set category - **/ + * Set category + */ public void setCategory(Category category) { this.category = category; } @@ -137,17 +137,17 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -157,17 +157,17 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ public List getPhotoUrls() { return photoUrls; } /** - * Set photoUrls - **/ + * Set photoUrls + */ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -185,17 +185,17 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ public List getTags() { return tags; } /** - * Set tags - **/ + * Set tags + */ public void setTags(List tags) { this.tags = tags; } @@ -213,19 +213,19 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated public StatusEnum getStatus() { return status; } /** - * Set status - **/ + * Set status + */ public void setStatus(StatusEnum status) { this.status = status; } @@ -237,8 +237,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 31b19492308..29afe967b74 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 @@ -25,7 +25,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * A tag for a pet - **/ + */ public class Tag { @@ -35,17 +35,17 @@ public class Tag { @JsonbProperty("name") private String name; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -55,17 +55,17 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ public String getName() { return name; } /** - * Set name - **/ + * Set name + */ public void setName(String name) { this.name = name; } @@ -77,8 +77,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 da9326887b1..67aba438db6 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 @@ -25,7 +25,7 @@ import javax.json.bind.annotation.JsonbProperty; /** * A User who is purchasing from the pet store - **/ + */ public class User { @@ -51,22 +51,22 @@ public class User { private String phone; /** - * User Status - **/ + * User Status + */ @JsonbProperty("userStatus") private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ public Long getId() { return id; } /** - * Set id - **/ + * Set id + */ public void setId(Long id) { this.id = id; } @@ -76,17 +76,17 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ public String getUsername() { return username; } /** - * Set username - **/ + * Set username + */ public void setUsername(String username) { this.username = username; } @@ -96,17 +96,17 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ public String getFirstName() { return firstName; } /** - * Set firstName - **/ + * Set firstName + */ public void setFirstName(String firstName) { this.firstName = firstName; } @@ -116,17 +116,17 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ public String getLastName() { return lastName; } /** - * Set lastName - **/ + * Set lastName + */ public void setLastName(String lastName) { this.lastName = lastName; } @@ -136,17 +136,17 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ public String getEmail() { return email; } /** - * Set email - **/ + * Set email + */ public void setEmail(String email) { this.email = email; } @@ -156,17 +156,17 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ public String getPassword() { return password; } /** - * Set password - **/ + * Set password + */ public void setPassword(String password) { this.password = password; } @@ -176,17 +176,17 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ public String getPhone() { return phone; } /** - * Set phone - **/ + * Set phone + */ public void setPhone(String phone) { this.phone = phone; } @@ -196,17 +196,17 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ public Integer getUserStatus() { return userStatus; } /** - * Set userStatus - **/ + * Set userStatus + */ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -218,8 +218,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/native-async/build.gradle b/samples/client/petstore/java/native-async/build.gradle index 14a7bef07d6..55464395440 100644 --- a/samples/client/petstore/java/native-async/build.gradle +++ b/samples/client/petstore/java/native-async/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson_version = "2.14.1" + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" junit_version = "5.10.2" httpmime_version = "4.5.13" diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index 6416fe9fa2e..0b3180965b0 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -253,7 +253,7 @@ UTF-8 11 11 - 2.15.2 + 2.17.1 0.2.6 1.3.5 4.5.14 diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index f596a0cf42a..5bad13d1147 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { private Duration readTimeout; private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b90f18a8c2e..3810d7c8310 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -34,6 +34,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * AdditionalPropertiesClass */ @@ -89,14 +90,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapProperty() { return mapProperty; } @@ -122,14 +122,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapOfMapProperty() { return mapOfMapProperty; } @@ -147,13 +146,12 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Object getAnytype1() { return anytype1.orElse(null); } @@ -180,14 +178,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getMapWithUndeclaredPropertiesAnytype1() { return mapWithUndeclaredPropertiesAnytype1; } @@ -205,14 +202,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getMapWithUndeclaredPropertiesAnytype2() { return mapWithUndeclaredPropertiesAnytype2; } @@ -238,14 +234,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapWithUndeclaredPropertiesAnytype3() { return mapWithUndeclaredPropertiesAnytype3; } @@ -263,14 +258,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMPTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getEmptyMap() { return emptyMap; } @@ -296,14 +290,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapWithUndeclaredPropertiesString() { return mapWithUndeclaredPropertiesString; } @@ -418,7 +411,7 @@ public class AdditionalPropertiesClass { for (String _key : getMapProperty().keySet()) { joiner.add(String.format("%smap_property%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapProperty().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -427,23 +420,23 @@ public class AdditionalPropertiesClass { for (String _key : getMapOfMapProperty().keySet()) { joiner.add(String.format("%smap_of_map_property%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapOfMapProperty().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `anytype_1` to the URL query string if (getAnytype1() != null) { - joiner.add(String.format("%sanytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sanytype_1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_1` to the URL query string if (getMapWithUndeclaredPropertiesAnytype1() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_2` to the URL query string if (getMapWithUndeclaredPropertiesAnytype2() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_3` to the URL query string @@ -451,13 +444,13 @@ public class AdditionalPropertiesClass { for (String _key : getMapWithUndeclaredPropertiesAnytype3().keySet()) { joiner.add(String.format("%smap_with_undeclared_properties_anytype_3%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesAnytype3().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype3().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapWithUndeclaredPropertiesAnytype3().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype3().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `empty_map` to the URL query string if (getEmptyMap() != null) { - joiner.add(String.format("%sempty_map%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmptyMap()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sempty_map%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEmptyMap()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_string` to the URL query string @@ -465,7 +458,7 @@ public class AdditionalPropertiesClass { for (String _key : getMapWithUndeclaredPropertiesString().keySet()) { joiner.add(String.format("%smap_with_undeclared_properties_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesString().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapWithUndeclaredPropertiesString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index e257e1fc440..9e7bd34c3d7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Animal */ @@ -65,14 +66,13 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -90,14 +90,13 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { return color; } @@ -186,12 +185,12 @@ public class Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Apple.java index 2f337272300..d7207f0cf79 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Apple.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Apple */ @@ -51,14 +52,13 @@ public class Apple { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCultivar() { return cultivar; } @@ -76,14 +76,13 @@ public class Apple { return this; } - /** + /** * Get origin * @return origin - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOrigin() { return origin; } @@ -172,12 +171,12 @@ public class Apple { // add `cultivar` to the URL query string if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `origin` to the URL query string if (getOrigin() != null) { - joiner.add(String.format("%sorigin%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrigin()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sorigin%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOrigin()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AppleReq.java index 5b9d8c3027b..934065a6ad2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AppleReq.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * AppleReq */ @@ -51,14 +52,13 @@ public class AppleReq { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getCultivar() { return cultivar; } @@ -76,14 +76,13 @@ public class AppleReq { return this; } - /** + /** * Get mealy * @return mealy - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MEALY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMealy() { return mealy; } @@ -172,12 +171,12 @@ public class AppleReq { // add `cultivar` to the URL query string if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `mealy` to the URL query string if (getMealy() != null) { - joiner.add(String.format("%smealy%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMealy()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smealy%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMealy()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cfb0f1f49bc..0352ed0a2ee 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,6 +31,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayOfArrayOfNumberOnly */ @@ -58,14 +59,13 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -156,7 +156,7 @@ public class ArrayOfArrayOfNumberOnly { if (getArrayArrayNumber().get(i) != null) { joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 1e31e687b02..a1da90e8962 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -31,6 +31,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayOfNumberOnly */ @@ -58,14 +59,13 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayNumber() { return arrayNumber; } @@ -156,7 +156,7 @@ public class ArrayOfNumberOnly { if (getArrayNumber().get(i) != null) { joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java index 41ab660344d..4590e865f2e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -31,6 +31,7 @@ import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayTest */ @@ -66,14 +67,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayOfString() { return arrayOfString; } @@ -99,14 +99,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -132,14 +131,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -233,7 +231,7 @@ public class ArrayTest { for (int i = 0; i < getArrayOfString().size(); i++) { joiner.add(String.format("%sarray_of_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -242,7 +240,7 @@ public class ArrayTest { for (int i = 0; i < getArrayArrayOfInteger().size(); i++) { joiner.add(String.format("%sarray_array_of_integer%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -252,7 +250,7 @@ public class ArrayTest { if (getArrayArrayOfModel().get(i) != null) { joiner.add(String.format("%sarray_array_of_model%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Banana.java index d68032a626c..dd9d033dd6b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Banana.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Banana */ @@ -48,14 +49,13 @@ public class Banana { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getLengthCm() { return lengthCm; } @@ -142,7 +142,7 @@ public class Banana { // add `lengthCm` to the URL query string if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BananaReq.java index 6eb7387832d..8c49ec8adb0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BananaReq.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * BananaReq */ @@ -52,14 +53,13 @@ public class BananaReq { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getLengthCm() { return lengthCm; } @@ -77,14 +77,13 @@ public class BananaReq { return this; } - /** + /** * Get sweet * @return sweet - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SWEET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSweet() { return sweet; } @@ -173,12 +172,12 @@ public class BananaReq { // add `lengthCm` to the URL query string if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `sweet` to the URL query string if (getSweet() != null) { - joiner.add(String.format("%ssweet%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSweet()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssweet%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSweet()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BasquePig.java index acc562341b8..411c5e232ad 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BasquePig.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * BasquePig */ @@ -47,14 +48,13 @@ public class BasquePig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -141,7 +141,7 @@ public class BasquePig { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java index 8e2362dc986..b48a517fc45 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Capitalization */ @@ -67,14 +68,13 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallCamel() { return smallCamel; } @@ -92,14 +92,13 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalCamel() { return capitalCamel; } @@ -117,14 +116,13 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallSnake() { return smallSnake; } @@ -142,14 +140,13 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalSnake() { return capitalSnake; } @@ -167,14 +164,13 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -192,14 +188,13 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getATTNAME() { return ATT_NAME; } @@ -296,32 +291,32 @@ public class Capitalization { // add `smallCamel` to the URL query string if (getSmallCamel() != null) { - joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `CapitalCamel` to the URL query string if (getCapitalCamel() != null) { - joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `small_Snake` to the URL query string if (getSmallSnake() != null) { - joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `Capital_Snake` to the URL query string if (getCapitalSnake() != null) { - joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `SCA_ETH_Flow_Points` to the URL query string if (getScAETHFlowPoints() != null) { - joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `ATT_NAME` to the URL query string if (getATTNAME() != null) { - joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index a0b9590d7fd..f0d734d710d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -34,6 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Cat */ @@ -59,14 +60,13 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { return declawed; } @@ -167,17 +167,17 @@ public class Cat extends Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `declawed` to the URL query string if (getDeclawed() != null) { - joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java index 6d972a9359e..8cd5c608746 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Category */ @@ -51,14 +52,13 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Category { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ChildCat.java index 7502248158c..79415bbe36d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ChildCat.java @@ -35,6 +35,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * ChildCat */ @@ -64,14 +65,13 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -97,14 +97,13 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPetType() { return petType; } @@ -199,12 +198,12 @@ public class ChildCat extends ParentPet { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java index 1497d1003d3..1b91684a0ab 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model with \"_class\" property */ @@ -47,14 +48,13 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } @@ -141,7 +141,7 @@ public class ClassModel { // add `_class` to the URL query string if (getPropertyClass() != null) { - joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java index 63023b3a96c..8bb044907a6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Client */ @@ -47,14 +48,13 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClient() { return client; } @@ -141,7 +141,7 @@ public class Client { // add `client` to the URL query string if (getClient() != null) { - joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 294aa35a99b..d7411d330ef 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ComplexQuadrilateral */ @@ -51,14 +52,13 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -172,12 +171,12 @@ public class ComplexQuadrilateral { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DanishPig.java index 760699a2de9..81e2bf24c1d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DanishPig.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * DanishPig */ @@ -47,14 +48,13 @@ public class DanishPig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -141,7 +141,7 @@ public class DanishPig { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 257807d8d33..68b7a1006c5 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * DeprecatedObject * @deprecated @@ -49,14 +50,13 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -143,7 +143,7 @@ public class DeprecatedObject { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java index 0f6de49adbc..329646de023 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java @@ -33,6 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Dog */ @@ -58,14 +59,13 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { return breed; } @@ -166,17 +166,17 @@ public class Dog extends Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `breed` to the URL query string if (getBreed() != null) { - joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java index a2fbda358f5..825ce184dcd 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java @@ -44,6 +44,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Drawing */ @@ -75,14 +76,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get mainShape * @return mainShape - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Shape getMainShape() { return mainShape; } @@ -100,14 +100,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get shapeOrNull * @return shapeOrNull - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ShapeOrNull getShapeOrNull() { return shapeOrNull; } @@ -125,13 +124,12 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get nullableShape * @return nullableShape - **/ + */ @javax.annotation.Nullable @JsonIgnore - public NullableShape getNullableShape() { return nullableShape.orElse(null); } @@ -166,14 +164,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get shapes * @return shapes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHAPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getShapes() { return shapes; } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java index f75a8c8fc35..1af1e8e882e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -30,6 +30,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EnumArrays */ @@ -123,14 +124,13 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -156,14 +156,13 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayEnum() { return arrayEnum; } @@ -252,7 +251,7 @@ public class EnumArrays { // add `just_symbol` to the URL query string if (getJustSymbol() != null) { - joiner.add(String.format("%sjust_symbol%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sjust_symbol%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `array_enum` to the URL query string @@ -260,7 +259,7 @@ public class EnumArrays { for (int i = 0; i < getArrayEnum().size(); i++) { joiner.add(String.format("%sarray_enum%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index c5a6694802c..cd9eedb70c0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -36,6 +36,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EnumTest */ @@ -266,14 +267,13 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumStringEnum getEnumString() { return enumString; } @@ -291,14 +291,13 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -316,14 +315,13 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -341,14 +339,13 @@ public class EnumTest { return this; } - /** + /** * Get enumIntegerOnly * @return enumIntegerOnly - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerOnlyEnum getEnumIntegerOnly() { return enumIntegerOnly; } @@ -366,14 +363,13 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -391,13 +387,12 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore - public OuterEnum getOuterEnum() { return outerEnum.orElse(null); } @@ -424,14 +419,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; } @@ -449,14 +443,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; } @@ -474,14 +467,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } @@ -595,47 +587,47 @@ public class EnumTest { // add `enum_string` to the URL query string if (getEnumString() != null) { - joiner.add(String.format("%senum_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_string%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_string_required` to the URL query string if (getEnumStringRequired() != null) { - joiner.add(String.format("%senum_string_required%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_string_required%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_integer` to the URL query string if (getEnumInteger() != null) { - joiner.add(String.format("%senum_integer%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_integer%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_integer_only` to the URL query string if (getEnumIntegerOnly() != null) { - joiner.add(String.format("%senum_integer_only%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumIntegerOnly()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_integer_only%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumIntegerOnly()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_number` to the URL query string if (getEnumNumber() != null) { - joiner.add(String.format("%senum_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnum` to the URL query string if (getOuterEnum() != null) { - joiner.add(String.format("%souterEnum%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnum%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumInteger` to the URL query string if (getOuterEnumInteger() != null) { - joiner.add(String.format("%souterEnumInteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumInteger%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumDefaultValue` to the URL query string if (getOuterEnumDefaultValue() != null) { - joiner.add(String.format("%souterEnumDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumIntegerDefaultValue` to the URL query string if (getOuterEnumIntegerDefaultValue() != null) { - joiner.add(String.format("%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 77bc8ddb3f2..ffe74e5fe9c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EquilateralTriangle */ @@ -51,14 +52,13 @@ public class EquilateralTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class EquilateralTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class EquilateralTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index d2deda7f15a..7cb4a8afd51 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -31,6 +31,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FakeBigDecimalMap200Response */ @@ -54,14 +55,13 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getSomeId() { return someId; } @@ -87,14 +87,13 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getSomeMap() { return someMap; } @@ -183,7 +182,7 @@ public class FakeBigDecimalMap200Response { // add `someId` to the URL query string if (getSomeId() != null) { - joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `someMap` to the URL query string @@ -191,7 +190,7 @@ public class FakeBigDecimalMap200Response { for (String _key : getSomeMap().keySet()) { joiner.add(String.format("%ssomeMap%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getSomeMap().get(_key), URLEncoder.encode(String.valueOf(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getSomeMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2b5f168fef9..3096b30e4c9 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -31,6 +31,7 @@ import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FileSchemaTestClass */ @@ -54,14 +55,13 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ModelFile getFile() { return _file; } @@ -87,14 +87,13 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { return files; } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Foo.java index b9009147ed6..3a2df4f301d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Foo.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Foo */ @@ -47,14 +48,13 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -141,7 +141,7 @@ public class Foo { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 1c15d8a3c9d..8af815e1c19 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -29,6 +29,7 @@ import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FooGetDefaultResponse */ @@ -48,14 +49,13 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Foo getString() { return string; } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java index d49ae74cadc..1feaea7aef2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java @@ -33,6 +33,7 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FormatTest */ @@ -112,16 +113,15 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInteger() { return integer; } @@ -139,16 +139,15 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInt32() { return int32; } @@ -166,14 +165,13 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getInt64() { return int64; } @@ -191,16 +189,15 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumber() { return number; } @@ -218,16 +215,15 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { return _float; } @@ -245,16 +241,15 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { return _double; } @@ -272,14 +267,13 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getDecimal() { return decimal; } @@ -297,14 +291,13 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getString() { return string; } @@ -322,14 +315,13 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public byte[] getByte() { return _byte; } @@ -347,14 +339,13 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getBinary() { return binary; } @@ -372,14 +363,13 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public LocalDate getDate() { return date; } @@ -397,14 +387,13 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } @@ -422,14 +411,13 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } @@ -447,14 +435,13 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPassword() { return password; } @@ -472,14 +459,13 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPatternWithDigits() { return patternWithDigits; } @@ -497,14 +483,13 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; } @@ -621,82 +606,82 @@ public class FormatTest { // add `integer` to the URL query string if (getInteger() != null) { - joiner.add(String.format("%sinteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sinteger%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `int32` to the URL query string if (getInt32() != null) { - joiner.add(String.format("%sint32%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sint32%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `int64` to the URL query string if (getInt64() != null) { - joiner.add(String.format("%sint64%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sint64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `number` to the URL query string if (getNumber() != null) { - joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `float` to the URL query string if (getFloat() != null) { - joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `double` to the URL query string if (getDouble() != null) { - joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `decimal` to the URL query string if (getDecimal() != null) { - joiner.add(String.format("%sdecimal%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdecimal%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `string` to the URL query string if (getString() != null) { - joiner.add(String.format("%sstring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstring%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `byte` to the URL query string if (getByte() != null) { - joiner.add(String.format("%sbyte%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbyte%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `binary` to the URL query string if (getBinary() != null) { - joiner.add(String.format("%sbinary%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbinary%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `date` to the URL query string if (getDate() != null) { - joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `dateTime` to the URL query string if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `password` to the URL query string if (getPassword() != null) { - joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `pattern_with_digits` to the URL query string if (getPatternWithDigits() != null) { - joiner.add(String.format("%spattern_with_digits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spattern_with_digits%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `pattern_with_digits_and_delimiter` to the URL query string if (getPatternWithDigitsAndDelimiter() != null) { - joiner.add(String.format("%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 1dea70c5ea1..19d1a4a32ed 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * GrandparentAnimal */ @@ -61,14 +62,13 @@ public class GrandparentAnimal { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPetType() { return petType; } @@ -155,7 +155,7 @@ public class GrandparentAnimal { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 780daa858b9..e52ab9c404d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * HasOnlyReadOnly */ @@ -56,14 +57,13 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -71,14 +71,13 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFoo() { return foo; } @@ -162,12 +161,12 @@ public class HasOnlyReadOnly { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `foo` to the URL query string if (getFoo() != null) { - joiner.add(String.format("%sfoo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfoo%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HealthCheckResult.java index f9770a701cc..9fc78109fb2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -32,6 +32,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ @@ -51,13 +52,12 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore - public String getNullableMessage() { return nullableMessage.orElse(null); } @@ -164,7 +164,7 @@ public class HealthCheckResult { // add `NullableMessage` to the URL query string if (getNullableMessage() != null) { - joiner.add(String.format("%sNullableMessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sNullableMessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index f8e3f920635..a9a8763235c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * IsoscelesTriangle */ @@ -51,14 +52,13 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class IsoscelesTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java index 6b792ff9ce2..feac748b582 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java @@ -30,6 +30,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * MapTest */ @@ -104,14 +105,13 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapOfString() { return mapMapOfString; } @@ -137,14 +137,13 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -170,14 +169,13 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getDirectMap() { return directMap; } @@ -203,14 +201,13 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getIndirectMap() { return indirectMap; } @@ -306,7 +303,7 @@ public class MapTest { for (String _key : getMapMapOfString().keySet()) { joiner.add(String.format("%smap_map_of_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapMapOfString().get(_key), URLEncoder.encode(String.valueOf(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapMapOfString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -315,7 +312,7 @@ public class MapTest { for (String _key : getMapOfEnumString().keySet()) { joiner.add(String.format("%smap_of_enum_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfEnumString().get(_key), URLEncoder.encode(String.valueOf(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapOfEnumString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -324,7 +321,7 @@ public class MapTest { for (String _key : getDirectMap().keySet()) { joiner.add(String.format("%sdirect_map%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getDirectMap().get(_key), URLEncoder.encode(String.valueOf(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getDirectMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -333,7 +330,7 @@ public class MapTest { for (String _key : getIndirectMap().keySet()) { joiner.add(String.format("%sindirect_map%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getIndirectMap().get(_key), URLEncoder.encode(String.valueOf(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getIndirectMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6c6b970ae15..18e275d98b1 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -33,6 +33,7 @@ import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -60,14 +61,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } @@ -85,14 +85,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } @@ -118,14 +117,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMap() { return map; } @@ -216,12 +214,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass { // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `dateTime` to the URL query string if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map` to the URL query string diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java index 09243076ef5..36031e11c8f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model name starting with number */ @@ -51,14 +52,13 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getName() { return name; } @@ -76,14 +76,13 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } @@ -172,12 +171,12 @@ public class Model200Response { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `class` to the URL query string if (getPropertyClass() != null) { - joiner.add(String.format("%sclass%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclass%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 91cbcabac89..30c33c40f13 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ModelApiResponse */ @@ -55,14 +56,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { return code; } @@ -80,14 +80,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { return type; } @@ -105,14 +104,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { return message; } @@ -203,17 +201,17 @@ public class ModelApiResponse { // add `code` to the URL query string if (getCode() != null) { - joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `type` to the URL query string if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `message` to the URL query string if (getMessage() != null) { - joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java index 0f857ffe15e..e4787ec1364 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Must be named `File` for test. */ @@ -47,14 +48,13 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceURI() { return sourceURI; } @@ -141,7 +141,7 @@ public class ModelFile { // add `sourceURI` to the URL query string if (getSourceURI() != null) { - joiner.add(String.format("%ssourceURI%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssourceURI%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java index 586be99e907..79537f8908c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ModelList */ @@ -47,14 +48,13 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String get123list() { return _123list; } @@ -141,7 +141,7 @@ public class ModelList { // add `123-list` to the URL query string if (get123list() != null) { - joiner.add(String.format("%s123-list%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s123-list%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java index 719aaf4d663..c86453a2901 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing reserved words */ @@ -47,14 +48,13 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getReturn() { return _return; } @@ -141,7 +141,7 @@ public class ModelReturn { // add `return` to the URL query string if (getReturn() != null) { - joiner.add(String.format("%sreturn%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sreturn%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java index a4145fd96b0..e75885b8c06 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model name same as property name */ @@ -69,14 +70,13 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getName() { return name; } @@ -89,14 +89,13 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSnakeCase() { return snakeCase; } @@ -109,14 +108,13 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProperty() { return property; } @@ -129,14 +127,13 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get123number() { return _123number; } @@ -224,22 +221,22 @@ public class Name { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `snake_case` to the URL query string if (getSnakeCase() != null) { - joiner.add(String.format("%ssnake_case%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssnake_case%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `property` to the URL query string if (getProperty() != null) { - joiner.add(String.format("%sproperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sproperty%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `123Number` to the URL query string if (get123number() != null) { - joiner.add(String.format("%s123Number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s123Number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java index 60063ab0985..e6e66c73ea2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java @@ -43,6 +43,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * NullableClass */ @@ -106,13 +107,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Integer getIntegerProp() { return integerProp.orElse(null); } @@ -139,13 +139,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public BigDecimal getNumberProp() { return numberProp.orElse(null); } @@ -172,13 +171,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Boolean getBooleanProp() { return booleanProp.orElse(null); } @@ -205,13 +203,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public String getStringProp() { return stringProp.orElse(null); } @@ -238,13 +235,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public LocalDate getDateProp() { return dateProp.orElse(null); } @@ -271,13 +267,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public OffsetDateTime getDatetimeProp() { return datetimeProp.orElse(null); } @@ -316,13 +311,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayNullableProp() { return arrayNullableProp.orElse(null); } @@ -361,13 +355,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayAndItemsNullableProp() { return arrayAndItemsNullableProp.orElse(null); } @@ -402,14 +395,13 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayItemsNullable() { return arrayItemsNullable; } @@ -439,13 +431,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Map getObjectNullableProp() { return objectNullableProp.orElse(null); } @@ -484,13 +475,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Map getObjectAndItemsNullableProp() { return objectAndItemsNullableProp.orElse(null); } @@ -525,14 +515,13 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getObjectItemsNullable() { return objectItemsNullable; } @@ -699,32 +688,32 @@ public class NullableClass extends HashMap { // add `integer_prop` to the URL query string if (getIntegerProp() != null) { - joiner.add(String.format("%sinteger_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sinteger_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `number_prop` to the URL query string if (getNumberProp() != null) { - joiner.add(String.format("%snumber_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%snumber_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `boolean_prop` to the URL query string if (getBooleanProp() != null) { - joiner.add(String.format("%sboolean_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sboolean_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `string_prop` to the URL query string if (getStringProp() != null) { - joiner.add(String.format("%sstring_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstring_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `date_prop` to the URL query string if (getDateProp() != null) { - joiner.add(String.format("%sdate_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdate_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `datetime_prop` to the URL query string if (getDatetimeProp() != null) { - joiner.add(String.format("%sdatetime_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdatetime_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `array_nullable_prop` to the URL query string @@ -732,7 +721,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayNullableProp().size(); i++) { joiner.add(String.format("%sarray_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -741,7 +730,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) { joiner.add(String.format("%sarray_and_items_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -750,7 +739,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayItemsNullable().size(); i++) { joiner.add(String.format("%sarray_items_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -759,7 +748,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectNullableProp().keySet()) { joiner.add(String.format("%sobject_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectNullableProp().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -768,7 +757,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectAndItemsNullableProp().keySet()) { joiner.add(String.format("%sobject_and_items_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -777,7 +766,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectItemsNullable().keySet()) { joiner.add(String.format("%sobject_items_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectItemsNullable().get(_key), URLEncoder.encode(String.valueOf(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectItemsNullable().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java index 2736cae3473..71a1621e056 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * NumberOnly */ @@ -48,14 +49,13 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getJustNumber() { return justNumber; } @@ -142,7 +142,7 @@ public class NumberOnly { // add `JustNumber` to the URL query string if (getJustNumber() != null) { - joiner.add(String.format("%sJustNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sJustNumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index c2006c37afb..7fd1333efab 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -32,6 +32,7 @@ import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ObjectWithDeprecatedFields */ @@ -63,14 +64,13 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUuid() { return uuid; } @@ -88,16 +88,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getId() { return id; } @@ -115,16 +114,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DeprecatedObject getDeprecatedRef() { return deprecatedRef; } @@ -150,16 +148,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBars() { return bars; } @@ -252,12 +249,12 @@ public class ObjectWithDeprecatedFields { // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `deprecatedRef` to the URL query string @@ -270,7 +267,7 @@ public class ObjectWithDeprecatedFields { for (int i = 0; i < getBars().size(); i++) { joiner.add(String.format("%sbars%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java index c94a9b5d44b..a83682cb6f7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Order */ @@ -105,14 +106,13 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -130,14 +130,13 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPetId() { return petId; } @@ -155,14 +154,13 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { return quantity; } @@ -180,14 +178,13 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getShipDate() { return shipDate; } @@ -205,14 +202,13 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -230,14 +226,13 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { return complete; } @@ -334,32 +329,32 @@ public class Order { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `petId` to the URL query string if (getPetId() != null) { - joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quantity` to the URL query string if (getQuantity() != null) { - joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `shipDate` to the URL query string if (getShipDate() != null) { - joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `complete` to the URL query string if (getComplete() != null) { - joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java index ae20f0bb8ff..070b777fb34 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * OuterComposite */ @@ -56,14 +57,13 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getMyNumber() { return myNumber; } @@ -81,14 +81,13 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMyString() { return myString; } @@ -106,14 +105,13 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMyBoolean() { return myBoolean; } @@ -204,17 +202,17 @@ public class OuterComposite { // add `my_number` to the URL query string if (getMyNumber() != null) { - joiner.add(String.format("%smy_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `my_string` to the URL query string if (getMyString() != null) { - joiner.add(String.format("%smy_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_string%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `my_boolean` to the URL query string if (getMyBoolean() != null) { - joiner.add(String.format("%smy_boolean%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_boolean%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java index afda1fcc6f0..a8efcb60ede 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java @@ -33,6 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * ParentPet */ @@ -131,7 +132,7 @@ public class ParentPet extends GrandparentAnimal { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java index beb52e3b073..45f55734b6f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java @@ -32,6 +32,7 @@ import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Pet */ @@ -108,14 +109,13 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -133,14 +133,13 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { return category; } @@ -158,14 +157,13 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -191,14 +189,13 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { return photoUrls; } @@ -224,14 +221,13 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { return tags; } @@ -249,14 +245,13 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -353,7 +348,7 @@ public class Pet { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `category` to the URL query string @@ -363,7 +358,7 @@ public class Pet { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `photoUrls` to the URL query string @@ -371,7 +366,7 @@ public class Pet { for (int i = 0; i < getPhotoUrls().size(); i++) { joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -387,7 +382,7 @@ public class Pet { // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index e75c80813f9..4978163b76e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * QuadrilateralInterface */ @@ -47,14 +48,13 @@ public class QuadrilateralInterface { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -141,7 +141,7 @@ public class QuadrilateralInterface { // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 88c7063be00..845eae2637b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ReadOnlyFirst */ @@ -54,14 +55,13 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -74,14 +74,13 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBaz() { return baz; } @@ -170,12 +169,12 @@ public class ReadOnlyFirst { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `baz` to the URL query string if (getBaz() != null) { - joiner.add(String.format("%sbaz%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbaz%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 1006fe856ca..927eb5a2853 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ScaleneTriangle */ @@ -51,14 +52,13 @@ public class ScaleneTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class ScaleneTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class ScaleneTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeInterface.java index b6fa6c00047..055dfe838e2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ShapeInterface */ @@ -47,14 +48,13 @@ public class ShapeInterface { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -141,7 +141,7 @@ public class ShapeInterface { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index e8722bab705..11e2010a05a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * SimpleQuadrilateral */ @@ -51,14 +52,13 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -172,12 +171,12 @@ public class SimpleQuadrilateral { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java index f106823e112..dd0da972dbb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * SpecialModelName */ @@ -51,14 +52,13 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -76,14 +76,13 @@ public class SpecialModelName { return this; } - /** + /** * Get specialModelName * @return specialModelName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSpecialModelName() { return specialModelName; } @@ -172,12 +171,12 @@ public class SpecialModelName { // add `$special[property.name]` to the URL query string if (get$SpecialPropertyName() != null) { - joiner.add(String.format("%s$special[property.name]%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s$special[property.name]%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `_special_model.name_` to the URL query string if (getSpecialModelName() != null) { - joiner.add(String.format("%s_special_model.name_%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpecialModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s_special_model.name_%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSpecialModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java index 66157ea8d85..50faae9f318 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Tag */ @@ -51,14 +52,13 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Tag { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index a286fd840b2..5757e9559df 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -34,6 +34,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * TestInlineFreeformAdditionalPropertiesRequest */ @@ -53,14 +54,13 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TypeEnum getType() { return type; } @@ -119,14 +119,13 @@ public class Zebra extends HashMap { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -262,12 +261,12 @@ public class Zebra extends HashMap { // add `type` to the URL query string if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/build.gradle b/samples/client/petstore/java/native-jakarta/build.gradle index a1106b11dc7..d1691d70243 100644 --- a/samples/client/petstore/java/native-jakarta/build.gradle +++ b/samples/client/petstore/java/native-jakarta/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson_version = "2.14.1" + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" junit_version = "5.10.2" httpmime_version = "4.5.13" diff --git a/samples/client/petstore/java/native-jakarta/pom.xml b/samples/client/petstore/java/native-jakarta/pom.xml index a8529c5102e..ed066454233 100644 --- a/samples/client/petstore/java/native-jakarta/pom.xml +++ b/samples/client/petstore/java/native-jakarta/pom.xml @@ -253,7 +253,7 @@ UTF-8 11 11 - 2.15.2 + 2.17.1 0.2.6 2.1.1 4.5.14 diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java index a9246a831e8..e1b17f8d9e8 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { private Duration readTimeout; private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Category.java index 4a324bfadec..40b8f512010 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * A category for a pet */ @@ -51,14 +52,13 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Category { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2a1dd77e9dc..5bda64fa249 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Describes the result of uploading an image resource */ @@ -55,14 +56,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { return code; } @@ -80,14 +80,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { return type; } @@ -105,14 +104,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { return message; } @@ -203,17 +201,17 @@ public class ModelApiResponse { // add `code` to the URL query string if (getCode() != null) { - joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `type` to the URL query string if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `message` to the URL query string if (getMessage() != null) { - joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Order.java index fff68bb3c96..e109d3fb8c0 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * An order for a pets from the pet store */ @@ -105,14 +106,13 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -130,14 +130,13 @@ public class Order { 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; } @@ -155,14 +154,13 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { return quantity; } @@ -180,14 +178,13 @@ public class Order { 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; } @@ -205,14 +202,13 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -230,14 +226,13 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { return complete; } @@ -334,32 +329,32 @@ public class Order { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `petId` to the URL query string if (getPetId() != null) { - joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quantity` to the URL query string if (getQuantity() != null) { - joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `shipDate` to the URL query string if (getShipDate() != null) { - joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `complete` to the URL query string if (getComplete() != null) { - joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java index 5a59f350a60..e58f117a4fd 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -32,6 +32,7 @@ import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * A pet for sale in the pet store */ @@ -108,14 +109,13 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -133,14 +133,13 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { return category; } @@ -158,14 +157,13 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -191,14 +189,13 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { return photoUrls; } @@ -224,14 +221,13 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { return tags; } @@ -249,16 +245,15 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -355,7 +350,7 @@ public class Pet { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `category` to the URL query string @@ -365,7 +360,7 @@ public class Pet { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `photoUrls` to the URL query string @@ -373,7 +368,7 @@ public class Pet { for (int i = 0; i < getPhotoUrls().size(); i++) { joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -389,7 +384,7 @@ public class Pet { // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Tag.java index 01b45dee8b8..eceadf6857f 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * A tag for a pet */ @@ -51,14 +52,13 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Tag { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/User.java index 3de4c4ff5d0..8c5b2faa104 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * A User who is purchasing from the pet store */ @@ -75,14 +76,13 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -100,14 +100,13 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUsername() { return username; } @@ -125,14 +124,13 @@ public class User { 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; } @@ -150,14 +148,13 @@ public class User { 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; } @@ -175,14 +172,13 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmail() { return email; } @@ -200,14 +196,13 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPassword() { return password; } @@ -225,14 +220,13 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPhone() { return phone; } @@ -250,14 +244,13 @@ public class User { 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; } @@ -358,42 +351,42 @@ public class User { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `username` to the URL query string if (getUsername() != null) { - joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `firstName` to the URL query string if (getFirstName() != null) { - joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFirstName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `lastName` to the URL query string if (getLastName() != null) { - joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLastName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `email` to the URL query string if (getEmail() != null) { - joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEmail()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `password` to the URL query string if (getPassword() != null) { - joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `phone` to the URL query string if (getPhone() != null) { - joiner.add(String.format("%sphone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhone()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sphone%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPhone()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `userStatus` to the URL query string if (getUserStatus() != null) { - joiner.add(String.format("%suserStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suserStatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUserStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index 14a7bef07d6..55464395440 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -66,7 +66,7 @@ artifacts { ext { - jackson_version = "2.14.1" + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" junit_version = "5.10.2" httpmime_version = "4.5.13" diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index 6416fe9fa2e..0b3180965b0 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -253,7 +253,7 @@ UTF-8 11 11 - 2.15.2 + 2.17.1 0.2.6 1.3.5 4.5.14 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index f596a0cf42a..5bad13d1147 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { private Duration readTimeout; private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } 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 04f8324d56f..cee0b7cfccf 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 @@ -34,6 +34,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * AdditionalPropertiesClass */ @@ -89,14 +90,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapProperty() { return mapProperty; } @@ -122,14 +122,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapOfMapProperty() { return mapOfMapProperty; } @@ -147,13 +146,12 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Object getAnytype1() { return anytype1.orElse(null); } @@ -180,14 +178,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getMapWithUndeclaredPropertiesAnytype1() { return mapWithUndeclaredPropertiesAnytype1; } @@ -205,14 +202,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getMapWithUndeclaredPropertiesAnytype2() { return mapWithUndeclaredPropertiesAnytype2; } @@ -238,14 +234,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapWithUndeclaredPropertiesAnytype3() { return mapWithUndeclaredPropertiesAnytype3; } @@ -263,14 +258,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMPTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getEmptyMap() { return emptyMap; } @@ -296,14 +290,13 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapWithUndeclaredPropertiesString() { return mapWithUndeclaredPropertiesString; } @@ -418,7 +411,7 @@ public class AdditionalPropertiesClass { for (String _key : getMapProperty().keySet()) { joiner.add(String.format("%smap_property%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapProperty().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -427,23 +420,23 @@ public class AdditionalPropertiesClass { for (String _key : getMapOfMapProperty().keySet()) { joiner.add(String.format("%smap_of_map_property%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapOfMapProperty().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `anytype_1` to the URL query string if (getAnytype1() != null) { - joiner.add(String.format("%sanytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sanytype_1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_1` to the URL query string if (getMapWithUndeclaredPropertiesAnytype1() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_2` to the URL query string if (getMapWithUndeclaredPropertiesAnytype2() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_anytype_3` to the URL query string @@ -451,13 +444,13 @@ public class AdditionalPropertiesClass { for (String _key : getMapWithUndeclaredPropertiesAnytype3().keySet()) { joiner.add(String.format("%smap_with_undeclared_properties_anytype_3%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesAnytype3().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype3().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapWithUndeclaredPropertiesAnytype3().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype3().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } // add `empty_map` to the URL query string if (getEmptyMap() != null) { - joiner.add(String.format("%sempty_map%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmptyMap()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sempty_map%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEmptyMap()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map_with_undeclared_properties_string` to the URL query string @@ -465,7 +458,7 @@ public class AdditionalPropertiesClass { for (String _key : getMapWithUndeclaredPropertiesString().keySet()) { joiner.add(String.format("%smap_with_undeclared_properties_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesString().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapWithUndeclaredPropertiesString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapWithUndeclaredPropertiesString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 6de79876ed0..5ad019145ed 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 @@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Animal */ @@ -65,14 +66,13 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -90,14 +90,13 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { return color; } @@ -186,12 +185,12 @@ public class Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 f43d59f0976..f7db63cdd94 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Apple */ @@ -51,14 +52,13 @@ public class Apple { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCultivar() { return cultivar; } @@ -76,14 +76,13 @@ public class Apple { return this; } - /** + /** * Get origin * @return origin - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOrigin() { return origin; } @@ -172,12 +171,12 @@ public class Apple { // add `cultivar` to the URL query string if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `origin` to the URL query string if (getOrigin() != null) { - joiner.add(String.format("%sorigin%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrigin()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sorigin%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOrigin()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 4098805f319..3e30b6c7b5b 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * AppleReq */ @@ -51,14 +52,13 @@ public class AppleReq { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getCultivar() { return cultivar; } @@ -76,14 +76,13 @@ public class AppleReq { return this; } - /** + /** * Get mealy * @return mealy - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MEALY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMealy() { return mealy; } @@ -172,12 +171,12 @@ public class AppleReq { // add `cultivar` to the URL query string if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `mealy` to the URL query string if (getMealy() != null) { - joiner.add(String.format("%smealy%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMealy()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smealy%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMealy()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 e05f4a5dbcd..5c1b85e900a 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 @@ -31,6 +31,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayOfArrayOfNumberOnly */ @@ -58,14 +59,13 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -156,7 +156,7 @@ public class ArrayOfArrayOfNumberOnly { if (getArrayArrayNumber().get(i) != null) { joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } 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 57d8419a8b2..2ad168247c9 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 @@ -31,6 +31,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayOfNumberOnly */ @@ -58,14 +59,13 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayNumber() { return arrayNumber; } @@ -156,7 +156,7 @@ public class ArrayOfNumberOnly { if (getArrayNumber().get(i) != null) { joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } 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 42ba1bf1270..5c8c807fe24 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 @@ -31,6 +31,7 @@ import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ArrayTest */ @@ -66,14 +67,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayOfString() { return arrayOfString; } @@ -99,14 +99,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -132,14 +131,13 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -233,7 +231,7 @@ public class ArrayTest { for (int i = 0; i < getArrayOfString().size(); i++) { joiner.add(String.format("%sarray_of_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -242,7 +240,7 @@ public class ArrayTest { for (int i = 0; i < getArrayArrayOfInteger().size(); i++) { joiner.add(String.format("%sarray_array_of_integer%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -252,7 +250,7 @@ public class ArrayTest { if (getArrayArrayOfModel().get(i) != null) { joiner.add(String.format("%sarray_array_of_model%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } } 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 e339552e2e1..96bc9ccb1b3 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Banana */ @@ -48,14 +49,13 @@ public class Banana { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getLengthCm() { return lengthCm; } @@ -142,7 +142,7 @@ public class Banana { // add `lengthCm` to the URL query string if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 d599889d08a..8d63c59505c 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * BananaReq */ @@ -52,14 +53,13 @@ public class BananaReq { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getLengthCm() { return lengthCm; } @@ -77,14 +77,13 @@ public class BananaReq { return this; } - /** + /** * Get sweet * @return sweet - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SWEET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSweet() { return sweet; } @@ -173,12 +172,12 @@ public class BananaReq { // add `lengthCm` to the URL query string if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `sweet` to the URL query string if (getSweet() != null) { - joiner.add(String.format("%ssweet%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSweet()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssweet%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSweet()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 98c6c3c4047..4a8cbc1fde3 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * BasquePig */ @@ -47,14 +48,13 @@ public class BasquePig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -141,7 +141,7 @@ public class BasquePig { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 6ae8c4a8b98..77f657c5375 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Capitalization */ @@ -67,14 +68,13 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallCamel() { return smallCamel; } @@ -92,14 +92,13 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalCamel() { return capitalCamel; } @@ -117,14 +116,13 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallSnake() { return smallSnake; } @@ -142,14 +140,13 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalSnake() { return capitalSnake; } @@ -167,14 +164,13 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -192,14 +188,13 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getATTNAME() { return ATT_NAME; } @@ -296,32 +291,32 @@ public class Capitalization { // add `smallCamel` to the URL query string if (getSmallCamel() != null) { - joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `CapitalCamel` to the URL query string if (getCapitalCamel() != null) { - joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `small_Snake` to the URL query string if (getSmallSnake() != null) { - joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `Capital_Snake` to the URL query string if (getCapitalSnake() != null) { - joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `SCA_ETH_Flow_Points` to the URL query string if (getScAETHFlowPoints() != null) { - joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `ATT_NAME` to the URL query string if (getATTNAME() != null) { - joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 ee64aec9b95..89070974d1f 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 @@ -34,6 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Cat */ @@ -59,14 +60,13 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { return declawed; } @@ -167,17 +167,17 @@ public class Cat extends Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `declawed` to the URL query string if (getDeclawed() != null) { - joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 22398944dfe..a231b471ecd 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Category */ @@ -51,14 +52,13 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Category { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 0b6deee6d94..274856a9f99 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 @@ -35,6 +35,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * ChildCat */ @@ -64,14 +65,13 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -97,14 +97,13 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPetType() { return petType; } @@ -199,12 +198,12 @@ public class ChildCat extends ParentPet { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 074e4a46da9..c8b527d1b46 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model with \"_class\" property */ @@ -47,14 +48,13 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } @@ -141,7 +141,7 @@ public class ClassModel { // add `_class` to the URL query string if (getPropertyClass() != null) { - joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 4f5bba3543d..ddccb81a356 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Client */ @@ -47,14 +48,13 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClient() { return client; } @@ -141,7 +141,7 @@ public class Client { // add `client` to the URL query string if (getClient() != null) { - joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 9d64e700796..2020b981f1e 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ComplexQuadrilateral */ @@ -51,14 +52,13 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -172,12 +171,12 @@ public class ComplexQuadrilateral { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 f8ea1c98bec..0b052fe592d 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * DanishPig */ @@ -47,14 +48,13 @@ public class DanishPig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -141,7 +141,7 @@ public class DanishPig { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 d619a398cff..8a2973436ff 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * DeprecatedObject * @deprecated @@ -49,14 +50,13 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -143,7 +143,7 @@ public class DeprecatedObject { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 32b75a9ce57..b524df7eb0e 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 @@ -33,6 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * Dog */ @@ -58,14 +59,13 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { return breed; } @@ -166,17 +166,17 @@ public class Dog extends Animal { // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `color` to the URL query string if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `breed` to the URL query string if (getBreed() != null) { - joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 ef512f4ce4a..6ea9bcb2034 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 @@ -44,6 +44,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Drawing */ @@ -75,14 +76,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get mainShape * @return mainShape - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Shape getMainShape() { return mainShape; } @@ -100,14 +100,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get shapeOrNull * @return shapeOrNull - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ShapeOrNull getShapeOrNull() { return shapeOrNull; } @@ -125,13 +124,12 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get nullableShape * @return nullableShape - **/ + */ @javax.annotation.Nullable @JsonIgnore - public NullableShape getNullableShape() { return nullableShape.orElse(null); } @@ -166,14 +164,13 @@ public class Drawing extends HashMap { return this; } - /** + /** * Get shapes * @return shapes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHAPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getShapes() { return shapes; } 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 45de8a83ef3..76cfb6ae854 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 @@ -30,6 +30,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EnumArrays */ @@ -123,14 +124,13 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -156,14 +156,13 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayEnum() { return arrayEnum; } @@ -252,7 +251,7 @@ public class EnumArrays { // add `just_symbol` to the URL query string if (getJustSymbol() != null) { - joiner.add(String.format("%sjust_symbol%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sjust_symbol%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `array_enum` to the URL query string @@ -260,7 +259,7 @@ public class EnumArrays { for (int i = 0; i < getArrayEnum().size(); i++) { joiner.add(String.format("%sarray_enum%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 5507b809889..6e8b5e57d5e 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 @@ -36,6 +36,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EnumTest */ @@ -266,14 +267,13 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumStringEnum getEnumString() { return enumString; } @@ -291,14 +291,13 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -316,14 +315,13 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -341,14 +339,13 @@ public class EnumTest { return this; } - /** + /** * Get enumIntegerOnly * @return enumIntegerOnly - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerOnlyEnum getEnumIntegerOnly() { return enumIntegerOnly; } @@ -366,14 +363,13 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -391,13 +387,12 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore - public OuterEnum getOuterEnum() { return outerEnum.orElse(null); } @@ -424,14 +419,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; } @@ -449,14 +443,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; } @@ -474,14 +467,13 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } @@ -595,47 +587,47 @@ public class EnumTest { // add `enum_string` to the URL query string if (getEnumString() != null) { - joiner.add(String.format("%senum_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_string%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_string_required` to the URL query string if (getEnumStringRequired() != null) { - joiner.add(String.format("%senum_string_required%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_string_required%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_integer` to the URL query string if (getEnumInteger() != null) { - joiner.add(String.format("%senum_integer%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_integer%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_integer_only` to the URL query string if (getEnumIntegerOnly() != null) { - joiner.add(String.format("%senum_integer_only%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumIntegerOnly()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_integer_only%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumIntegerOnly()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `enum_number` to the URL query string if (getEnumNumber() != null) { - joiner.add(String.format("%senum_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%senum_number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnum` to the URL query string if (getOuterEnum() != null) { - joiner.add(String.format("%souterEnum%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnum%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumInteger` to the URL query string if (getOuterEnumInteger() != null) { - joiner.add(String.format("%souterEnumInteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumInteger%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumDefaultValue` to the URL query string if (getOuterEnumDefaultValue() != null) { - joiner.add(String.format("%souterEnumDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `outerEnumIntegerDefaultValue` to the URL query string if (getOuterEnumIntegerDefaultValue() != null) { - joiner.add(String.format("%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 e04a35b0928..c26e843aae5 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * EquilateralTriangle */ @@ -51,14 +52,13 @@ public class EquilateralTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class EquilateralTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class EquilateralTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 5139d0c667b..df75ef993d2 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 @@ -31,6 +31,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FakeBigDecimalMap200Response */ @@ -54,14 +55,13 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getSomeId() { return someId; } @@ -87,14 +87,13 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getSomeMap() { return someMap; } @@ -183,7 +182,7 @@ public class FakeBigDecimalMap200Response { // add `someId` to the URL query string if (getSomeId() != null) { - joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssomeId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSomeId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `someMap` to the URL query string @@ -191,7 +190,7 @@ public class FakeBigDecimalMap200Response { for (String _key : getSomeMap().keySet()) { joiner.add(String.format("%ssomeMap%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getSomeMap().get(_key), URLEncoder.encode(String.valueOf(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getSomeMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getSomeMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 b02a9ec96e9..528b1981639 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 @@ -31,6 +31,7 @@ import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FileSchemaTestClass */ @@ -54,14 +55,13 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ModelFile getFile() { return _file; } @@ -87,14 +87,13 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { return files; } 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 ebe1809a039..f1459bfffff 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Foo */ @@ -47,14 +48,13 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -141,7 +141,7 @@ public class Foo { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 a5725a6d928..b9d240c25b0 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 @@ -29,6 +29,7 @@ import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FooGetDefaultResponse */ @@ -48,14 +49,13 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Foo getString() { return string; } 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 64637e1466a..ea46ccce34b 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 @@ -33,6 +33,7 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * FormatTest */ @@ -112,16 +113,15 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInteger() { return integer; } @@ -139,16 +139,15 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInt32() { return int32; } @@ -166,14 +165,13 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getInt64() { return int64; } @@ -191,16 +189,15 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumber() { return number; } @@ -218,16 +215,15 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { return _float; } @@ -245,16 +241,15 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { return _double; } @@ -272,14 +267,13 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getDecimal() { return decimal; } @@ -297,14 +291,13 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getString() { return string; } @@ -322,14 +315,13 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public byte[] getByte() { return _byte; } @@ -347,14 +339,13 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getBinary() { return binary; } @@ -372,14 +363,13 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public LocalDate getDate() { return date; } @@ -397,14 +387,13 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } @@ -422,14 +411,13 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } @@ -447,14 +435,13 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPassword() { return password; } @@ -472,14 +459,13 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPatternWithDigits() { return patternWithDigits; } @@ -497,14 +483,13 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; } @@ -621,82 +606,82 @@ public class FormatTest { // add `integer` to the URL query string if (getInteger() != null) { - joiner.add(String.format("%sinteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sinteger%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `int32` to the URL query string if (getInt32() != null) { - joiner.add(String.format("%sint32%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sint32%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `int64` to the URL query string if (getInt64() != null) { - joiner.add(String.format("%sint64%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sint64%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `number` to the URL query string if (getNumber() != null) { - joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `float` to the URL query string if (getFloat() != null) { - joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `double` to the URL query string if (getDouble() != null) { - joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `decimal` to the URL query string if (getDecimal() != null) { - joiner.add(String.format("%sdecimal%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdecimal%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `string` to the URL query string if (getString() != null) { - joiner.add(String.format("%sstring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstring%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `byte` to the URL query string if (getByte() != null) { - joiner.add(String.format("%sbyte%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbyte%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `binary` to the URL query string if (getBinary() != null) { - joiner.add(String.format("%sbinary%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbinary%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `date` to the URL query string if (getDate() != null) { - joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `dateTime` to the URL query string if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `password` to the URL query string if (getPassword() != null) { - joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `pattern_with_digits` to the URL query string if (getPatternWithDigits() != null) { - joiner.add(String.format("%spattern_with_digits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spattern_with_digits%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `pattern_with_digits_and_delimiter` to the URL query string if (getPatternWithDigitsAndDelimiter() != null) { - joiner.add(String.format("%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 4b095b70f84..f964c4fe0a5 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 @@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * GrandparentAnimal */ @@ -61,14 +62,13 @@ public class GrandparentAnimal { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPetType() { return petType; } @@ -155,7 +155,7 @@ public class GrandparentAnimal { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 9b982eee32f..8520b649853 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * HasOnlyReadOnly */ @@ -56,14 +57,13 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -71,14 +71,13 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFoo() { return foo; } @@ -162,12 +161,12 @@ public class HasOnlyReadOnly { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `foo` to the URL query string if (getFoo() != null) { - joiner.add(String.format("%sfoo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sfoo%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 4da81560047..3165635d9ad 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 @@ -32,6 +32,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ @@ -51,13 +52,12 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore - public String getNullableMessage() { return nullableMessage.orElse(null); } @@ -164,7 +164,7 @@ public class HealthCheckResult { // add `NullableMessage` to the URL query string if (getNullableMessage() != null) { - joiner.add(String.format("%sNullableMessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sNullableMessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 386789d058d..4085885adb9 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * IsoscelesTriangle */ @@ -51,14 +52,13 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class IsoscelesTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 38f7d53530f..335d2074a99 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 @@ -30,6 +30,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * MapTest */ @@ -104,14 +105,13 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapOfString() { return mapMapOfString; } @@ -137,14 +137,13 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -170,14 +169,13 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getDirectMap() { return directMap; } @@ -203,14 +201,13 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getIndirectMap() { return indirectMap; } @@ -306,7 +303,7 @@ public class MapTest { for (String _key : getMapMapOfString().keySet()) { joiner.add(String.format("%smap_map_of_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapMapOfString().get(_key), URLEncoder.encode(String.valueOf(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapMapOfString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -315,7 +312,7 @@ public class MapTest { for (String _key : getMapOfEnumString().keySet()) { joiner.add(String.format("%smap_of_enum_string%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfEnumString().get(_key), URLEncoder.encode(String.valueOf(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getMapOfEnumString().get(_key), URLEncoder.encode(ApiClient.valueToString(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -324,7 +321,7 @@ public class MapTest { for (String _key : getDirectMap().keySet()) { joiner.add(String.format("%sdirect_map%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getDirectMap().get(_key), URLEncoder.encode(String.valueOf(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getDirectMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -333,7 +330,7 @@ public class MapTest { for (String _key : getIndirectMap().keySet()) { joiner.add(String.format("%sindirect_map%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getIndirectMap().get(_key), URLEncoder.encode(String.valueOf(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getIndirectMap().get(_key), URLEncoder.encode(ApiClient.valueToString(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 afc64863e50..6fc534f868a 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 @@ -33,6 +33,7 @@ import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -60,14 +61,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } @@ -85,14 +85,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } @@ -118,14 +117,13 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMap() { return map; } @@ -216,12 +214,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass { // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `dateTime` to the URL query string if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `map` to the URL query string 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 46c45395701..7f6800a0893 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model name starting with number */ @@ -51,14 +52,13 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getName() { return name; } @@ -76,14 +76,13 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } @@ -172,12 +171,12 @@ public class Model200Response { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `class` to the URL query string if (getPropertyClass() != null) { - joiner.add(String.format("%sclass%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclass%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 79a1db7a3a2..716493f6bfe 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ModelApiResponse */ @@ -55,14 +56,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { return code; } @@ -80,14 +80,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { return type; } @@ -105,14 +104,13 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { return message; } @@ -203,17 +201,17 @@ public class ModelApiResponse { // add `code` to the URL query string if (getCode() != null) { - joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `type` to the URL query string if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `message` to the URL query string if (getMessage() != null) { - joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 212d9ba68ff..c28b31d10f3 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Must be named `File` for test. */ @@ -47,14 +48,13 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceURI() { return sourceURI; } @@ -141,7 +141,7 @@ public class ModelFile { // add `sourceURI` to the URL query string if (getSourceURI() != null) { - joiner.add(String.format("%ssourceURI%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssourceURI%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 49d00056c6a..b4caa4a4384 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ModelList */ @@ -47,14 +48,13 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String get123list() { return _123list; } @@ -141,7 +141,7 @@ public class ModelList { // add `123-list` to the URL query string if (get123list() != null) { - joiner.add(String.format("%s123-list%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s123-list%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 fc5c6cb34a9..44f5ad50fad 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing reserved words */ @@ -47,14 +48,13 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getReturn() { return _return; } @@ -141,7 +141,7 @@ public class ModelReturn { // add `return` to the URL query string if (getReturn() != null) { - joiner.add(String.format("%sreturn%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sreturn%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 8592a46a3aa..4ba848e11b9 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Model for testing model name same as property name */ @@ -69,14 +70,13 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getName() { return name; } @@ -89,14 +89,13 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSnakeCase() { return snakeCase; } @@ -109,14 +108,13 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProperty() { return property; } @@ -129,14 +127,13 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get123number() { return _123number; } @@ -224,22 +221,22 @@ public class Name { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `snake_case` to the URL query string if (getSnakeCase() != null) { - joiner.add(String.format("%ssnake_case%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%ssnake_case%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `property` to the URL query string if (getProperty() != null) { - joiner.add(String.format("%sproperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sproperty%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `123Number` to the URL query string if (get123number() != null) { - joiner.add(String.format("%s123Number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s123Number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 65715112047..ba7ed783441 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 @@ -43,6 +43,7 @@ import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * NullableClass */ @@ -106,13 +107,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Integer getIntegerProp() { return integerProp.orElse(null); } @@ -139,13 +139,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public BigDecimal getNumberProp() { return numberProp.orElse(null); } @@ -172,13 +171,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Boolean getBooleanProp() { return booleanProp.orElse(null); } @@ -205,13 +203,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public String getStringProp() { return stringProp.orElse(null); } @@ -238,13 +235,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public LocalDate getDateProp() { return dateProp.orElse(null); } @@ -271,13 +267,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public OffsetDateTime getDatetimeProp() { return datetimeProp.orElse(null); } @@ -316,13 +311,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayNullableProp() { return arrayNullableProp.orElse(null); } @@ -361,13 +355,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public List getArrayAndItemsNullableProp() { return arrayAndItemsNullableProp.orElse(null); } @@ -402,14 +395,13 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayItemsNullable() { return arrayItemsNullable; } @@ -439,13 +431,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Map getObjectNullableProp() { return objectNullableProp.orElse(null); } @@ -484,13 +475,12 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore - public Map getObjectAndItemsNullableProp() { return objectAndItemsNullableProp.orElse(null); } @@ -525,14 +515,13 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getObjectItemsNullable() { return objectItemsNullable; } @@ -699,32 +688,32 @@ public class NullableClass extends HashMap { // add `integer_prop` to the URL query string if (getIntegerProp() != null) { - joiner.add(String.format("%sinteger_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sinteger_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `number_prop` to the URL query string if (getNumberProp() != null) { - joiner.add(String.format("%snumber_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%snumber_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `boolean_prop` to the URL query string if (getBooleanProp() != null) { - joiner.add(String.format("%sboolean_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sboolean_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `string_prop` to the URL query string if (getStringProp() != null) { - joiner.add(String.format("%sstring_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstring_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `date_prop` to the URL query string if (getDateProp() != null) { - joiner.add(String.format("%sdate_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdate_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `datetime_prop` to the URL query string if (getDatetimeProp() != null) { - joiner.add(String.format("%sdatetime_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sdatetime_prop%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `array_nullable_prop` to the URL query string @@ -732,7 +721,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayNullableProp().size(); i++) { joiner.add(String.format("%sarray_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -741,7 +730,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) { joiner.add(String.format("%sarray_and_items_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -750,7 +739,7 @@ public class NullableClass extends HashMap { for (int i = 0; i < getArrayItemsNullable().size(); i++) { joiner.add(String.format("%sarray_items_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -759,7 +748,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectNullableProp().keySet()) { joiner.add(String.format("%sobject_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectNullableProp().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -768,7 +757,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectAndItemsNullableProp().keySet()) { joiner.add(String.format("%sobject_and_items_nullable_prop%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -777,7 +766,7 @@ public class NullableClass extends HashMap { for (String _key : getObjectItemsNullable().keySet()) { joiner.add(String.format("%sobject_items_nullable%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectItemsNullable().get(_key), URLEncoder.encode(String.valueOf(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + getObjectItemsNullable().get(_key), URLEncoder.encode(ApiClient.valueToString(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 425846c2814..9398954848b 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * NumberOnly */ @@ -48,14 +49,13 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getJustNumber() { return justNumber; } @@ -142,7 +142,7 @@ public class NumberOnly { // add `JustNumber` to the URL query string if (getJustNumber() != null) { - joiner.add(String.format("%sJustNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sJustNumber%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 dd138039de7..642dfe47435 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 @@ -32,6 +32,7 @@ import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ObjectWithDeprecatedFields */ @@ -63,14 +64,13 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUuid() { return uuid; } @@ -88,16 +88,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getId() { return id; } @@ -115,16 +114,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DeprecatedObject getDeprecatedRef() { return deprecatedRef; } @@ -150,16 +148,15 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBars() { return bars; } @@ -252,12 +249,12 @@ public class ObjectWithDeprecatedFields { // add `uuid` to the URL query string if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `deprecatedRef` to the URL query string @@ -270,7 +267,7 @@ public class ObjectWithDeprecatedFields { for (int i = 0; i < getBars().size(); i++) { joiner.add(String.format("%sbars%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } 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 f242366e513..97ecc876d8f 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Order */ @@ -105,14 +106,13 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -130,14 +130,13 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPetId() { return petId; } @@ -155,14 +154,13 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { return quantity; } @@ -180,14 +178,13 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getShipDate() { return shipDate; } @@ -205,14 +202,13 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -230,14 +226,13 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { return complete; } @@ -334,32 +329,32 @@ public class Order { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `petId` to the URL query string if (getPetId() != null) { - joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quantity` to the URL query string if (getQuantity() != null) { - joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `shipDate` to the URL query string if (getShipDate() != null) { - joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `complete` to the URL query string if (getComplete() != null) { - joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 e8b8df50c1e..acf39b63446 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * OuterComposite */ @@ -56,14 +57,13 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getMyNumber() { return myNumber; } @@ -81,14 +81,13 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMyString() { return myString; } @@ -106,14 +105,13 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMyBoolean() { return myBoolean; } @@ -204,17 +202,17 @@ public class OuterComposite { // add `my_number` to the URL query string if (getMyNumber() != null) { - joiner.add(String.format("%smy_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_number%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `my_string` to the URL query string if (getMyString() != null) { - joiner.add(String.format("%smy_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_string%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `my_boolean` to the URL query string if (getMyBoolean() != null) { - joiner.add(String.format("%smy_boolean%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%smy_boolean%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 a636c0d6a39..1b3a988eade 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 @@ -33,6 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; /** * ParentPet */ @@ -131,7 +132,7 @@ public class ParentPet extends GrandparentAnimal { // add `pet_type` to the URL query string if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 4eb7099d073..8b9226c0b03 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 @@ -32,6 +32,7 @@ import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Pet */ @@ -108,14 +109,13 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -133,14 +133,13 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { return category; } @@ -158,14 +157,13 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } @@ -191,14 +189,13 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { return photoUrls; } @@ -224,14 +221,13 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { return tags; } @@ -249,14 +245,13 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } @@ -353,7 +348,7 @@ public class Pet { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `category` to the URL query string @@ -363,7 +358,7 @@ public class Pet { // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `photoUrls` to the URL query string @@ -371,7 +366,7 @@ public class Pet { for (int i = 0; i < getPhotoUrls().size(); i++) { joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + URLEncoder.encode(ApiClient.valueToString(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } } @@ -387,7 +382,7 @@ public class Pet { // add `status` to the URL query string if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 82e05ef5fee..4927eb2841a 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * QuadrilateralInterface */ @@ -47,14 +48,13 @@ public class QuadrilateralInterface { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -141,7 +141,7 @@ public class QuadrilateralInterface { // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 6e30af28f51..965c187c10d 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ReadOnlyFirst */ @@ -54,14 +55,13 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } @@ -74,14 +74,13 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBaz() { return baz; } @@ -170,12 +169,12 @@ public class ReadOnlyFirst { // add `bar` to the URL query string if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `baz` to the URL query string if (getBaz() != null) { - joiner.add(String.format("%sbaz%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sbaz%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 1659c5b61b4..1a808afd035 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ScaleneTriangle */ @@ -51,14 +52,13 @@ public class ScaleneTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class ScaleneTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriangleType() { return triangleType; } @@ -172,12 +171,12 @@ public class ScaleneTriangle { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `triangleType` to the URL query string if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 2219837f61f..c779a173cf1 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * ShapeInterface */ @@ -47,14 +48,13 @@ public class ShapeInterface { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -141,7 +141,7 @@ public class ShapeInterface { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 09aa22a5470..59c85d87127 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * SimpleQuadrilateral */ @@ -51,14 +52,13 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getShapeType() { return shapeType; } @@ -76,14 +76,13 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getQuadrilateralType() { return quadrilateralType; } @@ -172,12 +171,12 @@ public class SimpleQuadrilateral { // add `shapeType` to the URL query string if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `quadrilateralType` to the URL query string if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 445f661d690..f1f0fe38cad 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * SpecialModelName */ @@ -51,14 +52,13 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -76,14 +76,13 @@ public class SpecialModelName { return this; } - /** + /** * Get specialModelName * @return specialModelName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSpecialModelName() { return specialModelName; } @@ -172,12 +171,12 @@ public class SpecialModelName { // add `$special[property.name]` to the URL query string if (get$SpecialPropertyName() != null) { - joiner.add(String.format("%s$special[property.name]%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s$special[property.name]%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `_special_model.name_` to the URL query string if (getSpecialModelName() != null) { - joiner.add(String.format("%s_special_model.name_%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpecialModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%s_special_model.name_%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSpecialModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 ca946bf4bae..5f7c51cc464 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 @@ -28,6 +28,7 @@ import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * Tag */ @@ -51,14 +52,13 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } @@ -76,14 +76,13 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } @@ -172,12 +171,12 @@ public class Tag { // add `id` to the URL query string if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `name` to the URL query string if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 f3a5cc7f97a..12f8ff910e1 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 @@ -34,6 +34,7 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.ApiClient; /** * TestInlineFreeformAdditionalPropertiesRequest */ @@ -53,14 +54,13 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TypeEnum getType() { return type; } @@ -119,14 +119,13 @@ public class Zebra extends HashMap { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } @@ -262,12 +261,12 @@ public class Zebra extends HashMap { // add `type` to the URL query string if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } // add `className` to the URL query string if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } return joiner.toString(); 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 2a378569612..aea2003a256 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/README.md +++ b/samples/client/petstore/java/okhttp-gson-3.1/README.md @@ -93,10 +93,10 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); try { - Object result = apiInstance.op1(); + Object result = apiInstance.fakeInlineSchemaAnyofPath1Get(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#op1"); + System.err.println("Exception when calling FakeApi#fakeInlineSchemaAnyofPath1Get"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -113,6 +113,9 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**fakeInlineSchemaAnyofPath1Get**](docs/FakeApi.md#fakeInlineSchemaAnyofPath1Get) | **GET** /fake/inline/schema/anyof/path1 | +*FakeApi* | [**fakeInlineSchemaAnyofPath2Get**](docs/FakeApi.md#fakeInlineSchemaAnyofPath2Get) | **GET** /fake/inline/schema/anyof/path2 | +*FakeApi* | [**fakeInlineSchemaAnyofPath3Get**](docs/FakeApi.md#fakeInlineSchemaAnyofPath3Get) | **GET** /fake/inline/schema/anyof/path3 | *FakeApi* | [**op1**](docs/FakeApi.md#op1) | **POST** /fake/api/changeowner | op1 *FakeApi* | [**op2**](docs/FakeApi.md#op2) | **POST** /fake/api/changename | op2 *FakeApi* | [**op3**](docs/FakeApi.md#op3) | **POST** /fake/api/query/enum | op3 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 4f61199e49a..262309383b0 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 @@ -751,6 +751,47 @@ paths: - fake x-accepts: - application/json + /fake/inline/schema/anyof/path1: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/myObject' + description: "" + tags: + - fake + x-accepts: + - application/json + /fake/inline/schema/anyof/path2: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/myObject' + description: "" + tags: + - fake + x-accepts: + - application/json + /fake/inline/schema/anyof/path3: + get: + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/myObject' + nullable: true + description: "" + tags: + - fake + x-accepts: + - application/json components: parameters: ref_to_uuid: @@ -1074,6 +1115,8 @@ components: AllOfSimpleModel: allOf: - $ref: '#/components/schemas/SimpleModelWithArrayProperty' + myObject: + type: object 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 9c49711c900..f2a6e8e06eb 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } 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 6d08084ea4a..fc99baef382 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/FakeApi.md b/samples/client/petstore/java/okhttp-gson-3.1/docs/FakeApi.md index 12709419253..19db959c0ed 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-3.1/docs/FakeApi.md @@ -4,6 +4,9 @@ All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**fakeInlineSchemaAnyofPath1Get**](FakeApi.md#fakeInlineSchemaAnyofPath1Get) | **GET** /fake/inline/schema/anyof/path1 | | +| [**fakeInlineSchemaAnyofPath2Get**](FakeApi.md#fakeInlineSchemaAnyofPath2Get) | **GET** /fake/inline/schema/anyof/path2 | | +| [**fakeInlineSchemaAnyofPath3Get**](FakeApi.md#fakeInlineSchemaAnyofPath3Get) | **GET** /fake/inline/schema/anyof/path3 | | | [**op1**](FakeApi.md#op1) | **POST** /fake/api/changeowner | op1 | | [**op2**](FakeApi.md#op2) | **POST** /fake/api/changename | op2 | | [**op3**](FakeApi.md#op3) | **POST** /fake/api/query/enum | op3 | @@ -13,6 +16,174 @@ All URIs are relative to *http://petstore.swagger.io/v2* | [**responseRefToRef**](FakeApi.md#responseRefToRef) | **GET** /ref/ref | | + +# **fakeInlineSchemaAnyofPath1Get** +> Object fakeInlineSchemaAnyofPath1Get() + + + +### 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/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + Object result = apiInstance.fakeInlineSchemaAnyofPath1Get(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeInlineSchemaAnyofPath1Get"); + 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 + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **fakeInlineSchemaAnyofPath2Get** +> Object fakeInlineSchemaAnyofPath2Get() + + + +### 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/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + Object result = apiInstance.fakeInlineSchemaAnyofPath2Get(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeInlineSchemaAnyofPath2Get"); + 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 + +**Object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **fakeInlineSchemaAnyofPath3Get** +> List<Object> fakeInlineSchemaAnyofPath3Get() + + + +### 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/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.fakeInlineSchemaAnyofPath3Get(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeInlineSchemaAnyofPath3Get"); + 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<Object>** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + # **op1** > Object op1() 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 0871be01351..cad8858e132 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml @@ -306,14 +306,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -334,14 +329,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 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 f5823fd7522..6fe26034d7e 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 @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -378,7 +371,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -388,7 +381,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -413,7 +406,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -432,7 +425,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/api/FakeApi.java index 198eb7a1ba6..67436864a00 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -73,6 +73,345 @@ public class FakeApi { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for fakeInlineSchemaAnyofPath1Get + * @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 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath1GetCall(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/inline/schema/anyof/path1"; + + 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 fakeInlineSchemaAnyofPath1GetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeInlineSchemaAnyofPath1GetCall(_callback); + + } + + /** + * + * + * @return Object + * @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 -
    + */ + public Object fakeInlineSchemaAnyofPath1Get() throws ApiException { + ApiResponse localVarResp = fakeInlineSchemaAnyofPath1GetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<Object> + * @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 -
    + */ + public ApiResponse fakeInlineSchemaAnyofPath1GetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath1GetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (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
    200 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath1GetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath1GetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeInlineSchemaAnyofPath2Get + * @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 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath2GetCall(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/inline/schema/anyof/path2"; + + 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 fakeInlineSchemaAnyofPath2GetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeInlineSchemaAnyofPath2GetCall(_callback); + + } + + /** + * + * + * @return Object + * @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 -
    + */ + public Object fakeInlineSchemaAnyofPath2Get() throws ApiException { + ApiResponse localVarResp = fakeInlineSchemaAnyofPath2GetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<Object> + * @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 -
    + */ + public ApiResponse fakeInlineSchemaAnyofPath2GetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath2GetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (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
    200 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath2GetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath2GetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeInlineSchemaAnyofPath3Get + * @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 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath3GetCall(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/inline/schema/anyof/path3"; + + 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 fakeInlineSchemaAnyofPath3GetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeInlineSchemaAnyofPath3GetCall(_callback); + + } + + /** + * + * + * @return List<Object> + * @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 -
    + */ + public List fakeInlineSchemaAnyofPath3Get() throws ApiException { + ApiResponse> localVarResp = fakeInlineSchemaAnyofPath3GetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<List<Object>> + * @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 -
    + */ + public ApiResponse> fakeInlineSchemaAnyofPath3GetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath3GetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (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
    200 -
    + */ + public okhttp3.Call fakeInlineSchemaAnyofPath3GetAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeInlineSchemaAnyofPath3GetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for op1 * @param _callback Callback for upload/download progress diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; 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 index 23fab4dc21c..46c512eaecd 100644 --- 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 @@ -73,10 +73,10 @@ public class AllOfSimpleModel { return this; } - /** + /** * Get arrayOfStrings * @return arrayOfStrings - **/ + */ @javax.annotation.Nonnull public List getArrayOfStrings() { return arrayOfStrings; @@ -185,12 +185,12 @@ public class AllOfSimpleModel { 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 - */ + /** + * 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 @@ -285,22 +285,22 @@ public class AllOfSimpleModel { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/Animal.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Animal.java index caf64e42518..e26fda7a415 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Animal.java @@ -68,10 +68,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -202,12 +202,12 @@ public class Animal { openapiRequiredFields.add("className"); } - /** - * 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 Animal - */ + /** + * 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 Animal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Animal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -229,22 +229,22 @@ public class Animal { } - /** - * Create an instance of Animal given an JSON string - * - * @param jsonString JSON string - * @return An instance of Animal - * @throws IOException if the JSON string is invalid with respect to Animal - */ + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ public static Animal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Animal.class); } - /** - * Convert an instance of Animal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Animal 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/AnyTypeTest.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java index d0e79f543ba..116ae2ea3ab 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java @@ -74,10 +74,10 @@ public class AnyTypeTest { return this; } - /** + /** * Get anyTypeProperty * @return anyTypeProperty - **/ + */ @javax.annotation.Nullable public Object getAnyTypeProperty() { return anyTypeProperty; @@ -101,10 +101,10 @@ public class AnyTypeTest { return this; } - /** + /** * test array in 3.1 spec * @return arrayProp - **/ + */ @javax.annotation.Nullable public List getArrayProp() { return arrayProp; @@ -128,10 +128,10 @@ public class AnyTypeTest { return this; } - /** + /** * An item that was added to the queue. * @return refArrayPrefixItems - **/ + */ @javax.annotation.Nullable public List getRefArrayPrefixItems() { return refArrayPrefixItems; @@ -256,12 +256,12 @@ public class AnyTypeTest { 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 AnyTypeTest - */ + /** + * 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 AnyTypeTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AnyTypeTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -351,22 +351,22 @@ public class AnyTypeTest { } } - /** - * Create an instance of AnyTypeTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of AnyTypeTest - * @throws IOException if the JSON string is invalid with respect to AnyTypeTest - */ + /** + * Create an instance of AnyTypeTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AnyTypeTest + * @throws IOException if the JSON string is invalid with respect to AnyTypeTest + */ public static AnyTypeTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AnyTypeTest.class); } - /** - * Convert an instance of AnyTypeTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AnyTypeTest 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/ArrayOfSameRef.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ArrayOfSameRef.java index 593f5e2e346..824fb84341f 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ArrayOfSameRef.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ArrayOfSameRef.java @@ -82,10 +82,10 @@ public class ArrayOfSameRef { return this; } - /** + /** * Get arrayFooOne * @return arrayFooOne - **/ + */ @javax.annotation.Nullable public List getArrayFooOne() { return arrayFooOne; @@ -109,10 +109,10 @@ public class ArrayOfSameRef { return this; } - /** + /** * Get arrayFooTwo * @return arrayFooTwo - **/ + */ @javax.annotation.Nullable public List getArrayFooTwo() { return arrayFooTwo; @@ -136,10 +136,10 @@ public class ArrayOfSameRef { return this; } - /** + /** * Get arrayFooThree * @return arrayFooThree - **/ + */ @javax.annotation.Nullable public List getArrayFooThree() { return arrayFooThree; @@ -253,12 +253,12 @@ public class ArrayOfSameRef { 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 ArrayOfSameRef - */ + /** + * 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 ArrayOfSameRef + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfSameRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -382,22 +382,22 @@ public class ArrayOfSameRef { } } - /** - * Create an instance of ArrayOfSameRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfSameRef - * @throws IOException if the JSON string is invalid with respect to ArrayOfSameRef - */ + /** + * Create an instance of ArrayOfSameRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfSameRef + * @throws IOException if the JSON string is invalid with respect to ArrayOfSameRef + */ public static ArrayOfSameRef fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfSameRef.class); } - /** - * Convert an instance of ArrayOfSameRef to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfSameRef 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/Cat.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Cat.java index d9a7105753b..a85afaf6410 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Cat.java @@ -65,10 +65,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { return declawed; @@ -181,12 +181,12 @@ public class Cat extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Cat - */ + /** + * 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 Cat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Cat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -274,22 +274,22 @@ public class Cat extends Animal { } } - /** - * Create an instance of Cat given an JSON string - * - * @param jsonString JSON string - * @return An instance of Cat - * @throws IOException if the JSON string is invalid with respect to Cat - */ + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ public static Cat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Cat.class); } - /** - * Convert an instance of Cat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Cat 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/Category.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Category.java index 4fee1f0e0d8..fd4f26d3a02 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Category { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference1.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference1.java index d40c00f8686..7d80e1dcd77 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference1.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference1.java @@ -64,10 +64,10 @@ public class CircularReference1 { return this; } - /** + /** * Get prop1 * @return prop1 - **/ + */ @javax.annotation.Nullable public CircularReference2 getProp1() { return prop1; @@ -175,12 +175,12 @@ public class CircularReference1 { 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 CircularReference1 - */ + /** + * 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 CircularReference1 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CircularReference1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class CircularReference1 { } } - /** - * Create an instance of CircularReference1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CircularReference1 - * @throws IOException if the JSON string is invalid with respect to CircularReference1 - */ + /** + * Create an instance of CircularReference1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CircularReference1 + * @throws IOException if the JSON string is invalid with respect to CircularReference1 + */ public static CircularReference1 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CircularReference1.class); } - /** - * Convert an instance of CircularReference1 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CircularReference1 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/CircularReference2.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference2.java index 09b052e1915..665378cc0bc 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference2.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference2.java @@ -64,10 +64,10 @@ public class CircularReference2 { return this; } - /** + /** * Get prop1 * @return prop1 - **/ + */ @javax.annotation.Nullable public CircularReference3 getProp1() { return prop1; @@ -175,12 +175,12 @@ public class CircularReference2 { 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 CircularReference2 - */ + /** + * 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 CircularReference2 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CircularReference2.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class CircularReference2 { } } - /** - * Create an instance of CircularReference2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CircularReference2 - * @throws IOException if the JSON string is invalid with respect to CircularReference2 - */ + /** + * Create an instance of CircularReference2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CircularReference2 + * @throws IOException if the JSON string is invalid with respect to CircularReference2 + */ public static CircularReference2 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CircularReference2.class); } - /** - * Convert an instance of CircularReference2 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CircularReference2 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/CircularReference3.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference3.java index b4b84955e40..fa77d693464 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference3.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/CircularReference3.java @@ -64,10 +64,10 @@ public class CircularReference3 { return this; } - /** + /** * Get prop1 * @return prop1 - **/ + */ @javax.annotation.Nullable public CircularReference1 getProp1() { return prop1; @@ -175,12 +175,12 @@ public class CircularReference3 { 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 CircularReference3 - */ + /** + * 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 CircularReference3 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CircularReference3.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class CircularReference3 { } } - /** - * Create an instance of CircularReference3 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CircularReference3 - * @throws IOException if the JSON string is invalid with respect to CircularReference3 - */ + /** + * Create an instance of CircularReference3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CircularReference3 + * @throws IOException if the JSON string is invalid with respect to CircularReference3 + */ public static CircularReference3 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CircularReference3.class); } - /** - * Convert an instance of CircularReference3 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CircularReference3 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/Dog.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Dog.java index 103b13613ea..29350743c2c 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Dog.java @@ -65,10 +65,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { return breed; @@ -181,12 +181,12 @@ public class Dog extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Dog - */ + /** + * 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 Dog + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Dog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -274,22 +274,22 @@ public class Dog extends Animal { } } - /** - * Create an instance of Dog given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dog - * @throws IOException if the JSON string is invalid with respect to Dog - */ + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ public static Dog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Dog.class); } - /** - * Convert an instance of Dog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Dog 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/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c2830b65d0c..4774fad6b92 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -226,12 +226,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -319,22 +319,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Order.java index 9a605940f5c..6062ff972bd 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -359,12 +359,12 @@ public class Order { 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 - */ + /** + * 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 @@ -453,22 +453,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Pet.java index 60f8c8515dd..e5b55d417eb 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Pet.java @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -385,12 +385,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -513,22 +513,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/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 index 4e999eacc45..dbb7cad1846 100644 --- 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 @@ -73,10 +73,10 @@ public class SimpleModelWithArrayProperty { return this; } - /** + /** * Get arrayOfStrings * @return arrayOfStrings - **/ + */ @javax.annotation.Nonnull public List getArrayOfStrings() { return arrayOfStrings; @@ -185,12 +185,12 @@ public class SimpleModelWithArrayProperty { 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 - */ + /** + * 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 @@ -285,22 +285,22 @@ public class SimpleModelWithArrayProperty { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/Tag.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Tag.java index 00ecdd0bbcb..b7a1a48eab7 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/User.java index d496ad8e28b..57afd72d3bd 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/User.java @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -356,12 +356,12 @@ public class User { 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 - */ + /** + * 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 @@ -461,22 +461,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/build.gradle b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle index bf28eaab47a..9efe9b9f0a0 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle @@ -112,16 +112,15 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation 'software.amazon.awssdk:auth:2.20.157' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt index 83d5a9f45c0..993651032ca 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt @@ -14,8 +14,7 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "software.amazon.awssdk" % "auth" % "2.20.157", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", @@ -23,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.10.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml index 8085232eb92..4432d2ac1c6 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml @@ -311,14 +311,9 @@ 2.20.157 - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -339,14 +334,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/JSON.java index ad2d26cbfbb..f993e935c7a 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -338,7 +331,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -348,7 +341,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -373,7 +366,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -392,7 +385,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Category.java index 4fee1f0e0d8..fd4f26d3a02 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Category { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c2830b65d0c..4774fad6b92 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -226,12 +226,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -319,22 +319,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Order.java index 9a605940f5c..6062ff972bd 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -359,12 +359,12 @@ public class Order { 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 - */ + /** + * 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 @@ -453,22 +453,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java index 60f8c8515dd..e5b55d417eb 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -385,12 +385,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -513,22 +513,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Tag.java index 00ecdd0bbcb..b7a1a48eab7 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/User.java index d496ad8e28b..57afd72d3bd 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/User.java @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -356,12 +356,12 @@ public class User { 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 - */ + /** + * 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 @@ -461,22 +461,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 53abcdebd4b..df040d5aac1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -112,16 +112,15 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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 '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.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 99d8419f18f..fe2edb8e3f1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -14,8 +14,7 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.30" % "compile" @@ -23,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.10.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 340c3277d16..c328e7c432d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -311,14 +311,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -339,14 +334,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java index 349f4ff8113..6d80edba2a7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -413,7 +406,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -423,7 +416,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -448,7 +441,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -467,7 +460,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index b4641c4217c..e801ee556a8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index abc3b6fd570..733ef9817ee 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -63,10 +63,10 @@ public class AdditionalPropertiesAnyType { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -174,12 +174,12 @@ public class AdditionalPropertiesAnyType { 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 AdditionalPropertiesAnyType - */ + /** + * 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 AdditionalPropertiesAnyType + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesAnyType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class AdditionalPropertiesAnyType { } } - /** - * Create an instance of AdditionalPropertiesAnyType given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesAnyType - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType - */ + /** + * Create an instance of AdditionalPropertiesAnyType given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesAnyType + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType + */ public static AdditionalPropertiesAnyType fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesAnyType.class); } - /** - * Convert an instance of AdditionalPropertiesAnyType to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesAnyType to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bbd16e67534..b012bd90a8f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -64,10 +64,10 @@ public class AdditionalPropertiesArray { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -175,12 +175,12 @@ public class AdditionalPropertiesArray { 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 AdditionalPropertiesArray - */ + /** + * 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 AdditionalPropertiesArray + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesArray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -265,22 +265,22 @@ public class AdditionalPropertiesArray { } } - /** - * Create an instance of AdditionalPropertiesArray given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesArray - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray - */ + /** + * Create an instance of AdditionalPropertiesArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesArray + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray + */ public static AdditionalPropertiesArray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesArray.class); } - /** - * Convert an instance of AdditionalPropertiesArray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesArray to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d79c74bfc32..9ad9cea4330 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -63,10 +63,10 @@ public class AdditionalPropertiesBoolean { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -174,12 +174,12 @@ public class AdditionalPropertiesBoolean { 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 AdditionalPropertiesBoolean - */ + /** + * 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 AdditionalPropertiesBoolean + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesBoolean.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class AdditionalPropertiesBoolean { } } - /** - * Create an instance of AdditionalPropertiesBoolean given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesBoolean - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean - */ + /** + * Create an instance of AdditionalPropertiesBoolean given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesBoolean + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean + */ public static AdditionalPropertiesBoolean fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesBoolean.class); } - /** - * Convert an instance of AdditionalPropertiesBoolean to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesBoolean to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index fe9e55c4b94..0888d534799 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -115,10 +115,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable public Map getMapString() { return mapString; @@ -142,10 +142,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable public Map getMapNumber() { return mapNumber; @@ -169,10 +169,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable public Map getMapInteger() { return mapInteger; @@ -196,10 +196,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable public Map getMapBoolean() { return mapBoolean; @@ -223,10 +223,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable public Map> getMapArrayInteger() { return mapArrayInteger; @@ -250,10 +250,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapArrayAnytype() { return mapArrayAnytype; @@ -277,10 +277,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable public Map> getMapMapString() { return mapMapString; @@ -304,10 +304,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapMapAnytype() { return mapMapAnytype; @@ -323,10 +323,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { return anytype1; @@ -342,10 +342,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable public Object getAnytype2() { return anytype2; @@ -361,10 +361,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable public Object getAnytype3() { return anytype3; @@ -456,12 +456,12 @@ public class AdditionalPropertiesClass { 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 AdditionalPropertiesClass - */ + /** + * 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 AdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -508,22 +508,22 @@ public class AdditionalPropertiesClass { } } - /** - * Create an instance of AdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass - */ + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); } - /** - * Convert an instance of AdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index cefcab2c492..23f0b14beee 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -63,10 +63,10 @@ public class AdditionalPropertiesInteger { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -174,12 +174,12 @@ public class AdditionalPropertiesInteger { 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 AdditionalPropertiesInteger - */ + /** + * 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 AdditionalPropertiesInteger + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesInteger.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class AdditionalPropertiesInteger { } } - /** - * Create an instance of AdditionalPropertiesInteger given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesInteger - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger - */ + /** + * Create an instance of AdditionalPropertiesInteger given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesInteger + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger + */ public static AdditionalPropertiesInteger fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesInteger.class); } - /** - * Convert an instance of AdditionalPropertiesInteger to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesInteger to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 895c78c11d8..1a3ec78f11d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -64,10 +64,10 @@ public class AdditionalPropertiesNumber { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -175,12 +175,12 @@ public class AdditionalPropertiesNumber { 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 AdditionalPropertiesNumber - */ + /** + * 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 AdditionalPropertiesNumber + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -265,22 +265,22 @@ public class AdditionalPropertiesNumber { } } - /** - * Create an instance of AdditionalPropertiesNumber given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesNumber - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber - */ + /** + * Create an instance of AdditionalPropertiesNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesNumber + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber + */ public static AdditionalPropertiesNumber fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesNumber.class); } - /** - * Convert an instance of AdditionalPropertiesNumber to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesNumber to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index f4f4ccf7f2c..a0d0eed58f7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -64,10 +64,10 @@ public class AdditionalPropertiesObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -175,12 +175,12 @@ public class AdditionalPropertiesObject { 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 AdditionalPropertiesObject - */ + /** + * 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 AdditionalPropertiesObject + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -265,22 +265,22 @@ public class AdditionalPropertiesObject { } } - /** - * Create an instance of AdditionalPropertiesObject given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesObject - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject - */ + /** + * Create an instance of AdditionalPropertiesObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesObject + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject + */ public static AdditionalPropertiesObject fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesObject.class); } - /** - * Convert an instance of AdditionalPropertiesObject to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesObject to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 1dcd504d27d..f3bab2d8ae3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -63,10 +63,10 @@ public class AdditionalPropertiesString { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -174,12 +174,12 @@ public class AdditionalPropertiesString { 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 AdditionalPropertiesString - */ + /** + * 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 AdditionalPropertiesString + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesString.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class AdditionalPropertiesString { } } - /** - * Create an instance of AdditionalPropertiesString given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesString - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString - */ + /** + * Create an instance of AdditionalPropertiesString given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesString + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString + */ public static AdditionalPropertiesString fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesString.class); } - /** - * Convert an instance of AdditionalPropertiesString to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesString to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java index 0aaeeb779b5..0bd679402e6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java @@ -68,10 +68,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -156,12 +156,12 @@ public class Animal { openapiRequiredFields.add("className"); } - /** - * 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 Animal - */ + /** + * 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 Animal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Animal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -186,22 +186,22 @@ public class Animal { } - /** - * Create an instance of Animal given an JSON string - * - * @param jsonString JSON string - * @return An instance of Animal - * @throws IOException if the JSON string is invalid with respect to Animal - */ + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ public static Animal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Animal.class); } - /** - * Convert an instance of Animal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 1dc91e5a61b..eaa35a6286d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -74,10 +74,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -139,12 +139,12 @@ public class ArrayOfArrayOfNumberOnly { 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 ArrayOfArrayOfNumberOnly - */ + /** + * 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 ArrayOfArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -195,22 +195,22 @@ public class ArrayOfArrayOfNumberOnly { } } - /** - * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index d53140021cf..34e103bbcf0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -74,10 +74,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { return arrayNumber; @@ -139,12 +139,12 @@ public class ArrayOfNumberOnly { 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 ArrayOfNumberOnly - */ + /** + * 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 ArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -195,22 +195,22 @@ public class ArrayOfNumberOnly { } } - /** - * Create an instance of ArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java index f0b65fd40cf..3b94400e607 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,10 +82,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { return arrayOfString; @@ -109,10 +109,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -136,10 +136,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -207,12 +207,12 @@ public class ArrayTest { 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 ArrayTest - */ + /** + * 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 ArrayTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -271,22 +271,22 @@ public class ArrayTest { } } - /** - * Create an instance of ArrayTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTest - * @throws IOException if the JSON string is invalid with respect to ArrayTest - */ + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ public static ArrayTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTest.class); } - /** - * Convert an instance of ArrayTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java index 186f11a0996..622f32c759b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java @@ -121,10 +121,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable public KindEnum getKind() { return kind; @@ -192,12 +192,12 @@ public class BigCat extends Cat { openapiRequiredFields.add("className"); } - /** - * 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 BigCat - */ + /** + * 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 BigCat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BigCat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -250,22 +250,22 @@ public class BigCat extends Cat { } } - /** - * Create an instance of BigCat given an JSON string - * - * @param jsonString JSON string - * @return An instance of BigCat - * @throws IOException if the JSON string is invalid with respect to BigCat - */ + /** + * Create an instance of BigCat given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCat + * @throws IOException if the JSON string is invalid with respect to BigCat + */ public static BigCat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BigCat.class); } - /** - * Convert an instance of BigCat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BigCat to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java index 481bbacd25c..efb3b2bf0e5 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java @@ -83,10 +83,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { return smallCamel; @@ -102,10 +102,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { return capitalCamel; @@ -121,10 +121,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { return smallSnake; @@ -140,10 +140,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { return capitalSnake; @@ -159,10 +159,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -178,10 +178,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { return ATT_NAME; @@ -258,12 +258,12 @@ public class Capitalization { 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 Capitalization - */ + /** + * 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 Capitalization + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Capitalization.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -328,22 +328,22 @@ public class Capitalization { } } - /** - * Create an instance of Capitalization given an JSON string - * - * @param jsonString JSON string - * @return An instance of Capitalization - * @throws IOException if the JSON string is invalid with respect to Capitalization - */ + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ public static Capitalization fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Capitalization.class); } - /** - * Convert an instance of Capitalization to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java index 63c73996bcb..7e8d6eb0f91 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java @@ -65,10 +65,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { return declawed; @@ -135,12 +135,12 @@ public class Cat extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Cat - */ + /** + * 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 Cat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Cat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -159,22 +159,22 @@ public class Cat extends Animal { } - /** - * Create an instance of Cat given an JSON string - * - * @param jsonString JSON string - * @return An instance of Cat - * @throws IOException if the JSON string is invalid with respect to Cat - */ + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ public static Cat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Cat.class); } - /** - * Convert an instance of Cat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java index a6f87260834..c704982f303 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -155,12 +155,12 @@ public class Category { openapiRequiredFields.add("name"); } - /** - * 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 - */ + /** + * 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 @@ -217,22 +217,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java index e61168f04f0..d02c1168826 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java @@ -63,10 +63,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -128,12 +128,12 @@ public class ClassModel { 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 ClassModel - */ + /** + * 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 ClassModel + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ClassModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -183,22 +183,22 @@ public class ClassModel { } } - /** - * Create an instance of ClassModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ClassModel - * @throws IOException if the JSON string is invalid with respect to ClassModel - */ + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ public static ClassModel fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ClassModel.class); } - /** - * Convert an instance of ClassModel to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java index c87cbdd3b38..6a874dccc31 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java @@ -63,10 +63,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { return client; @@ -128,12 +128,12 @@ public class Client { 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 Client - */ + /** + * 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 Client + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Client.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -183,22 +183,22 @@ public class Client { } } - /** - * Create an instance of Client given an JSON string - * - * @param jsonString JSON string - * @return An instance of Client - * @throws IOException if the JSON string is invalid with respect to Client - */ + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ public static Client fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Client.class); } - /** - * Convert an instance of Client to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java index c4a0f2caa3f..03c07d487a9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java @@ -65,10 +65,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { return breed; @@ -135,12 +135,12 @@ public class Dog extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Dog - */ + /** + * 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 Dog + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Dog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -193,22 +193,22 @@ public class Dog extends Animal { } } - /** - * Create an instance of Dog given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dog - * @throws IOException if the JSON string is invalid with respect to Dog - */ + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ public static Dog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Dog.class); } - /** - * Convert an instance of Dog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java index d558caf2fc3..02ff536ac15 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -173,10 +173,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -200,10 +200,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { return arrayEnum; @@ -268,12 +268,12 @@ public class EnumArrays { 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 EnumArrays - */ + /** + * 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 EnumArrays + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumArrays.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -331,22 +331,22 @@ public class EnumArrays { } } - /** - * Create an instance of EnumArrays given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumArrays - * @throws IOException if the JSON string is invalid with respect to EnumArrays - */ + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ public static EnumArrays fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumArrays.class); } - /** - * Convert an instance of EnumArrays to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java index bceadd45e52..94394296172 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java @@ -292,10 +292,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { return enumString; @@ -311,10 +311,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -330,10 +330,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -349,10 +349,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -368,10 +368,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { return outerEnum; @@ -446,12 +446,12 @@ public class EnumTest { openapiRequiredFields.add("enum_string_required"); } - /** - * 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 EnumTest - */ + /** + * 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 EnumTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -529,22 +529,22 @@ public class EnumTest { } } - /** - * Create an instance of EnumTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumTest - * @throws IOException if the JSON string is invalid with respect to EnumTest - */ + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ public static EnumTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumTest.class); } - /** - * Convert an instance of EnumTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index c0624f8bf4b..19e2ac58d5e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,10 +70,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { return _file; @@ -97,10 +97,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { return files; @@ -165,12 +165,12 @@ public class FileSchemaTestClass { 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 FileSchemaTestClass - */ + /** + * 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 FileSchemaTestClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FileSchemaTestClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,22 +235,22 @@ public class FileSchemaTestClass { } } - /** - * Create an instance of FileSchemaTestClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileSchemaTestClass - * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass - */ + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ public static FileSchemaTestClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); } - /** - * Convert an instance of FileSchemaTestClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileSchemaTestClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java index acff177e49d..42d969f38a2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java @@ -120,12 +120,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { return integer; @@ -141,12 +141,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { return int32; @@ -162,10 +162,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { return int64; @@ -181,12 +181,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { return number; @@ -202,12 +202,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { return _float; @@ -223,12 +223,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { return _double; @@ -244,10 +244,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { return string; @@ -263,10 +263,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { return _byte; @@ -282,10 +282,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { return binary; @@ -301,10 +301,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { return date; @@ -320,10 +320,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -339,10 +339,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -358,10 +358,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { return password; @@ -377,10 +377,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable public BigDecimal getBigDecimal() { return bigDecimal; @@ -485,12 +485,12 @@ public class FormatTest { openapiRequiredFields.add("password"); } - /** - * 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 FormatTest - */ + /** + * 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 FormatTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FormatTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -553,22 +553,22 @@ public class FormatTest { } } - /** - * Create an instance of FormatTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormatTest - * @throws IOException if the JSON string is invalid with respect to FormatTest - */ + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ public static FormatTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FormatTest.class); } - /** - * Convert an instance of FormatTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2796e7cc667..5505e3a1640 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -71,10 +71,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -82,10 +82,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { return foo; @@ -147,12 +147,12 @@ public class HasOnlyReadOnly { 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 HasOnlyReadOnly - */ + /** + * 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 HasOnlyReadOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -205,22 +205,22 @@ public class HasOnlyReadOnly { } } - /** - * Create an instance of HasOnlyReadOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of HasOnlyReadOnly - * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly - */ + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); } - /** - * Convert an instance of HasOnlyReadOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java index 80f4e6330ce..56eba7130bd 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java @@ -137,10 +137,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { return mapMapOfString; @@ -164,10 +164,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { return mapOfEnumString; @@ -191,10 +191,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { return directMap; @@ -218,10 +218,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { return indirectMap; @@ -292,12 +292,12 @@ public class MapTest { 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 MapTest - */ + /** + * 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 MapTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MapTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -344,22 +344,22 @@ public class MapTest { } } - /** - * Create an instance of MapTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of MapTest - * @throws IOException if the JSON string is invalid with respect to MapTest - */ + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ public static MapTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MapTest.class); } - /** - * Convert an instance of MapTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c3ecc6ac4b4..66ad2c3e2b8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -76,10 +76,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -95,10 +95,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -122,10 +122,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { return map; @@ -193,12 +193,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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 MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * 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 MixedPropertiesAndAdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -248,22 +248,22 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } } - /** - * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of MixedPropertiesAndAdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); } - /** - * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java index 2e33330c473..4ce0fe94e37 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,10 +67,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { return name; @@ -86,10 +86,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -154,12 +154,12 @@ public class Model200Response { 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 Model200Response - */ + /** + * 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 Model200Response + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Model200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -209,22 +209,22 @@ public class Model200Response { } } - /** - * Create an instance of Model200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of Model200Response - * @throws IOException if the JSON string is invalid with respect to Model200Response - */ + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ public static Model200Response fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Model200Response.class); } - /** - * Convert an instance of Model200Response to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c69d80602cb..aafc8d1e017 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -180,12 +180,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -238,22 +238,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java index f634961d61d..e65c7f73a5e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,10 +63,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { return sourceURI; @@ -128,12 +128,12 @@ public class ModelFile { 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 ModelFile - */ + /** + * 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 ModelFile + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -183,22 +183,22 @@ public class ModelFile { } } - /** - * Create an instance of ModelFile given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelFile - * @throws IOException if the JSON string is invalid with respect to ModelFile - */ + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ public static ModelFile fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelFile.class); } - /** - * Convert an instance of ModelFile to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java index 6f56998e581..83812e8756b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,10 +63,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { return _123list; @@ -128,12 +128,12 @@ public class ModelList { 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 ModelList - */ + /** + * 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 ModelList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -183,22 +183,22 @@ public class ModelList { } } - /** - * Create an instance of ModelList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelList - * @throws IOException if the JSON string is invalid with respect to ModelList - */ + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ public static ModelList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelList.class); } - /** - * Convert an instance of ModelList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java index 915094868b3..f3b9cddd4f4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -63,10 +63,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { return _return; @@ -128,12 +128,12 @@ public class ModelReturn { 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 ModelReturn - */ + /** + * 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 ModelReturn + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelReturn.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -180,22 +180,22 @@ public class ModelReturn { } } - /** - * Create an instance of ModelReturn given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelReturn - * @throws IOException if the JSON string is invalid with respect to ModelReturn - */ + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ public static ModelReturn fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelReturn.class); } - /** - * Convert an instance of ModelReturn to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java index 849cecd477a..c7ca1143118 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java @@ -84,10 +84,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { return name; @@ -98,10 +98,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { return snakeCase; @@ -114,10 +114,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { return property; @@ -128,10 +128,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { return _123number; @@ -200,12 +200,12 @@ public class Name { openapiRequiredFields.add("name"); } - /** - * 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 Name - */ + /** + * 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 Name + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Name.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -262,22 +262,22 @@ public class Name { } } - /** - * Create an instance of Name given an JSON string - * - * @param jsonString JSON string - * @return An instance of Name - * @throws IOException if the JSON string is invalid with respect to Name - */ + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ public static Name fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Name.class); } - /** - * Convert an instance of Name to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java index 81f543bf3ac..99a4defc2ae 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,10 +64,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { return justNumber; @@ -129,12 +129,12 @@ public class NumberOnly { 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 NumberOnly - */ + /** + * 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 NumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -181,22 +181,22 @@ public class NumberOnly { } } - /** - * Create an instance of NumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumberOnly - * @throws IOException if the JSON string is invalid with respect to NumberOnly - */ + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ public static NumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NumberOnly.class); } - /** - * Convert an instance of NumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java index 84ed85299ce..d82b996fda9 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -313,12 +313,12 @@ public class Order { 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 - */ + /** + * 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 @@ -372,22 +372,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java index 8ddf3a9d09e..d8c54d3f7ca 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -72,10 +72,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { return myNumber; @@ -91,10 +91,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { return myString; @@ -110,10 +110,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { return myBoolean; @@ -181,12 +181,12 @@ public class OuterComposite { 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 OuterComposite - */ + /** + * 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 OuterComposite + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!OuterComposite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -236,22 +236,22 @@ public class OuterComposite { } } - /** - * Create an instance of OuterComposite given an JSON string - * - * @param jsonString JSON string - * @return An instance of OuterComposite - * @throws IOException if the JSON string is invalid with respect to OuterComposite - */ + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ public static OuterComposite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, OuterComposite.class); } - /** - * Convert an instance of OuterComposite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java index cd64599b64a..edb9a33614f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java @@ -143,10 +143,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -162,10 +162,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -181,10 +181,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -208,10 +208,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public Set getPhotoUrls() { return photoUrls; @@ -235,10 +235,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,10 +254,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -336,12 +336,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -429,22 +429,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 13e2e0f47b9..c712a91f853 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -69,10 +69,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -85,10 +85,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { return baz; @@ -153,12 +153,12 @@ public class ReadOnlyFirst { 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 ReadOnlyFirst - */ + /** + * 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 ReadOnlyFirst + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ReadOnlyFirst.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -211,22 +211,22 @@ public class ReadOnlyFirst { } } - /** - * Create an instance of ReadOnlyFirst given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadOnlyFirst - * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst - */ + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ public static ReadOnlyFirst fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); } - /** - * Convert an instance of ReadOnlyFirst to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java index 713a65d8082..8cf3f338427 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -63,10 +63,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -128,12 +128,12 @@ public class SpecialModelName { 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 SpecialModelName - */ + /** + * 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 SpecialModelName + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SpecialModelName.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -180,22 +180,22 @@ public class SpecialModelName { } } - /** - * Create an instance of SpecialModelName given an JSON string - * - * @param jsonString JSON string - * @return An instance of SpecialModelName - * @throws IOException if the JSON string is invalid with respect to SpecialModelName - */ + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ public static SpecialModelName fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SpecialModelName.class); } - /** - * Convert an instance of SpecialModelName to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java index cebba48a5cb..7d99769d71d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -154,12 +154,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -209,22 +209,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index d880dbceaf6..36bbce781cc 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -82,10 +82,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { return stringItem; @@ -101,10 +101,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { return numberItem; @@ -120,10 +120,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { return integerItem; @@ -139,10 +139,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { return boolItem; @@ -166,10 +166,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { return arrayItem; @@ -248,12 +248,12 @@ public class TypeHolderDefault { openapiRequiredFields.add("array_item"); } - /** - * 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 TypeHolderDefault - */ + /** + * 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 TypeHolderDefault + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TypeHolderDefault.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -316,22 +316,22 @@ public class TypeHolderDefault { } } - /** - * Create an instance of TypeHolderDefault given an JSON string - * - * @param jsonString JSON string - * @return An instance of TypeHolderDefault - * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault - */ + /** + * Create an instance of TypeHolderDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderDefault + * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault + */ public static TypeHolderDefault fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TypeHolderDefault.class); } - /** - * Convert an instance of TypeHolderDefault to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TypeHolderDefault to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java index b60437909df..00517c37993 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -86,10 +86,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { return stringItem; @@ -105,10 +105,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { return numberItem; @@ -124,10 +124,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull public Float getFloatItem() { return floatItem; @@ -143,10 +143,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { return integerItem; @@ -162,10 +162,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { return boolItem; @@ -189,10 +189,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { return arrayItem; @@ -275,12 +275,12 @@ public class TypeHolderExample { openapiRequiredFields.add("array_item"); } - /** - * 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 TypeHolderExample - */ + /** + * 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 TypeHolderExample + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TypeHolderExample.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -343,22 +343,22 @@ public class TypeHolderExample { } } - /** - * Create an instance of TypeHolderExample given an JSON string - * - * @param jsonString JSON string - * @return An instance of TypeHolderExample - * @throws IOException if the JSON string is invalid with respect to TypeHolderExample - */ + /** + * Create an instance of TypeHolderExample given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderExample + * @throws IOException if the JSON string is invalid with respect to TypeHolderExample + */ public static TypeHolderExample fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TypeHolderExample.class); } - /** - * Convert an instance of TypeHolderExample to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TypeHolderExample to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java index 6d7c76fa2d9..42ee089cf4e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -310,12 +310,12 @@ public class User { 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 - */ + /** + * 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 @@ -380,22 +380,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java index ea155b76e4a..77fac7e12d3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java @@ -178,10 +178,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable public String getAttributeString() { return attributeString; @@ -197,10 +197,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getAttributeNumber() { return attributeNumber; @@ -216,10 +216,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable public Integer getAttributeInteger() { return attributeInteger; @@ -235,10 +235,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable public Boolean getAttributeBoolean() { return attributeBoolean; @@ -262,10 +262,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable public List getWrappedArray() { return wrappedArray; @@ -281,10 +281,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable public String getNameString() { return nameString; @@ -300,10 +300,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNameNumber() { return nameNumber; @@ -319,10 +319,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable public Integer getNameInteger() { return nameInteger; @@ -338,10 +338,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNameBoolean() { return nameBoolean; @@ -365,10 +365,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable public List getNameArray() { return nameArray; @@ -392,10 +392,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable public List getNameWrappedArray() { return nameWrappedArray; @@ -411,10 +411,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable public String getPrefixString() { return prefixString; @@ -430,10 +430,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNumber() { return prefixNumber; @@ -449,10 +449,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixInteger() { return prefixInteger; @@ -468,10 +468,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixBoolean() { return prefixBoolean; @@ -495,10 +495,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable public List getPrefixArray() { return prefixArray; @@ -522,10 +522,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -541,10 +541,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable public String getNamespaceString() { return namespaceString; @@ -560,10 +560,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -579,10 +579,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable public Integer getNamespaceInteger() { return namespaceInteger; @@ -598,10 +598,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -625,10 +625,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable public List getNamespaceArray() { return namespaceArray; @@ -652,10 +652,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -671,10 +671,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable public String getPrefixNsString() { return prefixNsString; @@ -690,10 +690,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -709,10 +709,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixNsInteger() { return prefixNsInteger; @@ -728,10 +728,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -755,10 +755,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsArray() { return prefixNsArray; @@ -782,10 +782,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; @@ -931,12 +931,12 @@ public class XmlItem { 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 XmlItem - */ + /** + * 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 XmlItem + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!XmlItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -1034,22 +1034,22 @@ public class XmlItem { } } - /** - * Create an instance of XmlItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of XmlItem - * @throws IOException if the JSON string is invalid with respect to XmlItem - */ + /** + * Create an instance of XmlItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of XmlItem + * @throws IOException if the JSON string is invalid with respect to XmlItem + */ public static XmlItem fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, XmlItem.class); } - /** - * Convert an instance of XmlItem to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of XmlItem to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } 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 0b538e51b8c..23a62038557 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } 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 986fec5f579..824632fc662 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml index ed94eca8ad8..aefb903304f 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml @@ -306,14 +306,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -334,14 +329,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/JSON.java index ad2d26cbfbb..f993e935c7a 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -338,7 +331,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -348,7 +341,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -373,7 +366,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -392,7 +385,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java index 4fee1f0e0d8..fd4f26d3a02 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Category { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c2830b65d0c..4774fad6b92 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -226,12 +226,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -319,22 +319,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java index 9a605940f5c..6062ff972bd 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -359,12 +359,12 @@ public class Order { 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 - */ + /** + * 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 @@ -453,22 +453,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java index 60f8c8515dd..e5b55d417eb 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -385,12 +385,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -513,22 +513,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java index 00ecdd0bbcb..b7a1a48eab7 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java index d496ad8e28b..57afd72d3bd 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -356,12 +356,12 @@ public class User { 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 - */ + /** + * 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 @@ -461,22 +461,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/build.gradle b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle index c9e122aff31..d52a031af35 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } 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 342822d7ac9..f0b139580df 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml index eeb259d1343..c9f7368ef83 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml @@ -306,14 +306,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -334,14 +329,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/JSON.java index 75faa7a82b3..cc08e8c32f4 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -340,7 +333,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -350,7 +343,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -375,7 +368,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -394,7 +387,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Category.java index 4fee1f0e0d8..fd4f26d3a02 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Category { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c2830b65d0c..4774fad6b92 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -226,12 +226,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -319,22 +319,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Order.java index 9a605940f5c..6062ff972bd 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -359,12 +359,12 @@ public class Order { 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 - */ + /** + * 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 @@ -453,22 +453,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Pet.java index 60f8c8515dd..e5b55d417eb 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Pet.java @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -385,12 +385,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -513,22 +513,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases1.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases1.java index 96d4c90b24c..72808f3676f 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases1.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases1.java @@ -143,10 +143,10 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -162,10 +162,10 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -181,10 +181,10 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -208,10 +208,10 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nullable public List getPhotoUrls() { return photoUrls; @@ -235,10 +235,10 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -255,11 +255,11 @@ public class PetWithRequiredNullableCases1 { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -397,12 +397,12 @@ public class PetWithRequiredNullableCases1 { 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 PetWithRequiredNullableCases1 - */ + /** + * 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 PetWithRequiredNullableCases1 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetWithRequiredNullableCases1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -525,22 +525,22 @@ public class PetWithRequiredNullableCases1 { } } - /** - * Create an instance of PetWithRequiredNullableCases1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetWithRequiredNullableCases1 - * @throws IOException if the JSON string is invalid with respect to PetWithRequiredNullableCases1 - */ + /** + * Create an instance of PetWithRequiredNullableCases1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetWithRequiredNullableCases1 + * @throws IOException if the JSON string is invalid with respect to PetWithRequiredNullableCases1 + */ public static PetWithRequiredNullableCases1 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetWithRequiredNullableCases1.class); } - /** - * Convert an instance of PetWithRequiredNullableCases1 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetWithRequiredNullableCases1 to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases2.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases2.java index ec4577e146b..05c4f6f7789 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases2.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/PetWithRequiredNullableCases2.java @@ -142,10 +142,10 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -161,10 +161,10 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -180,10 +180,10 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -207,10 +207,10 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -234,10 +234,10 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -254,11 +254,11 @@ public class PetWithRequiredNullableCases2 { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public StatusEnum getStatus() { @@ -385,12 +385,12 @@ public class PetWithRequiredNullableCases2 { 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 PetWithRequiredNullableCases2 - */ + /** + * 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 PetWithRequiredNullableCases2 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetWithRequiredNullableCases2.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -513,22 +513,22 @@ public class PetWithRequiredNullableCases2 { } } - /** - * Create an instance of PetWithRequiredNullableCases2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetWithRequiredNullableCases2 - * @throws IOException if the JSON string is invalid with respect to PetWithRequiredNullableCases2 - */ + /** + * Create an instance of PetWithRequiredNullableCases2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetWithRequiredNullableCases2 + * @throws IOException if the JSON string is invalid with respect to PetWithRequiredNullableCases2 + */ public static PetWithRequiredNullableCases2 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetWithRequiredNullableCases2.class); } - /** - * Convert an instance of PetWithRequiredNullableCases2 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetWithRequiredNullableCases2 to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Tag.java index 00ecdd0bbcb..b7a1a48eab7 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/User.java index d496ad8e28b..57afd72d3bd 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/src/main/java/org/openapitools/client/model/User.java @@ -91,10 +91,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -129,10 +129,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -148,10 +148,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -186,10 +186,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -224,10 +224,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -356,12 +356,12 @@ public class User { 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 - */ + /** + * 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 @@ -461,22 +461,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index ea4e98857ea..51ba39863b4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 6d8a20396b6..f93a3516af9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index ea1f1fdf159..969ae65f70e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -313,14 +313,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -341,14 +336,14 @@ ${java.version} ${java.version} 1.9.0 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index 349f4ff8113..6d80edba2a7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -413,7 +406,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -423,7 +416,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -448,7 +441,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -467,7 +460,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index b4641c4217c..e801ee556a8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 80ff0b9b494..ff19b2f0870 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -65,10 +65,10 @@ public class AdditionalPropertiesAnyType implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -197,12 +197,12 @@ public class AdditionalPropertiesAnyType implements Parcelable { 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 AdditionalPropertiesAnyType - */ + /** + * 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 AdditionalPropertiesAnyType + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesAnyType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -287,22 +287,22 @@ public class AdditionalPropertiesAnyType implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesAnyType given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesAnyType - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType - */ + /** + * Create an instance of AdditionalPropertiesAnyType given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesAnyType + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesAnyType + */ public static AdditionalPropertiesAnyType fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesAnyType.class); } - /** - * Convert an instance of AdditionalPropertiesAnyType to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesAnyType to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 287a7f47ae3..bb29da07e62 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -66,10 +66,10 @@ public class AdditionalPropertiesArray implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -198,12 +198,12 @@ public class AdditionalPropertiesArray implements Parcelable { 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 AdditionalPropertiesArray - */ + /** + * 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 AdditionalPropertiesArray + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesArray.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -288,22 +288,22 @@ public class AdditionalPropertiesArray implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesArray given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesArray - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray - */ + /** + * Create an instance of AdditionalPropertiesArray given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesArray + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesArray + */ public static AdditionalPropertiesArray fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesArray.class); } - /** - * Convert an instance of AdditionalPropertiesArray to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesArray to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7e63da95c88..94919e11f12 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -65,10 +65,10 @@ public class AdditionalPropertiesBoolean implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -197,12 +197,12 @@ public class AdditionalPropertiesBoolean implements Parcelable { 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 AdditionalPropertiesBoolean - */ + /** + * 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 AdditionalPropertiesBoolean + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesBoolean.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -287,22 +287,22 @@ public class AdditionalPropertiesBoolean implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesBoolean given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesBoolean - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean - */ + /** + * Create an instance of AdditionalPropertiesBoolean given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesBoolean + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesBoolean + */ public static AdditionalPropertiesBoolean fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesBoolean.class); } - /** - * Convert an instance of AdditionalPropertiesBoolean to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesBoolean to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 269cbcfaeba..00e98bdcfa1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -117,10 +117,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable public Map getMapString() { return mapString; @@ -144,10 +144,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable public Map getMapNumber() { return mapNumber; @@ -171,10 +171,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable public Map getMapInteger() { return mapInteger; @@ -198,10 +198,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable public Map getMapBoolean() { return mapBoolean; @@ -225,10 +225,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable public Map> getMapArrayInteger() { return mapArrayInteger; @@ -252,10 +252,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapArrayAnytype() { return mapArrayAnytype; @@ -279,10 +279,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable public Map> getMapMapString() { return mapMapString; @@ -306,10 +306,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapMapAnytype() { return mapMapAnytype; @@ -325,10 +325,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { return anytype1; @@ -344,10 +344,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable public Object getAnytype2() { return anytype2; @@ -363,10 +363,10 @@ public class AdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable public Object getAnytype3() { return anytype3; @@ -499,12 +499,12 @@ public class AdditionalPropertiesClass implements Parcelable { 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 AdditionalPropertiesClass - */ + /** + * 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 AdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -551,22 +551,22 @@ public class AdditionalPropertiesClass implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass - */ + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); } - /** - * Convert an instance of AdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 96ef4450bd5..e3f077d783d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -65,10 +65,10 @@ public class AdditionalPropertiesInteger implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -197,12 +197,12 @@ public class AdditionalPropertiesInteger implements Parcelable { 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 AdditionalPropertiesInteger - */ + /** + * 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 AdditionalPropertiesInteger + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesInteger.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -287,22 +287,22 @@ public class AdditionalPropertiesInteger implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesInteger given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesInteger - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger - */ + /** + * Create an instance of AdditionalPropertiesInteger given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesInteger + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesInteger + */ public static AdditionalPropertiesInteger fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesInteger.class); } - /** - * Convert an instance of AdditionalPropertiesInteger to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesInteger to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e56e31a0c2d..0796693b563 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -66,10 +66,10 @@ public class AdditionalPropertiesNumber implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -198,12 +198,12 @@ public class AdditionalPropertiesNumber implements Parcelable { 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 AdditionalPropertiesNumber - */ + /** + * 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 AdditionalPropertiesNumber + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -288,22 +288,22 @@ public class AdditionalPropertiesNumber implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesNumber given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesNumber - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber - */ + /** + * Create an instance of AdditionalPropertiesNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesNumber + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesNumber + */ public static AdditionalPropertiesNumber fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesNumber.class); } - /** - * Convert an instance of AdditionalPropertiesNumber to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesNumber to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 106be49d2a1..ca43c9e9f5a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -66,10 +66,10 @@ public class AdditionalPropertiesObject implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -198,12 +198,12 @@ public class AdditionalPropertiesObject implements Parcelable { 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 AdditionalPropertiesObject - */ + /** + * 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 AdditionalPropertiesObject + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -288,22 +288,22 @@ public class AdditionalPropertiesObject implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesObject given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesObject - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject - */ + /** + * Create an instance of AdditionalPropertiesObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesObject + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesObject + */ public static AdditionalPropertiesObject fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesObject.class); } - /** - * Convert an instance of AdditionalPropertiesObject to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesObject to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index e4050e130c5..a47061d08ab 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -65,10 +65,10 @@ public class AdditionalPropertiesString implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -197,12 +197,12 @@ public class AdditionalPropertiesString implements Parcelable { 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 AdditionalPropertiesString - */ + /** + * 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 AdditionalPropertiesString + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesString.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -287,22 +287,22 @@ public class AdditionalPropertiesString implements Parcelable { } } - /** - * Create an instance of AdditionalPropertiesString given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesString - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString - */ + /** + * Create an instance of AdditionalPropertiesString given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesString + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesString + */ public static AdditionalPropertiesString fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesString.class); } - /** - * Convert an instance of AdditionalPropertiesString to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesString to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java index 45599e5b0d4..c67357087e6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -70,10 +70,10 @@ public class Animal implements Parcelable { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -89,10 +89,10 @@ public class Animal implements Parcelable { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -181,12 +181,12 @@ public class Animal implements Parcelable { openapiRequiredFields.add("className"); } - /** - * 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 Animal - */ + /** + * 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 Animal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Animal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -211,22 +211,22 @@ public class Animal implements Parcelable { } - /** - * Create an instance of Animal given an JSON string - * - * @param jsonString JSON string - * @return An instance of Animal - * @throws IOException if the JSON string is invalid with respect to Animal - */ + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ public static Animal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Animal.class); } - /** - * Convert an instance of Animal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index da9ae96cd31..005d40e5db9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -76,10 +76,10 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -162,12 +162,12 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { 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 ArrayOfArrayOfNumberOnly - */ + /** + * 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 ArrayOfArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -218,22 +218,22 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { } } - /** - * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2dc3ade55e4..a747a2555bb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -76,10 +76,10 @@ public class ArrayOfNumberOnly implements Parcelable { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { return arrayNumber; @@ -162,12 +162,12 @@ public class ArrayOfNumberOnly implements Parcelable { 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 ArrayOfNumberOnly - */ + /** + * 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 ArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -218,22 +218,22 @@ public class ArrayOfNumberOnly implements Parcelable { } } - /** - * Create an instance of ArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java index 4485a5d2361..68eebaa20e1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -84,10 +84,10 @@ public class ArrayTest implements Parcelable { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { return arrayOfString; @@ -111,10 +111,10 @@ public class ArrayTest implements Parcelable { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -138,10 +138,10 @@ public class ArrayTest implements Parcelable { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -234,12 +234,12 @@ public class ArrayTest implements Parcelable { 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 ArrayTest - */ + /** + * 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 ArrayTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -298,22 +298,22 @@ public class ArrayTest implements Parcelable { } } - /** - * Create an instance of ArrayTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTest - * @throws IOException if the JSON string is invalid with respect to ArrayTest - */ + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ public static ArrayTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTest.class); } - /** - * Convert an instance of ArrayTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java index 3e4a9689248..856a4700dbc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -124,10 +124,10 @@ public class BigCat extends Cat implements Parcelable { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable public KindEnum getKind() { return kind; @@ -218,12 +218,12 @@ public class BigCat extends Cat implements Parcelable { openapiRequiredFields.add("className"); } - /** - * 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 BigCat - */ + /** + * 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 BigCat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BigCat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -276,22 +276,22 @@ public class BigCat extends Cat implements Parcelable { } } - /** - * Create an instance of BigCat given an JSON string - * - * @param jsonString JSON string - * @return An instance of BigCat - * @throws IOException if the JSON string is invalid with respect to BigCat - */ + /** + * Create an instance of BigCat given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCat + * @throws IOException if the JSON string is invalid with respect to BigCat + */ public static BigCat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BigCat.class); } - /** - * Convert an instance of BigCat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BigCat to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java index a3ef6c369e5..0a09af6ceac 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java @@ -85,10 +85,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { return smallCamel; @@ -104,10 +104,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { return capitalCamel; @@ -123,10 +123,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { return smallSnake; @@ -142,10 +142,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { return capitalSnake; @@ -161,10 +161,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -180,10 +180,10 @@ public class Capitalization implements Parcelable { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { return ATT_NAME; @@ -291,12 +291,12 @@ public class Capitalization implements Parcelable { 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 Capitalization - */ + /** + * 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 Capitalization + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Capitalization.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -361,22 +361,22 @@ public class Capitalization implements Parcelable { } } - /** - * Create an instance of Capitalization given an JSON string - * - * @param jsonString JSON string - * @return An instance of Capitalization - * @throws IOException if the JSON string is invalid with respect to Capitalization - */ + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ public static Capitalization fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Capitalization.class); } - /** - * Convert an instance of Capitalization to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java index 55d85f4899f..a72ab1c59a5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java @@ -68,10 +68,10 @@ public class Cat extends Animal implements Parcelable { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { return declawed; @@ -161,12 +161,12 @@ public class Cat extends Animal implements Parcelable { openapiRequiredFields.add("className"); } - /** - * 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 Cat - */ + /** + * 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 Cat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Cat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -185,22 +185,22 @@ public class Cat extends Animal implements Parcelable { } - /** - * Create an instance of Cat given an JSON string - * - * @param jsonString JSON string - * @return An instance of Cat - * @throws IOException if the JSON string is invalid with respect to Cat - */ + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ public static Cat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Cat.class); } - /** - * Convert an instance of Cat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java index 539c50b35b0..baa9ca1944f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java @@ -69,10 +69,10 @@ public class Category implements Parcelable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -88,10 +88,10 @@ public class Category implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -180,12 +180,12 @@ public class Category implements Parcelable { openapiRequiredFields.add("name"); } - /** - * 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 - */ + /** + * 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 @@ -242,22 +242,22 @@ public class Category implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java index 2cd2ffa1852..e54ba6ef744 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java @@ -65,10 +65,10 @@ public class ClassModel implements Parcelable { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -151,12 +151,12 @@ public class ClassModel implements Parcelable { 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 ClassModel - */ + /** + * 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 ClassModel + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ClassModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -206,22 +206,22 @@ public class ClassModel implements Parcelable { } } - /** - * Create an instance of ClassModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ClassModel - * @throws IOException if the JSON string is invalid with respect to ClassModel - */ + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ public static ClassModel fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ClassModel.class); } - /** - * Convert an instance of ClassModel to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java index f91b260cc9c..5de8c1d26b4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java @@ -65,10 +65,10 @@ public class Client implements Parcelable { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { return client; @@ -151,12 +151,12 @@ public class Client implements Parcelable { 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 Client - */ + /** + * 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 Client + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Client.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -206,22 +206,22 @@ public class Client implements Parcelable { } } - /** - * Create an instance of Client given an JSON string - * - * @param jsonString JSON string - * @return An instance of Client - * @throws IOException if the JSON string is invalid with respect to Client - */ + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ public static Client fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Client.class); } - /** - * Convert an instance of Client to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index 12fc2d9fedf..e593dc0e7c7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -68,10 +68,10 @@ public class Dog extends Animal implements Parcelable { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { return breed; @@ -161,12 +161,12 @@ public class Dog extends Animal implements Parcelable { openapiRequiredFields.add("className"); } - /** - * 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 Dog - */ + /** + * 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 Dog + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Dog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public class Dog extends Animal implements Parcelable { } } - /** - * Create an instance of Dog given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dog - * @throws IOException if the JSON string is invalid with respect to Dog - */ + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ public static Dog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Dog.class); } - /** - * Convert an instance of Dog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java index f1ddb4dd20b..409ab143e47 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -175,10 +175,10 @@ public class EnumArrays implements Parcelable { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -202,10 +202,10 @@ public class EnumArrays implements Parcelable { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { return arrayEnum; @@ -293,12 +293,12 @@ public class EnumArrays implements Parcelable { 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 EnumArrays - */ + /** + * 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 EnumArrays + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumArrays.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -356,22 +356,22 @@ public class EnumArrays implements Parcelable { } } - /** - * Create an instance of EnumArrays given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumArrays - * @throws IOException if the JSON string is invalid with respect to EnumArrays - */ + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ public static EnumArrays fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumArrays.class); } - /** - * Convert an instance of EnumArrays to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index 38046411006..07e712ad21d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -294,10 +294,10 @@ public class EnumTest implements Parcelable { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { return enumString; @@ -313,10 +313,10 @@ public class EnumTest implements Parcelable { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -332,10 +332,10 @@ public class EnumTest implements Parcelable { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -351,10 +351,10 @@ public class EnumTest implements Parcelable { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -370,10 +370,10 @@ public class EnumTest implements Parcelable { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { return outerEnum; @@ -477,12 +477,12 @@ public class EnumTest implements Parcelable { openapiRequiredFields.add("enum_string_required"); } - /** - * 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 EnumTest - */ + /** + * 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 EnumTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -560,22 +560,22 @@ public class EnumTest implements Parcelable { } } - /** - * Create an instance of EnumTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumTest - * @throws IOException if the JSON string is invalid with respect to EnumTest - */ + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ public static EnumTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumTest.class); } - /** - * Convert an instance of EnumTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5dc9f61132b..9ed4599e406 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -72,10 +72,10 @@ public class FileSchemaTestClass implements Parcelable { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { return _file; @@ -99,10 +99,10 @@ public class FileSchemaTestClass implements Parcelable { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { return files; @@ -190,12 +190,12 @@ public class FileSchemaTestClass implements Parcelable { 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 FileSchemaTestClass - */ + /** + * 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 FileSchemaTestClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FileSchemaTestClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -260,22 +260,22 @@ public class FileSchemaTestClass implements Parcelable { } } - /** - * Create an instance of FileSchemaTestClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileSchemaTestClass - * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass - */ + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ public static FileSchemaTestClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); } - /** - * Convert an instance of FileSchemaTestClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileSchemaTestClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index 71e2b5f7019..da2fed4c8ec 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -122,12 +122,12 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { return integer; @@ -143,12 +143,12 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { return int32; @@ -164,10 +164,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { return int64; @@ -183,12 +183,12 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { return number; @@ -204,12 +204,12 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { return _float; @@ -225,12 +225,12 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { return _double; @@ -246,10 +246,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { return string; @@ -265,10 +265,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { return _byte; @@ -284,10 +284,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { return binary; @@ -303,10 +303,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { return date; @@ -322,10 +322,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -341,10 +341,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -360,10 +360,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { return password; @@ -379,10 +379,10 @@ public class FormatTest implements Parcelable { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable public BigDecimal getBigDecimal() { return bigDecimal; @@ -534,12 +534,12 @@ public class FormatTest implements Parcelable { openapiRequiredFields.add("password"); } - /** - * 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 FormatTest - */ + /** + * 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 FormatTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FormatTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -602,22 +602,22 @@ public class FormatTest implements Parcelable { } } - /** - * Create an instance of FormatTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormatTest - * @throws IOException if the JSON string is invalid with respect to FormatTest - */ + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ public static FormatTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FormatTest.class); } - /** - * Convert an instance of FormatTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e64093e9620..ef12e989a48 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -73,10 +73,10 @@ public class HasOnlyReadOnly implements Parcelable { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -84,10 +84,10 @@ public class HasOnlyReadOnly implements Parcelable { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { return foo; @@ -172,12 +172,12 @@ public class HasOnlyReadOnly implements Parcelable { 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 HasOnlyReadOnly - */ + /** + * 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 HasOnlyReadOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -230,22 +230,22 @@ public class HasOnlyReadOnly implements Parcelable { } } - /** - * Create an instance of HasOnlyReadOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of HasOnlyReadOnly - * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly - */ + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); } - /** - * Convert an instance of HasOnlyReadOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index 178fa658b4a..fe1a0740a9d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -139,10 +139,10 @@ public class MapTest implements Parcelable { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { return mapMapOfString; @@ -166,10 +166,10 @@ public class MapTest implements Parcelable { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { return mapOfEnumString; @@ -193,10 +193,10 @@ public class MapTest implements Parcelable { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { return directMap; @@ -220,10 +220,10 @@ public class MapTest implements Parcelable { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { return indirectMap; @@ -321,12 +321,12 @@ public class MapTest implements Parcelable { 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 MapTest - */ + /** + * 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 MapTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MapTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -373,22 +373,22 @@ public class MapTest implements Parcelable { } } - /** - * Create an instance of MapTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of MapTest - * @throws IOException if the JSON string is invalid with respect to MapTest - */ + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ public static MapTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MapTest.class); } - /** - * Convert an instance of MapTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fee1888ed4d..32d0e573811 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -78,10 +78,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -97,10 +97,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -124,10 +124,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { return map; @@ -220,12 +220,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { 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 MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * 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 MixedPropertiesAndAdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -275,22 +275,22 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { } } - /** - * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of MixedPropertiesAndAdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); } - /** - * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java index 100fb14de9d..55182e6dec7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java @@ -69,10 +69,10 @@ public class Model200Response implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { return name; @@ -88,10 +88,10 @@ public class Model200Response implements Parcelable { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -179,12 +179,12 @@ public class Model200Response implements Parcelable { 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 Model200Response - */ + /** + * 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 Model200Response + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Model200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -234,22 +234,22 @@ public class Model200Response implements Parcelable { } } - /** - * Create an instance of Model200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of Model200Response - * @throws IOException if the JSON string is invalid with respect to Model200Response - */ + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ public static Model200Response fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Model200Response.class); } - /** - * Convert an instance of Model200Response to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 748610072b6..df726716fcc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -73,10 +73,10 @@ public class ModelApiResponse implements Parcelable { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -92,10 +92,10 @@ public class ModelApiResponse implements Parcelable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -111,10 +111,10 @@ public class ModelApiResponse implements Parcelable { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -207,12 +207,12 @@ public class ModelApiResponse implements Parcelable { 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 - */ + /** + * 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 @@ -265,22 +265,22 @@ public class ModelApiResponse implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java index 265aad2aa66..b209eb7e57f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java @@ -65,10 +65,10 @@ public class ModelFile implements Parcelable { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { return sourceURI; @@ -151,12 +151,12 @@ public class ModelFile implements Parcelable { 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 ModelFile - */ + /** + * 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 ModelFile + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -206,22 +206,22 @@ public class ModelFile implements Parcelable { } } - /** - * Create an instance of ModelFile given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelFile - * @throws IOException if the JSON string is invalid with respect to ModelFile - */ + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ public static ModelFile fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelFile.class); } - /** - * Convert an instance of ModelFile to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java index 9f2e30d85d8..7d1ee3cd6b1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java @@ -65,10 +65,10 @@ public class ModelList implements Parcelable { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { return _123list; @@ -151,12 +151,12 @@ public class ModelList implements Parcelable { 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 ModelList - */ + /** + * 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 ModelList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -206,22 +206,22 @@ public class ModelList implements Parcelable { } } - /** - * Create an instance of ModelList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelList - * @throws IOException if the JSON string is invalid with respect to ModelList - */ + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ public static ModelList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelList.class); } - /** - * Convert an instance of ModelList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java index 4a044e56c8a..d3c0ff2979b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -65,10 +65,10 @@ public class ModelReturn implements Parcelable { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { return _return; @@ -151,12 +151,12 @@ public class ModelReturn implements Parcelable { 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 ModelReturn - */ + /** + * 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 ModelReturn + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelReturn.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -203,22 +203,22 @@ public class ModelReturn implements Parcelable { } } - /** - * Create an instance of ModelReturn given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelReturn - * @throws IOException if the JSON string is invalid with respect to ModelReturn - */ + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ public static ModelReturn fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelReturn.class); } - /** - * Convert an instance of ModelReturn to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java index b64f9165638..22d4d94bfc2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java @@ -86,10 +86,10 @@ public class Name implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { return name; @@ -100,10 +100,10 @@ public class Name implements Parcelable { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { return snakeCase; @@ -116,10 +116,10 @@ public class Name implements Parcelable { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { return property; @@ -130,10 +130,10 @@ public class Name implements Parcelable { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { return _123number; @@ -229,12 +229,12 @@ public class Name implements Parcelable { openapiRequiredFields.add("name"); } - /** - * 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 Name - */ + /** + * 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 Name + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Name.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -291,22 +291,22 @@ public class Name implements Parcelable { } } - /** - * Create an instance of Name given an JSON string - * - * @param jsonString JSON string - * @return An instance of Name - * @throws IOException if the JSON string is invalid with respect to Name - */ + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ public static Name fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Name.class); } - /** - * Convert an instance of Name to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java index db1fa766f91..a282621a0f5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -66,10 +66,10 @@ public class NumberOnly implements Parcelable { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { return justNumber; @@ -152,12 +152,12 @@ public class NumberOnly implements Parcelable { 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 NumberOnly - */ + /** + * 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 NumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -204,22 +204,22 @@ public class NumberOnly implements Parcelable { } } - /** - * Create an instance of NumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumberOnly - * @throws IOException if the JSON string is invalid with respect to NumberOnly - */ + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ public static NumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NumberOnly.class); } - /** - * Convert an instance of NumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index 1680112050a..b79f79796ce 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -140,10 +140,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -159,10 +159,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -178,10 +178,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -197,10 +197,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -216,10 +216,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -235,10 +235,10 @@ public class Order implements Parcelable { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -346,12 +346,12 @@ public class Order implements Parcelable { 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 - */ + /** + * 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 @@ -405,22 +405,22 @@ public class Order implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index 22069a4e9a5..16665fa0659 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -74,10 +74,10 @@ public class OuterComposite implements Parcelable { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { return myNumber; @@ -93,10 +93,10 @@ public class OuterComposite implements Parcelable { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { return myString; @@ -112,10 +112,10 @@ public class OuterComposite implements Parcelable { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { return myBoolean; @@ -208,12 +208,12 @@ public class OuterComposite implements Parcelable { 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 OuterComposite - */ + /** + * 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 OuterComposite + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!OuterComposite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -263,22 +263,22 @@ public class OuterComposite implements Parcelable { } } - /** - * Create an instance of OuterComposite given an JSON string - * - * @param jsonString JSON string - * @return An instance of OuterComposite - * @throws IOException if the JSON string is invalid with respect to OuterComposite - */ + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ public static OuterComposite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, OuterComposite.class); } - /** - * Convert an instance of OuterComposite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index e6f2662db6b..2c0019f1b63 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -145,10 +145,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -164,10 +164,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -183,10 +183,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -210,10 +210,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public Set getPhotoUrls() { return photoUrls; @@ -237,10 +237,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -256,10 +256,10 @@ public class Pet implements Parcelable { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -369,12 +369,12 @@ public class Pet implements Parcelable { 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 - */ + /** + * 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 @@ -462,22 +462,22 @@ public class Pet implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 5fe01e2904f..a181133470e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -71,10 +71,10 @@ public class ReadOnlyFirst implements Parcelable { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -87,10 +87,10 @@ public class ReadOnlyFirst implements Parcelable { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { return baz; @@ -178,12 +178,12 @@ public class ReadOnlyFirst implements Parcelable { 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 ReadOnlyFirst - */ + /** + * 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 ReadOnlyFirst + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ReadOnlyFirst.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -236,22 +236,22 @@ public class ReadOnlyFirst implements Parcelable { } } - /** - * Create an instance of ReadOnlyFirst given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadOnlyFirst - * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst - */ + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ public static ReadOnlyFirst fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); } - /** - * Convert an instance of ReadOnlyFirst to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java index b7981dd1018..f90fa27480a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -65,10 +65,10 @@ public class SpecialModelName implements Parcelable { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -151,12 +151,12 @@ public class SpecialModelName implements Parcelable { 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 SpecialModelName - */ + /** + * 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 SpecialModelName + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SpecialModelName.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -203,22 +203,22 @@ public class SpecialModelName implements Parcelable { } } - /** - * Create an instance of SpecialModelName given an JSON string - * - * @param jsonString JSON string - * @return An instance of SpecialModelName - * @throws IOException if the JSON string is invalid with respect to SpecialModelName - */ + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ public static SpecialModelName fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SpecialModelName.class); } - /** - * Convert an instance of SpecialModelName to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java index 4df566edb6c..d6018f0bc1a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java @@ -69,10 +69,10 @@ public class Tag implements Parcelable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -88,10 +88,10 @@ public class Tag implements Parcelable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -179,12 +179,12 @@ public class Tag implements Parcelable { 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 - */ + /** + * 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 @@ -234,22 +234,22 @@ public class Tag implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index a99a893f96b..b37fa6ab532 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -84,10 +84,10 @@ public class TypeHolderDefault implements Parcelable { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { return stringItem; @@ -103,10 +103,10 @@ public class TypeHolderDefault implements Parcelable { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { return numberItem; @@ -122,10 +122,10 @@ public class TypeHolderDefault implements Parcelable { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { return integerItem; @@ -141,10 +141,10 @@ public class TypeHolderDefault implements Parcelable { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { return boolItem; @@ -168,10 +168,10 @@ public class TypeHolderDefault implements Parcelable { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { return arrayItem; @@ -279,12 +279,12 @@ public class TypeHolderDefault implements Parcelable { openapiRequiredFields.add("array_item"); } - /** - * 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 TypeHolderDefault - */ + /** + * 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 TypeHolderDefault + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TypeHolderDefault.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -347,22 +347,22 @@ public class TypeHolderDefault implements Parcelable { } } - /** - * Create an instance of TypeHolderDefault given an JSON string - * - * @param jsonString JSON string - * @return An instance of TypeHolderDefault - * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault - */ + /** + * Create an instance of TypeHolderDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderDefault + * @throws IOException if the JSON string is invalid with respect to TypeHolderDefault + */ public static TypeHolderDefault fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TypeHolderDefault.class); } - /** - * Convert an instance of TypeHolderDefault to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TypeHolderDefault to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java index bd488d3870f..8f85753d40b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -88,10 +88,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { return stringItem; @@ -107,10 +107,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { return numberItem; @@ -126,10 +126,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull public Float getFloatItem() { return floatItem; @@ -145,10 +145,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { return integerItem; @@ -164,10 +164,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { return boolItem; @@ -191,10 +191,10 @@ public class TypeHolderExample implements Parcelable { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { return arrayItem; @@ -308,12 +308,12 @@ public class TypeHolderExample implements Parcelable { openapiRequiredFields.add("array_item"); } - /** - * 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 TypeHolderExample - */ + /** + * 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 TypeHolderExample + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TypeHolderExample.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -376,22 +376,22 @@ public class TypeHolderExample implements Parcelable { } } - /** - * Create an instance of TypeHolderExample given an JSON string - * - * @param jsonString JSON string - * @return An instance of TypeHolderExample - * @throws IOException if the JSON string is invalid with respect to TypeHolderExample - */ + /** + * Create an instance of TypeHolderExample given an JSON string + * + * @param jsonString JSON string + * @return An instance of TypeHolderExample + * @throws IOException if the JSON string is invalid with respect to TypeHolderExample + */ public static TypeHolderExample fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TypeHolderExample.class); } - /** - * Convert an instance of TypeHolderExample to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TypeHolderExample to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java index 1ad9a692a0e..773592fe4eb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java @@ -93,10 +93,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -112,10 +112,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -131,10 +131,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -150,10 +150,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -169,10 +169,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -188,10 +188,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -207,10 +207,10 @@ public class User implements Parcelable { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -226,10 +226,10 @@ public class User implements Parcelable { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -347,12 +347,12 @@ public class User implements Parcelable { 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 - */ + /** + * 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 @@ -417,22 +417,22 @@ public class User implements Parcelable { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java index 092ab556f88..d5c70fbf2d9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/XmlItem.java @@ -180,10 +180,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable public String getAttributeString() { return attributeString; @@ -199,10 +199,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getAttributeNumber() { return attributeNumber; @@ -218,10 +218,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable public Integer getAttributeInteger() { return attributeInteger; @@ -237,10 +237,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable public Boolean getAttributeBoolean() { return attributeBoolean; @@ -264,10 +264,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable public List getWrappedArray() { return wrappedArray; @@ -283,10 +283,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable public String getNameString() { return nameString; @@ -302,10 +302,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNameNumber() { return nameNumber; @@ -321,10 +321,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable public Integer getNameInteger() { return nameInteger; @@ -340,10 +340,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNameBoolean() { return nameBoolean; @@ -367,10 +367,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable public List getNameArray() { return nameArray; @@ -394,10 +394,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable public List getNameWrappedArray() { return nameWrappedArray; @@ -413,10 +413,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable public String getPrefixString() { return prefixString; @@ -432,10 +432,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNumber() { return prefixNumber; @@ -451,10 +451,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixInteger() { return prefixInteger; @@ -470,10 +470,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixBoolean() { return prefixBoolean; @@ -497,10 +497,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable public List getPrefixArray() { return prefixArray; @@ -524,10 +524,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -543,10 +543,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable public String getNamespaceString() { return namespaceString; @@ -562,10 +562,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -581,10 +581,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable public Integer getNamespaceInteger() { return namespaceInteger; @@ -600,10 +600,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -627,10 +627,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable public List getNamespaceArray() { return namespaceArray; @@ -654,10 +654,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -673,10 +673,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable public String getPrefixNsString() { return prefixNsString; @@ -692,10 +692,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -711,10 +711,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixNsInteger() { return prefixNsInteger; @@ -730,10 +730,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -757,10 +757,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsArray() { return prefixNsArray; @@ -784,10 +784,10 @@ public class XmlItem implements Parcelable { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; @@ -1010,12 +1010,12 @@ public class XmlItem implements Parcelable { 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 XmlItem - */ + /** + * 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 XmlItem + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!XmlItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -1113,22 +1113,22 @@ public class XmlItem implements Parcelable { } } - /** - * Create an instance of XmlItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of XmlItem - * @throws IOException if the JSON string is invalid with respect to XmlItem - */ + /** + * Create an instance of XmlItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of XmlItem + * @throws IOException if the JSON string is invalid with respect to XmlItem + */ public static XmlItem fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, XmlItem.class); } - /** - * Convert an instance of XmlItem to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of XmlItem to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle index 67dd0df27bd..5ce050edbdd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt index 982b47d2980..ce7b54dda96 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml index 1d394370ae9..c91c33c44b5 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml @@ -311,14 +311,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -340,14 +335,14 @@ ${java.version} 1.9.0 1.6.6 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/JSON.java index ad2d26cbfbb..f993e935c7a 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -338,7 +331,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -348,7 +341,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -373,7 +366,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -392,7 +385,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Category.java index 25744b859d4..56e698010f1 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Category.java @@ -70,10 +70,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getId() { @@ -90,10 +90,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getName() { @@ -205,12 +205,12 @@ public class Category { 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 - */ + /** + * 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 @@ -295,22 +295,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f4ef16f55cf..0315dd540da 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -74,10 +74,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getCode() { @@ -94,10 +94,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getType() { @@ -114,10 +114,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getMessage() { @@ -232,12 +232,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -325,22 +325,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Order.java index 596be195f66..ed4f674f886 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Order.java @@ -141,10 +141,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getId() { @@ -161,10 +161,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getPetId() { @@ -181,10 +181,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getQuantity() { @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { @@ -221,10 +221,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { @@ -241,10 +241,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getComplete() { @@ -368,12 +368,12 @@ public class Order { 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 - */ + /** + * 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 @@ -462,22 +462,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 09802201946..9e1a12ff47b 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -145,10 +145,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getId() { @@ -165,10 +165,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Category getCategory() { @@ -185,10 +185,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { @@ -213,10 +213,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { @@ -241,10 +241,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public List getTags() { @@ -262,11 +262,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") @@ -394,12 +394,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -522,22 +522,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Tag.java index 5cc4e3cca94..390e18ff8fd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Tag.java @@ -70,10 +70,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getId() { @@ -90,10 +90,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getName() { @@ -205,12 +205,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -295,22 +295,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/User.java index a276c1bc92b..877f73117dc 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/User.java @@ -94,10 +94,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public Long getId() { @@ -114,10 +114,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getUsername() { @@ -134,10 +134,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getFirstName() { @@ -154,10 +154,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getLastName() { @@ -174,10 +174,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getEmail() { @@ -194,10 +194,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getPassword() { @@ -214,10 +214,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getPhone() { @@ -234,10 +234,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") public Integer getUserStatus() { @@ -367,12 +367,12 @@ public class User { 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 - */ + /** + * 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 @@ -472,22 +472,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle index 67dd0df27bd..5ce050edbdd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt index 982b47d2980..ce7b54dda96 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml index d0e30fb7e0f..969ea3012fd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml @@ -311,14 +311,9 @@ ${jackson-databind-nullable-version} - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -340,14 +335,14 @@ ${java.version} 1.9.0 2.2.15 - 4.11.0 + 4.12.0 2.10.1 3.14.0 0.2.6 1.3.5 - 5.10.2 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 2.43.0 diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/JSON.java index ad2d26cbfbb..f993e935c7a 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -338,7 +331,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -348,7 +341,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -373,7 +366,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -392,7 +385,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f40a47ba215..199e6eb66ef 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Category.java index 36b1249459b..41ec0d06087 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -69,10 +69,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getId() { @@ -89,10 +89,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getName() { @@ -204,12 +204,12 @@ public class Category { 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 - */ + /** + * 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 @@ -294,22 +294,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 621da1a45b2..c8bc135a5d7 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -73,10 +73,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Integer getCode() { @@ -93,10 +93,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getType() { @@ -113,10 +113,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getMessage() { @@ -231,12 +231,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -324,22 +324,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Order.java index e1812887e1c..711a69685b2 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -140,10 +140,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getId() { @@ -160,10 +160,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getPetId() { @@ -180,10 +180,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Integer getQuantity() { @@ -200,10 +200,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public OffsetDateTime getShipDate() { @@ -220,10 +220,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") public StatusEnum getStatus() { @@ -240,10 +240,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Boolean getComplete() { @@ -367,12 +367,12 @@ public class Order { 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 - */ + /** + * 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 @@ -461,22 +461,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Pet.java index cc2778cb69a..a29adbebb61 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -144,10 +144,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getId() { @@ -164,10 +164,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Category getCategory() { @@ -184,10 +184,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") public String getName() { @@ -212,10 +212,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") public List getPhotoUrls() { @@ -240,10 +240,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public List getTags() { @@ -261,11 +261,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "pet status in the store") @@ -393,12 +393,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -521,22 +521,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Tag.java index 38c64862877..bae4166e9e3 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -69,10 +69,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getId() { @@ -89,10 +89,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getName() { @@ -204,12 +204,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -294,22 +294,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/User.java index 9d8143c12bb..2bdd75ca68d 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -93,10 +93,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public Long getId() { @@ -113,10 +113,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getUsername() { @@ -133,10 +133,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getFirstName() { @@ -153,10 +153,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getLastName() { @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getEmail() { @@ -193,10 +193,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getPassword() { @@ -213,10 +213,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") public String getPhone() { @@ -233,10 +233,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "User Status") public Integer getUserStatus() { @@ -366,12 +366,12 @@ public class User { 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 - */ + /** + * 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 @@ -471,22 +471,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore index fcc3c36a6e5..7a5d6d2e1b5 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator-ignore @@ -11,4 +11,5 @@ src/test/java/org/openapitools/client/model/PetTest.java src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java src/test/java/org/openapitools/client/JSONTest.java src/test/java/org/openapitools/client/api/PetApiTest.java -pom.xml +# to manually include mockito-core in pom.xml +pom.xml diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 02515104fd6..113cd16b938 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -60,6 +60,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/Mammal.md +docs/MammalAnyof.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -203,6 +204,7 @@ 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/IsoscelesTriangle.java src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MammalAnyof.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 diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index a2c78c0de6d..cbbc3a822d3 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -220,6 +220,7 @@ Class | Method | HTTP request | Description - [HealthCheckResult](docs/HealthCheckResult.md) - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Mammal](docs/Mammal.md) + - [MammalAnyof](docs/MammalAnyof.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index 979f2695d99..45059a37678 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -2298,6 +2298,13 @@ components: - $ref: '#/components/schemas/whale' - $ref: '#/components/schemas/zebra' - $ref: '#/components/schemas/Pig' + mammal_anyof: + anyOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className whale: properties: hasBaleen: @@ -2640,6 +2647,17 @@ components: category_allOf_ref: allOf: - $ref: '#/components/schemas/Category' + category_allOf_ref_description: + allOf: + - $ref: '#/components/schemas/Category' + description: | + Adding description to property using allOf + category_allOf_ref_description_readonly: + allOf: + - $ref: '#/components/schemas/Category' + description: | + Adding description to readonly property using allOf + readOnly: true name: example: doggie type: string diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 67dd0df27bd..5ce050edbdd 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -112,15 +112,14 @@ dependencies { 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 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' 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.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 982b47d2980..ce7b54dda96 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -14,15 +14,14 @@ lazy val root = (project in file(".")). "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", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "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", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "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/MammalAnyof.md b/samples/client/petstore/java/okhttp-gson/docs/MammalAnyof.md new file mode 100644 index 00000000000..7a366e10da4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/MammalAnyof.md @@ -0,0 +1,26 @@ + + +# MammalAnyof + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasBaleen** | **Boolean** | | [optional] | +|**hasTeeth** | **Boolean** | | [optional] | +|**className** | **String** | | | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| PLAINS | "plains" | +| MOUNTAIN | "mountain" | +| GREVYS | "grevys" | + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/NewPet.md b/samples/client/petstore/java/okhttp-gson/docs/NewPet.md index 818b8db0079..3cfa8c0076f 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/NewPet.md +++ b/samples/client/petstore/java/okhttp-gson/docs/NewPet.md @@ -10,6 +10,8 @@ |**id** | **Long** | | [optional] | |**categoryInlineAllof** | [**NewPetCategoryInlineAllof**](NewPetCategoryInlineAllof.md) | | [optional] | |**categoryAllOfRef** | [**Category**](Category.md) | | [optional] | +|**categoryAllOfRefDescription** | [**Category**](Category.md) | Adding description to property using allOf | [optional] | +|**categoryAllOfRefDescriptionReadonly** | [**Category**](Category.md) | Adding description to readonly property using allOf | [optional] [readonly] | |**name** | **String** | | | |**photoUrls** | **List<String>** | | | |**tags** | [**List<Tag>**](Tag.md) | | [optional] | diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index dbf329da8a7..5f7a29c64c6 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.4.1 enforce-maven @@ -72,12 +72,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -93,7 +93,7 @@ maven-dependency-plugin - 3.3.0 + 3.6.1 package @@ -124,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.5.0 add_sources @@ -155,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.6.3 attach-javadocs @@ -178,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -241,7 +241,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -306,19 +306,9 @@ ${jackson-databind-nullable-version} - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - - - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -348,15 +338,14 @@ 1.9.0 4.11.0 2.10.1 - 3.13.0 + 3.14.0 0.2.6 - 2.16.0 1.3.5 - 5.10.0 + 5.10.3 1.10.0 - 2.1.1 + 2.1.6 1.1.1 UTF-8 - 2.27.2 + 2.43.0 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 db57f2dbba8..431ee642f41 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 @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -31,16 +31,14 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; +import java.text.ParsePosition; 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 @@ -57,11 +55,6 @@ public class JSON { 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() @@ -124,6 +117,18 @@ public class JSON { return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); } + }) + .registerTypeSelector(org.openapitools.client.model.MammalAnyof.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); + classByDiscriminatorValue.put("whale", org.openapitools.client.model.Whale.class); + classByDiscriminatorValue.put("zebra", org.openapitools.client.model.Zebra.class); + classByDiscriminatorValue.put("mammal_anyof", org.openapitools.client.model.MammalAnyof.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } }) .registerTypeSelector(org.openapitools.client.model.NullableShape.class, new TypeSelector() { @Override @@ -284,6 +289,7 @@ public class JSON { gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IsoscelesTriangle.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Mammal.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MammalAnyof.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()); @@ -562,7 +568,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -572,7 +578,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -597,7 +603,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -616,7 +622,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index b4641c4217c..e801ee556a8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b297f1a5326..83590a16158 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -102,10 +102,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable public Map getMapProperty() { return mapProperty; @@ -129,10 +129,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable public Map> getMapOfMapProperty() { return mapOfMapProperty; @@ -148,10 +148,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { return anytype1; @@ -167,10 +167,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 - **/ + */ @javax.annotation.Nullable public Object getMapWithUndeclaredPropertiesAnytype1() { return mapWithUndeclaredPropertiesAnytype1; @@ -186,10 +186,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 - **/ + */ @javax.annotation.Nullable public Object getMapWithUndeclaredPropertiesAnytype2() { return mapWithUndeclaredPropertiesAnytype2; @@ -213,10 +213,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 - **/ + */ @javax.annotation.Nullable public Map getMapWithUndeclaredPropertiesAnytype3() { return mapWithUndeclaredPropertiesAnytype3; @@ -232,10 +232,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap - **/ + */ @javax.annotation.Nullable public Object getEmptyMap() { return emptyMap; @@ -259,10 +259,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString - **/ + */ @javax.annotation.Nullable public Map getMapWithUndeclaredPropertiesString() { return mapWithUndeclaredPropertiesString; @@ -402,12 +402,12 @@ public class AdditionalPropertiesClass { 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 AdditionalPropertiesClass - */ + /** + * 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 AdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -489,22 +489,22 @@ public class AdditionalPropertiesClass { } } - /** - * Create an instance of AdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass - */ + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); } - /** - * Convert an instance of AdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AdditionalPropertiesClass 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/AllOfModelArrayAnyOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOf.java index 0b2f8443002..3b4b4c8f8b1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOf.java @@ -77,10 +77,10 @@ public class AllOfModelArrayAnyOf { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -96,10 +96,10 @@ public class AllOfModelArrayAnyOf { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -115,10 +115,10 @@ public class AllOfModelArrayAnyOf { return this; } - /** + /** * Get linkListColumn1 * @return linkListColumn1 - **/ + */ @javax.annotation.Nullable public AllOfModelArrayAnyOfAllOfLinkListColumn1 getLinkListColumn1() { return linkListColumn1; @@ -134,10 +134,10 @@ public class AllOfModelArrayAnyOf { return this; } - /** + /** * Get attributes * @return attributes - **/ + */ @javax.annotation.Nullable public AllOfModelArrayAnyOfAllOfAttributes getAttributes() { return attributes; @@ -255,12 +255,12 @@ public class AllOfModelArrayAnyOf { openapiRequiredFields.add("name"); } - /** - * 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 AllOfModelArrayAnyOf - */ + /** + * 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 AllOfModelArrayAnyOf + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AllOfModelArrayAnyOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -360,22 +360,22 @@ public class AllOfModelArrayAnyOf { } } - /** - * Create an instance of AllOfModelArrayAnyOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllOfModelArrayAnyOf - * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOf - */ + /** + * Create an instance of AllOfModelArrayAnyOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllOfModelArrayAnyOf + * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOf + */ public static AllOfModelArrayAnyOf fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AllOfModelArrayAnyOf.class); } - /** - * Convert an instance of AllOfModelArrayAnyOf to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AllOfModelArrayAnyOf 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/AllOfModelArrayAnyOfAllOfAttributes.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributes.java index 73952c58451..4fd92095d11 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributes.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributes.java @@ -64,10 +64,10 @@ public class AllOfModelArrayAnyOfAllOfAttributes { return this; } - /** + /** * Get C * @return C - **/ + */ @javax.annotation.Nullable public AllOfModelArrayAnyOfAllOfAttributesC getC() { return C; @@ -175,12 +175,12 @@ public class AllOfModelArrayAnyOfAllOfAttributes { 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 AllOfModelArrayAnyOfAllOfAttributes - */ + /** + * 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 AllOfModelArrayAnyOfAllOfAttributes + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AllOfModelArrayAnyOfAllOfAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class AllOfModelArrayAnyOfAllOfAttributes { } } - /** - * Create an instance of AllOfModelArrayAnyOfAllOfAttributes given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllOfModelArrayAnyOfAllOfAttributes - * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOfAllOfAttributes - */ + /** + * Create an instance of AllOfModelArrayAnyOfAllOfAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllOfModelArrayAnyOfAllOfAttributes + * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOfAllOfAttributes + */ public static AllOfModelArrayAnyOfAllOfAttributes fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AllOfModelArrayAnyOfAllOfAttributes.class); } - /** - * Convert an instance of AllOfModelArrayAnyOfAllOfAttributes to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AllOfModelArrayAnyOfAllOfAttributes 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/AllOfModelArrayAnyOfAllOfLinkListColumn1.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1.java index 86441af44bb..fb353c09d3c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1.java @@ -74,10 +74,10 @@ public class AllOfModelArrayAnyOfAllOfLinkListColumn1 { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull public List getValue() { return value; @@ -186,12 +186,12 @@ public class AllOfModelArrayAnyOfAllOfLinkListColumn1 { openapiRequiredFields.add("value"); } - /** - * 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 AllOfModelArrayAnyOfAllOfLinkListColumn1 - */ + /** + * 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 AllOfModelArrayAnyOfAllOfLinkListColumn1 + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AllOfModelArrayAnyOfAllOfLinkListColumn1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -290,22 +290,22 @@ public class AllOfModelArrayAnyOfAllOfLinkListColumn1 { } } - /** - * Create an instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 - * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOfAllOfLinkListColumn1 - */ + /** + * Create an instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 + * @throws IOException if the JSON string is invalid with respect to AllOfModelArrayAnyOfAllOfLinkListColumn1 + */ public static AllOfModelArrayAnyOfAllOfLinkListColumn1 fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AllOfModelArrayAnyOfAllOfLinkListColumn1.class); } - /** - * Convert an instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AllOfModelArrayAnyOfAllOfLinkListColumn1 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/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java index dadf4e3513f..73b8cc8c7b3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java @@ -68,10 +68,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -202,12 +202,12 @@ public class Animal { openapiRequiredFields.add("className"); } - /** - * 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 Animal - */ + /** + * 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 Animal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Animal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -229,22 +229,22 @@ public class Animal { } - /** - * Create an instance of Animal given an JSON string - * - * @param jsonString JSON string - * @return An instance of Animal - * @throws IOException if the JSON string is invalid with respect to Animal - */ + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ public static Animal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Animal.class); } - /** - * Convert an instance of Animal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Animal 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/Apple.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java index ea311ecacdb..29b5887ba6e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java @@ -67,10 +67,10 @@ public class Apple { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nullable public String getCultivar() { return cultivar; @@ -86,10 +86,10 @@ public class Apple { return this; } - /** + /** * Get origin * @return origin - **/ + */ @javax.annotation.Nullable public String getOrigin() { return origin; @@ -200,12 +200,12 @@ public class Apple { 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 Apple - */ + /** + * 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 Apple + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Apple.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -293,22 +293,22 @@ public class Apple { } } - /** - * Create an instance of Apple given an JSON string - * - * @param jsonString JSON string - * @return An instance of Apple - * @throws IOException if the JSON string is invalid with respect to Apple - */ + /** + * Create an instance of Apple given an JSON string + * + * @param jsonString JSON string + * @return An instance of Apple + * @throws IOException if the JSON string is invalid with respect to Apple + */ public static Apple fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Apple.class); } - /** - * Convert an instance of Apple to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Apple 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/AppleReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java index eb5f336dfa8..704fb6510f2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java @@ -67,10 +67,10 @@ public class AppleReq { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nonnull public String getCultivar() { return cultivar; @@ -86,10 +86,10 @@ public class AppleReq { return this; } - /** + /** * Get mealy * @return mealy - **/ + */ @javax.annotation.Nullable public Boolean getMealy() { return mealy; @@ -155,12 +155,12 @@ public class AppleReq { openapiRequiredFields.add("cultivar"); } - /** - * 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 AppleReq - */ + /** + * 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 AppleReq + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AppleReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -217,22 +217,22 @@ public class AppleReq { } } - /** - * Create an instance of AppleReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AppleReq - * @throws IOException if the JSON string is invalid with respect to AppleReq - */ + /** + * Create an instance of AppleReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppleReq + * @throws IOException if the JSON string is invalid with respect to AppleReq + */ public static AppleReq fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AppleReq.class); } - /** - * Convert an instance of AppleReq to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AppleReq 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/ArrayDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayDefault.java index 6406af30b8b..bd1ad60620e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayDefault.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayDefault.java @@ -77,10 +77,10 @@ public class ArrayDefault { return this; } - /** + /** * Get withDefaultEmptyBracket * @return withDefaultEmptyBracket - **/ + */ @javax.annotation.Nullable public List getWithDefaultEmptyBracket() { return withDefaultEmptyBracket; @@ -104,10 +104,10 @@ public class ArrayDefault { return this; } - /** + /** * Get withoutDefault * @return withoutDefault - **/ + */ @javax.annotation.Nullable public List getWithoutDefault() { return withoutDefault; @@ -218,12 +218,12 @@ public class ArrayDefault { 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 ArrayDefault - */ + /** + * 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 ArrayDefault + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayDefault.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -313,22 +313,22 @@ public class ArrayDefault { } } - /** - * Create an instance of ArrayDefault given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayDefault - * @throws IOException if the JSON string is invalid with respect to ArrayDefault - */ + /** + * Create an instance of ArrayDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayDefault + * @throws IOException if the JSON string is invalid with respect to ArrayDefault + */ public static ArrayDefault fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayDefault.class); } - /** - * Convert an instance of ArrayDefault to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayDefault 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/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 0ed88ae15bc..6c34ee05bf7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -74,10 +74,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -185,12 +185,12 @@ public class ArrayOfArrayOfNumberOnly { 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 ArrayOfArrayOfNumberOnly - */ + /** + * 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 ArrayOfArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -276,22 +276,22 @@ public class ArrayOfArrayOfNumberOnly { } } - /** - * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfArrayOfNumberOnly 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/ArrayOfInlineAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java index 02905fc106c..21526f8d471 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java @@ -74,10 +74,10 @@ public class ArrayOfInlineAllOf { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -93,10 +93,10 @@ public class ArrayOfInlineAllOf { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -120,10 +120,10 @@ public class ArrayOfInlineAllOf { return this; } - /** + /** * Get arrayAllofDogProperty * @return arrayAllofDogProperty - **/ + */ @javax.annotation.Nullable public List getArrayAllofDogProperty() { return arrayAllofDogProperty; @@ -238,12 +238,12 @@ public class ArrayOfInlineAllOf { openapiRequiredFields.add("name"); } - /** - * 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 ArrayOfInlineAllOf - */ + /** + * 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 ArrayOfInlineAllOf + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfInlineAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -349,22 +349,22 @@ public class ArrayOfInlineAllOf { } } - /** - * Create an instance of ArrayOfInlineAllOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfInlineAllOf - * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOf - */ + /** + * Create an instance of ArrayOfInlineAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfInlineAllOf + * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOf + */ public static ArrayOfInlineAllOf fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOf.class); } - /** - * Convert an instance of ArrayOfInlineAllOf to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfInlineAllOf 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/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java index 121ca44a504..d569c36c910 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java @@ -67,10 +67,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { return breed; @@ -86,10 +86,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { return color; @@ -200,12 +200,12 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { 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 ArrayOfInlineAllOfArrayAllofDogPropertyInner - */ + /** + * 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 ArrayOfInlineAllOfArrayAllofDogPropertyInner + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfInlineAllOfArrayAllofDogPropertyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -293,22 +293,22 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { } } - /** - * Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner - * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyInner - */ + /** + * Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner + * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyInner + */ public static ArrayOfInlineAllOfArrayAllofDogPropertyInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyInner.class); } - /** - * Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyInner 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/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index f3368741f1a..84b10935097 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -74,10 +74,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { return arrayNumber; @@ -185,12 +185,12 @@ public class ArrayOfNumberOnly { 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 ArrayOfNumberOnly - */ + /** + * 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 ArrayOfNumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -276,22 +276,22 @@ public class ArrayOfNumberOnly { } } - /** - * Create an instance of ArrayOfNumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfNumberOnly - * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly - */ + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); } - /** - * Convert an instance of ArrayOfNumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayOfNumberOnly 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/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java index a6a5f12b1a7..8c8514ee2d4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,10 +82,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { return arrayOfString; @@ -109,10 +109,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -136,10 +136,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -253,12 +253,12 @@ public class ArrayTest { 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 ArrayTest - */ + /** + * 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 ArrayTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ArrayTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -352,22 +352,22 @@ public class ArrayTest { } } - /** - * Create an instance of ArrayTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayTest - * @throws IOException if the JSON string is invalid with respect to ArrayTest - */ + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ public static ArrayTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ArrayTest.class); } - /** - * Convert an instance of ArrayTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ArrayTest 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/Banana.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java index 25af803d7ff..41de68abc84 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java @@ -64,10 +64,10 @@ public class Banana { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nullable public BigDecimal getLengthCm() { return lengthCm; @@ -175,12 +175,12 @@ public class Banana { 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 Banana - */ + /** + * 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 Banana + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Banana.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -262,22 +262,22 @@ public class Banana { } } - /** - * Create an instance of Banana given an JSON string - * - * @param jsonString JSON string - * @return An instance of Banana - * @throws IOException if the JSON string is invalid with respect to Banana - */ + /** + * Create an instance of Banana given an JSON string + * + * @param jsonString JSON string + * @return An instance of Banana + * @throws IOException if the JSON string is invalid with respect to Banana + */ public static Banana fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Banana.class); } - /** - * Convert an instance of Banana to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Banana 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/BananaReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java index 3808cc52eb6..3498f91c504 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java @@ -68,10 +68,10 @@ public class BananaReq { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nonnull public BigDecimal getLengthCm() { return lengthCm; @@ -87,10 +87,10 @@ public class BananaReq { return this; } - /** + /** * Get sweet * @return sweet - **/ + */ @javax.annotation.Nullable public Boolean getSweet() { return sweet; @@ -156,12 +156,12 @@ public class BananaReq { openapiRequiredFields.add("lengthCm"); } - /** - * 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 BananaReq - */ + /** + * 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 BananaReq + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BananaReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -215,22 +215,22 @@ public class BananaReq { } } - /** - * Create an instance of BananaReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of BananaReq - * @throws IOException if the JSON string is invalid with respect to BananaReq - */ + /** + * Create an instance of BananaReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of BananaReq + * @throws IOException if the JSON string is invalid with respect to BananaReq + */ public static BananaReq fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BananaReq.class); } - /** - * Convert an instance of BananaReq to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BananaReq 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/BasquePig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java index 1a4364ab1e5..7c351fa8a13 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java @@ -63,10 +63,10 @@ public class BasquePig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -175,12 +175,12 @@ public class BasquePig { openapiRequiredFields.add("className"); } - /** - * 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 BasquePig - */ + /** + * 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 BasquePig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BasquePig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -272,22 +272,22 @@ public class BasquePig { } } - /** - * Create an instance of BasquePig given an JSON string - * - * @param jsonString JSON string - * @return An instance of BasquePig - * @throws IOException if the JSON string is invalid with respect to BasquePig - */ + /** + * Create an instance of BasquePig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BasquePig + * @throws IOException if the JSON string is invalid with respect to BasquePig + */ public static BasquePig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BasquePig.class); } - /** - * Convert an instance of BasquePig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BasquePig 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/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java index 65ce13d209f..bb831e5f685 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -83,10 +83,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { return smallCamel; @@ -102,10 +102,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { return capitalCamel; @@ -121,10 +121,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { return smallSnake; @@ -140,10 +140,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { return capitalSnake; @@ -159,10 +159,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -178,10 +178,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { return ATT_NAME; @@ -304,12 +304,12 @@ public class Capitalization { 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 Capitalization - */ + /** + * 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 Capitalization + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Capitalization.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -409,22 +409,22 @@ public class Capitalization { } } - /** - * Create an instance of Capitalization given an JSON string - * - * @param jsonString JSON string - * @return An instance of Capitalization - * @throws IOException if the JSON string is invalid with respect to Capitalization - */ + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ public static Capitalization fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Capitalization.class); } - /** - * Convert an instance of Capitalization to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Capitalization 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/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index 78375e3cb69..131bc4d6b02 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -66,10 +66,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { return declawed; @@ -182,12 +182,12 @@ public class Cat extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Cat - */ + /** + * 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 Cat + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Cat.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -275,22 +275,22 @@ public class Cat extends Animal { } } - /** - * Create an instance of Cat given an JSON string - * - * @param jsonString JSON string - * @return An instance of Cat - * @throws IOException if the JSON string is invalid with respect to Cat - */ + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ public static Cat fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Cat.class); } - /** - * Convert an instance of Cat to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Cat 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/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index 00fea776a3a..c1660904755 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -67,10 +67,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -201,12 +201,12 @@ public class Category { openapiRequiredFields.add("name"); } - /** - * 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 - */ + /** + * 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 @@ -298,22 +298,22 @@ public class Category { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java index 975c4343ee6..5c53259d1e4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -63,10 +63,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -174,12 +174,12 @@ public class ClassModel { 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 ClassModel - */ + /** + * 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 ClassModel + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ClassModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class ClassModel { } } - /** - * Create an instance of ClassModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of ClassModel - * @throws IOException if the JSON string is invalid with respect to ClassModel - */ + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ public static ClassModel fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ClassModel.class); } - /** - * Convert an instance of ClassModel to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ClassModel 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/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java index 6786ad13c39..a569f2bc9ad 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java @@ -63,10 +63,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { return client; @@ -174,12 +174,12 @@ public class Client { 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 Client - */ + /** + * 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 Client + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Client.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class Client { } } - /** - * Create an instance of Client given an JSON string - * - * @param jsonString JSON string - * @return An instance of Client - * @throws IOException if the JSON string is invalid with respect to Client - */ + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ public static Client fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Client.class); } - /** - * Convert an instance of Client to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Client 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/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 6d42b75e90a..74f42af97d3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -67,10 +67,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -86,10 +86,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull public String getQuadrilateralType() { return quadrilateralType; @@ -202,12 +202,12 @@ public class ComplexQuadrilateral { openapiRequiredFields.add("quadrilateralType"); } - /** - * 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 ComplexQuadrilateral - */ + /** + * 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 ComplexQuadrilateral + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ComplexQuadrilateral.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -302,22 +302,22 @@ public class ComplexQuadrilateral { } } - /** - * Create an instance of ComplexQuadrilateral given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComplexQuadrilateral - * @throws IOException if the JSON string is invalid with respect to ComplexQuadrilateral - */ + /** + * Create an instance of ComplexQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComplexQuadrilateral + * @throws IOException if the JSON string is invalid with respect to ComplexQuadrilateral + */ public static ComplexQuadrilateral fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ComplexQuadrilateral.class); } - /** - * Convert an instance of ComplexQuadrilateral to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ComplexQuadrilateral 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/DanishPig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java index adbd90d5932..45f32030d70 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java @@ -63,10 +63,10 @@ public class DanishPig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -175,12 +175,12 @@ public class DanishPig { openapiRequiredFields.add("className"); } - /** - * 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 DanishPig - */ + /** + * 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 DanishPig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DanishPig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -272,22 +272,22 @@ public class DanishPig { } } - /** - * Create an instance of DanishPig given an JSON string - * - * @param jsonString JSON string - * @return An instance of DanishPig - * @throws IOException if the JSON string is invalid with respect to DanishPig - */ + /** + * Create an instance of DanishPig given an JSON string + * + * @param jsonString JSON string + * @return An instance of DanishPig + * @throws IOException if the JSON string is invalid with respect to DanishPig + */ public static DanishPig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DanishPig.class); } - /** - * Convert an instance of DanishPig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DanishPig 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/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java index a2a2bc5728b..7a69bc6abb9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -65,10 +65,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -176,12 +176,12 @@ public class DeprecatedObject { 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 DeprecatedObject - */ + /** + * 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 DeprecatedObject + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DeprecatedObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class DeprecatedObject { } } - /** - * Create an instance of DeprecatedObject given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeprecatedObject - * @throws IOException if the JSON string is invalid with respect to DeprecatedObject - */ + /** + * Create an instance of DeprecatedObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeprecatedObject + * @throws IOException if the JSON string is invalid with respect to DeprecatedObject + */ public static DeprecatedObject fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DeprecatedObject.class); } - /** - * Convert an instance of DeprecatedObject to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DeprecatedObject 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/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index dff23ef5674..128c44e7097 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -65,10 +65,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { return breed; @@ -181,12 +181,12 @@ public class Dog extends Animal { openapiRequiredFields.add("className"); } - /** - * 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 Dog - */ + /** + * 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 Dog + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Dog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -274,22 +274,22 @@ public class Dog extends Animal { } } - /** - * Create an instance of Dog given an JSON string - * - * @param jsonString JSON string - * @return An instance of Dog - * @throws IOException if the JSON string is invalid with respect to Dog - */ + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ public static Dog fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Dog.class); } - /** - * Convert an instance of Dog to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Dog 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/Drawing.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java index 4ce48fc6b1b..383c8910c8f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java @@ -82,10 +82,10 @@ public class Drawing { return this; } - /** + /** * Get mainShape * @return mainShape - **/ + */ @javax.annotation.Nullable public Shape getMainShape() { return mainShape; @@ -101,10 +101,10 @@ public class Drawing { return this; } - /** + /** * Get shapeOrNull * @return shapeOrNull - **/ + */ @javax.annotation.Nullable public ShapeOrNull getShapeOrNull() { return shapeOrNull; @@ -120,10 +120,10 @@ public class Drawing { return this; } - /** + /** * Get nullableShape * @return nullableShape - **/ + */ @javax.annotation.Nullable public NullableShape getNullableShape() { return nullableShape; @@ -147,10 +147,10 @@ public class Drawing { return this; } - /** + /** * Get shapes * @return shapes - **/ + */ @javax.annotation.Nullable public List getShapes() { return shapes; @@ -278,12 +278,12 @@ public class Drawing { 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 Drawing - */ + /** + * 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 Drawing + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Drawing.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -391,22 +391,22 @@ public class Drawing { } } - /** - * Create an instance of Drawing given an JSON string - * - * @param jsonString JSON string - * @return An instance of Drawing - * @throws IOException if the JSON string is invalid with respect to Drawing - */ + /** + * Create an instance of Drawing given an JSON string + * + * @param jsonString JSON string + * @return An instance of Drawing + * @throws IOException if the JSON string is invalid with respect to Drawing + */ public static Drawing fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Drawing.class); } - /** - * Convert an instance of Drawing to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Drawing 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/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java index b0e4d1261a1..a3e0184f83b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -173,10 +173,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -200,10 +200,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { return arrayEnum; @@ -314,12 +314,12 @@ public class EnumArrays { 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 EnumArrays - */ + /** + * 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 EnumArrays + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumArrays.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -412,22 +412,22 @@ public class EnumArrays { } } - /** - * Create an instance of EnumArrays given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumArrays - * @throws IOException if the JSON string is invalid with respect to EnumArrays - */ + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ public static EnumArrays fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumArrays.class); } - /** - * Convert an instance of EnumArrays to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumArrays 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/EnumStringDiscriminator.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java index 36d63227905..8d56f3784fd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java @@ -115,10 +115,10 @@ public class EnumStringDiscriminator { return this; } - /** + /** * enum string type * @return enumStrType - **/ + */ @javax.annotation.Nonnull public EnumStrTypeEnum getEnumStrType() { return enumStrType; @@ -227,12 +227,12 @@ public class EnumStringDiscriminator { openapiRequiredFields.add("enum_str_type"); } - /** - * 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 EnumStringDiscriminator - */ + /** + * 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 EnumStringDiscriminator + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumStringDiscriminator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -320,22 +320,22 @@ public class EnumStringDiscriminator { } } - /** - * Create an instance of EnumStringDiscriminator given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumStringDiscriminator - * @throws IOException if the JSON string is invalid with respect to EnumStringDiscriminator - */ + /** + * Create an instance of EnumStringDiscriminator given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumStringDiscriminator + * @throws IOException if the JSON string is invalid with respect to EnumStringDiscriminator + */ public static EnumStringDiscriminator fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumStringDiscriminator.class); } - /** - * Convert an instance of EnumStringDiscriminator to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumStringDiscriminator 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/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index f97e8b578ce..a0648223438 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -364,10 +364,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { return enumString; @@ -383,10 +383,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -402,10 +402,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -421,10 +421,10 @@ public class EnumTest { return this; } - /** + /** * Get enumIntegerOnly * @return enumIntegerOnly - **/ + */ @javax.annotation.Nullable public EnumIntegerOnlyEnum getEnumIntegerOnly() { return enumIntegerOnly; @@ -440,10 +440,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -459,10 +459,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { return outerEnum; @@ -478,10 +478,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; @@ -497,10 +497,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; @@ -516,10 +516,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; @@ -663,12 +663,12 @@ public class EnumTest { openapiRequiredFields.add("enum_string_required"); } - /** - * 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 EnumTest - */ + /** + * 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 EnumTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EnumTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -797,22 +797,22 @@ public class EnumTest { } } - /** - * Create an instance of EnumTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of EnumTest - * @throws IOException if the JSON string is invalid with respect to EnumTest - */ + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ public static EnumTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EnumTest.class); } - /** - * Convert an instance of EnumTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EnumTest 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/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 76e63ae80dd..596a5151ae6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -67,10 +67,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -86,10 +86,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull public String getTriangleType() { return triangleType; @@ -202,12 +202,12 @@ public class EquilateralTriangle { openapiRequiredFields.add("triangleType"); } - /** - * 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 EquilateralTriangle - */ + /** + * 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 EquilateralTriangle + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!EquilateralTriangle.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -302,22 +302,22 @@ public class EquilateralTriangle { } } - /** - * Create an instance of EquilateralTriangle given an JSON string - * - * @param jsonString JSON string - * @return An instance of EquilateralTriangle - * @throws IOException if the JSON string is invalid with respect to EquilateralTriangle - */ + /** + * Create an instance of EquilateralTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of EquilateralTriangle + * @throws IOException if the JSON string is invalid with respect to EquilateralTriangle + */ public static EquilateralTriangle fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, EquilateralTriangle.class); } - /** - * Convert an instance of EquilateralTriangle to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of EquilateralTriangle 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/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 50b4cfdc340..ec92b1f0d66 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,10 +70,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { return _file; @@ -97,10 +97,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { return files; @@ -211,12 +211,12 @@ public class FileSchemaTestClass { 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 FileSchemaTestClass - */ + /** + * 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 FileSchemaTestClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FileSchemaTestClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -316,22 +316,22 @@ public class FileSchemaTestClass { } } - /** - * Create an instance of FileSchemaTestClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of FileSchemaTestClass - * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass - */ + /** + * Create an instance of FileSchemaTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileSchemaTestClass + * @throws IOException if the JSON string is invalid with respect to FileSchemaTestClass + */ public static FileSchemaTestClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FileSchemaTestClass.class); } - /** - * Convert an instance of FileSchemaTestClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FileSchemaTestClass 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/Foo.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java index 762a886f030..0b1b139d3c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java @@ -63,10 +63,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -174,12 +174,12 @@ public class Foo { 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 Foo - */ + /** + * 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 Foo + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Foo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class Foo { } } - /** - * Create an instance of Foo given an JSON string - * - * @param jsonString JSON string - * @return An instance of Foo - * @throws IOException if the JSON string is invalid with respect to Foo - */ + /** + * Create an instance of Foo given an JSON string + * + * @param jsonString JSON string + * @return An instance of Foo + * @throws IOException if the JSON string is invalid with respect to Foo + */ public static Foo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Foo.class); } - /** - * Convert an instance of Foo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Foo 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/FooGetDefaultResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index d5ac659fd99..06129a8d9ed 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -64,10 +64,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public Foo getString() { return string; @@ -175,12 +175,12 @@ public class FooGetDefaultResponse { 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 FooGetDefaultResponse - */ + /** + * 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 FooGetDefaultResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FooGetDefaultResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -266,22 +266,22 @@ public class FooGetDefaultResponse { } } - /** - * Create an instance of FooGetDefaultResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of FooGetDefaultResponse - * @throws IOException if the JSON string is invalid with respect to FooGetDefaultResponse - */ + /** + * Create an instance of FooGetDefaultResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FooGetDefaultResponse + * @throws IOException if the JSON string is invalid with respect to FooGetDefaultResponse + */ public static FooGetDefaultResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FooGetDefaultResponse.class); } - /** - * Convert an instance of FooGetDefaultResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FooGetDefaultResponse 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/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index 3a3179b2e38..d60e21d0ef6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -132,12 +132,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { return integer; @@ -153,12 +153,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { return int32; @@ -174,10 +174,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { return int64; @@ -193,12 +193,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { return number; @@ -214,12 +214,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { return _float; @@ -235,12 +235,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { return _double; @@ -256,10 +256,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable public BigDecimal getDecimal() { return decimal; @@ -275,10 +275,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { return string; @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { return _byte; @@ -313,10 +313,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { return binary; @@ -332,10 +332,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { return date; @@ -351,10 +351,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -370,10 +370,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -389,10 +389,10 @@ public class FormatTest { return this; } - /** + /** * Get uuidWithDefault * @return uuidWithDefault - **/ + */ @javax.annotation.Nullable public UUID getUuidWithDefault() { return uuidWithDefault; @@ -408,10 +408,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { return password; @@ -427,10 +427,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable public String getPatternWithDigits() { return patternWithDigits; @@ -446,10 +446,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable public String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; @@ -609,12 +609,12 @@ public class FormatTest { openapiRequiredFields.add("password"); } - /** - * 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 FormatTest - */ + /** + * 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 FormatTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FormatTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -721,22 +721,22 @@ public class FormatTest { } } - /** - * Create an instance of FormatTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormatTest - * @throws IOException if the JSON string is invalid with respect to FormatTest - */ + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ public static FormatTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FormatTest.class); } - /** - * Convert an instance of FormatTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FormatTest 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 index da0b9077cda..8e9560beb4b 100644 --- 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 @@ -68,10 +68,10 @@ public class FreeFormObjectTestClass { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -87,10 +87,10 @@ public class FreeFormObjectTestClass { return this; } - /** + /** * Get properties * @return properties - **/ + */ @javax.annotation.Nullable public FreeFormObjectTestClassProperties getProperties() { return properties; @@ -201,12 +201,12 @@ public class FreeFormObjectTestClass { 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 - */ + /** + * 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 @@ -295,22 +295,22 @@ public class FreeFormObjectTestClass { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index ec36a1dd8d4..9ea484ee72f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -64,10 +64,10 @@ public class GrandparentAnimal { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nonnull public String getPetType() { return petType; @@ -176,12 +176,12 @@ public class GrandparentAnimal { openapiRequiredFields.add("pet_type"); } - /** - * 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 GrandparentAnimal - */ + /** + * 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 GrandparentAnimal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GrandparentAnimal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -200,22 +200,22 @@ public class GrandparentAnimal { } - /** - * Create an instance of GrandparentAnimal given an JSON string - * - * @param jsonString JSON string - * @return An instance of GrandparentAnimal - * @throws IOException if the JSON string is invalid with respect to GrandparentAnimal - */ + /** + * Create an instance of GrandparentAnimal given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrandparentAnimal + * @throws IOException if the JSON string is invalid with respect to GrandparentAnimal + */ public static GrandparentAnimal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GrandparentAnimal.class); } - /** - * Convert an instance of GrandparentAnimal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GrandparentAnimal 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/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 49b52bb5381..85e755b6cab 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -71,10 +71,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -82,10 +82,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { return foo; @@ -193,12 +193,12 @@ public class HasOnlyReadOnly { 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 HasOnlyReadOnly - */ + /** + * 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 HasOnlyReadOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -286,22 +286,22 @@ public class HasOnlyReadOnly { } } - /** - * Create an instance of HasOnlyReadOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of HasOnlyReadOnly - * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly - */ + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); } - /** - * Convert an instance of HasOnlyReadOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HasOnlyReadOnly 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/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 72819176f91..07df6b71872 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -64,10 +64,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable public String getNullableMessage() { return nullableMessage; @@ -186,12 +186,12 @@ public class HealthCheckResult { 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 HealthCheckResult - */ + /** + * 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 HealthCheckResult + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HealthCheckResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -276,22 +276,22 @@ public class HealthCheckResult { } } - /** - * Create an instance of HealthCheckResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of HealthCheckResult - * @throws IOException if the JSON string is invalid with respect to HealthCheckResult - */ + /** + * Create an instance of HealthCheckResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of HealthCheckResult + * @throws IOException if the JSON string is invalid with respect to HealthCheckResult + */ public static HealthCheckResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HealthCheckResult.class); } - /** - * Convert an instance of HealthCheckResult to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HealthCheckResult 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/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index bbf56d8a551..01e848ed753 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -67,10 +67,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -86,10 +86,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull public String getTriangleType() { return triangleType; @@ -156,12 +156,12 @@ public class IsoscelesTriangle { openapiRequiredFields.add("triangleType"); } - /** - * 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 IsoscelesTriangle - */ + /** + * 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 IsoscelesTriangle + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!IsoscelesTriangle.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -221,22 +221,22 @@ public class IsoscelesTriangle { } } - /** - * Create an instance of IsoscelesTriangle given an JSON string - * - * @param jsonString JSON string - * @return An instance of IsoscelesTriangle - * @throws IOException if the JSON string is invalid with respect to IsoscelesTriangle - */ + /** + * Create an instance of IsoscelesTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsoscelesTriangle + * @throws IOException if the JSON string is invalid with respect to IsoscelesTriangle + */ public static IsoscelesTriangle fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, IsoscelesTriangle.class); } - /** - * Convert an instance of IsoscelesTriangle to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of IsoscelesTriangle 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/MammalAnyof.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MammalAnyof.java new file mode 100644 index 00000000000..544e456b00c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -0,0 +1,311 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto 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.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + + + +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 MammalAnyof extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MammalAnyof.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MammalAnyof.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MammalAnyof' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWhale = gson.getDelegateAdapter(this, TypeToken.get(Whale.class)); + final TypeAdapter adapterZebra = gson.getDelegateAdapter(this, TypeToken.get(Zebra.class)); + final TypeAdapter adapterPig = gson.getDelegateAdapter(this, TypeToken.get(Pig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MammalAnyof value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Whale` + if (value.getActualInstance() instanceof Whale) { + JsonElement element = adapterWhale.toJsonTree((Whale)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Zebra` + if (value.getActualInstance() instanceof Zebra) { + JsonElement element = adapterZebra.toJsonTree((Zebra)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Pig` + if (value.getActualInstance() instanceof Pig) { + JsonElement element = adapterPig.toJsonTree((Pig)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Pig, Whale, Zebra"); + } + + @Override + public MammalAnyof read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Whale + try { + // validate the JSON object to see if any exception is thrown + Whale.validateJsonElement(jsonElement); + actualAdapter = adapterWhale; + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Whale'", e); + } + // deserialize Zebra + try { + // validate the JSON object to see if any exception is thrown + Zebra.validateJsonElement(jsonElement); + actualAdapter = adapterZebra; + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); + } + // deserialize Pig + try { + // validate the JSON object to see if any exception is thrown + Pig.validateJsonElement(jsonElement); + actualAdapter = adapterPig; + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Pig'", e); + } + + throw new IOException(String.format("Failed deserialization for MammalAnyof: 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 MammalAnyof() { + super("anyOf", Boolean.FALSE); + } + + public MammalAnyof(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Whale", Whale.class); + schemas.put("Zebra", Zebra.class); + schemas.put("Pig", Pig.class); + } + + @Override + public Map> getSchemas() { + return MammalAnyof.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Pig, Whale, Zebra + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Whale) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Zebra) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Pig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + /** + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)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 MammalAnyof + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Whale + try { + Whale.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Whale failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Zebra + try { + Zebra.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Zebra failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Pig + try { + Pig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Pig failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for MammalAnyof with anyOf schemas: Pig, Whale, Zebra. 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 MammalAnyof given an JSON string + * + * @param jsonString JSON string + * @return An instance of MammalAnyof + * @throws IOException if the JSON string is invalid with respect to MammalAnyof + */ + public static MammalAnyof fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MammalAnyof.class); + } + + /** + * Convert an instance of MammalAnyof 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/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index ade5bab0bef..05afecfff3f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -137,10 +137,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { return mapMapOfString; @@ -164,10 +164,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { return mapOfEnumString; @@ -191,10 +191,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { return directMap; @@ -218,10 +218,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { return indirectMap; @@ -338,12 +338,12 @@ public class MapTest { 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 MapTest - */ + /** + * 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 MapTest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MapTest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -425,22 +425,22 @@ public class MapTest { } } - /** - * Create an instance of MapTest given an JSON string - * - * @param jsonString JSON string - * @return An instance of MapTest - * @throws IOException if the JSON string is invalid with respect to MapTest - */ + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ public static MapTest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MapTest.class); } - /** - * Convert an instance of MapTest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MapTest 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/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6cd5175e3d4..f9b6d9c655e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -76,10 +76,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { return uuid; @@ -95,10 +95,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { return dateTime; @@ -122,10 +122,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { return map; @@ -239,12 +239,12 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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 MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * 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 MixedPropertiesAndAdditionalPropertiesClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -329,22 +329,22 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } } - /** - * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of MixedPropertiesAndAdditionalPropertiesClass - * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass - */ + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); } - /** - * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass 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/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java index c5a09d65727..bb94f11d354 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,10 +67,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { return name; @@ -86,10 +86,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { return propertyClass; @@ -200,12 +200,12 @@ public class Model200Response { 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 Model200Response - */ + /** + * 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 Model200Response + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Model200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -290,22 +290,22 @@ public class Model200Response { } } - /** - * Create an instance of Model200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of Model200Response - * @throws IOException if the JSON string is invalid with respect to Model200Response - */ + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ public static Model200Response fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Model200Response.class); } - /** - * Convert an instance of Model200Response to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Model200Response 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/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ecb93790cc2..e943af127c3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,10 +71,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { return code; @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -226,12 +226,12 @@ public class ModelApiResponse { 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 - */ + /** + * 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 @@ -319,22 +319,22 @@ public class ModelApiResponse { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java index eaa325997ae..09a7dfb3180 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,10 +63,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { return sourceURI; @@ -174,12 +174,12 @@ public class ModelFile { 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 ModelFile - */ + /** + * 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 ModelFile + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class ModelFile { } } - /** - * Create an instance of ModelFile given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelFile - * @throws IOException if the JSON string is invalid with respect to ModelFile - */ + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ public static ModelFile fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelFile.class); } - /** - * Convert an instance of ModelFile to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelFile 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/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java index b17dab803e5..c64a22f640c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,10 +63,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { return _123list; @@ -174,12 +174,12 @@ public class ModelList { 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 ModelList - */ + /** + * 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 ModelList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class ModelList { } } - /** - * Create an instance of ModelList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelList - * @throws IOException if the JSON string is invalid with respect to ModelList - */ + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ public static ModelList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelList.class); } - /** - * Convert an instance of ModelList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelList 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/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java index 781a8d27789..81c12d09ce6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -63,10 +63,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { return _return; @@ -174,12 +174,12 @@ public class ModelReturn { 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 ModelReturn - */ + /** + * 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 ModelReturn + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelReturn.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -261,22 +261,22 @@ public class ModelReturn { } } - /** - * Create an instance of ModelReturn given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelReturn - * @throws IOException if the JSON string is invalid with respect to ModelReturn - */ + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ public static ModelReturn fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelReturn.class); } - /** - * Convert an instance of ModelReturn to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelReturn 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/ModelWithOneOfAnyOfProperties.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelWithOneOfAnyOfProperties.java index c6c532e6bf2..93daa9dbcfd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelWithOneOfAnyOfProperties.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelWithOneOfAnyOfProperties.java @@ -69,10 +69,10 @@ public class ModelWithOneOfAnyOfProperties { return this; } - /** + /** * Get oneofProp * @return oneofProp - **/ + */ @javax.annotation.Nullable public ArrayOneOf getOneofProp() { return oneofProp; @@ -88,10 +88,10 @@ public class ModelWithOneOfAnyOfProperties { return this; } - /** + /** * Get anyofProp * @return anyofProp - **/ + */ @javax.annotation.Nullable public ArrayAnyOf getAnyofProp() { return anyofProp; @@ -202,12 +202,12 @@ public class ModelWithOneOfAnyOfProperties { 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 ModelWithOneOfAnyOfProperties - */ + /** + * 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 ModelWithOneOfAnyOfProperties + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ModelWithOneOfAnyOfProperties.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -297,22 +297,22 @@ public class ModelWithOneOfAnyOfProperties { } } - /** - * Create an instance of ModelWithOneOfAnyOfProperties given an JSON string - * - * @param jsonString JSON string - * @return An instance of ModelWithOneOfAnyOfProperties - * @throws IOException if the JSON string is invalid with respect to ModelWithOneOfAnyOfProperties - */ + /** + * Create an instance of ModelWithOneOfAnyOfProperties given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelWithOneOfAnyOfProperties + * @throws IOException if the JSON string is invalid with respect to ModelWithOneOfAnyOfProperties + */ public static ModelWithOneOfAnyOfProperties fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ModelWithOneOfAnyOfProperties.class); } - /** - * Convert an instance of ModelWithOneOfAnyOfProperties to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ModelWithOneOfAnyOfProperties 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/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java index 7f8f4844253..b47a0d6028a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java @@ -84,10 +84,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { return name; @@ -98,10 +98,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { return snakeCase; @@ -114,10 +114,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { return property; @@ -128,10 +128,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { return _123number; @@ -246,12 +246,12 @@ public class Name { openapiRequiredFields.add("name"); } - /** - * 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 Name - */ + /** + * 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 Name + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Name.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -343,22 +343,22 @@ public class Name { } } - /** - * Create an instance of Name given an JSON string - * - * @param jsonString JSON string - * @return An instance of Name - * @throws IOException if the JSON string is invalid with respect to Name - */ + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ public static Name fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Name.class); } - /** - * Convert an instance of Name to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Name 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/NewPet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPet.java index b89a83e7698..d44e27743bc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPet.java @@ -68,6 +68,14 @@ public class NewPet { @SerializedName(SERIALIZED_NAME_CATEGORY_ALL_OF_REF) private Category categoryAllOfRef; + public static final String SERIALIZED_NAME_CATEGORY_ALL_OF_REF_DESCRIPTION = "category_allOf_ref_description"; + @SerializedName(SERIALIZED_NAME_CATEGORY_ALL_OF_REF_DESCRIPTION) + private Category categoryAllOfRefDescription; + + public static final String SERIALIZED_NAME_CATEGORY_ALL_OF_REF_DESCRIPTION_READONLY = "category_allOf_ref_description_readonly"; + @SerializedName(SERIALIZED_NAME_CATEGORY_ALL_OF_REF_DESCRIPTION_READONLY) + private Category categoryAllOfRefDescriptionReadonly; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -141,15 +149,22 @@ public class NewPet { public NewPet() { } + public NewPet( + Category categoryAllOfRefDescriptionReadonly + ) { + this(); + this.categoryAllOfRefDescriptionReadonly = categoryAllOfRefDescriptionReadonly; + } + public NewPet id(Long id) { this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -165,10 +180,10 @@ public class NewPet { return this; } - /** + /** * Get categoryInlineAllof * @return categoryInlineAllof - **/ + */ @javax.annotation.Nullable public NewPetCategoryInlineAllof getCategoryInlineAllof() { return categoryInlineAllof; @@ -184,10 +199,10 @@ public class NewPet { return this; } - /** + /** * Get categoryAllOfRef * @return categoryAllOfRef - **/ + */ @javax.annotation.Nullable public Category getCategoryAllOfRef() { return categoryAllOfRef; @@ -198,15 +213,45 @@ public class NewPet { } + public NewPet categoryAllOfRefDescription(Category categoryAllOfRefDescription) { + this.categoryAllOfRefDescription = categoryAllOfRefDescription; + return this; + } + + /** + * Adding description to property using allOf + * @return categoryAllOfRefDescription + */ + @javax.annotation.Nullable + public Category getCategoryAllOfRefDescription() { + return categoryAllOfRefDescription; + } + + public void setCategoryAllOfRefDescription(Category categoryAllOfRefDescription) { + this.categoryAllOfRefDescription = categoryAllOfRefDescription; + } + + + /** + * Adding description to readonly property using allOf + * @return categoryAllOfRefDescriptionReadonly + */ + @javax.annotation.Nullable + public Category getCategoryAllOfRefDescriptionReadonly() { + return categoryAllOfRefDescriptionReadonly; + } + + + public NewPet name(String name) { this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -230,10 +275,10 @@ public class NewPet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -257,10 +302,10 @@ public class NewPet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -276,10 +321,10 @@ public class NewPet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -347,6 +392,8 @@ public class NewPet { return Objects.equals(this.id, newPet.id) && Objects.equals(this.categoryInlineAllof, newPet.categoryInlineAllof) && Objects.equals(this.categoryAllOfRef, newPet.categoryAllOfRef) && + Objects.equals(this.categoryAllOfRefDescription, newPet.categoryAllOfRefDescription) && + Objects.equals(this.categoryAllOfRefDescriptionReadonly, newPet.categoryAllOfRefDescriptionReadonly) && Objects.equals(this.name, newPet.name) && Objects.equals(this.photoUrls, newPet.photoUrls) && Objects.equals(this.tags, newPet.tags) && @@ -356,7 +403,7 @@ public class NewPet { @Override public int hashCode() { - return Objects.hash(id, categoryInlineAllof, categoryAllOfRef, name, photoUrls, tags, status, additionalProperties); + return Objects.hash(id, categoryInlineAllof, categoryAllOfRef, categoryAllOfRefDescription, categoryAllOfRefDescriptionReadonly, name, photoUrls, tags, status, additionalProperties); } @Override @@ -366,6 +413,8 @@ public class NewPet { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" categoryInlineAllof: ").append(toIndentedString(categoryInlineAllof)).append("\n"); sb.append(" categoryAllOfRef: ").append(toIndentedString(categoryAllOfRef)).append("\n"); + sb.append(" categoryAllOfRefDescription: ").append(toIndentedString(categoryAllOfRefDescription)).append("\n"); + sb.append(" categoryAllOfRefDescriptionReadonly: ").append(toIndentedString(categoryAllOfRefDescriptionReadonly)).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"); @@ -396,6 +445,8 @@ public class NewPet { openapiFields.add("id"); openapiFields.add("category_inline_allof"); openapiFields.add("category_allOf_ref"); + openapiFields.add("category_allOf_ref_description"); + openapiFields.add("category_allOf_ref_description_readonly"); openapiFields.add("name"); openapiFields.add("photoUrls"); openapiFields.add("tags"); @@ -407,12 +458,12 @@ public class NewPet { 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 NewPet - */ + /** + * 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 NewPet + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NewPet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -435,6 +486,14 @@ public class NewPet { if (jsonObj.get("category_allOf_ref") != null && !jsonObj.get("category_allOf_ref").isJsonNull()) { Category.validateJsonElement(jsonObj.get("category_allOf_ref")); } + // validate the optional field `category_allOf_ref_description` + if (jsonObj.get("category_allOf_ref_description") != null && !jsonObj.get("category_allOf_ref_description").isJsonNull()) { + Category.validateJsonElement(jsonObj.get("category_allOf_ref_description")); + } + // validate the optional field `category_allOf_ref_description_readonly` + if (jsonObj.get("category_allOf_ref_description_readonly") != null && !jsonObj.get("category_allOf_ref_description_readonly").isJsonNull()) { + Category.validateJsonElement(jsonObj.get("category_allOf_ref_description_readonly")); + } 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())); } @@ -539,22 +598,22 @@ public class NewPet { } } - /** - * Create an instance of NewPet given an JSON string - * - * @param jsonString JSON string - * @return An instance of NewPet - * @throws IOException if the JSON string is invalid with respect to NewPet - */ + /** + * Create an instance of NewPet given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewPet + * @throws IOException if the JSON string is invalid with respect to NewPet + */ public static NewPet fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NewPet.class); } - /** - * Convert an instance of NewPet to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NewPet 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/NewPetCategoryInlineAllof.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllof.java index 20b217619f2..c6d68ba6770 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllof.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllof.java @@ -72,10 +72,10 @@ public class NewPetCategoryInlineAllof { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -91,10 +91,10 @@ public class NewPetCategoryInlineAllof { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -110,10 +110,10 @@ public class NewPetCategoryInlineAllof { return this; } - /** + /** * Get categoryTag * @return categoryTag - **/ + */ @javax.annotation.Nullable public NewPetCategoryInlineAllofAllOfCategoryTag getCategoryTag() { return categoryTag; @@ -228,12 +228,12 @@ public class NewPetCategoryInlineAllof { openapiRequiredFields.add("name"); } - /** - * 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 NewPetCategoryInlineAllof - */ + /** + * 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 NewPetCategoryInlineAllof + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NewPetCategoryInlineAllof.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -329,22 +329,22 @@ public class NewPetCategoryInlineAllof { } } - /** - * Create an instance of NewPetCategoryInlineAllof given an JSON string - * - * @param jsonString JSON string - * @return An instance of NewPetCategoryInlineAllof - * @throws IOException if the JSON string is invalid with respect to NewPetCategoryInlineAllof - */ + /** + * Create an instance of NewPetCategoryInlineAllof given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewPetCategoryInlineAllof + * @throws IOException if the JSON string is invalid with respect to NewPetCategoryInlineAllof + */ public static NewPetCategoryInlineAllof fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NewPetCategoryInlineAllof.class); } - /** - * Convert an instance of NewPetCategoryInlineAllof to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NewPetCategoryInlineAllof 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/NewPetCategoryInlineAllofAllOfCategoryTag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllofAllOfCategoryTag.java index 48b898b61b5..c08e756b968 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllofAllOfCategoryTag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NewPetCategoryInlineAllofAllOfCategoryTag.java @@ -67,10 +67,10 @@ public class NewPetCategoryInlineAllofAllOfCategoryTag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class NewPetCategoryInlineAllofAllOfCategoryTag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class NewPetCategoryInlineAllofAllOfCategoryTag { 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 NewPetCategoryInlineAllofAllOfCategoryTag - */ + /** + * 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 NewPetCategoryInlineAllofAllOfCategoryTag + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NewPetCategoryInlineAllofAllOfCategoryTag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -290,22 +290,22 @@ public class NewPetCategoryInlineAllofAllOfCategoryTag { } } - /** - * Create an instance of NewPetCategoryInlineAllofAllOfCategoryTag given an JSON string - * - * @param jsonString JSON string - * @return An instance of NewPetCategoryInlineAllofAllOfCategoryTag - * @throws IOException if the JSON string is invalid with respect to NewPetCategoryInlineAllofAllOfCategoryTag - */ + /** + * Create an instance of NewPetCategoryInlineAllofAllOfCategoryTag given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewPetCategoryInlineAllofAllOfCategoryTag + * @throws IOException if the JSON string is invalid with respect to NewPetCategoryInlineAllofAllOfCategoryTag + */ public static NewPetCategoryInlineAllofAllOfCategoryTag fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NewPetCategoryInlineAllofAllOfCategoryTag.class); } - /** - * Convert an instance of NewPetCategoryInlineAllofAllOfCategoryTag to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NewPetCategoryInlineAllofAllOfCategoryTag 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/NullableClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java index 48dfef7b705..46d2854d930 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java @@ -115,10 +115,10 @@ public class NullableClass { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable public Integer getIntegerProp() { return integerProp; @@ -134,10 +134,10 @@ public class NullableClass { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable public BigDecimal getNumberProp() { return numberProp; @@ -153,10 +153,10 @@ public class NullableClass { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable public Boolean getBooleanProp() { return booleanProp; @@ -172,10 +172,10 @@ public class NullableClass { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable public String getStringProp() { return stringProp; @@ -191,10 +191,10 @@ public class NullableClass { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable public LocalDate getDateProp() { return dateProp; @@ -210,10 +210,10 @@ public class NullableClass { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDatetimeProp() { return datetimeProp; @@ -237,10 +237,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable public List getArrayNullableProp() { return arrayNullableProp; @@ -264,10 +264,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable public List getArrayAndItemsNullableProp() { return arrayAndItemsNullableProp; @@ -291,10 +291,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable public List getArrayItemsNullable() { return arrayItemsNullable; @@ -318,10 +318,10 @@ public class NullableClass { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable public Map getObjectNullableProp() { return objectNullableProp; @@ -345,10 +345,10 @@ public class NullableClass { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable public Map getObjectAndItemsNullableProp() { return objectAndItemsNullableProp; @@ -372,10 +372,10 @@ public class NullableClass { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable public Map getObjectItemsNullable() { return objectItemsNullable; @@ -527,12 +527,12 @@ public class NullableClass { 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 NullableClass - */ + /** + * 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 NullableClass + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NullableClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -629,22 +629,22 @@ public class NullableClass { } } - /** - * Create an instance of NullableClass given an JSON string - * - * @param jsonString JSON string - * @return An instance of NullableClass - * @throws IOException if the JSON string is invalid with respect to NullableClass - */ + /** + * Create an instance of NullableClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of NullableClass + * @throws IOException if the JSON string is invalid with respect to NullableClass + */ public static NullableClass fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NullableClass.class); } - /** - * Convert an instance of NullableClass to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NullableClass 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/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java index c6063325552..cc504e31f28 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,10 +64,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { return justNumber; @@ -175,12 +175,12 @@ public class NumberOnly { 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 NumberOnly - */ + /** + * 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 NumberOnly + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NumberOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -262,22 +262,22 @@ public class NumberOnly { } } - /** - * Create an instance of NumberOnly given an JSON string - * - * @param jsonString JSON string - * @return An instance of NumberOnly - * @throws IOException if the JSON string is invalid with respect to NumberOnly - */ + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ public static NumberOnly fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NumberOnly.class); } - /** - * Convert an instance of NumberOnly to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NumberOnly 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/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 4fdabf7ae6e..0b6ed2a8093 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -82,10 +82,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public String getUuid() { return uuid; @@ -102,11 +102,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public BigDecimal getId() { @@ -125,11 +125,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public DeprecatedObject getDeprecatedRef() { @@ -156,11 +156,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable public List getBars() { @@ -279,12 +279,12 @@ public class ObjectWithDeprecatedFields { 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 ObjectWithDeprecatedFields - */ + /** + * 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 ObjectWithDeprecatedFields + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectWithDeprecatedFields.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -377,22 +377,22 @@ public class ObjectWithDeprecatedFields { } } - /** - * Create an instance of ObjectWithDeprecatedFields given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectWithDeprecatedFields - * @throws IOException if the JSON string is invalid with respect to ObjectWithDeprecatedFields - */ + /** + * Create an instance of ObjectWithDeprecatedFields given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectWithDeprecatedFields + * @throws IOException if the JSON string is invalid with respect to ObjectWithDeprecatedFields + */ public static ObjectWithDeprecatedFields fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectWithDeprecatedFields.class); } - /** - * Convert an instance of ObjectWithDeprecatedFields to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectWithDeprecatedFields 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/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index 279d5e72bb4..345e3614f99 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { return petId; @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { return quantity; @@ -195,10 +195,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { return shipDate; @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { return complete; @@ -359,12 +359,12 @@ public class Order { 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 - */ + /** + * 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 @@ -453,22 +453,22 @@ public class Order { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index 61af315efe2..bf3e98c9847 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -72,10 +72,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { return myNumber; @@ -91,10 +91,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { return myString; @@ -110,10 +110,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { return myBoolean; @@ -227,12 +227,12 @@ public class OuterComposite { 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 OuterComposite - */ + /** + * 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 OuterComposite + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!OuterComposite.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -317,22 +317,22 @@ public class OuterComposite { } } - /** - * Create an instance of OuterComposite given an JSON string - * - * @param jsonString JSON string - * @return An instance of OuterComposite - * @throws IOException if the JSON string is invalid with respect to OuterComposite - */ + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ public static OuterComposite fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, OuterComposite.class); } - /** - * Convert an instance of OuterComposite to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of OuterComposite 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/ParentPet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java index 4134962f876..8b9d436e733 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java @@ -152,12 +152,12 @@ public class ParentPet extends GrandparentAnimal { openapiRequiredFields.add("pet_type"); } - /** - * 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 ParentPet - */ + /** + * 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 ParentPet + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ParentPet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -245,22 +245,22 @@ public class ParentPet extends GrandparentAnimal { } } - /** - * Create an instance of ParentPet given an JSON string - * - * @param jsonString JSON string - * @return An instance of ParentPet - * @throws IOException if the JSON string is invalid with respect to ParentPet - */ + /** + * Create an instance of ParentPet given an JSON string + * + * @param jsonString JSON string + * @return An instance of ParentPet + * @throws IOException if the JSON string is invalid with respect to ParentPet + */ public static ParentPet fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ParentPet.class); } - /** - * Convert an instance of ParentPet to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ParentPet 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/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index 5773de74465..296e3a1f807 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -141,10 +141,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -179,10 +179,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -206,10 +206,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -252,10 +252,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -380,12 +380,12 @@ public class Pet { 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 - */ + /** + * 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 @@ -508,22 +508,22 @@ public class Pet { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetComposition.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetComposition.java index d2117279724..50ae42d8b26 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetComposition.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetComposition.java @@ -141,10 +141,10 @@ public class PetComposition { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class PetComposition { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -179,10 +179,10 @@ public class PetComposition { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -206,10 +206,10 @@ public class PetComposition { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class PetComposition { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -252,10 +252,10 @@ public class PetComposition { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -380,12 +380,12 @@ public class PetComposition { 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 PetComposition - */ + /** + * 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 PetComposition + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetComposition.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -508,22 +508,22 @@ public class PetComposition { } } - /** - * Create an instance of PetComposition given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetComposition - * @throws IOException if the JSON string is invalid with respect to PetComposition - */ + /** + * Create an instance of PetComposition given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetComposition + * @throws IOException if the JSON string is invalid with respect to PetComposition + */ public static PetComposition fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetComposition.class); } - /** - * Convert an instance of PetComposition to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetComposition 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/PetRef.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetRef.java index 1df59f380ce..53eeb460603 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetRef.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetRef.java @@ -141,10 +141,10 @@ public class PetRef { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class PetRef { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -179,10 +179,10 @@ public class PetRef { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -206,10 +206,10 @@ public class PetRef { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class PetRef { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -252,10 +252,10 @@ public class PetRef { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -380,12 +380,12 @@ public class PetRef { 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 PetRef - */ + /** + * 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 PetRef + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -508,22 +508,22 @@ public class PetRef { } } - /** - * Create an instance of PetRef given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetRef - * @throws IOException if the JSON string is invalid with respect to PetRef - */ + /** + * Create an instance of PetRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetRef + * @throws IOException if the JSON string is invalid with respect to PetRef + */ public static PetRef fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetRef.class); } - /** - * Convert an instance of PetRef to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetRef 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/PetUsingAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetUsingAllOf.java index 5938565ff6c..8a6752453f0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetUsingAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetUsingAllOf.java @@ -141,10 +141,10 @@ public class PetUsingAllOf { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class PetUsingAllOf { return this; } - /** + /** * multi line description 2nd line last line * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -179,10 +179,10 @@ public class PetUsingAllOf { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -206,10 +206,10 @@ public class PetUsingAllOf { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class PetUsingAllOf { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { return tags; @@ -252,10 +252,10 @@ public class PetUsingAllOf { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -380,12 +380,12 @@ public class PetUsingAllOf { 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 PetUsingAllOf - */ + /** + * 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 PetUsingAllOf + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetUsingAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -508,22 +508,22 @@ public class PetUsingAllOf { } } - /** - * Create an instance of PetUsingAllOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetUsingAllOf - * @throws IOException if the JSON string is invalid with respect to PetUsingAllOf - */ + /** + * Create an instance of PetUsingAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetUsingAllOf + * @throws IOException if the JSON string is invalid with respect to PetUsingAllOf + */ public static PetUsingAllOf fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetUsingAllOf.class); } - /** - * Convert an instance of PetUsingAllOf to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetUsingAllOf 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/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java index 119ce72b930..5a056b2c348 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java @@ -141,10 +141,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -160,10 +160,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { return category; @@ -179,10 +179,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -206,10 +206,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public List getPhotoUrls() { return photoUrls; @@ -233,10 +233,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nonnull public List getTags() { return tags; @@ -252,10 +252,10 @@ public class PetWithRequiredTags { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { return status; @@ -381,12 +381,12 @@ public class PetWithRequiredTags { openapiRequiredFields.add("tags"); } - /** - * 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 PetWithRequiredTags - */ + /** + * 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 PetWithRequiredTags + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PetWithRequiredTags.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -505,22 +505,22 @@ public class PetWithRequiredTags { } } - /** - * Create an instance of PetWithRequiredTags given an JSON string - * - * @param jsonString JSON string - * @return An instance of PetWithRequiredTags - * @throws IOException if the JSON string is invalid with respect to PetWithRequiredTags - */ + /** + * Create an instance of PetWithRequiredTags given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetWithRequiredTags + * @throws IOException if the JSON string is invalid with respect to PetWithRequiredTags + */ public static PetWithRequiredTags fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PetWithRequiredTags.class); } - /** - * Convert an instance of PetWithRequiredTags to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PetWithRequiredTags 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/PropertyNameCollision.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PropertyNameCollision.java index 2e445d029c5..cf2393b986d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PropertyNameCollision.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PropertyNameCollision.java @@ -71,10 +71,10 @@ public class PropertyNameCollision { return this; } - /** + /** * Get underscoreType * @return underscoreType - **/ + */ @javax.annotation.Nullable public String getUnderscoreType() { return underscoreType; @@ -90,10 +90,10 @@ public class PropertyNameCollision { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { return type; @@ -109,10 +109,10 @@ public class PropertyNameCollision { return this; } - /** + /** * Get typeWithUnderscore * @return typeWithUnderscore - **/ + */ @javax.annotation.Nullable public String getTypeWithUnderscore() { return typeWithUnderscore; @@ -226,12 +226,12 @@ public class PropertyNameCollision { 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 PropertyNameCollision - */ + /** + * 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 PropertyNameCollision + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PropertyNameCollision.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -322,22 +322,22 @@ public class PropertyNameCollision { } } - /** - * Create an instance of PropertyNameCollision given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyNameCollision - * @throws IOException if the JSON string is invalid with respect to PropertyNameCollision - */ + /** + * Create an instance of PropertyNameCollision given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyNameCollision + * @throws IOException if the JSON string is invalid with respect to PropertyNameCollision + */ public static PropertyNameCollision fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PropertyNameCollision.class); } - /** - * Convert an instance of PropertyNameCollision to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PropertyNameCollision 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/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 72423b46603..8f509a101b1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -63,10 +63,10 @@ public class QuadrilateralInterface { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull public String getQuadrilateralType() { return quadrilateralType; @@ -175,12 +175,12 @@ public class QuadrilateralInterface { openapiRequiredFields.add("quadrilateralType"); } - /** - * 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 QuadrilateralInterface - */ + /** + * 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 QuadrilateralInterface + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!QuadrilateralInterface.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -272,22 +272,22 @@ public class QuadrilateralInterface { } } - /** - * Create an instance of QuadrilateralInterface given an JSON string - * - * @param jsonString JSON string - * @return An instance of QuadrilateralInterface - * @throws IOException if the JSON string is invalid with respect to QuadrilateralInterface - */ + /** + * Create an instance of QuadrilateralInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuadrilateralInterface + * @throws IOException if the JSON string is invalid with respect to QuadrilateralInterface + */ public static QuadrilateralInterface fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QuadrilateralInterface.class); } - /** - * Convert an instance of QuadrilateralInterface to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of QuadrilateralInterface 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/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f80cae5ec7e..070ec540acf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -69,10 +69,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { return bar; @@ -85,10 +85,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { return baz; @@ -199,12 +199,12 @@ public class ReadOnlyFirst { 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 ReadOnlyFirst - */ + /** + * 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 ReadOnlyFirst + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ReadOnlyFirst.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -292,22 +292,22 @@ public class ReadOnlyFirst { } } - /** - * Create an instance of ReadOnlyFirst given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadOnlyFirst - * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst - */ + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ public static ReadOnlyFirst fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); } - /** - * Convert an instance of ReadOnlyFirst to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ReadOnlyFirst 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/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index a096a8004c2..48f86832ced 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -67,10 +67,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -86,10 +86,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull public String getTriangleType() { return triangleType; @@ -202,12 +202,12 @@ public class ScaleneTriangle { openapiRequiredFields.add("triangleType"); } - /** - * 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 ScaleneTriangle - */ + /** + * 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 ScaleneTriangle + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ScaleneTriangle.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -302,22 +302,22 @@ public class ScaleneTriangle { } } - /** - * Create an instance of ScaleneTriangle given an JSON string - * - * @param jsonString JSON string - * @return An instance of ScaleneTriangle - * @throws IOException if the JSON string is invalid with respect to ScaleneTriangle - */ + /** + * Create an instance of ScaleneTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScaleneTriangle + * @throws IOException if the JSON string is invalid with respect to ScaleneTriangle + */ public static ScaleneTriangle fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ScaleneTriangle.class); } - /** - * Convert an instance of ScaleneTriangle to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ScaleneTriangle 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/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java index 96c88a17ac8..a78e2a35230 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -63,10 +63,10 @@ public class ShapeInterface { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -175,12 +175,12 @@ public class ShapeInterface { openapiRequiredFields.add("shapeType"); } - /** - * 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 ShapeInterface - */ + /** + * 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 ShapeInterface + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ShapeInterface.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -272,22 +272,22 @@ public class ShapeInterface { } } - /** - * Create an instance of ShapeInterface given an JSON string - * - * @param jsonString JSON string - * @return An instance of ShapeInterface - * @throws IOException if the JSON string is invalid with respect to ShapeInterface - */ + /** + * Create an instance of ShapeInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShapeInterface + * @throws IOException if the JSON string is invalid with respect to ShapeInterface + */ public static ShapeInterface fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ShapeInterface.class); } - /** - * Convert an instance of ShapeInterface to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ShapeInterface 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/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 18085c0ce69..a178f5f0a6d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -67,10 +67,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull public String getShapeType() { return shapeType; @@ -86,10 +86,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull public String getQuadrilateralType() { return quadrilateralType; @@ -202,12 +202,12 @@ public class SimpleQuadrilateral { openapiRequiredFields.add("quadrilateralType"); } - /** - * 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 SimpleQuadrilateral - */ + /** + * 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 SimpleQuadrilateral + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SimpleQuadrilateral.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -302,22 +302,22 @@ public class SimpleQuadrilateral { } } - /** - * Create an instance of SimpleQuadrilateral given an JSON string - * - * @param jsonString JSON string - * @return An instance of SimpleQuadrilateral - * @throws IOException if the JSON string is invalid with respect to SimpleQuadrilateral - */ + /** + * Create an instance of SimpleQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleQuadrilateral + * @throws IOException if the JSON string is invalid with respect to SimpleQuadrilateral + */ public static SimpleQuadrilateral fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SimpleQuadrilateral.class); } - /** - * Convert an instance of SimpleQuadrilateral to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SimpleQuadrilateral 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/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java index dc983c8e720..e4e612dba0c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -67,10 +67,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -86,10 +86,10 @@ public class SpecialModelName { return this; } - /** + /** * Get specialModelName * @return specialModelName - **/ + */ @javax.annotation.Nullable public String getSpecialModelName() { return specialModelName; @@ -200,12 +200,12 @@ public class SpecialModelName { 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 SpecialModelName - */ + /** + * 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 SpecialModelName + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SpecialModelName.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -290,22 +290,22 @@ public class SpecialModelName { } } - /** - * Create an instance of SpecialModelName given an JSON string - * - * @param jsonString JSON string - * @return An instance of SpecialModelName - * @throws IOException if the JSON string is invalid with respect to SpecialModelName - */ + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ public static SpecialModelName fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SpecialModelName.class); } - /** - * Convert an instance of SpecialModelName to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SpecialModelName 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/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index 607507f7508..1d64a627383 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -67,10 +67,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -86,10 +86,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -200,12 +200,12 @@ public class Tag { 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 - */ + /** + * 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 @@ -290,22 +290,22 @@ public class Tag { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index aa95fbd5bc3..7bef8774a2b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -63,10 +63,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest { return this; } - /** + /** * Get someProperty * @return someProperty - **/ + */ @javax.annotation.Nullable public String getSomeProperty() { return someProperty; @@ -174,12 +174,12 @@ public class TestInlineFreeformAdditionalPropertiesRequest { 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 TestInlineFreeformAdditionalPropertiesRequest - */ + /** + * 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 TestInlineFreeformAdditionalPropertiesRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TestInlineFreeformAdditionalPropertiesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,22 +264,22 @@ public class TestInlineFreeformAdditionalPropertiesRequest { } } - /** - * Create an instance of TestInlineFreeformAdditionalPropertiesRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of TestInlineFreeformAdditionalPropertiesRequest - * @throws IOException if the JSON string is invalid with respect to TestInlineFreeformAdditionalPropertiesRequest - */ + /** + * Create an instance of TestInlineFreeformAdditionalPropertiesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TestInlineFreeformAdditionalPropertiesRequest + * @throws IOException if the JSON string is invalid with respect to TestInlineFreeformAdditionalPropertiesRequest + */ public static TestInlineFreeformAdditionalPropertiesRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TestInlineFreeformAdditionalPropertiesRequest.class); } - /** - * Convert an instance of TestInlineFreeformAdditionalPropertiesRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TestInlineFreeformAdditionalPropertiesRequest 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/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java index 191d122cbe4..5a5a108f88a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -63,10 +63,10 @@ public class TriangleInterface { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull public String getTriangleType() { return triangleType; @@ -175,12 +175,12 @@ public class TriangleInterface { openapiRequiredFields.add("triangleType"); } - /** - * 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 TriangleInterface - */ + /** + * 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 TriangleInterface + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TriangleInterface.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -272,22 +272,22 @@ public class TriangleInterface { } } - /** - * Create an instance of TriangleInterface given an JSON string - * - * @param jsonString JSON string - * @return An instance of TriangleInterface - * @throws IOException if the JSON string is invalid with respect to TriangleInterface - */ + /** + * Create an instance of TriangleInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of TriangleInterface + * @throws IOException if the JSON string is invalid with respect to TriangleInterface + */ public static TriangleInterface fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TriangleInterface.class); } - /** - * Convert an instance of TriangleInterface to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TriangleInterface 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/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java index 650baf3f8b9..21a80e4ec35 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java @@ -108,10 +108,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { return id; @@ -127,10 +127,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { return username; @@ -146,10 +146,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { return firstName; @@ -165,10 +165,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { return lastName; @@ -184,10 +184,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; @@ -203,10 +203,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { return password; @@ -222,10 +222,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { return phone; @@ -241,10 +241,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { return userStatus; @@ -260,10 +260,10 @@ public class User { return this; } - /** + /** * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. * @return objectWithNoDeclaredProps - **/ + */ @javax.annotation.Nullable public Object getObjectWithNoDeclaredProps() { return objectWithNoDeclaredProps; @@ -279,10 +279,10 @@ public class User { return this; } - /** + /** * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. * @return objectWithNoDeclaredPropsNullable - **/ + */ @javax.annotation.Nullable public Object getObjectWithNoDeclaredPropsNullable() { return objectWithNoDeclaredPropsNullable; @@ -298,10 +298,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 * @return anyTypeProp - **/ + */ @javax.annotation.Nullable public Object getAnyTypeProp() { return anyTypeProp; @@ -317,10 +317,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. * @return anyTypePropNullable - **/ + */ @javax.annotation.Nullable public Object getAnyTypePropNullable() { return anyTypePropNullable; @@ -472,12 +472,12 @@ public class User { 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 - */ + /** + * 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 @@ -577,22 +577,22 @@ public class User { } } - /** - * 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 - */ + /** + * 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 - */ + /** + * 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/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Variable.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Variable.java index 5a62c3ae224..32c55d10de8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Variable.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Variable.java @@ -68,10 +68,10 @@ public class Variable { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; @@ -87,10 +87,10 @@ public class Variable { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull public Value getValue() { return value; @@ -203,12 +203,12 @@ public class Variable { openapiRequiredFields.add("value"); } - /** - * 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 Variable - */ + /** + * 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 Variable + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Variable.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -302,22 +302,22 @@ public class Variable { } } - /** - * Create an instance of Variable given an JSON string - * - * @param jsonString JSON string - * @return An instance of Variable - * @throws IOException if the JSON string is invalid with respect to Variable - */ + /** + * Create an instance of Variable given an JSON string + * + * @param jsonString JSON string + * @return An instance of Variable + * @throws IOException if the JSON string is invalid with respect to Variable + */ public static Variable fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Variable.class); } - /** - * Convert an instance of Variable to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Variable 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/Whale.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java index 12665e1ec13..6a7d30ff245 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java @@ -71,10 +71,10 @@ public class Whale { return this; } - /** + /** * Get hasBaleen * @return hasBaleen - **/ + */ @javax.annotation.Nullable public Boolean getHasBaleen() { return hasBaleen; @@ -90,10 +90,10 @@ public class Whale { return this; } - /** + /** * Get hasTeeth * @return hasTeeth - **/ + */ @javax.annotation.Nullable public Boolean getHasTeeth() { return hasTeeth; @@ -109,10 +109,10 @@ public class Whale { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -227,12 +227,12 @@ public class Whale { openapiRequiredFields.add("className"); } - /** - * 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 Whale - */ + /** + * 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 Whale + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Whale.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -324,22 +324,22 @@ public class Whale { } } - /** - * Create an instance of Whale given an JSON string - * - * @param jsonString JSON string - * @return An instance of Whale - * @throws IOException if the JSON string is invalid with respect to Whale - */ + /** + * Create an instance of Whale given an JSON string + * + * @param jsonString JSON string + * @return An instance of Whale + * @throws IOException if the JSON string is invalid with respect to Whale + */ public static Whale fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Whale.class); } - /** - * Convert an instance of Whale to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Whale 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/Zebra.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java index 55f8512a8c0..f8e1c6f270b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java @@ -121,10 +121,10 @@ public class Zebra { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public TypeEnum getType() { return type; @@ -140,10 +140,10 @@ public class Zebra { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { return className; @@ -255,12 +255,12 @@ public class Zebra { openapiRequiredFields.add("className"); } - /** - * 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 Zebra - */ + /** + * 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 Zebra + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Zebra.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -359,22 +359,22 @@ public class Zebra { } } - /** - * Create an instance of Zebra given an JSON string - * - * @param jsonString JSON string - * @return An instance of Zebra - * @throws IOException if the JSON string is invalid with respect to Zebra - */ + /** + * Create an instance of Zebra given an JSON string + * + * @param jsonString JSON string + * @return An instance of Zebra + * @throws IOException if the JSON string is invalid with respect to Zebra + */ public static Zebra fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Zebra.class); } - /** - * Convert an instance of Zebra to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Zebra 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/test/java/org/openapitools/client/model/MammalAnyofTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MammalAnyofTest.java new file mode 100644 index 00000000000..c36c434de11 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/MammalAnyofTest.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.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.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MammalAnyof + */ +public class MammalAnyofTest { + private final MammalAnyof model = new MammalAnyof(); + + /** + * Model tests for MammalAnyof + */ + @Test + public void testMammalAnyof() { + // TODO: test MammalAnyof + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index 17f5b4a9841..3d35d7ba46b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -98,12 +98,12 @@ if(hasProperty('target') && target == 'android') { ext { rest_assured_version = "5.3.2" - junit_version = "4.13.2" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + junit_version = "5.10.3" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -119,5 +119,5 @@ dependencies { implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "org.hibernate:hibernate-validator:6.0.19.Final" 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/rest-assured-jackson/build.sbt b/samples/client/petstore/java/rest-assured-jackson/build.sbt index e080650b9ef..58b7d967ddc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.sbt +++ b/samples/client/petstore/java/rest-assured-jackson/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index 499b537d6e6..9023c63de60 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -227,11 +227,6 @@ rest-assured ${rest-assured.version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.fasterxml.jackson.core @@ -241,6 +236,10 @@ com.fasterxml.jackson.core jackson-annotations + + com.fasterxml.jackson.core + jackson-databind + org.openapitools jackson-databind-nullable @@ -270,8 +269,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -281,12 +280,12 @@ 5.3.2 2.10.1 1.9.0 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 3.0.2 3.6.0 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java index 53034a2a25f..b0947b63fe5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/BeanValidationException.java @@ -2,8 +2,8 @@ package org.openapitools.client; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index aadd3a6d242..c890ea89ff9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,10 +49,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f416122f359..1c6f55c51f1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -25,8 +25,8 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -50,10 +50,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 90dbe3b166f..caf95ae942e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,10 +49,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) 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 d3d45dcf25f..2049d1c5f47 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 @@ -26,8 +26,8 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -98,10 +98,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @@ -132,10 +132,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -167,10 +167,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @@ -201,10 +201,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @@ -235,10 +235,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @Valid @@ -270,10 +270,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @Valid @@ -305,10 +305,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @Valid @@ -340,10 +340,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @Valid @@ -367,10 +367,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @@ -393,10 +393,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @@ -419,10 +419,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ae90e027c19..149b30dc885 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,10 +49,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 3c7d6c999c7..3f8c3bd3f2e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -25,8 +25,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -50,10 +50,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index c4441769ee4..928c87c5a49 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,10 +49,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 07d66d6dbc8..ec38b002201 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,10 +49,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) 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 17302ab16f4..bb9545c3d3e 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 @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -64,10 +64,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @NotNull @@ -91,10 +91,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b876c4044bd..9df412528f9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -26,8 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -58,10 +58,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2ae4e49067c..89410bb56c1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -26,8 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -58,10 +58,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @Valid 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 41c6d31f3f6..1d1c0445513 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 @@ -26,8 +26,8 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -66,10 +66,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @@ -100,10 +100,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @Valid @@ -135,10 +135,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 5909193e4e5..244cd39e031 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -26,8 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -96,10 +96,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) 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 bfdca6f8222..43d881d0407 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -66,10 +66,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @@ -92,10 +92,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @@ -118,10 +118,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @@ -144,10 +144,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @@ -170,10 +170,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @@ -196,10 +196,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) 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 9884e516cc0..ce596121bb7 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 @@ -26,8 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -60,10 +60,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) 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 0d105a750de..c60733ae425 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -50,10 +50,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -76,10 +76,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index f9a43fc6194..5fc14a02caf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index 984c49aa5bb..8befc299cd0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index a4c41938697..63e1c576b7d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -26,8 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -57,10 +57,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) 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 fc729752290..9a60985e35c 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 @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -123,10 +123,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @@ -157,10 +157,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java index 43ec2faf20c..9d1fa380058 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumClass.java @@ -17,8 +17,8 @@ import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; 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 ae7db4b351d..2de6d4540ed 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 @@ -23,8 +23,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnum; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -208,10 +208,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @@ -234,10 +234,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @NotNull @@ -261,10 +261,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @@ -287,10 +287,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @@ -313,10 +313,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @Valid 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 c10d97d85fd..4b044af9f61 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 @@ -26,8 +26,8 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -54,10 +54,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @Valid @@ -89,10 +89,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @Valid 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 5361ee93055..31d1de77d1f 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 @@ -27,8 +27,8 @@ import java.time.OffsetDateTime; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -104,12 +104,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @Min(10) @Max(100) @JsonProperty(JSON_PROPERTY_INTEGER) @@ -132,12 +132,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @Min(20) @Max(200) @JsonProperty(JSON_PROPERTY_INT32) @@ -160,10 +160,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @@ -186,12 +186,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -216,12 +216,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(JSON_PROPERTY_FLOAT) @@ -244,12 +244,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(JSON_PROPERTY_DOUBLE) @@ -272,10 +272,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @Pattern(regexp="/[a-z]/i") @JsonProperty(JSON_PROPERTY_STRING) @@ -298,10 +298,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @NotNull @@ -325,10 +325,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @Valid @@ -352,10 +352,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Valid @@ -407,10 +407,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Valid @@ -434,10 +434,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @NotNull @Size(min=10,max=64) @@ -461,10 +461,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @Valid 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 e43dfd79cbf..d25e3159715 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -45,8 +45,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -57,10 +57,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -72,10 +72,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 24d13b4a54f..57484c36cd2 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 @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -103,10 +103,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @Valid @@ -138,10 +138,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @@ -172,10 +172,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @@ -206,10 +206,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) 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 d7dc6adcb75..7a7c172b0f8 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 @@ -27,8 +27,8 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -59,10 +59,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Valid @@ -86,10 +86,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Valid @@ -121,10 +121,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @Valid 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 5a46fe0b823..48fc3cfc4ba 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -51,10 +51,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @@ -77,10 +77,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) 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 053ac040a98..c9bc2cd3868 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -55,10 +55,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @@ -81,10 +81,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @@ -107,10 +107,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java index f522577018e..9db30ce1566 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java index e09029105ac..0e7f5efe5d3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index cdebeed4122..3548c2df08a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) 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 889310cc72f..49690f74e6c 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -52,8 +52,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -70,10 +70,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull @@ -91,10 +91,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @@ -112,10 +112,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @@ -132,10 +132,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index a7ecdbe3320..ff467fea757 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -23,8 +23,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @Valid 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 c9effca78ce..3ae3c6d2d16 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 @@ -23,8 +23,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -104,10 +104,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -130,10 +130,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @@ -156,10 +156,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -182,10 +182,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Valid @@ -209,10 +209,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @@ -235,10 +235,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 bbd5870b117..69e80477627 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 @@ -23,8 +23,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -55,10 +55,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -82,10 +82,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @@ -108,10 +108,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java index 386290bc652..efff50487a8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -17,8 +17,8 @@ import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; 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 16482fdcefa..451f4fc2dc3 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 @@ -30,8 +30,8 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -111,10 +111,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -137,10 +137,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Valid @@ -164,10 +164,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull @@ -199,10 +199,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @NotNull @@ -235,10 +235,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Valid @@ -262,10 +262,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 86be39c084d..55841856f71 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -44,8 +44,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -54,10 +54,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -75,10 +75,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index f50d0082d5f..6c1f51991e1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) 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 22d0f3f6d91..984526318e4 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -50,10 +50,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -76,10 +76,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 2d795aa98db..e2162f806a3 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 @@ -26,8 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -66,10 +66,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -93,10 +93,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -121,10 +121,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -148,10 +148,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -183,10 +183,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @NotNull 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 fb83edbd9cf..136dc365878 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 @@ -26,8 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -70,10 +70,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -97,10 +97,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -125,10 +125,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -152,10 +152,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -179,10 +179,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -214,10 +214,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @NotNull 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 e1f7dd23452..46c98dc9fb8 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 @@ -22,8 +22,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -74,10 +74,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -100,10 +100,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @@ -126,10 +126,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -152,10 +152,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -178,10 +178,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @@ -204,10 +204,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -230,10 +230,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @@ -256,10 +256,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) 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 9275cb88534..524c0ec5b71 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 @@ -26,8 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -162,10 +162,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @@ -188,10 +188,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -215,10 +215,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @@ -241,10 +241,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @@ -275,10 +275,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @@ -301,10 +301,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -327,10 +327,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -354,10 +354,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @@ -380,10 +380,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @@ -414,10 +414,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @@ -448,10 +448,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @@ -474,10 +474,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -500,10 +500,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -527,10 +527,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @@ -553,10 +553,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @@ -587,10 +587,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @@ -621,10 +621,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @@ -647,10 +647,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -673,10 +673,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -700,10 +700,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @@ -726,10 +726,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @@ -760,10 +760,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @@ -794,10 +794,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @@ -820,10 +820,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -846,10 +846,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -873,10 +873,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @@ -899,10 +899,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @@ -933,10 +933,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @@ -967,10 +967,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index d1efa43a308..93441f6ab51 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,18 +14,25 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.ApiClient; import org.openapitools.client.api.AnotherFakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +40,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -52,10 +59,12 @@ public class AnotherFakeApiTest { */ @Test public void shouldSee200AfterCall123testSpecialTags() { + String uuidTest = null; Client body = null; api.call123testSpecialTags() + .uuidTestHeader(uuidTest) .body(body).execute(r -> r.prettyPeek()); // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 183de79127e..b2db6700588 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -26,14 +26,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.FakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -41,12 +47,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -303,4 +309,4 @@ public class FakeApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 3d2b74185ba..de05aa0a336 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.FakeClassnameTags123Api; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +39,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -58,4 +64,4 @@ public class FakeClassnameTags123ApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java index 1ae1e95a3a7..7d169d41366 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -21,14 +21,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -36,12 +42,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -244,7 +250,7 @@ public class PetApiTest { public void shouldSee200AfterUploadFile() { Long petId = null; String additionalMetadata = null; - File file = null; + File _file = null; api.uploadFile() .petIdPath(petId).execute(r -> r.prettyPeek()); // TODO: test validations @@ -265,4 +271,4 @@ public class PetApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java index 88b10b312b0..c3e65eb4696 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.StoreApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +39,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -136,4 +142,4 @@ public class StoreApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java index 8b224223bdb..b8e03ee1d4f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,19 +13,26 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; import org.openapitools.client.api.UserApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.JacksonObjectMapper.jackson; @@ -33,12 +40,12 @@ import static org.openapitools.client.JacksonObjectMapper.jackson; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -64,7 +71,7 @@ public class UserApiTest { */ @Test public void shouldSee0AfterCreateUsersWithArrayInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithArrayInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -76,7 +83,7 @@ public class UserApiTest { */ @Test public void shouldSee0AfterCreateUsersWithListInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithListInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -203,4 +210,4 @@ public class UserApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 4f6fd800ab7..faacb289c17 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.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 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 } @@ -43,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 41e6497ecee..b506ff7ae92 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -21,22 +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 } @@ -44,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index d2e17831ba7..ba65ffedc14 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.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 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 } @@ -43,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 14fd8022feb..72854079e5e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -22,22 +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 } @@ -45,7 +44,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -53,7 +52,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -61,7 +60,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -69,7 +68,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -77,7 +76,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -85,7 +84,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -93,7 +92,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -101,7 +100,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -109,7 +108,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -117,7 +116,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -125,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 58b7521c6a7..916c2c2bcb3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.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 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 } @@ -43,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 10ad938f52c..a099245eec5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -21,22 +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 } @@ -44,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index bcbb9c54b27..d47c9a37d1f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.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 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 } @@ -43,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index f7662d6c469..3820dd2e23c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.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 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 } @@ -43,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java index 930e5c17d07..24776d3cb51 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,25 +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.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; /** * 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 } @@ -47,7 +43,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..6bbe877044d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..eaf908bb1ab 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..99c6bcf5360 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd150512..20bc4e0d424 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..a0217acd1f2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java index 90fdba14c24..1b389a075be 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,23 +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.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; /** * 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 } @@ -46,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..6ef5c744fbc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..8028f11bc2b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..4a755b0d442 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..48aa1a737fc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java index 8907cfa8e8f..b06e3eb195d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/EnumTestTest.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.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 } @@ -42,7 +41,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -50,7 +49,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -58,7 +57,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -66,7 +65,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -74,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..0048cb2c749 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java index 48bec93d994..3060f7f2d56 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -102,7 +101,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -110,7 +109,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -118,7 +117,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -126,7 +125,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -134,7 +133,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -142,7 +141,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -150,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/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..908f0aff6ed 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..3752c5ba31f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..0f47e193af8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..5743b70142b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..436e4abd59e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..f128d7b9ac2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..92273f48d23 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..1c5337654cd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..1a6aa18fa20 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..8623386a5e9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..670c2535646 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..870a977da94 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..0333ee657a0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..2e4303f1e4b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..c56da4290fa 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..9501cf722d6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..dc9cf9742ef 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 8c096c188fc..7ee75c35731 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.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 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/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index b1655df6165..5c77882f500 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.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 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/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..69d274133b9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/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/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java index 4bab95a9126..d2e45fadf56 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/XmlItemTest.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 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/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index b81ff3e04bb..bf42131b49d 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -98,10 +98,11 @@ if(hasProperty('target') && target == 'android') { ext { rest_assured_version = "5.3.2" - junit_version = "4.13.2" + junit_version = "5.10.3" gson_version = "2.10.1" gson_fire_version = "1.9.0" okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { @@ -113,5 +114,5 @@ dependencies { implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "org.hibernate:hibernate-validator:6.0.19.Final" 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/rest-assured/build.sbt b/samples/client/petstore/java/rest-assured/build.sbt index bc19cbe3820..52d6008056e 100644 --- a/samples/client/petstore/java/rest-assured/build.sbt +++ b/samples/client/petstore/java/rest-assured/build.sbt @@ -19,7 +19,7 @@ lazy val root = (project in file(".")). "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index 78d21d74e7c..006eb9f1d8f 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -226,11 +226,6 @@ gson-fire ${gson-fire-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.squareup.okio okio @@ -251,8 +246,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -262,10 +257,9 @@ 5.3.2 2.10.1 1.9.0 - 2.15.2 1.3.5 3.0.2 3.6.0 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java index 53034a2a25f..b0947b63fe5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/BeanValidationException.java @@ -2,8 +2,8 @@ package org.openapitools.client; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java index 5f2e9f70d67..edcc9eed5b9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -35,14 +35,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -53,11 +50,6 @@ public class JSON { private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); private 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() @@ -380,7 +372,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -390,7 +382,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -415,7 +407,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -434,7 +426,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 0dd6b86998c..ba0f3abd09a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 6ce1e5960e9..205e0decc61 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 0a823ccada9..6aae2110b52 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable 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 e5bed7fb59f..5a9c0e31369 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 @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -95,10 +95,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @@ -125,10 +125,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -156,10 +156,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @@ -186,10 +186,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @@ -216,10 +216,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @Valid @@ -247,10 +247,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @Valid @@ -278,10 +278,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @Valid @@ -309,10 +309,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @Valid @@ -332,10 +332,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @@ -354,10 +354,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @@ -376,10 +376,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 65a97381d60..a337bf8791a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 17e58b1f9e1..9a69defa684 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -24,8 +24,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 75acbfb1984..d61f63ab9db 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 2c2ecd6a7cb..9c143d0c1dc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -46,10 +46,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable 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 be915944429..a6a776906db 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @NotNull @@ -70,10 +70,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e947cbdf79a..c402bdbd645 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 67b4ed4ad0b..8d809024430 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @Valid 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 2d39da8c131..97b8e9a5243 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 @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @@ -93,10 +93,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @Valid @@ -124,10 +124,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index a7e37d9796a..6de4ca6263f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Cat; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -96,10 +96,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable 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 03a33e9ab69..4415d3455ab 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @@ -85,10 +85,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @@ -107,10 +107,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @@ -129,10 +129,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @@ -151,10 +151,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @@ -173,10 +173,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable 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 f903ed44d38..4124fda946b 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 @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -45,10 +45,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable 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 17b3117a956..573d264238b 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @@ -69,10 +69,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 45411f70849..8fc5563025c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index 97da344b514..22d96d8e66d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index f26106e74d0..044b86c430d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -45,10 +45,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable 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 b6267966b1d..607d65467e2 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 @@ -24,8 +24,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -144,10 +144,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @@ -174,10 +174,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java index ae6366ff619..3e594e7ef3e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java @@ -16,8 +16,8 @@ package org.openapitools.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import java.io.IOException; 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 97e4f99594a..0156d7fd44e 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 @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -252,10 +252,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @NotNull @@ -297,10 +297,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @@ -319,10 +319,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @@ -341,10 +341,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @Valid 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 8f2e16a1f03..fe5908d4f58 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 @@ -25,8 +25,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @Valid @@ -82,10 +82,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @Valid 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 35891d1f260..edf49ff153b 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 @@ -26,8 +26,8 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -100,12 +100,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @Min(10) @Max(100) @@ -124,12 +124,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @Min(20) @Max(200) @@ -148,10 +148,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @@ -170,12 +170,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -196,12 +196,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @@ -220,12 +220,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @@ -244,10 +244,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @Pattern(regexp="/[a-z]/i") @@ -266,10 +266,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @NotNull @@ -289,10 +289,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @Valid @@ -312,10 +312,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -336,10 +336,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Valid @@ -359,10 +359,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Valid @@ -382,10 +382,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @NotNull @Size(min=10,max=64) @@ -405,10 +405,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @Valid 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 64675e81eda..1db97b534cd 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -41,8 +41,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -53,10 +53,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @@ -66,10 +66,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable 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 1486429aafc..0bb2ac6d43c 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 @@ -23,8 +23,8 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -112,10 +112,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @Valid @@ -143,10 +143,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @@ -173,10 +173,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @@ -203,10 +203,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable 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 16ca093ba2f..f400c538401 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 @@ -26,8 +26,8 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Valid @@ -79,10 +79,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Valid @@ -110,10 +110,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @Valid 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 dbcc56c936f..6e55942159a 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @@ -69,10 +69,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable 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 e09cd67e147..27d7e5861a4 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -51,10 +51,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @@ -73,10 +73,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @@ -95,10 +95,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java index 585586daaa1..6abe46395a9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java index b972f222521..f8969b8a336 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 23834cbaac6..bd63b09495a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable 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 0cd260c5e2a..f41968849d4 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull @@ -84,10 +84,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @@ -103,10 +103,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @@ -119,10 +119,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index a3d94fd66c8..da24546c95b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @Valid 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 f72f1acea07..c3c6847ee4c 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 @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -113,10 +113,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @@ -135,10 +135,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @@ -179,10 +179,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Valid @@ -202,10 +202,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @@ -224,10 +224,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable 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 5fc15112d4a..f3aa38a7f2e 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 @@ -22,8 +22,8 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -75,10 +75,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @@ -97,10 +97,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java index be690856408..5cf2df00965 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -16,8 +16,8 @@ package org.openapitools.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; import java.io.IOException; 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 d46cb1d3548..f7eca9bbfad 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 @@ -28,8 +28,8 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -119,10 +119,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @@ -141,10 +141,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Valid @@ -164,10 +164,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @NotNull @@ -195,10 +195,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @NotNull @@ -226,10 +226,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Valid @@ -249,10 +249,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable 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 14540f14970..30f23eaf7c6 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @@ -70,10 +70,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7a88d238177..d6d7bf021df 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -43,10 +43,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable 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 b54f7af51fe..5621e03a16b 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @@ -69,10 +69,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable 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 da3744fbbee..29b7cc793ce 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 @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -63,10 +63,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -86,10 +86,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -110,10 +110,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -133,10 +133,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -164,10 +164,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @NotNull 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 8981d1c9320..4fb98698146 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 @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -67,10 +67,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -90,10 +90,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @NotNull @Valid @@ -114,10 +114,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -137,10 +137,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -160,10 +160,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @NotNull @@ -191,10 +191,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @NotNull 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 ae8fef63d06..9d06fe313f3 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 @@ -21,8 +21,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -71,10 +71,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @@ -93,10 +93,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @@ -115,10 +115,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @@ -137,10 +137,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @@ -159,10 +159,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @@ -181,10 +181,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @@ -203,10 +203,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @@ -225,10 +225,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable 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 e5220f0e6fd..34ef610807c 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 @@ -25,8 +25,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.hibernate.validator.constraints.*; /** @@ -159,10 +159,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @@ -181,10 +181,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -204,10 +204,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @@ -226,10 +226,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @@ -256,10 +256,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @@ -278,10 +278,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @@ -300,10 +300,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -323,10 +323,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @@ -345,10 +345,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @@ -375,10 +375,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @@ -405,10 +405,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @@ -427,10 +427,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @@ -449,10 +449,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -472,10 +472,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @@ -494,10 +494,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @@ -524,10 +524,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @@ -554,10 +554,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @@ -576,10 +576,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @@ -598,10 +598,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -621,10 +621,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @@ -643,10 +643,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @@ -673,10 +673,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @@ -703,10 +703,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @@ -725,10 +725,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @@ -747,10 +747,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @Valid @@ -770,10 +770,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @@ -792,10 +792,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @@ -822,10 +822,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @@ -852,10 +852,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 11417e240fc..98ae595b408 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,18 +14,25 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.ApiClient; import org.openapitools.client.api.AnotherFakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +40,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -52,10 +59,12 @@ public class AnotherFakeApiTest { */ @Test public void shouldSee200AfterCall123testSpecialTags() { + String uuidTest = null; Client body = null; api.call123testSpecialTags() + .uuidTestHeader(uuidTest) .body(body).execute(r -> r.prettyPeek()); // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java index e248c2155a2..a7abe7c1e75 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -26,14 +26,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.FakeApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -41,12 +47,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -303,4 +309,4 @@ public class FakeApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index d8fbcab9123..fa03b6cd79b 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.FakeClassnameTags123Api; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +39,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -58,4 +64,4 @@ public class FakeClassnameTags123ApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java index 933f5aed2b8..ad4bf4ca0b0 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,19 +16,24 @@ 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.openapitools.client.ApiClient; import org.openapitools.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 java.util.Set; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; @@ -37,12 +42,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -245,7 +250,7 @@ public class PetApiTest { public void shouldSee200AfterUploadFile() { Long petId = null; String additionalMetadata = null; - File file = null; + File _file = null; api.uploadFile() .petIdPath(petId).execute(r -> r.prettyPeek()); // TODO: test validations @@ -266,4 +271,4 @@ public class PetApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java index b4ca1cc5d74..8463e028240 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -18,14 +18,20 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.api.StoreApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +39,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -136,4 +142,4 @@ public class StoreApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java index b64674d7bf4..cbb964e6209 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,19 +13,26 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; import org.openapitools.client.api.UserApi; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -33,12 +40,12 @@ import static org.openapitools.client.GsonObjectMapper.gson; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -64,7 +71,7 @@ public class UserApiTest { */ @Test public void shouldSee0AfterCreateUsersWithArrayInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithArrayInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -76,7 +83,7 @@ public class UserApiTest { */ @Test public void shouldSee0AfterCreateUsersWithListInput() { - List body = null; + List<@Valid User> body = null; api.createUsersWithListInput() .body(body).execute(r -> r.prettyPeek()); // TODO: test validations @@ -203,4 +210,4 @@ public class UserApiTest { // TODO: test validations } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 50305c9c365..04fa4f5b6d9 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index d48028727f8..80dc3fcbd43 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -22,22 +22,21 @@ import java.io.IOException; 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 } @@ -45,7 +44,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 287c5b053a0..ca1046a0fc8 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3363cd409f9..3c34271bf0d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -23,22 +23,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 } @@ -46,7 +45,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -54,7 +53,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -62,7 +61,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -70,7 +69,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -78,7 +77,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -86,7 +85,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -94,7 +93,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -102,7 +101,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -110,7 +109,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -118,7 +117,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -126,7 +125,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 77d9b6526c5..e9f37e84ecd 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 09113d376a6..3d6ac0eec25 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -22,22 +22,21 @@ import java.io.IOException; 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 } @@ -45,7 +44,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index c5b1e774cc2..47389e5fd54 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index d7f054fbbd9..162ae6f2edd 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java index 39baa2cbc38..e8508c4319b 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -19,25 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -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; /** * 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 } @@ -45,7 +41,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +49,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 165c1862aee..9d8fb3480f6 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,23 +21,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -45,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/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4c5e8b7ef58..ef70479bb3c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -21,23 +21,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -45,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/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java index eaf7cb8aadf..f5c7ed8752f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -20,24 +20,24 @@ 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.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 } @@ -45,7 +45,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -53,7 +53,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -61,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/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d8..aa1db2031da 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -42,7 +42,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java index dad32fc0895..eda1830e0c0 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -50,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -58,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -66,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -74,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -82,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/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java index f272c0fa92f..6e38fb46e73 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CatTest.java @@ -20,23 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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; /** * 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 +42,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +50,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +58,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java index 09046fd21c4..4ac631b1e8c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,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/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java index 6998a0cb766..aa381b709d9 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java index 103e991a403..95f0e2d39d2 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ClientTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,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/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java index 35c27a3eda0..f65ec9fbebe 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/DogTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -43,7 +42,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -51,7 +50,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -59,7 +58,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java index b87e410f963..1175d0a96ec 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -20,23 +20,23 @@ 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.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +44,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -52,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/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java index 329454658e3..cb2a9c69498 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java index 6569d711402..b097f85302d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -43,7 +42,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -51,7 +50,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -59,7 +58,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -67,7 +66,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -75,7 +74,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 3df1cafc7f9..08d51e19dad 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -20,24 +20,24 @@ 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.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 } @@ -45,7 +45,7 @@ public class FileSchemaTestClassTest { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -53,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/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java index 24d631e5c6e..bcdcaf9dd06 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -24,22 +24,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 } @@ -47,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -55,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -63,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -71,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -79,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -87,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -95,7 +94,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -103,7 +102,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -111,7 +110,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -119,7 +118,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -127,7 +126,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -135,7 +134,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -143,7 +142,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -151,7 +150,7 @@ public class FormatTestTest { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 6da8d8d167e..01be6b15413 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,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/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java index 038898516fa..d9b643e6b43 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -21,22 +21,21 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -44,7 +43,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -52,7 +51,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -60,7 +59,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -68,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/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b0c6aec73ee..0d57da0126e 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -24,22 +24,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 } @@ -47,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -55,7 +54,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -63,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/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index ad739d2173c..ecae6e0f437 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 8c57deac712..bb4aa91a78c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -50,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -58,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/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java index a40382564ac..973730324cc 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java index 8a2d23e90ec..bdba8c46a91 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,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/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 3ec9148deee..ae4eaf6295f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java index 96201d5a520..f35cf4746e5 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NameTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 192572d7dca..16ed327afed 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -43,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/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java index ee9699fba98..439814c48b1 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OrderTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -43,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -59,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -67,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -75,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -83,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/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 620678b1cd9..cf76f8e58d0 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -20,22 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -43,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -51,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -59,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/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 220d40e83cb..4110989633b 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java index 13936977f7d..82448ec2368 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,27 +20,27 @@ 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.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/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 61bda609f8d..72101f74b61 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,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/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index ed82c1fd679..dfc2065188d 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,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/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java index 7ddf73984f2..36eea1ddb7b 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TagTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,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/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 1561e6bbb3d..3f8ac3d4a3f 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -21,23 +21,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -45,7 +45,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +53,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +61,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -69,7 +69,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -77,7 +77,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index b369123e981..e0a7a0d614c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -21,23 +21,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -45,7 +45,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +53,7 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +61,7 @@ public class TypeHolderExampleTest { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -69,7 +69,7 @@ public class TypeHolderExampleTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -77,7 +77,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -85,7 +85,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java index 2d4e842d6a3..5163783cfdc 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/UserTest.java @@ -19,22 +19,21 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -42,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -58,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -66,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -74,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -82,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -90,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -98,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/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java index 0476f2f1630..3cfe59d203c 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -21,23 +21,23 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -45,7 +45,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -53,7 +53,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -61,7 +61,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -69,7 +69,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -77,7 +77,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -85,7 +85,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -93,7 +93,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -101,7 +101,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -109,7 +109,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -117,7 +117,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -125,7 +125,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -133,7 +133,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -141,7 +141,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -149,7 +149,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -157,7 +157,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -165,7 +165,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -173,7 +173,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -181,7 +181,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -189,7 +189,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -197,7 +197,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -205,7 +205,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -213,7 +213,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -221,7 +221,7 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -229,7 +229,7 @@ public class XmlItemTest { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -237,7 +237,7 @@ public class XmlItemTest { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -245,7 +245,7 @@ public class XmlItemTest { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -253,7 +253,7 @@ public class XmlItemTest { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -261,7 +261,7 @@ public class XmlItemTest { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -269,7 +269,7 @@ public class XmlItemTest { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/restclient-nullable-arrays/README.md b/samples/client/petstore/java/restclient-nullable-arrays/README.md index 47585d64efb..348285bad95 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/README.md +++ b/samples/client/petstore/java/restclient-nullable-arrays/README.md @@ -89,17 +89,17 @@ import org.openapitools.client.api.DefaultApi; public class DefaultApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://localhost"); DefaultApi apiInstance = new DefaultApi(defaultClient); try { List result = apiInstance.nullableArrayTestGet(); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException 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("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/petstore/java/restclient-nullable-arrays/build.gradle b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle index e3ae783def4..4fc07a99b55 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/build.gradle +++ b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "6.1.6" jakarta_annotation_version = "2.1.1" diff --git a/samples/client/petstore/java/restclient-nullable-arrays/pom.xml b/samples/client/petstore/java/restclient-nullable-arrays/pom.xml index be447494260..789ad397735 100644 --- a/samples/client/petstore/java/restclient-nullable-arrays/pom.xml +++ b/samples/client/petstore/java/restclient-nullable-arrays/pom.xml @@ -281,8 +281,8 @@ UTF-8 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 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 index b8b55b2cefb..ceadfbde2a9 100644 --- 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 @@ -10,8 +10,8 @@ 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.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; 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 index c508cc63f59..fb05ddfe3b0 100644 --- 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 @@ -64,10 +64,10 @@ public class ByteArrayObject { return this; } - /** + /** * byte array. * @return nullableArray - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -97,10 +97,10 @@ public class ByteArrayObject { return this; } - /** + /** * byte array. * @return normalArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NORMAL_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,10 +122,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get nullableString * @return nullableString - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -155,10 +155,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get stringField * @return stringField - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING_FIELD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,10 +180,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get intField * @return intField - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT_FIELD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/restclient-swagger2/README.md b/samples/client/petstore/java/restclient-swagger2/README.md index a9421f71622..26ffabbd6cb 100644 --- a/samples/client/petstore/java/restclient-swagger2/README.md +++ b/samples/client/petstore/java/restclient-swagger2/README.md @@ -89,7 +89,7 @@ import org.openapitools.client.api.AnotherFakeApi; public class AnotherFakeApiExample { public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); + ApiClient defaultClient = new ApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); @@ -97,10 +97,10 @@ public class AnotherFakeApiExample { try { Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); - } catch (ApiException e) { + } catch (HttpStatusCodeException 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("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } diff --git a/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml b/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml +++ b/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/restclient-swagger2/build.gradle b/samples/client/petstore/java/restclient-swagger2/build.gradle index 130f284555a..620565aa93f 100644 --- a/samples/client/petstore/java/restclient-swagger2/build.gradle +++ b/samples/client/petstore/java/restclient-swagger2/build.gradle @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "2.2.9" - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "6.1.6" jakarta_annotation_version = "2.1.1" diff --git a/samples/client/petstore/java/restclient-swagger2/pom.xml b/samples/client/petstore/java/restclient-swagger2/pom.xml index b054e583727..5670fabdbc5 100644 --- a/samples/client/petstore/java/restclient-swagger2/pom.xml +++ b/samples/client/petstore/java/restclient-swagger2/pom.xml @@ -287,8 +287,8 @@ UTF-8 2.2.15 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 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 index 4b2f31199d4..23f576d8c8d 100644 --- 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 @@ -10,8 +10,8 @@ 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.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; 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 index 707e011033d..279799520cd 100644 --- 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 @@ -58,10 +58,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @@ -92,10 +92,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) 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 index 98c9bfc98b0..2a01e3fad3e 100644 --- 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 @@ -49,10 +49,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -75,10 +75,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) 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 index 0ca94fbbbca..94524a1a264 100644 --- 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 @@ -61,10 +61,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CLASS_NAME) @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_COLOR) 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 index 3f21e1b4062..65cd66ae19f 100644 --- 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 @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) 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 index 859bc32fea3..9a7faa329a3 100644 --- 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 @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) 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 index 753d83e8621..856eb1875cc 100644 --- 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 @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @@ -98,10 +98,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @@ -132,10 +132,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) 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 index 56e0c842741..ba41af2aff0 100644 --- 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 @@ -64,10 +64,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @@ -116,10 +116,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @@ -142,10 +142,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @@ -168,10 +168,10 @@ public class Capitalization { 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) @@ -194,10 +194,10 @@ public class Capitalization { 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) 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 index 45cfc4670bd..074df2e6c0c 100644 --- 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 @@ -55,10 +55,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DECLAWED) 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 index bf88896f8ce..3fa69e350cf 100644 --- 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 @@ -48,10 +48,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) 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 index 2ed41453b7f..2fd6f007c20 100644 --- 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 @@ -56,10 +56,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) 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 index b535168d5cc..fea63f0eebd 100644 --- 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 @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) 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 index 020aa95f186..bfbc2272599 100644 --- 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 @@ -44,10 +44,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CLIENT) 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 index 9a144e3922a..f7e5deea0e5 100644 --- 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 @@ -46,10 +46,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) 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 index 54043d7904a..3785140028b 100644 --- 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 @@ -55,10 +55,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BREED) 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 index 4531378c2a4..0b3754e741c 100644 --- 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 @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @@ -155,10 +155,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) 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 index faff3e49fb2..8fc5576f3a6 100644 --- 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 @@ -225,10 +225,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING) @@ -251,10 +251,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @@ -277,10 +277,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @@ -303,10 +303,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @@ -329,10 +329,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -363,10 +363,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @@ -389,10 +389,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @@ -415,10 +415,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) 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 index c3886444e5f..28e4dcffe48 100644 --- 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 @@ -52,10 +52,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SOME_ID) @@ -86,10 +86,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SOME_MAP) 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 index 96dde0fe3cd..5df4c0e83ed 100644 --- 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 @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FILE) @@ -86,10 +86,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FILES) 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 index f0068951b3e..940b6e43d78 100644 --- 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 @@ -44,10 +44,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) 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 index 3ca24aa5474..009da9022ae 100644 --- 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 @@ -46,10 +46,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_STRING) 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 index 551ee31ced9..209bc4e4d9b 100644 --- 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 @@ -110,12 +110,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INTEGER) @@ -138,12 +138,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INT32) @@ -166,10 +166,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INT64) @@ -192,12 +192,12 @@ public class FormatTest { 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) @@ -220,12 +220,12 @@ public class FormatTest { 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) @@ -248,12 +248,12 @@ public class FormatTest { 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) @@ -276,10 +276,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DECIMAL) @@ -302,10 +302,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_STRING) @@ -328,10 +328,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BYTE) @@ -354,10 +354,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BINARY) @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE) @@ -406,10 +406,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @@ -432,10 +432,10 @@ public class FormatTest { 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) @@ -458,10 +458,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -484,10 +484,10 @@ public class FormatTest { 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) @@ -510,10 +510,10 @@ public class FormatTest { 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) 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 index 000b933594d..fe90739694e 100644 --- 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 @@ -43,8 +43,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -55,10 +55,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) @@ -70,10 +70,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FOO) 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 index bc9e05ff326..c8f2648ee87 100644 --- 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 @@ -49,10 +49,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore 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 index 41f0e2175b8..f8f2b1692f1 100644 --- 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 @@ -101,10 +101,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @@ -169,10 +169,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @@ -203,10 +203,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) 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 index 58b58e94d4b..d695d16e444 100644 --- 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 @@ -57,10 +57,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_UUID) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @@ -117,10 +117,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP) 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 index 692a1d63dbc..2eeb93d127b 100644 --- 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 @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -76,10 +76,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) 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 index 8da9af8b1db..99112de8f9e 100644 --- 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 @@ -53,10 +53,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -105,10 +105,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MESSAGE) 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 index 80aab3c8c52..3e4bbe87ec2 100644 --- 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 @@ -46,10 +46,10 @@ public class ModelFile { 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) 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 index f2fbb573977..d9fd9ecc3b8 100644 --- 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 @@ -45,10 +45,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_123LIST) 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 index 9d2aacff3d9..41524ab9edc 100644 --- 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 @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_RETURN) 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 index ab0e2b8294b..f83c2fd922b 100644 --- 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 @@ -51,8 +51,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -69,10 +69,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -89,10 +89,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @@ -110,10 +110,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY) @@ -130,10 +130,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_123NUMBER) 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 index eeb28c8b03c..73664e67099 100644 --- 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 @@ -101,10 +101,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -135,10 +135,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -169,10 +169,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -203,10 +203,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -237,10 +237,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -271,10 +271,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -317,10 +317,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -363,10 +363,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -405,10 +405,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @@ -443,10 +443,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -489,10 +489,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -531,10 +531,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) 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 index 398ea6a9e2f..3ee71c2efd2 100644 --- 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 @@ -45,10 +45,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_JUST_NUMBER) 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 index daf2ff0e03e..1618983304a 100644 --- 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 @@ -61,10 +61,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_UUID) @@ -87,11 +87,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @@ -115,11 +115,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @@ -151,11 +151,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") 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 index faf3c9ca784..744db4c6853 100644 --- 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 @@ -102,10 +102,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -154,10 +154,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -180,10 +180,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -206,10 +206,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -232,10 +232,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_COMPLETE) 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 index bbca9fca005..d7ca09b50c0 100644 --- 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 @@ -53,10 +53,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_NUMBER) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_STRING) @@ -105,10 +105,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) 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 index 3c61ad409a3..652b9d633f5 100644 --- 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 @@ -45,10 +45,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_VALUE) 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 index 6599943d4fc..7a2a685feb0 100644 --- 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 @@ -97,10 +97,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -123,10 +123,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore 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 index 7c4ad272388..57dd3d7f4af 100644 --- 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 @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -135,10 +135,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -195,10 +195,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -230,10 +230,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -256,10 +256,10 @@ public class Pet { 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) 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 index 89b8b82f23e..3b700bf46ff 100644 --- 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 @@ -42,8 +42,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -52,10 +52,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) @@ -73,10 +73,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAZ) 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 index 9e04d7f37ef..84e293f145f 100644 --- 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 @@ -45,10 +45,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) 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 index eefcacc0922..44f5e28d542 100644 --- 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 @@ -48,10 +48,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) 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 index c3221bdc208..0bd8c1acd22 100644 --- 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 @@ -48,10 +48,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 6.1.6 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 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 index 4b2f31199d4..23f576d8c8d 100644 --- 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 @@ -10,8 +10,8 @@ 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.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; 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 index 0a43fa2d40e..e9b231eac36 100644 --- 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 @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 245502c27cb..c433fca7bf0 100644 --- 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 @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 0ee7ca10136..5cf05089ba9 100644 --- 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 @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index acce678d27d..cd56f9056d1 100644 --- 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 @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 7d58942a9d5..ec49b5340f9 100644 --- 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 @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 1d99c254d99..2bbc8cddff9 100644 --- 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 7ff0d8d1c68..44a19508cee 100644 --- 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { 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) @@ -188,10 +188,10 @@ public class Capitalization { 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) 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 index 275ac0a572a..881114869ef 100644 --- 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 @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 9937475f745..ce3d420120e 100644 --- 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 index deec65f5ecc..f8f404e66be 100644 --- 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 @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index dcd0d2ec424..10a9a7c63a2 100644 --- 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 @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 0eddf18ba0d..d8b3f613a1a 100644 --- 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 @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index d89d61e6410..457513842dd 100644 --- 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 @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 2721eb32f72..b0690af7411 100644 --- 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 @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index ad4fbf45d14..c0bb3091361 100644 --- 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 2981d30db90..439272c3aae 100644 --- 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 @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,10 +299,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -357,10 +357,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -382,10 +382,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,10 +407,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 4ac66ca3434..14d475066d6 100644 --- 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 @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index c9aa160c135..3156e0c16f5 100644 --- 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index e9069943cec..b97483e507a 100644 --- 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 @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 2d464d604c8..02f487ee607 100644 --- 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 @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index c67a8985f9e..674233bf228 100644 --- 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 @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,12 +136,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,12 +188,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,12 +215,12 @@ public class FormatTest { 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) @@ -242,12 +242,12 @@ public class FormatTest { 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) @@ -269,10 +269,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,10 +319,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -344,10 +344,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,10 +369,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -394,10 +394,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,10 +419,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,10 +469,10 @@ public class FormatTest { 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) @@ -494,10 +494,10 @@ public class FormatTest { 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) 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 index 6ed089041e3..b0e52156684 100644 --- 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 5131a02efc6..0e175957b49 100644 --- 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 @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @jakarta.annotation.Nullable @JsonIgnore 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 index 5a4ac913b51..d5856cef8f8 100644 --- 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 16c0c4ffefc..08c9e462e7b 100644 --- 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 6890500da26..2ef6607b664 100644 --- 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 5855bba3134..91d6ac0f272 100644 --- 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 536c114f7bf..3d734f3a626 100644 --- 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 @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index a54c89f4aef..d7a981d7c6d 100644 --- 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 @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 0ae4173b86e..65ecbae7361 100644 --- 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 @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 0e5b485fe91..7dd1956b60d 100644 --- 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 337ee2088f3..b1608478d24 100644 --- 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 @@ -100,10 +100,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -133,10 +133,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -166,10 +166,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -199,10 +199,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -232,10 +232,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -265,10 +265,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -310,10 +310,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -355,10 +355,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -396,10 +396,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -478,10 +478,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -519,10 +519,10 @@ public class NullableClass extends HashMap { 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) 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 index ae83af4b079..d505cd848f2 100644 --- 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 @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index bf0d9346ec4..8b250cd39cd 100644 --- 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 @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,11 +85,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -112,11 +112,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -147,11 +147,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) 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 index 31d5d4f19c5..11b1188e55f 100644 --- 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 03e67767714..39677c6bd31 100644 --- 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index eb11a70eecb..89d59fd4a4d 100644 --- 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 @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 index f032bccf711..43b87af07d0 100644 --- 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @jakarta.annotation.Nullable @JsonIgnore 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 index c4b4ba4b393..9e6fbd0fd89 100644 --- 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 806117333ca..33eb8b5e950 100644 --- 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 92a42c44734..e869ce8915c 100644 --- 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 @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index fb996d933b6..94481f0d92b 100644 --- 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 index 1239e610351..214defe13be 100644 --- 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 @@ -47,10 +47,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 4.7.6.Final - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 2.9.10 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 85b3c9ae19d..9e5d7ef0062 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 @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c7ec666bb18..48cce2e1b92 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 @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3e5dfccd5dc..fd638012ad6 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 @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b73a6b95c5b..0fb7c3ccf51 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ffb6c03113c..4261ff3c03b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 41b29a30249..ef4b636e71d 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 accb755a668..cd221f2a733 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index ea026441f36..2aa380a9921 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed8e1e2da05..8a373c41fc1 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ChildWithNullable.java index d90495dcd16..cf37302c53d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..3a22cce40b5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..d9eb667823f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f142c01c211..2fe1e9548d5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..c026300889e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 58a77ffded8..f4de7bccc58 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 04f1adb80ea..9a2e37cf4a3 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 @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,10 +299,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -357,10 +357,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -382,10 +382,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,10 +407,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e2c63da4e8d..31b78812225 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 @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e149084b1a5..899d32a294d 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Foo.java index 336ab5f2a6d..6eb92e22720 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Foo.java @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 9977c248dee..c1eb15c6864 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f76f9b027ec..f628a150c08 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 @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,12 +136,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,12 +188,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,12 +215,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +242,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,10 +269,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,10 +319,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -344,10 +344,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,10 +369,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -394,10 +394,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,10 +419,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,10 +469,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -494,10 +494,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9fc24a2b7f4..7cab692c045 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ab073044ca9..a688bb1b598 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 136e37557dd..29f371af8b0 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4ec2bb53611..dd6f0ad59bb 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 517b2eb9f07..7c0af5e4781 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8f27c57192..4ca95892895 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..42e71d96a66 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..dd0d3fd9653 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..16728e09539 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 458314f0d83..fe05ad26482 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7ce7d5cb48a..2a887e6aa0e 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 @@ -100,10 +100,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -133,10 +133,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -166,10 +166,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -199,10 +199,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -232,10 +232,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -265,10 +265,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -310,10 +310,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -355,10 +355,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -396,10 +396,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -478,10 +478,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -519,10 +519,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..436cd1f2ba1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f573813253c..4dc8b588878 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 @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,11 +85,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -112,11 +112,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -147,11 +147,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 05dfbdaeefa..f8ab64dbb0a 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7045f92dd8f..1768fc9496d 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 9a077aa0970..b8172c169ed 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 0f980144308..15e84e897bc 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 180ee4787ba..a26c02589d1 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d585c01ecc3..08e36c5f03d 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index 26f99ed95e6..deb7b4074cc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 201029ba21a..181ed783218 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0d37480fa3f..5bf75e39a21 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -47,10 +47,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 6.1.5 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 5.10.2 diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java index bdc58fa9782..52280b0fe15 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -240,9 +240,18 @@ public class ApiClient extends JavaTimeFormatter { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/auth/OAuth.java index 9ab517eee4f..1a1a71bddf9 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,24 +1,48 @@ package org.openapitools.client.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } 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 53262dca481..c16adfd1be1 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 @@ -42,8 +42,8 @@ public class Category { } /** - * Constructor with all args parameters - */ + * 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; @@ -55,10 +55,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 75d9e0f7777..5a9ea10c0e9 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 @@ -47,8 +47,8 @@ public class ModelApiResponse { } /** - * Constructor with all args parameters - */ + * 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; @@ -61,10 +61,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,10 +86,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -111,10 +111,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ad523355f6c..41ac3096668 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 @@ -96,8 +96,8 @@ public class Order { } /** - * Constructor with all args parameters - */ + * 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; @@ -113,10 +113,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,10 +213,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,10 +238,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4d2350bd21c..11c11b3dc22 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 @@ -100,8 +100,8 @@ public class Pet { } /** - * Constructor with all args parameters - */ + * 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; @@ -117,10 +117,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,10 +142,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,10 +167,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -200,10 +200,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -233,10 +233,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -258,11 +258,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 89d04728d6f..c20b84c9c26 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 @@ -42,8 +42,8 @@ public class Tag { } /** - * Constructor with all args parameters - */ + * 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; @@ -55,10 +55,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1de14518c65..846c3859f8e 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 @@ -66,8 +66,8 @@ public class User { } /** - * Constructor with all args parameters - */ + * 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; @@ -85,10 +85,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,10 +160,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,10 +185,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,10 +210,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,10 +235,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,10 +260,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-swagger1/build.gradle b/samples/client/petstore/java/resttemplate-swagger1/build.gradle index ac81d8157a5..42f909e68f7 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/build.gradle +++ b/samples/client/petstore/java/resttemplate-swagger1/build.gradle @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.9" - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/petstore/java/resttemplate-swagger1/pom.xml b/samples/client/petstore/java/resttemplate-swagger1/pom.xml index b7f72a3646f..3d437270395 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/pom.xml +++ b/samples/client/petstore/java/resttemplate-swagger1/pom.xml @@ -287,8 +287,8 @@ UTF-8 1.6.9 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java index 397edd6fec6..8cc51a66ca9 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -240,9 +240,18 @@ public class ApiClient extends JavaTimeFormatter { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/auth/OAuth.java index 80920b5ade9..543c17618ea 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,24 +1,48 @@ package org.openapitools.client.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } 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 b3b5b41f1b2..1db19725e7b 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 @@ -50,10 +50,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -76,10 +76,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_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 f512afe18ed..b27fa94cf9a 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 @@ -55,10 +55,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -81,10 +81,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -107,10 +107,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_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 78d5990a969..423263e25c2 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 @@ -104,10 +104,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -130,10 +130,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -156,10 +156,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -182,10 +182,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -208,10 +208,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -234,10 +234,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_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 9318da486f9..7734b08a259 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -134,10 +134,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -160,10 +160,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -194,10 +194,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -228,10 +228,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -254,11 +254,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") 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 f5223ee058a..862eb249a30 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 @@ -50,10 +50,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -76,10 +76,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_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 30a852d0af0..9e99cbe5ee7 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 @@ -74,10 +74,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -100,10 +100,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -126,10 +126,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -152,10 +152,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -178,10 +178,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EMAIL) @@ -204,10 +204,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -230,10 +230,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PHONE) @@ -256,10 +256,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) diff --git a/samples/client/petstore/java/resttemplate-swagger2/build.gradle b/samples/client/petstore/java/resttemplate-swagger2/build.gradle index bcf5c29c990..5be16c73cce 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/build.gradle +++ b/samples/client/petstore/java/resttemplate-swagger2/build.gradle @@ -98,8 +98,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "2.2.9" - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/petstore/java/resttemplate-swagger2/pom.xml b/samples/client/petstore/java/resttemplate-swagger2/pom.xml index f205fc0c586..35c924e2a5d 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/pom.xml +++ b/samples/client/petstore/java/resttemplate-swagger2/pom.xml @@ -287,8 +287,8 @@ UTF-8 2.2.15 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/ApiClient.java index 397edd6fec6..8cc51a66ca9 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -240,9 +240,18 @@ public class ApiClient extends JavaTimeFormatter { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java index 80920b5ade9..543c17618ea 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,24 +1,48 @@ package org.openapitools.client.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } 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 0f7c33d2ae8..bea2de997a9 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 @@ -49,10 +49,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -75,10 +75,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 0c16024fb7e..8b46360e62b 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 @@ -54,10 +54,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -80,10 +80,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -106,10 +106,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 c595f9c8b8d..46293c735a3 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 @@ -103,10 +103,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -129,10 +129,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -155,10 +155,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -181,10 +181,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -207,10 +207,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -233,10 +233,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 f578ac3077a..691247fae72 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 @@ -107,10 +107,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -159,10 +159,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -193,10 +193,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -227,10 +227,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -253,11 +253,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "pet status in the store") 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 1feff5d025f..4ac68af0a4f 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 @@ -49,10 +49,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -75,10 +75,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 6f757b42fdd..b25e712d1d3 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 @@ -73,10 +73,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -99,10 +99,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -125,10 +125,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -151,10 +151,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -177,10 +177,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_EMAIL) @@ -203,10 +203,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -229,10 +229,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHONE) @@ -255,10 +255,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 94468bd3782..a6e41305ff5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { } ext { - jackson_version = "2.14.2" - jackson_databind_version = "2.15.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index e5eec3c25de..d5e58767e81 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -293,8 +293,8 @@ UTF-8 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 94f632a0535..643da17c651 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -303,9 +303,18 @@ public class ApiClient extends JavaTimeFormatter { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/auth/OAuth.java index 80920b5ade9..543c17618ea 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,24 +1,48 @@ package org.openapitools.client.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } 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 2f5c5eb12d4..165e23daf79 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 @@ -42,17 +42,11 @@ import io.github.threetenjaxb.core.*; @JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "inner") + @XmlElement(name = "map_property") private Map mapProperty = new HashMap<>(); public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Map<String, String> - @XmlElement(name = "inner") + @XmlElement(name = "map_of_map_property") private Map> mapOfMapProperty = new HashMap<>(); public AdditionalPropertiesClass() { @@ -72,10 +66,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,10 +103,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 28fb48270d5..e83ecbb5881 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 @@ -57,10 +57,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 387e6dea9a6..8ca96a8d11e 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 @@ -69,10 +69,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,10 +96,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d8da4096d4d..1e3a799328b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -43,10 +43,7 @@ import io.github.threetenjaxb.core.*; @JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - // Is a container wrapped=false - // items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace= - // items.example= items.type=List<BigDecimal> - @XmlElement(name = "arrayArrayNumber") + @XmlElement(name = "ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly() { @@ -66,10 +63,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index e3d77d286d3..7dbc0a73ba6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -43,10 +43,7 @@ import io.github.threetenjaxb.core.*; @JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - // Is a container wrapped=false - // items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace= - // items.example= items.type=BigDecimal - @XmlElement(name = "arrayNumber") + @XmlElement(name = "ArrayNumber") private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly() { @@ -66,10 +63,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1a7481952e1..bd5fddcc405 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 @@ -45,24 +45,15 @@ import io.github.threetenjaxb.core.*; @JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - // Is a container wrapped=false - // items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "arrayOfString") + @XmlElement(name = "array_of_string") private List arrayOfString = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - // Is a container wrapped=false - // items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace= - // items.example= items.type=List<Long> - @XmlElement(name = "arrayArrayOfInteger") + @XmlElement(name = "array_array_of_integer") private List> arrayArrayOfInteger = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - // Is a container wrapped=false - // items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace= - // items.example= items.type=List<ReadOnlyFirst> - @XmlElement(name = "arrayArrayOfModel") + @XmlElement(name = "array_array_of_model") private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest() { @@ -82,10 +73,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -119,10 +110,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,10 +147,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 286a38f1492..dfe93473371 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 @@ -76,10 +76,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -103,10 +103,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,10 +157,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,10 +184,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -211,10 +211,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index 1342a751c51..7909f246708 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -62,10 +62,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 be0f40c4f84..6314283e639 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 @@ -56,10 +56,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java index dd8703a753c..2d3064d6d89 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -63,10 +63,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 48996499a39..2e6c65a5a89 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -51,10 +51,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 9f00aad1d67..cb7800f79ca 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -51,10 +51,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f88b28cc904..0609a832300 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -53,10 +53,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 86e87e7d4f4..308453ce996 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -62,10 +62,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 66ef0003138..fe2d128626f 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 @@ -125,10 +125,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - // Is a container wrapped=false - // items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "arrayEnum") + @XmlElement(name = "array_enum") private List arrayEnum = new ArrayList<>(); public EnumArrays() { @@ -140,10 +137,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -175,10 +172,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 61b47757307..91c4d3e5067 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 @@ -257,10 +257,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,10 +284,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -311,10 +311,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -338,10 +338,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -365,10 +365,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -399,10 +399,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -426,10 +426,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -453,10 +453,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a345093b67c..a47cf7a9701 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 @@ -48,10 +48,7 @@ public class FakeBigDecimalMap200Response { private BigDecimal someId; public static final String JSON_PROPERTY_SOME_MAP = "someMap"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=BigDecimal - @XmlElement(name = "inner") + @XmlElement(name = "someMap") private Map someMap = new HashMap<>(); public FakeBigDecimalMap200Response() { @@ -63,10 +60,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +95,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 37960229b66..0e33ab8c6c9 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 @@ -48,9 +48,6 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - // Is a container wrapped=false - // items.name=files items.baseName=files items.xmlName= items.xmlNamespace= - // items.example= items.type=ModelFile @XmlElement(name = "files") private List files = new ArrayList<>(); @@ -63,10 +60,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +95,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java index f6be0e6b085..6add39c282c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java @@ -51,10 +51,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 50f1e18f7fa..294291fd55b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -53,10 +53,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 781d709fef0..cdcf2ae6fcb 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 @@ -133,12 +133,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -162,12 +162,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,10 +191,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,12 +218,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -247,12 +247,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +276,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,10 +305,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -332,10 +332,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -359,10 +359,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -386,10 +386,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -413,10 +413,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -440,10 +440,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,10 +467,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -494,10 +494,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -521,10 +521,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -548,10 +548,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a42ee4ae607..1a41cef0e13 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 @@ -51,10 +51,10 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -66,10 +66,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java index e0bcb1b24db..87bdfdccc45 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -55,10 +55,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 ca791ebe738..bed3ba772f0 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 @@ -44,10 +44,7 @@ import io.github.threetenjaxb.core.*; @JacksonXmlRootElement(localName = "MapTest") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Map<String, String> - @XmlElement(name = "inner") + @XmlElement(name = "map_map_of_string") private Map> mapMapOfString = new HashMap<>(); /** @@ -90,24 +87,15 @@ public class MapTest { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "inner") + @XmlElement(name = "map_of_enum_string") private Map mapOfEnumString = new HashMap<>(); public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Boolean - @XmlElement(name = "inner") + @XmlElement(name = "direct_map") private Map directMap = new HashMap<>(); public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Boolean - @XmlElement(name = "inner") + @XmlElement(name = "indirect_map") private Map indirectMap = new HashMap<>(); public MapTest() { @@ -127,10 +115,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,10 +152,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +189,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,10 +226,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0e7a6ac6fa9..af278c1fdfe 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 @@ -55,10 +55,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Animal - @XmlElement(name = "inner") + @XmlElement(name = "map") private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass() { @@ -70,10 +67,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,10 +94,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,10 +129,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 fd7abec7f76..e6a123d74e8 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 @@ -57,10 +57,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1db5153e02d..0dbf203b639 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 @@ -62,10 +62,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -89,10 +89,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java index efde04aa0dd..e7eda4dc8e8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -52,10 +52,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java index 745a41ddec0..4bd0e9491da 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -52,10 +52,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index b5f7134bfa0..785aa98e1e0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -52,10 +52,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 823660e828e..f3c87cf5876 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 @@ -66,10 +66,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,10 +87,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,10 +108,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0c5227f0207..dd75db6a9ce 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 @@ -87,45 +87,27 @@ public class NullableClass extends HashMap { private JsonNullable datetimeProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; - // Is a container wrapped=false - // items.name=arrayNullableProp items.baseName=arrayNullableProp items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "arrayNullableProp") + @XmlElement(name = "array_nullable_prop") private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; - // Is a container wrapped=false - // items.name=arrayAndItemsNullableProp items.baseName=arrayAndItemsNullableProp items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "arrayAndItemsNullableProp") + @XmlElement(name = "array_and_items_nullable_prop") private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - // Is a container wrapped=false - // items.name=arrayItemsNullable items.baseName=arrayItemsNullable items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "arrayItemsNullable") + @XmlElement(name = "array_items_nullable") private List arrayItemsNullable = new ArrayList<>(); public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "inner") + @XmlElement(name = "object_nullable_prop") private JsonNullable> objectNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "inner") + @XmlElement(name = "object_and_items_nullable_prop") private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Object - @XmlElement(name = "inner") + @XmlElement(name = "object_items_nullable") private Map objectItemsNullable = new HashMap<>(); public NullableClass() { @@ -138,10 +120,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -172,10 +154,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -206,10 +188,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -240,10 +222,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -274,10 +256,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -308,10 +290,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -354,10 +336,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -401,10 +383,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -444,10 +426,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -485,10 +467,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -532,10 +514,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -575,10 +557,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 7e5ade29b00..aef7b898fd6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -52,10 +52,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 b8523d8e919..ad019dc1dc1 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 @@ -59,9 +59,6 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - // Is a container wrapped=false - // items.name=bars items.baseName=bars items.xmlName= items.xmlNamespace= - // items.example= items.type=String @XmlElement(name = "bars") private List bars = new ArrayList<>(); @@ -74,10 +71,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -101,11 +98,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -130,11 +127,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -167,11 +164,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 5389fbe7def..e0d799d6c7b 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 @@ -120,10 +120,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,10 +147,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,10 +174,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -228,10 +228,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -255,10 +255,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 53d1710851e..26b911b698f 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 @@ -62,10 +62,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -89,10 +89,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 4027b760bd1..a0c45d607c2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -52,10 +52,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 641295ec133..0440637c016 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 @@ -108,10 +108,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 e229f5c955d..de79b0b7200 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 @@ -64,17 +64,11 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - // Is a container wrapped=true - // items.name=photoUrls items.baseName=photoUrls items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "photoUrls") - @XmlElementWrapper(name = "photoUrl") + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrls") private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - // Is a container wrapped=true - // items.name=tags items.baseName=tags items.xmlName=Tag items.xmlNamespace= - // items.example= items.type=Tag @XmlElement(name = "Tag") @XmlElementWrapper(name = "tag") private List tags = new ArrayList<>(); @@ -134,10 +128,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +155,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +182,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -223,16 +217,15 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - // xmlName=photoUrl @JacksonXmlProperty(localName = "photoUrl") - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrls", useWrapping = true) public Set getPhotoUrls() { return photoUrls; @@ -242,9 +235,8 @@ public class Pet { @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - // xmlName=photoUrl @JacksonXmlProperty(localName = "photoUrl") - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrls", useWrapping = true) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } @@ -263,16 +255,15 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - // xmlName=tag - @JacksonXmlProperty(localName = "tag") - @JacksonXmlElementWrapper(useWrapping = true, localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public List getTags() { return tags; @@ -281,9 +272,8 @@ public class Pet { @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - // xmlName=tag - @JacksonXmlProperty(localName = "tag") - @JacksonXmlElementWrapper(useWrapping = true, localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public void setTags(List tags) { this.tags = tags; } @@ -294,10 +284,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1c7259dbfd1..5a903665d34 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 @@ -50,10 +50,10 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index b1187218fb7..2b45a3107ba 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -52,10 +52,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ad9edf45859..7e46063b9ed 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 @@ -56,10 +56,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index f7638d353ac..a0be16449c0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -55,10 +55,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 5.3.33 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.2 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 6a1f92d32d3..7d511747519 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -298,9 +298,18 @@ public class ApiClient extends JavaTimeFormatter { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/auth/OAuth.java index 80920b5ade9..543c17618ea 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,24 +1,48 @@ package org.openapitools.client.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } 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 ff8249326e7..b27ca071262 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 @@ -44,8 +44,8 @@ public class AdditionalPropertiesClass { } /** - * Constructor with all args parameters - */ + * 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; @@ -65,10 +65,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 763b123cf4d..2c49af607da 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 @@ -43,8 +43,8 @@ public class AllOfWithSingleRef { } /** - * Constructor with all args parameters - */ + * 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; @@ -56,10 +56,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 decc86a5459..051509fbfad 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 @@ -55,8 +55,8 @@ public class Animal { } /** - * Constructor with all args parameters - */ + * 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; @@ -68,10 +68,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -93,10 +93,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f9103b6ef46..6923d25c10f 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 @@ -42,8 +42,8 @@ public class ArrayOfArrayOfNumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ArrayOfArrayOfNumberOnly(@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } @@ -62,10 +62,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3a5bc090b7c..8bfa38e5f39 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 @@ -42,8 +42,8 @@ public class ArrayOfNumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ArrayOfNumberOnly(@JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) List arrayNumber) { this.arrayNumber = arrayNumber; } @@ -62,10 +62,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 2a8e7d6b8f9..d136e14ac7d 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 @@ -50,8 +50,8 @@ public class ArrayTest { } /** - * Constructor with all args parameters - */ + * 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; @@ -72,10 +72,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,10 +105,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 afe76d1effe..662ec53680b 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 @@ -58,8 +58,8 @@ public class Capitalization { } /** - * Constructor with all args parameters - */ + * 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; @@ -75,10 +75,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,10 +100,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,10 +150,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -175,10 +175,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -200,10 +200,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 825d182d714..4254c4c3164 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 @@ -49,8 +49,8 @@ public class Cat extends Animal { } /** - * Constructor with all args parameters - */ + * 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; @@ -62,10 +62,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 26be0de5232..789746dd3bd 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 @@ -42,8 +42,8 @@ public class Category { } /** - * Constructor with all args parameters - */ + * 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; @@ -55,10 +55,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 f7c20ba0565..3122f079ef8 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 @@ -50,8 +50,8 @@ public class ChildWithNullable extends ParentWithNullable { } /** - * Constructor with all args parameters - */ + * 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; @@ -63,10 +63,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0bf712502cf..d3e531b328d 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 @@ -38,8 +38,8 @@ public class ClassModel { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ClassModel(@JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) String propertyClass) { this.propertyClass = propertyClass; } @@ -50,10 +50,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 acaafc3237b..ec034647bb6 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 @@ -38,8 +38,8 @@ public class Client { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Client(@JsonProperty(JSON_PROPERTY_CLIENT) String client) { this.client = client; } @@ -50,10 +50,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 91e2c31cbe4..293be8255e3 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 @@ -40,8 +40,8 @@ public class DeprecatedObject { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public DeprecatedObject(@JsonProperty(JSON_PROPERTY_NAME) String name) { this.name = name; } @@ -52,10 +52,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 fe6d658d442..74c5a20f877 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 @@ -49,8 +49,8 @@ public class Dog extends Animal { } /** - * Constructor with all args parameters - */ + * 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; @@ -62,10 +62,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1c9ca816a07..508b1b49e8d 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 @@ -115,8 +115,8 @@ public class EnumArrays { } /** - * Constructor with all args parameters - */ + * 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; @@ -128,10 +128,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +161,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c40d9ee636c..152c0460843 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 @@ -219,8 +219,8 @@ public class EnumTest { } /** - * Constructor with all args parameters - */ + * 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; @@ -238,10 +238,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -263,10 +263,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -288,10 +288,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -313,10 +313,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -338,10 +338,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -371,10 +371,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,10 +396,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -421,10 +421,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed2bd8b8cc3..1f4a6c26770 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 @@ -46,8 +46,8 @@ public class FakeBigDecimalMap200Response { } /** - * Constructor with all args parameters - */ + * 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; @@ -59,10 +59,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,10 +92,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 141f1ed45d8..311ed0148e3 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 @@ -46,8 +46,8 @@ public class FileSchemaTestClass { } /** - * Constructor with all args parameters - */ + * 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; @@ -59,10 +59,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,10 +92,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 afe48149069..a02b742d9d5 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 @@ -38,8 +38,8 @@ public class Foo { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Foo(@JsonProperty(JSON_PROPERTY_BAR) String bar) { this.bar = bar; } @@ -50,10 +50,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a80081e63d5..2e87e207303 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 @@ -40,8 +40,8 @@ public class FooGetDefaultResponse { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public FooGetDefaultResponse(@JsonProperty(JSON_PROPERTY_STRING) Foo string) { this.string = string; } @@ -52,10 +52,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 121ba1bba78..fe1e3078a4c 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 @@ -104,8 +104,8 @@ public class FormatTest { } /** - * Constructor with all args parameters - */ + * 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; @@ -131,12 +131,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,12 +158,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,10 +185,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,12 +210,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -237,12 +237,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -264,12 +264,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -291,10 +291,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,10 +316,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -341,10 +341,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -366,10 +366,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -391,10 +391,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -416,10 +416,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,10 +441,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -466,10 +466,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -491,10 +491,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -516,10 +516,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 fa85baa3bea..0c13ee4f6f1 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters and all parameters - */ + * Constructor with only readonly parameters and all parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8df265798c..590605e89a7 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 @@ -42,8 +42,8 @@ public class HealthCheckResult { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public HealthCheckResult(@JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) String nullableMessage) { this.nullableMessage = nullableMessage == null ? JsonNullable.undefined() : JsonNullable.of(nullableMessage); } @@ -54,10 +54,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 1b8592530bc..6cdec54e77d 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 @@ -87,8 +87,8 @@ public class MapTest { } /** - * Constructor with all args parameters - */ + * 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; @@ -110,10 +110,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -143,10 +143,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,10 +209,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f3a7afa4064..4a07ed9f999 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 @@ -51,8 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } /** - * Constructor with all args parameters - */ + * 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; @@ -65,10 +65,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,10 +123,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 6eee6490ef6..703fc53cccb 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 @@ -43,8 +43,8 @@ public class Model200Response { } /** - * Constructor with all args parameters - */ + * 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; @@ -56,10 +56,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 90de098a3b1..af6726e7577 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 @@ -47,8 +47,8 @@ public class ModelApiResponse { } /** - * Constructor with all args parameters - */ + * 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; @@ -61,10 +61,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,10 +86,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -111,10 +111,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 94bab49dfa7..5009b559e78 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 @@ -39,8 +39,8 @@ public class ModelFile { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelFile(@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) String sourceURI) { this.sourceURI = sourceURI; } @@ -51,10 +51,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 76eb515b5a2..2df8c16244c 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 @@ -39,8 +39,8 @@ public class ModelList { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelList(@JsonProperty(JSON_PROPERTY_123LIST) String _123list) { this._123list = _123list; } @@ -51,10 +51,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 8b27c484888..13e7d6e3ea0 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 @@ -39,8 +39,8 @@ public class ModelReturn { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelReturn(@JsonProperty(JSON_PROPERTY_RETURN) Integer _return) { this._return = _return; } @@ -51,10 +51,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0abc898a643..02552d4feaf 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -62,8 +62,8 @@ public class Name { } /** - * Constructor with all args parameters - */ + * 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; @@ -77,10 +77,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,10 +96,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c2483aaa7b9..c75361404e5 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 @@ -95,8 +95,8 @@ public class NullableClass extends HashMap { } /** - * Constructor with all args parameters - */ + * 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); @@ -119,10 +119,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -152,10 +152,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -185,10 +185,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -218,10 +218,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -251,10 +251,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -284,10 +284,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -329,10 +329,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -374,10 +374,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -415,10 +415,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -452,10 +452,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -497,10 +497,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -538,10 +538,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) 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 96c4017ee89..588c6a85d6a 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 @@ -39,8 +39,8 @@ public class NumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public NumberOnly(@JsonProperty(JSON_PROPERTY_JUST_NUMBER) BigDecimal justNumber) { this.justNumber = justNumber; } @@ -51,10 +51,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 58f8db806f7..59c0f74e38d 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 @@ -55,8 +55,8 @@ public class ObjectWithDeprecatedFields { } /** - * Constructor with all args parameters - */ + * 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; @@ -70,10 +70,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -95,11 +95,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -122,11 +122,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -157,11 +157,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) 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 24162db7c62..af1a9fdf9b1 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 @@ -96,8 +96,8 @@ public class Order { } /** - * Constructor with all args parameters - */ + * 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; @@ -113,10 +113,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,10 +213,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,10 +238,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3a57fc43ad4..8ed19d99e67 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 @@ -47,8 +47,8 @@ public class OuterComposite { } /** - * Constructor with all args parameters - */ + * 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; @@ -61,10 +61,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,10 +86,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -111,10 +111,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 b7b6b6175c2..56626aeffa9 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 @@ -39,8 +39,8 @@ public class OuterObjectWithEnumProperty { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public OuterObjectWithEnumProperty(@JsonProperty(JSON_PROPERTY_VALUE) OuterEnumInteger value) { this.value = value; } @@ -51,10 +51,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 b108cbf6ea4..03c862c5ec0 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 @@ -91,8 +91,8 @@ public class ParentWithNullable { } /** - * Constructor with all args parameters - */ + * 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); @@ -104,10 +104,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 edc9f16a7f2..bbf3cfa2f54 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 @@ -103,8 +103,8 @@ public class Pet { } /** - * Constructor with all args parameters - */ + * 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; @@ -120,10 +120,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -145,10 +145,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,10 +170,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -203,10 +203,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -237,10 +237,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,10 +262,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d74cc836731..0fbbadc9322 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -52,17 +52,17 @@ public class ReadOnlyFirst { } /** - * Constructor with all args parameters - */ + * 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 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7651df76be9..49aa8ee0a9f 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 @@ -39,8 +39,8 @@ public class SpecialModelName { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public SpecialModelName(@JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @@ -51,10 +51,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1e0942a8f47..978fe85e942 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 @@ -42,8 +42,8 @@ public class Tag { } /** - * Constructor with all args parameters - */ + * 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; @@ -55,10 +55,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,10 +80,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 40747d4d557..21e1f754340 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 @@ -42,8 +42,8 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapswagger-annotations ${swagger-annotations-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.google.code.findbugs @@ -252,6 +247,11 @@ jackson-annotations ${jackson-version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + org.openapitools jackson-databind-nullable @@ -277,6 +277,11 @@ play-ahc-ws_2.12 ${play-version} + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + jakarta.annotation jakarta.annotation-api @@ -285,8 +290,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -297,8 +302,8 @@ ${java.version} ${java.version} 1.6.3 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.1.1 2.6.7 @@ -306,6 +311,6 @@ 2.1.1 3.0.2 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 98de7838ea3..a52f4dfc8d0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -48,10 +48,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3647badbe5b..e199e4f8eff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 6d5d7154ed8..ea8f6d9a687 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -48,10 +48,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) 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 a933da27912..041e8cb0969 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 @@ -97,10 +97,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @@ -131,10 +131,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -166,10 +166,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @@ -200,10 +200,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @@ -234,10 +234,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @jakarta.annotation.Nullable @Valid @@ -269,10 +269,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @jakarta.annotation.Nullable @Valid @@ -304,10 +304,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @jakarta.annotation.Nullable @Valid @@ -339,10 +339,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @jakarta.annotation.Nullable @Valid @@ -366,10 +366,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @@ -392,10 +392,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @@ -418,10 +418,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 598a8b4d18e..9f92dc7a207 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -48,10 +48,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 4993bc01fbe..f21d2abe20d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -49,10 +49,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 439d13d666e..54555c5048f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -48,10 +48,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 75b8b44e8a8..97dae533916 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -48,10 +48,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) 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 68b0e8f5c91..499060cd857 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 @@ -63,10 +63,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -90,10 +90,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 412978ab803..febc9e518af 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -57,10 +57,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a6e7b61325a..75696392dff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -57,10 +57,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @jakarta.annotation.Nullable @Valid 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 830eee3cbd2..e76b308a3f2 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 @@ -65,10 +65,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @@ -99,10 +99,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @jakarta.annotation.Nullable @Valid @@ -134,10 +134,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @jakarta.annotation.Nullable @Valid diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 278b3504a25..bc2b367c950 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -95,10 +95,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) 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 c3d7ca473c5..d08855f977d 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 @@ -65,10 +65,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @@ -91,10 +91,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @@ -117,10 +117,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @@ -143,10 +143,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @@ -169,10 +169,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @@ -195,10 +195,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) 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 0702a4e4b91..1ea152ef03d 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 @@ -59,10 +59,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) 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 116fe04bf20..20d7b34594b 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 @@ -49,10 +49,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -75,10 +75,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index afbf4202cfd..eefc6010da4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index cbafd037706..117cf2c24bc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -45,10 +45,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index be7b0e3acfe..d33fb3c360d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -56,10 +56,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) 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 402847e9c8d..6d08ccb0490 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 @@ -122,10 +122,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @@ -156,10 +156,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) 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 e046bf275b0..426476f6151 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 @@ -207,10 +207,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @@ -233,10 +233,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -260,10 +260,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @@ -286,10 +286,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @@ -312,10 +312,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @jakarta.annotation.Nullable @Valid 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 732ab8fbe34..db6f49a269c 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 @@ -53,10 +53,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @jakarta.annotation.Nullable @Valid @@ -88,10 +88,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @jakarta.annotation.Nullable @Valid 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 bc87e89136e..e97ea911fc5 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 @@ -103,12 +103,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @jakarta.annotation.Nullable @Min(10) @Max(100) @JsonProperty(JSON_PROPERTY_INTEGER) @@ -131,12 +131,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @jakarta.annotation.Nullable @Min(20) @Max(200) @JsonProperty(JSON_PROPERTY_INT32) @@ -159,10 +159,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @@ -185,12 +185,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -215,12 +215,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @jakarta.annotation.Nullable @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(JSON_PROPERTY_FLOAT) @@ -243,12 +243,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @jakarta.annotation.Nullable @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(JSON_PROPERTY_DOUBLE) @@ -271,10 +271,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @Pattern(regexp="/[a-z]/i") @JsonProperty(JSON_PROPERTY_STRING) @@ -297,10 +297,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -324,10 +324,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @jakarta.annotation.Nullable @Valid @@ -351,10 +351,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -379,10 +379,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Valid @@ -406,10 +406,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Valid @@ -433,10 +433,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nonnull @NotNull @Size(min=10,max=64) @@ -460,10 +460,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @jakarta.annotation.Nullable @Valid 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 643809d2c31..bb7e3296908 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 @@ -44,8 +44,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -56,10 +56,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -71,10 +71,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 f68ec4df914..afa2323fd70 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 @@ -102,10 +102,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @jakarta.annotation.Nullable @Valid @@ -137,10 +137,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @@ -171,10 +171,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @@ -205,10 +205,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) 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 ebf89a2463a..d7250d03af6 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 @@ -58,10 +58,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @Valid @@ -85,10 +85,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @Valid @@ -120,10 +120,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @jakarta.annotation.Nullable @Valid 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 5e373830d04..a399c803477 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 @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @@ -76,10 +76,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) 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 b46efb531bc..8a0a8fdbfe3 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 @@ -54,10 +54,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @@ -80,10 +80,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @@ -106,10 +106,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java index 52f2c28eb00..57d7654cca2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java @@ -46,10 +46,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java index c1e9132f44e..bb278f8dc51 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java @@ -46,10 +46,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index 6b142ff33d8..58412b3c9d7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) 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 af284016f17..1319ebee08a 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 @@ -51,8 +51,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -69,10 +69,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -90,10 +90,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @@ -111,10 +111,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @@ -131,10 +131,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index aa979159736..927151cc500 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -46,10 +46,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @jakarta.annotation.Nullable @Valid 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 7313e8ad8d8..41dc94b45cf 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 @@ -103,10 +103,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -129,10 +129,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @@ -155,10 +155,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -181,10 +181,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @Valid @@ -208,10 +208,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @@ -234,10 +234,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 e23424c36bd..00903c6385f 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 @@ -54,10 +54,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -81,10 +81,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @@ -107,10 +107,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) 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 a5b395f3e16..b075e20b1db 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 @@ -110,10 +110,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -136,10 +136,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @Valid @@ -163,10 +163,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -198,10 +198,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -234,10 +234,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @Valid @@ -261,10 +261,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 8341211432b..7a9b88186f2 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 @@ -43,8 +43,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -53,10 +53,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @@ -74,10 +74,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 8da708b44f4..eb4daf20ab5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -46,10 +46,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) 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 2d769878e57..a85aef12767 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 @@ -49,10 +49,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -75,10 +75,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 38647bdab8f..69ceb01cd4c 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 @@ -65,10 +65,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -92,10 +92,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -120,10 +120,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -147,10 +147,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -182,10 +182,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @jakarta.annotation.Nonnull @NotNull 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 e3d89fcb283..60a3c76e28f 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 @@ -69,10 +69,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -96,10 +96,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @Valid @@ -124,10 +124,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -151,10 +151,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -178,10 +178,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @jakarta.annotation.Nonnull @NotNull @@ -213,10 +213,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @jakarta.annotation.Nonnull @NotNull 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 5732783a30b..8a682a9a69d 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 @@ -73,10 +73,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -99,10 +99,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @@ -125,10 +125,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -151,10 +151,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -177,10 +177,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @@ -203,10 +203,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -229,10 +229,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @@ -255,10 +255,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) 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 4f236d780d5..514d6c5ebfd 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 @@ -161,10 +161,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @@ -187,10 +187,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -214,10 +214,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @@ -240,10 +240,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @@ -274,10 +274,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @@ -300,10 +300,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -326,10 +326,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -353,10 +353,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @@ -379,10 +379,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @@ -413,10 +413,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @@ -447,10 +447,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @@ -473,10 +473,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -499,10 +499,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -526,10 +526,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @@ -552,10 +552,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @@ -586,10 +586,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @@ -620,10 +620,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @@ -646,10 +646,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -672,10 +672,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -699,10 +699,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @@ -725,10 +725,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @@ -759,10 +759,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @@ -793,10 +793,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @@ -819,10 +819,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -845,10 +845,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @jakarta.annotation.Nullable @Valid @@ -872,10 +872,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @@ -898,10 +898,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @@ -932,10 +932,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @@ -966,10 +966,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 0307ed17779..575598ee4c2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -1,9 +1,21 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 AnotherFakeApi @@ -12,7 +24,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -24,8 +36,9 @@ public class AnotherFakeApiTest { */ @Test public void call123testSpecialTagsTest() { - Client client = null; - // Client response = api.call123testSpecialTags(client); + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java index 82a96b9818b..20f06e6eb90 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -9,14 +9,21 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 FakeApi */ @@ -24,11 +31,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +67,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +103,8 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +116,8 @@ public class FakeApiTest { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +128,15 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +201,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +217,22 @@ public class FakeApiTest { String param2 = null; // api.testJsonFormData(param, param2); + // 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; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index e615576da23..4037ef6fbe8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -1,9 +1,20 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 FakeClassnameTags123Api @@ -12,7 +23,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -24,8 +35,8 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java index 9d7a40be314..cc6f0aba773 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -1,12 +1,23 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; -import org.openapitools.client.model.Pet; - 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.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 PetApi @@ -15,7 +26,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -23,19 +34,19 @@ public class PetApiTest { /** * Add a new pet to the store * - * + * */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } /** * Deletes a pet * - * + * */ @Test public void deletePetTest() { @@ -64,8 +75,8 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -84,19 +95,19 @@ public class PetApiTest { /** * Update an existing pet * - * + * */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } /** * Updates a pet in the store with form data * - * + * */ @Test public void updatePetWithFormTest() { @@ -110,21 +121,21 @@ public class PetApiTest { /** * uploads an image * - * + * */ @Test public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); // TODO: test validations } /** * uploads an image (required) * - * + * */ @Test public void uploadFileWithRequiredFileTest() { diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java index 8cb33d8fd16..cb6aefe9459 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -1,9 +1,20 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +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 StoreApi @@ -12,7 +23,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -55,12 +66,12 @@ public class StoreApiTest { /** * Place an order for a pet * - * + * */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java index c64cf2a1a68..ab150fabca4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,11 +1,21 @@ package org.openapitools.client.api; -import org.junit.Before; -import org.junit.Test; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +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 @@ -14,7 +24,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -26,32 +36,32 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } /** * Creates list of users with given input array * - * + * */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List<@Valid User> body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } /** * Creates list of users with given input array * - * + * */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List<@Valid User> body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -70,7 +80,7 @@ public class UserApiTest { /** * Get user by user name * - * + * */ @Test public void getUserByNameTest() { @@ -82,7 +92,7 @@ public class UserApiTest { /** * Logs user into the system * - * + * */ @Test public void loginUserTest() { @@ -95,7 +105,7 @@ public class UserApiTest { /** * Logs out current logged in user session * - * + * */ @Test public void logoutUserTest() { @@ -111,8 +121,8 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 2b0bd0bbaef..faacb289c17 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index c6dd88eea82..b506ff7ae92 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,29 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 9d474c0dd80..ba65ffedc14 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index c6bcc988bf9..72854079e5e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,47 +13,119 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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 } /** - * Test the property 'mapProperty' + * Test the property 'mapString' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void mapStringTest() { + // TODO: test mapString } /** - * Test the property 'mapOfMapProperty' + * Test the property 'mapNumber' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' + */ + @Test + void anytype2Test() { + // TODO: test anytype2 + } + + /** + * Test the property 'anytype3' + */ + @Test + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index bf1b1c427b6..916c2c2bcb3 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index b9cb6470e38..a099245eec5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,29 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3cbcb8ec3b0..d47c9a37d1f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 1d3c05075ea..3820dd2e23c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java index beb02882b30..24776d3cb51 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,29 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index ae7970522b1..6bbe877044d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.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.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 6151b7068b7..eaf908bb1ab 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.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.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 4bb62b6569a..99c6bcf5360 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd150512..20bc4e0d424 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/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/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java index eae9be7938c..a0217acd1f2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java index dcb9f2d4cae..1b389a075be 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,30 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -42,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,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/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java index 1df27cf0320..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java index 04eb02f835e..6ef5c744fbc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java index 03b6bb41a52..8028f11bc2b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java index 06ac28f804a..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,30 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -42,7 +44,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +52,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,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/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 11b5f01985f..4a755b0d442 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,29 +13,29 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java index cb51ca50c95..48aa1a737fc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -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/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java index 13122a0cb97..b06e3eb195d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -42,7 +41,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -50,7 +49,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -58,7 +57,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -66,7 +65,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -74,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/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a6b0d8ff7b0..0048cb2c749 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,45 +13,46 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.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 */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java index 097984bdeac..3060f7f2d56 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,32 +13,31 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +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 */ -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 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -102,7 +101,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -110,7 +109,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -118,7 +117,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -126,7 +125,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -134,7 +133,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -142,8 +141,16 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 2c4b2470b98..908f0aff6ed 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java index 0f08d8c88f0..3752c5ba31f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,28 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 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 } @@ -44,7 +42,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -52,7 +50,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -60,7 +58,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -68,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/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 95cd93a316d..0f47e193af8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,33 +13,31 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -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 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 } @@ -47,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -55,7 +53,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -63,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/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 1ad55ca32ea..5743b70142b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 73d28676aea..436e4abd59e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java index 5b3fde28d4b..f128d7b9ac2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java index 36755ee2bd6..92273f48d23 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b073fda0014..1c5337654cd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java index e81ebc38e65..1a6aa18fa20 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 565c8bd0627..8623386a5e9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java index d65ce716e13..670c2535646 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 49b656a93fa..870a977da94 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,28 +13,27 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 61154c6d881..0333ee657a0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -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/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java index bf6908e4a45..2e4303f1e4b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,31 +13,34 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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 } @@ -45,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -61,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -69,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -77,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -85,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/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index e48b31a39fd..c56da4290fa 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 1696eee82da..9501cf722d6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java index b37aca5fdfc..dc9cf9742ef 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 409076e80a3..7ee75c35731 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.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.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index ffd8f3ddc33..5c77882f500 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.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.junit.Assert; -import org.junit.Ignore; -import 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,15 +52,23 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -68,7 +76,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -76,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/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java index 76733c9e72f..69d274133b9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,27 +13,26 @@ 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java index 55e75391e00..d2e45fadf56 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,30 +13,30 @@ 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.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.junit.Assert; -import org.junit.Ignore; -import 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,56 +220,56 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index af7698cba39..d64edfad025 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -99,10 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_databind_version = "2.15.2" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" json_fire_version = "1.9.0" } @@ -116,7 +115,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_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/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index 1a2ae1ec441..06a3a304b69 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -16,7 +16,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 619349f6878..e171f876690 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -204,11 +204,6 @@ swagger-annotations ${swagger-annotations-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.google.code.findbugs @@ -254,8 +249,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -267,10 +262,9 @@ ${java.version} 1.9.0 1.6.3 - 2.15.2 2.5.0 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java index bce9a553a7d..65ad4ef6f55 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -34,14 +34,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -50,11 +47,6 @@ public class JSON { private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static final StdDateFormat sdf = new StdDateFormat() - .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) - .withColonInTimeZone(true); - private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() .registerTypeSelector(Animal.class, new TypeSelector() { @@ -293,7 +285,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -303,7 +295,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -329,7 +321,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -348,7 +340,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index e482d8cc427..3fe406df7c4 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3171e88ad4e..46f046cffe0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 43b1e4ab7c2..215779a63ce 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 cc4e35b8534..6c372a22b0f 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 @@ -92,10 +92,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable public Map getMapString() { @@ -121,10 +121,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable public Map getMapNumber() { @@ -150,10 +150,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable public Map getMapInteger() { @@ -179,10 +179,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable public Map getMapBoolean() { @@ -208,10 +208,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable public Map> getMapArrayInteger() { @@ -237,10 +237,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapArrayAnytype() { @@ -266,10 +266,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable public Map> getMapMapString() { @@ -295,10 +295,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapMapAnytype() { @@ -316,10 +316,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { @@ -337,10 +337,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable public Object getAnytype2() { @@ -358,10 +358,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable public Object getAnytype3() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c5e427ba04a..a296f8fd549 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a5faebcb64d..36c25a8e996 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e6abb5561b6..542ce688ca0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfe652d2cdb..3e129ecfd28 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 42bfd3e8f78..eb7e8b30744 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 @@ -44,10 +44,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { @@ -65,10 +65,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c52cba33e4f..389a7f17e4e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 8b20e8ad508..b71bac70c4b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { 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 d32703c6a35..c0a48a9efc1 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 @@ -60,10 +60,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { @@ -89,10 +89,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { @@ -118,10 +118,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java index 35428f6c8e1..ef64083f1be 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -93,10 +93,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable public KindEnum getKind() { 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 5754da56c1a..a0305d92e96 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 @@ -60,10 +60,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { @@ -81,10 +81,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { @@ -102,10 +102,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { @@ -123,10 +123,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { @@ -144,10 +144,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { 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 2facf39b805..1842272b068 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 @@ -42,10 +42,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { 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 175c4272671..c9e9db35214 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 @@ -44,10 +44,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java index a85a5d6dff6..a088bdea486 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,10 +40,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java index 1af3141f62e..5187ec2ad84 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java @@ -40,10 +40,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java index 2edada5cce9..c4aed068eba 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java @@ -42,10 +42,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { 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 bb1b5af5ec2..5a34b48a8cc 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 @@ -141,10 +141,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { @@ -170,10 +170,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { 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 cf7152d7b74..5d19fd258f4 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 @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { @@ -270,10 +270,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { @@ -291,10 +291,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { @@ -312,10 +312,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { @@ -333,10 +333,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { 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 58470d89d2c..3b2c3532077 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 @@ -48,10 +48,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { @@ -77,10 +77,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { 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 6558de31c11..1e9bdb1071f 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 @@ -97,12 +97,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { @@ -120,12 +120,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { @@ -143,10 +143,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { @@ -164,12 +164,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { @@ -187,12 +187,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { @@ -210,12 +210,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { @@ -233,10 +233,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { @@ -254,10 +254,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { @@ -275,10 +275,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { @@ -296,10 +296,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { @@ -317,10 +317,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -338,10 +338,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -359,10 +359,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable public BigDecimal getBigDecimal() { 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 7b36ff52a99..ddd630dd409 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 @@ -38,8 +38,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -50,10 +50,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -62,10 +62,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { 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 35c12d819b6..4c0a00b58e4 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 @@ -109,10 +109,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { @@ -138,10 +138,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { @@ -167,10 +167,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { @@ -196,10 +196,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { 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 3ea68ff1cde..d3754724ddf 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 @@ -53,10 +53,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -74,10 +74,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -103,10 +103,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { 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 568e11bb99d..6aeee587cf5 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 @@ -44,10 +44,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { @@ -65,10 +65,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { 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 8b0bae353e6..c4595dcc553 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 @@ -48,10 +48,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { @@ -69,10 +69,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java index ed1fb11bb63..30a33932088 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -40,10 +40,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java index 4596b18cba3..ea70d4c29c6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java @@ -40,10 +40,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java index 2060a7f467e..094dfebca69 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,10 +40,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { 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 abd4b6b520e..addc3be90ea 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 @@ -46,8 +46,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -64,10 +64,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { @@ -79,10 +79,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { @@ -97,10 +97,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { @@ -112,10 +112,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java index 70ae97980a4..91d482cd5a1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -41,10 +41,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { 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 ddfe93fb538..33e05a4ccec 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 @@ -110,10 +110,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -131,10 +131,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { @@ -152,10 +152,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { @@ -173,10 +173,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { @@ -194,10 +194,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { @@ -215,10 +215,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { 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 29cad25a60a..1b19db05cc6 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 @@ -49,10 +49,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { @@ -70,10 +70,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { @@ -91,10 +91,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { 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 a3589f3a3a2..4653705b841 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 @@ -116,10 +116,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -137,10 +137,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { @@ -187,10 +187,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public Set getPhotoUrls() { @@ -216,10 +216,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { @@ -237,10 +237,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { 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 b7e9397bb92..5ad85674606 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 @@ -38,8 +38,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -48,10 +48,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -66,10 +66,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java index dfe54530145..430eb91b95c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -40,10 +40,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { 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 c5a553b77db..af5dcd5a77d 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 @@ -44,10 +44,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 5ecc2f60e07..613766c04cc 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 @@ -60,10 +60,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -81,10 +81,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -102,10 +102,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -123,10 +123,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -152,10 +152,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 3f3671dc58e..5fa951fd9f1 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 @@ -64,10 +64,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -85,10 +85,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -106,10 +106,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull public Float getFloatItem() { @@ -127,10 +127,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -148,10 +148,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -177,10 +177,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 a450c67dfa8..574f127efc7 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 @@ -68,10 +68,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -89,10 +89,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { @@ -131,10 +131,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { @@ -152,10 +152,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { @@ -194,10 +194,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { @@ -215,10 +215,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { 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 1ac473f9da6..b36215cb37c 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 @@ -156,10 +156,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable public String getAttributeString() { @@ -177,10 +177,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getAttributeNumber() { @@ -198,10 +198,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable public Integer getAttributeInteger() { @@ -219,10 +219,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable public Boolean getAttributeBoolean() { @@ -248,10 +248,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable public List getWrappedArray() { @@ -269,10 +269,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable public String getNameString() { @@ -290,10 +290,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNameNumber() { @@ -311,10 +311,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable public Integer getNameInteger() { @@ -332,10 +332,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNameBoolean() { @@ -361,10 +361,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable public List getNameArray() { @@ -390,10 +390,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable public List getNameWrappedArray() { @@ -411,10 +411,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable public String getPrefixString() { @@ -432,10 +432,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNumber() { @@ -453,10 +453,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixInteger() { @@ -474,10 +474,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixBoolean() { @@ -503,10 +503,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable public List getPrefixArray() { @@ -532,10 +532,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixWrappedArray() { @@ -553,10 +553,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable public String getNamespaceString() { @@ -574,10 +574,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNamespaceNumber() { @@ -595,10 +595,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable public Integer getNamespaceInteger() { @@ -616,10 +616,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNamespaceBoolean() { @@ -645,10 +645,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable public List getNamespaceArray() { @@ -674,10 +674,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable public List getNamespaceWrappedArray() { @@ -695,10 +695,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable public String getPrefixNsString() { @@ -716,10 +716,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNsNumber() { @@ -737,10 +737,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixNsInteger() { @@ -758,10 +758,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixNsBoolean() { @@ -787,10 +787,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsArray() { @@ -816,10 +816,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsWrappedArray() { diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 1d45ba717a2..ac000a3d22a 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -25,12 +29,13 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number */ @Test - public void testSpecialTagsTest() { - Client client = null; - // Client response = api.testSpecialTags(client); + public void call123testSpecialTagsTest() { + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java index eaff766c5d5..896c594ae92 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -5,10 +5,14 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -24,11 +28,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +100,8 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +113,8 @@ public class FakeApiTest { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +125,15 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +198,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +214,22 @@ public class FakeApiTest { String param2 = null; // api.testJsonFormData(param, param2); + // 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; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6e32cc28481..3bde7219918 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -29,8 +32,8 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java index 65eed9391e9..c9cf0ff38e4 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -4,9 +4,13 @@ import org.openapitools.client.ApiClient; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Before; -import org.junit.Test; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -19,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -31,8 +35,8 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } @@ -68,8 +72,8 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -92,8 +96,8 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } @@ -120,8 +124,22 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + 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 } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java index 2f72f617c3a..3a00aa1b95e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -64,8 +67,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java index 9174f6d0250..a269d4fc6b1 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -29,8 +33,8 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } @@ -41,8 +45,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } @@ -53,8 +57,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -114,8 +118,8 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 656f0577161..04fa4f5b6d9 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 4c5bdc4ffad..80dc3fcbd43 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index de976999c63..ca1046a0fc8 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3c18ad38c7e..3c34271bf0d 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,45 +18,115 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +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 } /** - * Test the property 'mapProperty' + * Test the property 'mapString' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void mapStringTest() { + // TODO: test mapString } /** - * Test the property 'mapOfMapProperty' + * Test the property 'mapNumber' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' + */ + @Test + void anytype2Test() { + // TODO: test anytype2 + } + + /** + * Test the property 'anytype3' + */ + @Test + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 712e0c131b1..e9f37e84ecd 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index a2039fa83a5..3d6ac0eec25 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3c9fe9323b8..47389e5fd54 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3a3942ab84d..162ae6f2edd 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java index 30ed464f5e1..e8508c4319b 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +49,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 70947526050..9d8fb3480f6 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 2f88d6ad4b9..ef70479bb3c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 3182aa65481..f5c7ed8752f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,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/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d8..aa1db2031da 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -42,7 +42,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 1d029ba7c50..eda1830e0c0 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,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/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java index 718bb5b6baf..6e38fb46e73 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 +42,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java index 79374c54e6f..4ac631b1e8c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java index 4c66db89c4f..aa381b709d9 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java index 1a9f6d6fc9e..95f0e2d39d2 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java index 8392c174564..f65ec9fbebe 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 +42,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java index a116bb028fc..1175d0a96ec 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +44,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,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/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java index 97855ba723a..cb2a9c69498 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java index d43e3cace6d..b097f85302d 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a960673c616..08d51e19dad 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,43 +18,42 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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.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 */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java index c6ffb82e15b..bcdcaf9dd06 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; 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 } @@ -47,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -55,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -63,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -71,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -79,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -87,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -95,7 +94,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -103,7 +102,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -111,7 +110,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -119,7 +118,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -127,7 +126,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -135,7 +134,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -143,8 +142,16 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index d854c0c9daf..01be6b15413 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java index 9f78d486659..d9b643e6b43 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 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 } @@ -47,7 +43,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,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/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f9229a1a76b..0d57da0126e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,30 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; 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 } @@ -49,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -57,7 +54,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -65,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/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dcea5877334..ecae6e0f437 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,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/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 46b8648fdcc..bb4aa91a78c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,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/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c38..973730324cc 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a..bdba8c46a91 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 4135ead5686..ae4eaf6295f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java index bdc04b000c1..f35cf4746e5 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,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/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 214a6d4538d..16ed327afed 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,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/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java index b97d88a4de2..439814c48b1 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +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 */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -44,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -60,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -68,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -76,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -84,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/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 710bfedd580..cf76f8e58d0 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,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/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 064f84b3ff6..4110989633b 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java index 4e8e4c65827..82448ec2368 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,29 +18,29 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index c89b608f609..72101f74b61 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d058c884e49..dfc2065188d 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java index 27acc7ce8e7..36eea1ddb7b 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index f120407395a..3f8ac3d4a3f 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5e99dff0cae..e0a7a0d614c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,15 +53,23 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +77,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +85,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java index da1c9bda4b5..5163783cfdc 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,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/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java index 5e861e18621..3cfe59d203c 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,56 +221,56 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 98ca76ac50a..f55f6d44fe9 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -99,10 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_databind_version = "2.15.2" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" rx_java_version = "2.1.1" json_fire_version = "1.9.0" } @@ -119,7 +118,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_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/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 872d126e7c5..1fc10a88b7a 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 62305514590..8ee5b1ab864 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -204,11 +204,6 @@ swagger-annotations ${swagger-annotations-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.google.code.findbugs @@ -264,8 +259,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -277,11 +272,10 @@ ${java.version} 1.9.0 1.6.3 - 2.15.2 2.5.0 2.1.1 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java index bce9a553a7d..65ad4ef6f55 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -34,14 +34,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -50,11 +47,6 @@ public class JSON { private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static final StdDateFormat sdf = new StdDateFormat() - .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) - .withColonInTimeZone(true); - private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() .registerTypeSelector(Animal.class, new TypeSelector() { @@ -293,7 +285,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -303,7 +295,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -329,7 +321,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -348,7 +340,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index e482d8cc427..3fe406df7c4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3171e88ad4e..46f046cffe0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 43b1e4ab7c2..215779a63ce 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 cc4e35b8534..6c372a22b0f 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 @@ -92,10 +92,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable public Map getMapString() { @@ -121,10 +121,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable public Map getMapNumber() { @@ -150,10 +150,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable public Map getMapInteger() { @@ -179,10 +179,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable public Map getMapBoolean() { @@ -208,10 +208,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable public Map> getMapArrayInteger() { @@ -237,10 +237,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapArrayAnytype() { @@ -266,10 +266,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable public Map> getMapMapString() { @@ -295,10 +295,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapMapAnytype() { @@ -316,10 +316,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { @@ -337,10 +337,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable public Object getAnytype2() { @@ -358,10 +358,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable public Object getAnytype3() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c5e427ba04a..a296f8fd549 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a5faebcb64d..36c25a8e996 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e6abb5561b6..542ce688ca0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfe652d2cdb..3e129ecfd28 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 42bfd3e8f78..eb7e8b30744 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 @@ -44,10 +44,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { @@ -65,10 +65,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c52cba33e4f..389a7f17e4e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 8b20e8ad508..b71bac70c4b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { 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 d32703c6a35..c0a48a9efc1 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 @@ -60,10 +60,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { @@ -89,10 +89,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { @@ -118,10 +118,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java index 35428f6c8e1..ef64083f1be 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -93,10 +93,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable public KindEnum getKind() { 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 5754da56c1a..a0305d92e96 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 @@ -60,10 +60,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { @@ -81,10 +81,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { @@ -102,10 +102,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { @@ -123,10 +123,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { @@ -144,10 +144,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { 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 2facf39b805..1842272b068 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 @@ -42,10 +42,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { 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 175c4272671..c9e9db35214 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 @@ -44,10 +44,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java index a85a5d6dff6..a088bdea486 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,10 +40,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java index 1af3141f62e..5187ec2ad84 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java @@ -40,10 +40,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java index 2edada5cce9..c4aed068eba 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java @@ -42,10 +42,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { 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 bb1b5af5ec2..5a34b48a8cc 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 @@ -141,10 +141,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { @@ -170,10 +170,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { 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 cf7152d7b74..5d19fd258f4 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 @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { @@ -270,10 +270,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { @@ -291,10 +291,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { @@ -312,10 +312,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { @@ -333,10 +333,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { 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 58470d89d2c..3b2c3532077 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 @@ -48,10 +48,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { @@ -77,10 +77,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { 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 6558de31c11..1e9bdb1071f 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 @@ -97,12 +97,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { @@ -120,12 +120,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { @@ -143,10 +143,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { @@ -164,12 +164,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { @@ -187,12 +187,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { @@ -210,12 +210,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { @@ -233,10 +233,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { @@ -254,10 +254,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { @@ -275,10 +275,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { @@ -296,10 +296,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { @@ -317,10 +317,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -338,10 +338,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -359,10 +359,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable public BigDecimal getBigDecimal() { 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 7b36ff52a99..ddd630dd409 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 @@ -38,8 +38,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -50,10 +50,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -62,10 +62,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { 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 35c12d819b6..4c0a00b58e4 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 @@ -109,10 +109,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { @@ -138,10 +138,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { @@ -167,10 +167,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { @@ -196,10 +196,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { 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 3ea68ff1cde..d3754724ddf 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 @@ -53,10 +53,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -74,10 +74,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -103,10 +103,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { 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 568e11bb99d..6aeee587cf5 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 @@ -44,10 +44,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { @@ -65,10 +65,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { 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 8b0bae353e6..c4595dcc553 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 @@ -48,10 +48,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { @@ -69,10 +69,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java index ed1fb11bb63..30a33932088 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -40,10 +40,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java index 4596b18cba3..ea70d4c29c6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java @@ -40,10 +40,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java index 2060a7f467e..094dfebca69 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,10 +40,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { 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 abd4b6b520e..addc3be90ea 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 @@ -46,8 +46,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -64,10 +64,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { @@ -79,10 +79,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { @@ -97,10 +97,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { @@ -112,10 +112,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java index 70ae97980a4..91d482cd5a1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -41,10 +41,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { 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 ddfe93fb538..33e05a4ccec 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 @@ -110,10 +110,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -131,10 +131,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { @@ -152,10 +152,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { @@ -173,10 +173,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { @@ -194,10 +194,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { @@ -215,10 +215,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { 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 29cad25a60a..1b19db05cc6 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 @@ -49,10 +49,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { @@ -70,10 +70,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { @@ -91,10 +91,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { 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 a3589f3a3a2..4653705b841 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 @@ -116,10 +116,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -137,10 +137,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { @@ -187,10 +187,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public Set getPhotoUrls() { @@ -216,10 +216,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { @@ -237,10 +237,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { 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 b7e9397bb92..5ad85674606 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 @@ -38,8 +38,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -48,10 +48,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -66,10 +66,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java index dfe54530145..430eb91b95c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -40,10 +40,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { 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 c5a553b77db..af5dcd5a77d 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 @@ -44,10 +44,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 5ecc2f60e07..613766c04cc 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 @@ -60,10 +60,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -81,10 +81,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -102,10 +102,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -123,10 +123,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -152,10 +152,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 3f3671dc58e..5fa951fd9f1 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 @@ -64,10 +64,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -85,10 +85,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -106,10 +106,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull public Float getFloatItem() { @@ -127,10 +127,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -148,10 +148,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -177,10 +177,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 a450c67dfa8..574f127efc7 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 @@ -68,10 +68,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -89,10 +89,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { @@ -131,10 +131,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { @@ -152,10 +152,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { @@ -194,10 +194,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { @@ -215,10 +215,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { 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 1ac473f9da6..b36215cb37c 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 @@ -156,10 +156,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable public String getAttributeString() { @@ -177,10 +177,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getAttributeNumber() { @@ -198,10 +198,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable public Integer getAttributeInteger() { @@ -219,10 +219,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable public Boolean getAttributeBoolean() { @@ -248,10 +248,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable public List getWrappedArray() { @@ -269,10 +269,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable public String getNameString() { @@ -290,10 +290,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNameNumber() { @@ -311,10 +311,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable public Integer getNameInteger() { @@ -332,10 +332,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNameBoolean() { @@ -361,10 +361,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable public List getNameArray() { @@ -390,10 +390,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable public List getNameWrappedArray() { @@ -411,10 +411,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable public String getPrefixString() { @@ -432,10 +432,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNumber() { @@ -453,10 +453,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixInteger() { @@ -474,10 +474,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixBoolean() { @@ -503,10 +503,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable public List getPrefixArray() { @@ -532,10 +532,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixWrappedArray() { @@ -553,10 +553,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable public String getNamespaceString() { @@ -574,10 +574,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNamespaceNumber() { @@ -595,10 +595,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable public Integer getNamespaceInteger() { @@ -616,10 +616,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNamespaceBoolean() { @@ -645,10 +645,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable public List getNamespaceArray() { @@ -674,10 +674,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable public List getNamespaceWrappedArray() { @@ -695,10 +695,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable public String getPrefixNsString() { @@ -716,10 +716,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNsNumber() { @@ -737,10 +737,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixNsInteger() { @@ -758,10 +758,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixNsBoolean() { @@ -787,10 +787,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsArray() { @@ -816,10 +816,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsWrappedArray() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 1d45ba717a2..ac000a3d22a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -25,12 +29,13 @@ public class AnotherFakeApiTest { /** * To test special tags * - * To test special tags + * To test special tags and operation ID starting with number */ @Test - public void testSpecialTagsTest() { - Client client = null; - // Client response = api.testSpecialTags(client); + public void call123testSpecialTagsTest() { + UUID uuidTest = null; + Client body = null; + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java index 82a96b9818b..896c594ae92 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -9,9 +9,13 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.openapitools.client.model.XmlItem; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -24,11 +28,23 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } + /** + * creates an XmlItem + * + * this route creates an XmlItem + */ + @Test + public void createXmlItemTest() { + XmlItem xmlItem = null; + // api.createXmlItem(xmlItem); + + // TODO: test validations + } /** * * @@ -48,8 +64,8 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } @@ -84,8 +100,8 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - // api.testBodyWithFileSchema(fileSchemaTestClass); + FileSchemaTestClass body = null; + // api.testBodyWithFileSchema(body); // TODO: test validations } @@ -97,8 +113,8 @@ public class FakeApiTest { @Test public void testBodyWithQueryParamsTest() { String query = null; - User user = null; - // api.testBodyWithQueryParams(query, user); + User body = null; + // api.testBodyWithQueryParams(query, body); // TODO: test validations } @@ -109,15 +125,15 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - // Client response = api.testClientModel(client); + Client body = null; + // Client response = api.testClientModel(body); // TODO: test validations } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ @Test public void testEndpointParametersTest() { @@ -182,8 +198,8 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - // api.testInlineAdditionalProperties(requestBody); + Map param = null; + // api.testInlineAdditionalProperties(param); // TODO: test validations } @@ -198,6 +214,22 @@ public class FakeApiTest { String param2 = null; // api.testJsonFormData(param, param2); + // 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; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations } } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6e32cc28481..3bde7219918 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } @@ -29,8 +32,8 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - // Client response = api.testClassname(client); + Client body = null; + // Client response = api.testClassname(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java index 65eed9391e9..c9cf0ff38e4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -4,9 +4,13 @@ import org.openapitools.client.ApiClient; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Before; -import org.junit.Test; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -19,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -31,8 +35,8 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet pet = null; - // api.addPet(pet); + Pet body = null; + // api.addPet(body); // TODO: test validations } @@ -68,8 +72,8 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - List tags = null; - // List response = api.findPetsByTags(tags); + Set tags = null; + // Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -92,8 +96,8 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet pet = null; - // api.updatePet(pet); + Pet body = null; + // api.updatePet(body); // TODO: test validations } @@ -120,8 +124,22 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + 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 } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java index 2f72f617c3a..3a00aa1b95e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } @@ -64,8 +67,8 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order order = null; - // Order response = api.placeOrder(order); + Order body = null; + // Order response = api.placeOrder(body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java index 9174f6d0250..a269d4fc6b1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } @@ -29,8 +33,8 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - // api.createUser(user); + User body = null; + // api.createUser(body); // TODO: test validations } @@ -41,8 +45,8 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - // api.createUsersWithArrayInput(user); + List body = null; + // api.createUsersWithArrayInput(body); // TODO: test validations } @@ -53,8 +57,8 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List user = null; - // api.createUsersWithListInput(user); + List body = null; + // api.createUsersWithListInput(body); // TODO: test validations } @@ -114,8 +118,8 @@ public class UserApiTest { @Test public void updateUserTest() { String username = null; - User user = null; - // api.updateUser(username, user); + User body = null; + // api.updateUser(username, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 656f0577161..04fa4f5b6d9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 4c5bdc4ffad..80dc3fcbd43 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index de976999c63..ca1046a0fc8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 3c18ad38c7e..3c34271bf0d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,45 +18,115 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +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 } /** - * Test the property 'mapProperty' + * Test the property 'mapString' */ @Test - public void mapPropertyTest() { - // TODO: test mapProperty + void mapStringTest() { + // TODO: test mapString } /** - * Test the property 'mapOfMapProperty' + * Test the property 'mapNumber' */ @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty + void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' + */ + @Test + void anytype2Test() { + // TODO: test anytype2 + } + + /** + * Test the property 'anytype3' + */ + @Test + void anytype3Test() { + // TODO: test anytype3 } } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 712e0c131b1..e9f37e84ecd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index a2039fa83a5..3d6ac0eec25 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3c9fe9323b8..47389e5fd54 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3a3942ab84d..162ae6f2edd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java index 30ed464f5e1..e8508c4319b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +49,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 70947526050..9d8fb3480f6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 2f88d6ad4b9..ef70479bb3c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 3182aa65481..f5c7ed8752f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,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/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d8..aa1db2031da 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -42,7 +42,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 1d029ba7c50..eda1830e0c0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,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/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java index 718bb5b6baf..6e38fb46e73 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CatTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 +42,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java index 79374c54e6f..4ac631b1e8c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java index 4c66db89c4f..aa381b709d9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java index 1a9f6d6fc9e..95f0e2d39d2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java index 8392c174564..f65ec9fbebe 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/DogTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 +42,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java index a116bb028fc..1175d0a96ec 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,27 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +44,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,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/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java index 97855ba723a..cb2a9c69498 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java index d43e3cace6d..b097f85302d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index a960673c616..08d51e19dad 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,43 +18,42 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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.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 */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java index 324f11ac458..bcdcaf9dd06 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,30 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +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 */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -49,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -57,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -65,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -73,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -81,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -89,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -97,7 +94,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -105,7 +102,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -113,7 +110,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -121,7 +118,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -129,7 +126,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -137,7 +134,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -145,8 +142,16 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } + /** + * Test the property 'bigDecimal' + */ + @Test + void bigDecimalTest() { + // TODO: test bigDecimal + } + } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index d854c0c9daf..01be6b15413 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java index 9f78d486659..d9b643e6b43 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 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 } @@ -47,7 +43,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,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/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index af2d1b2db30..0d57da0126e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,31 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -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 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 } @@ -50,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -58,7 +54,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -66,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/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dcea5877334..ecae6e0f437 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 46b8648fdcc..bb4aa91a78c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c38..973730324cc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a..bdba8c46a91 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 4135ead5686..ae4eaf6295f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java index bdc04b000c1..f35cf4746e5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,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/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 214a6d4538d..16ed327afed 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,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/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java index 266bb3290d5..439814c48b1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -61,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -69,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -77,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -85,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/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 710bfedd580..cf76f8e58d0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,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/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 064f84b3ff6..4110989633b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java index 4e8e4c65827..82448ec2368 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/PetTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,29 +18,29 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index c89b608f609..72101f74b61 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d058c884e49..dfc2065188d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java index 27acc7ce8e7..36eea1ddb7b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TagTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index f120407395a..3f8ac3d4a3f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5e99dff0cae..e0a7a0d614c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,15 +53,23 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } + /** + * Test the property 'floatItem' + */ + @Test + void floatItemTest() { + // TODO: test floatItem + } + /** * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +77,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +85,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java index da1c9bda4b5..5163783cfdc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/UserTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,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/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java index 5e861e18621..3cfe59d203c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -2,7 +2,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: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,56 +221,56 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } /** - * Test the property 'prefixNamespaceString' + * Test the property 'prefixNsString' */ @Test - public void prefixNamespaceStringTest() { - // TODO: test prefixNamespaceString + void prefixNsStringTest() { + // TODO: test prefixNsString } /** - * Test the property 'prefixNamespaceNumber' + * Test the property 'prefixNsNumber' */ @Test - public void prefixNamespaceNumberTest() { - // TODO: test prefixNamespaceNumber + void prefixNsNumberTest() { + // TODO: test prefixNsNumber } /** - * Test the property 'prefixNamespaceInteger' + * Test the property 'prefixNsInteger' */ @Test - public void prefixNamespaceIntegerTest() { - // TODO: test prefixNamespaceInteger + void prefixNsIntegerTest() { + // TODO: test prefixNsInteger } /** - * Test the property 'prefixNamespaceBoolean' + * Test the property 'prefixNsBoolean' */ @Test - public void prefixNamespaceBooleanTest() { - // TODO: test prefixNamespaceBoolean + void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean } /** - * Test the property 'prefixNamespaceArray' + * Test the property 'prefixNsArray' */ @Test - public void prefixNamespaceArrayTest() { - // TODO: test prefixNamespaceArray + void prefixNsArrayTest() { + // TODO: test prefixNsArray } /** - * Test the property 'prefixNamespaceWrappedArray' + * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNamespaceWrappedArrayTest() { - // TODO: test prefixNamespaceWrappedArray + void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray } } diff --git a/samples/client/petstore/java/retrofit2rx3/build.gradle b/samples/client/petstore/java/retrofit2rx3/build.gradle index e9a08c49790..5dd9b794a14 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.gradle +++ b/samples/client/petstore/java/retrofit2rx3/build.gradle @@ -99,10 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_databind_version = "2.15.2" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.2" + junit_version = "5.10.3" rx_java_version = "3.0.4" json_fire_version = "1.9.0" } @@ -119,7 +118,6 @@ dependencies { exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' } implementation "io.gsonfire:gson-fire:$json_fire_version" - implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_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/retrofit2rx3/build.sbt b/samples/client/petstore/java/retrofit2rx3/build.sbt index d95ca2d5e89..55c87017344 100644 --- a/samples/client/petstore/java/retrofit2rx3/build.sbt +++ b/samples/client/petstore/java/retrofit2rx3/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/samples/client/petstore/java/retrofit2rx3/pom.xml b/samples/client/petstore/java/retrofit2rx3/pom.xml index 4abc9a52d93..508fd7747cd 100644 --- a/samples/client/petstore/java/retrofit2rx3/pom.xml +++ b/samples/client/petstore/java/retrofit2rx3/pom.xml @@ -204,11 +204,6 @@ swagger-annotations ${swagger-annotations-version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind-version} - com.google.code.findbugs @@ -264,8 +259,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -277,11 +272,10 @@ ${java.version} 1.9.0 1.6.3 - 2.15.2 2.5.0 3.0.4 1.3.5 1.0.1 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java index bce9a553a7d..65ad4ef6f55 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/JSON.java @@ -13,11 +13,11 @@ 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.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonElement; @@ -34,14 +34,11 @@ import java.text.ParseException; import java.text.ParsePosition; import java.time.LocalDate; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.ZoneId; 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; public class JSON { private Gson gson; @@ -50,11 +47,6 @@ public class JSON { private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static final StdDateFormat sdf = new StdDateFormat() - .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) - .withColonInTimeZone(true); - private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() .registerTypeSelector(Animal.class, new TypeSelector() { @@ -293,7 +285,7 @@ public class JSON { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(sdf.parse(date).getTime()); + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -303,7 +295,7 @@ public class JSON { /** * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, DateTimeFormatter will be used. + * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter { @@ -329,7 +321,7 @@ public class JSON { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + value = ISO8601Utils.format(date, true); } out.value(value); } @@ -348,7 +340,7 @@ public class JSON { if (dateFormat != null) { return dateFormat.parse(date); } - return sdf.parse(date); + return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index e482d8cc427..3fe406df7c4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3171e88ad4e..46f046cffe0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 43b1e4ab7c2..215779a63ce 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 cc4e35b8534..6c372a22b0f 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 @@ -92,10 +92,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable public Map getMapString() { @@ -121,10 +121,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable public Map getMapNumber() { @@ -150,10 +150,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable public Map getMapInteger() { @@ -179,10 +179,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable public Map getMapBoolean() { @@ -208,10 +208,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable public Map> getMapArrayInteger() { @@ -237,10 +237,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapArrayAnytype() { @@ -266,10 +266,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable public Map> getMapMapString() { @@ -295,10 +295,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable public Map> getMapMapAnytype() { @@ -316,10 +316,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable public Object getAnytype1() { @@ -337,10 +337,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable public Object getAnytype2() { @@ -358,10 +358,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable public Object getAnytype3() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index c5e427ba04a..a296f8fd549 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a5faebcb64d..36c25a8e996 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -44,10 +44,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e6abb5561b6..542ce688ca0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cfe652d2cdb..3e129ecfd28 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -43,10 +43,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 42bfd3e8f78..eb7e8b30744 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 @@ -44,10 +44,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull public String getClassName() { @@ -65,10 +65,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable public String getColor() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c52cba33e4f..389a7f17e4e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 8b20e8ad508..b71bac70c4b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -52,10 +52,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable public List getArrayNumber() { 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 d32703c6a35..c0a48a9efc1 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 @@ -60,10 +60,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable public List getArrayOfString() { @@ -89,10 +89,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfInteger() { @@ -118,10 +118,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java index 35428f6c8e1..ef64083f1be 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java @@ -93,10 +93,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable public KindEnum getKind() { 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 5754da56c1a..a0305d92e96 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 @@ -60,10 +60,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable public String getSmallCamel() { @@ -81,10 +81,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable public String getCapitalCamel() { @@ -102,10 +102,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable public String getSmallSnake() { @@ -123,10 +123,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable public String getCapitalSnake() { @@ -144,10 +144,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable public String getScAETHFlowPoints() { @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable public String getATTNAME() { 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 2facf39b805..1842272b068 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 @@ -42,10 +42,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable public Boolean getDeclawed() { 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 175c4272671..c9e9db35214 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 @@ -44,10 +44,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java index a85a5d6dff6..a088bdea486 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,10 +40,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java index 1af3141f62e..5187ec2ad84 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java @@ -40,10 +40,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable public String getClient() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java index 2edada5cce9..c4aed068eba 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java @@ -42,10 +42,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable public String getBreed() { 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 bb1b5af5ec2..5a34b48a8cc 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 @@ -141,10 +141,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable public JustSymbolEnum getJustSymbol() { @@ -170,10 +170,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable public List getArrayEnum() { 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 cf7152d7b74..5d19fd258f4 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 @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable public EnumStringEnum getEnumString() { @@ -270,10 +270,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull public EnumStringRequiredEnum getEnumStringRequired() { @@ -291,10 +291,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable public EnumIntegerEnum getEnumInteger() { @@ -312,10 +312,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable public EnumNumberEnum getEnumNumber() { @@ -333,10 +333,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable public OuterEnum getOuterEnum() { 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 58470d89d2c..3b2c3532077 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 @@ -48,10 +48,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable public ModelFile getFile() { @@ -77,10 +77,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable public List getFiles() { 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 6558de31c11..1e9bdb1071f 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 @@ -97,12 +97,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable public Integer getInteger() { @@ -120,12 +120,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable public Integer getInt32() { @@ -143,10 +143,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable public Long getInt64() { @@ -164,12 +164,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumber() { @@ -187,12 +187,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable public Float getFloat() { @@ -210,12 +210,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable public Double getDouble() { @@ -233,10 +233,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable public String getString() { @@ -254,10 +254,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull public byte[] getByte() { @@ -275,10 +275,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable public File getBinary() { @@ -296,10 +296,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull public LocalDate getDate() { @@ -317,10 +317,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -338,10 +338,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -359,10 +359,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull public String getPassword() { @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable public BigDecimal getBigDecimal() { 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 7b36ff52a99..ddd630dd409 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 @@ -38,8 +38,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -50,10 +50,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -62,10 +62,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable public String getFoo() { 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 35c12d819b6..4c0a00b58e4 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 @@ -109,10 +109,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable public Map> getMapMapOfString() { @@ -138,10 +138,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable public Map getMapOfEnumString() { @@ -167,10 +167,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable public Map getDirectMap() { @@ -196,10 +196,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable public Map getIndirectMap() { 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 3ea68ff1cde..d3754724ddf 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 @@ -53,10 +53,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable public UUID getUuid() { @@ -74,10 +74,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getDateTime() { @@ -103,10 +103,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable public Map getMap() { 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 568e11bb99d..6aeee587cf5 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 @@ -44,10 +44,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public Integer getName() { @@ -65,10 +65,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable public String getPropertyClass() { 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 8b0bae353e6..c4595dcc553 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 @@ -48,10 +48,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable public Integer getCode() { @@ -69,10 +69,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable public String getType() { @@ -90,10 +90,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java index ed1fb11bb63..30a33932088 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -40,10 +40,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable public String getSourceURI() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java index 4596b18cba3..ea70d4c29c6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java @@ -40,10 +40,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable public String get123list() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java index 2060a7f467e..094dfebca69 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,10 +40,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable public Integer getReturn() { 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 abd4b6b520e..addc3be90ea 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 @@ -46,8 +46,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -64,10 +64,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public Integer getName() { @@ -79,10 +79,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable public Integer getSnakeCase() { @@ -97,10 +97,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable public String getProperty() { @@ -112,10 +112,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable public Integer get123number() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java index 70ae97980a4..91d482cd5a1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -41,10 +41,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getJustNumber() { 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 ddfe93fb538..33e05a4ccec 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 @@ -110,10 +110,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -131,10 +131,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable public Long getPetId() { @@ -152,10 +152,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable public Integer getQuantity() { @@ -173,10 +173,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable public OffsetDateTime getShipDate() { @@ -194,10 +194,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { @@ -215,10 +215,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable public Boolean getComplete() { 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 29cad25a60a..1b19db05cc6 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 @@ -49,10 +49,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getMyNumber() { @@ -70,10 +70,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable public String getMyString() { @@ -91,10 +91,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable public Boolean getMyBoolean() { 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 a3589f3a3a2..4653705b841 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 @@ -116,10 +116,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -137,10 +137,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable public Category getCategory() { @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { @@ -187,10 +187,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull public Set getPhotoUrls() { @@ -216,10 +216,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable public List getTags() { @@ -237,10 +237,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable public StatusEnum getStatus() { 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 b7e9397bb92..5ad85674606 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 @@ -38,8 +38,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -48,10 +48,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable public String getBar() { @@ -66,10 +66,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable public String getBaz() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java index dfe54530145..430eb91b95c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -40,10 +40,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable public Long get$SpecialPropertyName() { 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 c5a553b77db..af5dcd5a77d 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 @@ -44,10 +44,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -65,10 +65,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { 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 5ecc2f60e07..613766c04cc 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 @@ -60,10 +60,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -81,10 +81,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -102,10 +102,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -123,10 +123,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -152,10 +152,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 3f3671dc58e..5fa951fd9f1 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 @@ -64,10 +64,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull public String getStringItem() { @@ -85,10 +85,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull public BigDecimal getNumberItem() { @@ -106,10 +106,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull public Float getFloatItem() { @@ -127,10 +127,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull public Integer getIntegerItem() { @@ -148,10 +148,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull public Boolean getBoolItem() { @@ -177,10 +177,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull public List getArrayItem() { 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 a450c67dfa8..574f127efc7 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 @@ -68,10 +68,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable public Long getId() { @@ -89,10 +89,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable public String getUsername() { @@ -110,10 +110,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable public String getFirstName() { @@ -131,10 +131,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable public String getLastName() { @@ -152,10 +152,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { @@ -173,10 +173,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable public String getPassword() { @@ -194,10 +194,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable public String getPhone() { @@ -215,10 +215,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable public Integer getUserStatus() { 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 1ac473f9da6..b36215cb37c 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 @@ -156,10 +156,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable public String getAttributeString() { @@ -177,10 +177,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getAttributeNumber() { @@ -198,10 +198,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable public Integer getAttributeInteger() { @@ -219,10 +219,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable public Boolean getAttributeBoolean() { @@ -248,10 +248,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable public List getWrappedArray() { @@ -269,10 +269,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable public String getNameString() { @@ -290,10 +290,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNameNumber() { @@ -311,10 +311,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable public Integer getNameInteger() { @@ -332,10 +332,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNameBoolean() { @@ -361,10 +361,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable public List getNameArray() { @@ -390,10 +390,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable public List getNameWrappedArray() { @@ -411,10 +411,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable public String getPrefixString() { @@ -432,10 +432,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNumber() { @@ -453,10 +453,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixInteger() { @@ -474,10 +474,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixBoolean() { @@ -503,10 +503,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable public List getPrefixArray() { @@ -532,10 +532,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixWrappedArray() { @@ -553,10 +553,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable public String getNamespaceString() { @@ -574,10 +574,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getNamespaceNumber() { @@ -595,10 +595,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable public Integer getNamespaceInteger() { @@ -616,10 +616,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable public Boolean getNamespaceBoolean() { @@ -645,10 +645,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable public List getNamespaceArray() { @@ -674,10 +674,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable public List getNamespaceWrappedArray() { @@ -695,10 +695,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable public String getPrefixNsString() { @@ -716,10 +716,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable public BigDecimal getPrefixNsNumber() { @@ -737,10 +737,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable public Integer getPrefixNsInteger() { @@ -758,10 +758,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable public Boolean getPrefixNsBoolean() { @@ -787,10 +787,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsArray() { @@ -816,10 +816,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable public List getPrefixNsWrappedArray() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index d53aa9ca735..ac000a3d22a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -2,9 +2,13 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class AnotherFakeApiTest { private AnotherFakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } @@ -29,8 +33,9 @@ public class AnotherFakeApiTest { */ @Test public void call123testSpecialTagsTest() { + UUID uuidTest = null; Client body = null; - // Client response = api.call123testSpecialTags(body); + // Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java index a18414831d4..896c594ae92 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -10,9 +10,12 @@ 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.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,7 +28,7 @@ public class FakeApiTest { private FakeApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6fb41f046ee..3bde7219918 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(FakeClassnameTags123Api.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java index 5061b45f8c6..c9cf0ff38e4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -5,9 +5,12 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -20,7 +23,7 @@ public class PetApiTest { private PetApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(PetApi.class); } @@ -121,8 +124,8 @@ public class PetApiTest { public void uploadFileTest() { Long petId = null; String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + File _file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java index e02a6df7082..3a00aa1b95e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -2,9 +2,12 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +20,7 @@ public class StoreApiTest { private StoreApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(StoreApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java index 8fb13a93899..a269d4fc6b1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,10 +1,14 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -17,7 +21,7 @@ public class UserApiTest { private UserApi api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService(UserApi.class); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 5507437bbe4..04fa4f5b6d9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index d770842e2c3..80dc3fcbd43 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 17ad4aa94d8..ca1046a0fc8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 19f1a8fe7aa..3c34271bf0d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -18,29 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -48,7 +45,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -56,7 +53,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -64,7 +61,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -72,7 +69,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -80,7 +77,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -88,7 +85,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -96,7 +93,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -104,7 +101,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -112,7 +109,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -120,7 +117,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -128,7 +125,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index e6efde8fed9..e9f37e84ecd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 01433159e0f..3d6ac0eec25 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -18,28 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index a307b7604d8..47389e5fd54 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 6a66b95c7b4..162ae6f2edd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -18,27 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +43,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java index 340abc2587a..e8508c4319b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -18,28 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -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; /** * 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 } @@ -47,7 +41,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +49,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index d0e66d29354..9d8fb3480f6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 9afc3397f46..ef70479bb3c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java index fab9a30565f..f5c7ed8752f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -55,7 +53,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -63,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/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java index 0949e1385d8..aa1db2031da 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -20,21 +20,21 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; 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 } @@ -42,7 +42,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -50,7 +50,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -58,7 +58,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -66,7 +66,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java index ced4f48eb5f..eda1830e0c0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -52,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -60,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -68,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -76,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -84,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/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java index e26c6db5da9..6e38fb46e73 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CatTest.java @@ -18,27 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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; /** * 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 } @@ -46,7 +42,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +50,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,7 +58,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java index a6efa6e1fbc..4ac631b1e8c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java index 1233feec65e..aa381b709d9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java index 456fab74c4d..95f0e2d39d2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java index b2e427523bc..f65ec9fbebe 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/DogTest.java @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 +42,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +50,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +58,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java index c25b05e9f0d..1175d0a96ec 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -18,27 +18,25 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -46,7 +44,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -54,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/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java index 329454658e3..cb2a9c69498 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java index 8b76ef55606..b097f85302d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -53,7 +50,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -61,7 +58,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -69,7 +66,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -77,7 +74,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 0ca36621208..08d51e19dad 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -18,43 +18,42 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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.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 */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java index 9c600e488b5..bcdcaf9dd06 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -18,30 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.io.IOException; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +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 */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -49,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -57,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -65,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -73,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -81,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -89,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -97,7 +94,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -105,7 +102,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -113,7 +110,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -121,7 +118,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -129,7 +126,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -137,7 +134,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -145,7 +142,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -153,7 +150,7 @@ public class FormatTestTest { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index 0272d7b8000..01be6b15413 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java index f86a1303fc8..d9b643e6b43 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -18,28 +18,24 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 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 } @@ -47,7 +43,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -55,7 +51,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -63,7 +59,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -71,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/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 3a23e8217ba..0d57da0126e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -18,31 +18,27 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -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 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 } @@ -50,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -58,7 +54,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -66,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/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index d81fa5a0f66..ecae6e0f437 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 91bd8fada26..bb4aa91a78c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -52,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -60,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java index 132012d4c38..973730324cc 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java index d3ed2075e9a..bdba8c46a91 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java index f317fef485e..ae4eaf6295f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java index 1ed41a0f80c..f35cf4746e5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -52,7 +49,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -60,7 +57,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -68,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/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 15b74f7ef8b..16ed327afed 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,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/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java index 8bad0b69dc3..439814c48b1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -53,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -61,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -69,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -77,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -85,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/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 67ee5996363..cf76f8e58d0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -18,26 +18,23 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -45,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -53,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -61,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/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 220d40e83cb..4110989633b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -14,20 +14,19 @@ package org.openapitools.client.model; import com.google.gson.annotations.SerializedName; -import org.junit.Assert; -import org.junit.Ignore; -import 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/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java index 8acfe87f62c..82448ec2368 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/PetTest.java @@ -18,31 +18,29 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -50,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -58,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -66,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -74,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -82,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -90,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/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 2dc9cb2ae2c..72101f74b61 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -52,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/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index bcf23eb3cbc..dfc2065188d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,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/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java index 83f536d2fa3..36eea1ddb7b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,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/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index ca08c6362ce..3f8ac3d4a3f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -71,7 +69,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -79,7 +77,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 763bccefe43..e0a7a0d614c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -55,7 +53,7 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -63,7 +61,7 @@ public class TypeHolderExampleTest { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -71,7 +69,7 @@ public class TypeHolderExampleTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -79,7 +77,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -87,7 +85,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java index b3a76f61da5..5163783cfdc 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,25 +18,22 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -44,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -60,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -68,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -76,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -84,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -92,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -100,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/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java index f9790cd7c6b..3cfe59d203c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -18,28 +18,26 @@ 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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; 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 } @@ -47,7 +45,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -55,7 +53,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -63,7 +61,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -71,7 +69,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -79,7 +77,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -87,7 +85,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -95,7 +93,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -103,7 +101,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -111,7 +109,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -119,7 +117,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -127,7 +125,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -135,7 +133,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -143,7 +141,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -151,7 +149,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -159,7 +157,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -167,7 +165,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -175,7 +173,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -183,7 +181,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -191,7 +189,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -199,7 +197,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -207,7 +205,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -215,7 +213,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -223,7 +221,7 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -231,7 +229,7 @@ public class XmlItemTest { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -239,7 +237,7 @@ public class XmlItemTest { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -247,7 +245,7 @@ public class XmlItemTest { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -255,7 +253,7 @@ public class XmlItemTest { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -263,7 +261,7 @@ public class XmlItemTest { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -271,7 +269,7 @@ public class XmlItemTest { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index e5042dc3c9d..e486a82fb27 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -30,10 +30,10 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" jakarta_annotation_version = "1.3.5" } @@ -47,6 +47,6 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_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" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index c658b4051c0..718027ec3d5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -249,8 +249,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -265,10 +265,10 @@ UTF-8 3.5.2 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 - 4.13.2 + 5.10.3 diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index c44efb80b92..f5d6526054b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesAnyType extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb5a34572ee..10f4788c75e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -47,10 +47,10 @@ public class AdditionalPropertiesArray extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index bc7b72a9c0f..8c97438fb92 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesBoolean extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 07369d6cefd..333bf9cf868 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 @@ -95,10 +95,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapString * @return mapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapNumber * @return mapNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,10 +161,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapInteger * @return mapInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,10 +194,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapBoolean * @return mapBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -227,10 +227,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayInteger * @return mapArrayInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,10 +260,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapArrayAnytype * @return mapArrayAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapString * @return mapMapString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,10 +326,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapMapAnytype * @return mapMapAnytype - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,10 +351,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,10 +376,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype2 * @return anytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -401,10 +401,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype3 * @return anytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 9c71be2635d..d227fafd55c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesInteger extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index b743d0c1369..48f234227fd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -47,10 +47,10 @@ public class AdditionalPropertiesNumber extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 8410739124e..4697b13ff24 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesObject extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 615abde4eae..b16b5272e25 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -46,10 +46,10 @@ public class AdditionalPropertiesString extends HashMap { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 711644819bf..bfeffbb42fd 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 @@ -61,10 +61,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b73a6b95c5b..0fb7c3ccf51 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ffb6c03113c..4261ff3c03b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 41b29a30249..ef4b636e71d 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 58ffbf2d228..2676d86a37b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -93,10 +93,10 @@ public class BigCat extends Cat { return this; } - /** + /** * Get kind * @return kind - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_KIND) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 accb755a668..cd221f2a733 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 121bba4519c..fecf436ef92 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 @@ -57,10 +57,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed8e1e2da05..8a373c41fc1 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..3a22cce40b5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..d9eb667823f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..c026300889e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 58a77ffded8..f4de7bccc58 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 53ee553f740..f4813fef674 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 @@ -205,10 +205,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -230,10 +230,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -255,10 +255,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -280,10 +280,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,10 +305,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e149084b1a5..899d32a294d 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f502fee0984..d925ed6a1a4 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 @@ -101,12 +101,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,12 +128,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,10 +155,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,12 +180,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -207,12 +207,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +234,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,10 +261,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -286,10 +286,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -311,10 +311,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,10 +336,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -361,10 +361,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -386,10 +386,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -411,10 +411,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -436,10 +436,10 @@ public class FormatTest { return this; } - /** + /** * Get bigDecimal * @return bigDecimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9fc24a2b7f4..7cab692c045 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 136e37557dd..29f371af8b0 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4ec2bb53611..dd6f0ad59bb 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 517b2eb9f07..7c0af5e4781 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8f27c57192..4ca95892895 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..42e71d96a66 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..dd0d3fd9653 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..16728e09539 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 458314f0d83..fe05ad26482 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..436cd1f2ba1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 05dfbdaeefa..f8ab64dbb0a 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7045f92dd8f..1768fc9496d 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 180ee4787ba..a26c02589d1 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d585c01ecc3..08e36c5f03d 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index c445b6f653e..62f674ba6db 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 201029ba21a..181ed783218 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 579da79a3e7..8f9ea0c9110 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 @@ -63,10 +63,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,10 +88,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -113,10 +113,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -138,10 +138,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,10 +171,10 @@ public class TypeHolderDefault { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 4fb1973cb1b..f358d529562 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 @@ -67,10 +67,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get stringItem * @return stringItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -92,10 +92,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get numberItem * @return numberItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -117,10 +117,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get floatItem * @return floatItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -142,10 +142,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get integerItem * @return integerItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -167,10 +167,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get boolItem * @return boolItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -200,10 +200,10 @@ public class TypeHolderExample { return this; } - /** + /** * Get arrayItem * @return arrayItem - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 b501d23345c..9dcf5d067a6 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 @@ -71,10 +71,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -146,10 +146,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -171,10 +171,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,10 +196,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,10 +221,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,10 +246,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 92837b71b1c..e65878cd49e 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 @@ -159,10 +159,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeString * @return attributeString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,10 +184,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeNumber * @return attributeNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,10 +209,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeInteger * @return attributeInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,10 +234,10 @@ public class XmlItem { return this; } - /** + /** * Get attributeBoolean * @return attributeBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,10 +267,10 @@ public class XmlItem { return this; } - /** + /** * Get wrappedArray * @return wrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -292,10 +292,10 @@ public class XmlItem { return this; } - /** + /** * Get nameString * @return nameString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -317,10 +317,10 @@ public class XmlItem { return this; } - /** + /** * Get nameNumber * @return nameNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,10 +342,10 @@ public class XmlItem { return this; } - /** + /** * Get nameInteger * @return nameInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,10 +367,10 @@ public class XmlItem { return this; } - /** + /** * Get nameBoolean * @return nameBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -400,10 +400,10 @@ public class XmlItem { return this; } - /** + /** * Get nameArray * @return nameArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class XmlItem { return this; } - /** + /** * Get nameWrappedArray * @return nameWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -458,10 +458,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixString * @return prefixString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -483,10 +483,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNumber * @return prefixNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -508,10 +508,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixInteger * @return prefixInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,10 +533,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixBoolean * @return prefixBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -566,10 +566,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixArray * @return prefixArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -599,10 +599,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixWrappedArray * @return prefixWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -624,10 +624,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceString * @return namespaceString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -649,10 +649,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceNumber * @return namespaceNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -674,10 +674,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceInteger * @return namespaceInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -699,10 +699,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceBoolean * @return namespaceBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -732,10 +732,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceArray * @return namespaceArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -765,10 +765,10 @@ public class XmlItem { return this; } - /** + /** * Get namespaceWrappedArray * @return namespaceWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -790,10 +790,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsString * @return prefixNsString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,10 +815,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsNumber * @return prefixNsNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,10 +840,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsInteger * @return prefixNsInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -865,10 +865,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsBoolean * @return prefixNsBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -898,10 +898,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsArray * @return prefixNsArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -931,10 +931,10 @@ public class XmlItem { return this; } - /** + /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 35dca85fdf2..7e981066706 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -13,14 +13,14 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.UUID; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +31,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +41,16 @@ import java.util.Map; /** * API tests for AnotherFakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class AnotherFakeApiTest { private AnotherFakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new AnotherFakeApiImpl(); } - + /** * To test special tags * To test special tags and operation ID starting with number @@ -66,11 +60,11 @@ public class AnotherFakeApiTest { @Test public void call123testSpecialTagsTest(TestContext testContext) { Async async = testContext.async(); + UUID uuidTest = null; Client body = null; - api.call123testSpecialTags(body, result -> { + api.call123testSpecialTags(uuidTest, body, result -> { // TODO: test validations async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java index b907b722c29..10ad680e364 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -24,11 +24,10 @@ import org.openapitools.client.model.XmlItem; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -39,6 +38,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,24 +48,16 @@ import java.util.Map; /** * API tests for FakeApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeApiTest { private FakeApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeApiImpl(); } - + /** * creates an XmlItem * this route creates an XmlItem @@ -80,7 +73,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * Test serialization of outer boolean types @@ -96,7 +88,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * Test serialization of object with outer number type @@ -112,7 +103,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * Test serialization of outer number types @@ -128,7 +118,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * Test serialization of outer string types @@ -144,7 +133,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * For this test, the body for this request much reference a schema named `File`. @@ -160,7 +148,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * @@ -177,7 +164,6 @@ public class FakeApiTest { async.complete(); }); } - /** * To test \"client\" model * To test \"client\" model @@ -193,7 +179,6 @@ public class FakeApiTest { async.complete(); }); } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -222,7 +207,6 @@ public class FakeApiTest { async.complete(); }); } - /** * To test enum parameters * To test enum parameters @@ -245,7 +229,6 @@ public class FakeApiTest { async.complete(); }); } - /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -266,7 +249,6 @@ public class FakeApiTest { async.complete(); }); } - /** * test inline additionalProperties * @@ -282,7 +264,6 @@ public class FakeApiTest { async.complete(); }); } - /** * test json serialization of form data * @@ -299,7 +280,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * To test the collection format in query parameters @@ -319,5 +299,4 @@ public class FakeApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 470100109e6..64d937df0c4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.model.Client; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +30,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +40,16 @@ import java.util.Map; /** * API tests for FakeClassnameTags123Api */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeClassnameTags123ApiImpl(); } - + /** * To test class name in snake case * To test class name in snake case @@ -72,5 +65,4 @@ public class FakeClassnameTags123ApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java index a180bf86964..ac1d4ba352c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -19,11 +19,10 @@ import java.util.Set; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -34,6 +33,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -42,24 +43,16 @@ import java.util.Map; /** * API tests for PetApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new PetApiImpl(); } - + /** * Add a new pet to the store * @@ -75,7 +68,6 @@ public class PetApiTest { async.complete(); }); } - /** * Deletes a pet * @@ -92,7 +84,6 @@ public class PetApiTest { async.complete(); }); } - /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -108,7 +99,6 @@ public class PetApiTest { async.complete(); }); } - /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -124,7 +114,6 @@ public class PetApiTest { async.complete(); }); } - /** * Find pet by ID * Returns a single pet @@ -140,7 +129,6 @@ public class PetApiTest { async.complete(); }); } - /** * Update an existing pet * @@ -156,7 +144,6 @@ public class PetApiTest { async.complete(); }); } - /** * Updates a pet in the store with form data * @@ -174,7 +161,6 @@ public class PetApiTest { async.complete(); }); } - /** * uploads an image * @@ -186,13 +172,12 @@ public class PetApiTest { Async async = testContext.async(); Long petId = null; String additionalMetadata = null; - AsyncFile file = null; - api.uploadFile(petId, additionalMetadata, file, result -> { + AsyncFile _file = null; + api.uploadFile(petId, additionalMetadata, _file, result -> { // TODO: test validations async.complete(); }); } - /** * uploads an image (required) * @@ -210,5 +195,4 @@ public class PetApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java index 5581be91dc8..c33d57cc669 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.model.Order; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +30,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +40,16 @@ import java.util.Map; /** * API tests for StoreApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new StoreApiImpl(); } - + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -72,7 +65,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -87,7 +79,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -103,7 +94,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Place an order for a pet * @@ -119,5 +109,4 @@ public class StoreApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java index b5724cd0926..446a53ee192 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -12,15 +12,15 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -31,6 +31,8 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -39,24 +41,16 @@ import java.util.Map; /** * API tests for UserApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new UserApiImpl(); } - + /** * Create user * This can only be done by the logged in user. @@ -72,7 +66,6 @@ public class UserApiTest { async.complete(); }); } - /** * Creates list of users with given input array * @@ -88,7 +81,6 @@ public class UserApiTest { async.complete(); }); } - /** * Creates list of users with given input array * @@ -104,7 +96,6 @@ public class UserApiTest { async.complete(); }); } - /** * Delete user * This can only be done by the logged in user. @@ -120,7 +111,6 @@ public class UserApiTest { async.complete(); }); } - /** * Get user by user name * @@ -136,7 +126,6 @@ public class UserApiTest { async.complete(); }); } - /** * Logs user into the system * @@ -153,7 +142,6 @@ public class UserApiTest { async.complete(); }); } - /** * Logs out current logged in user session * @@ -168,7 +156,6 @@ public class UserApiTest { async.complete(); }); } - /** * Updated user * This can only be done by the logged in user. @@ -185,5 +172,4 @@ public class UserApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 0ef36c6a64c..faacb289c17 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 49ebece62c2..b506ff7ae92 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -18,27 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -46,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 1113d5dd466..ba65ffedc14 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 0217e6cd5dc..72854079e5e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -18,28 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -47,7 +44,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -55,7 +52,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -63,7 +60,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -71,7 +68,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -79,7 +76,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -87,7 +84,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -95,7 +92,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -103,7 +100,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -111,7 +108,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -119,7 +116,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -127,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 815f5742786..916c2c2bcb3 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 20d1c6199d2..a099245eec5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -18,27 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -46,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index 3a863bdf2db..d47c9a37d1f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 8ab8d9c52a9..3820dd2e23c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java index 3475d2be312..24776d3cb51 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -13,6 +13,7 @@ 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; @@ -20,27 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -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; /** * 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 } @@ -48,7 +43,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -56,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 928e2973997..6bbe877044d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -18,27 +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.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.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -46,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 0c02796dc79..eaf908bb1ab 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -18,27 +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.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.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -46,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java index bc5ac744672..99c6bcf5360 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -18,27 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -46,7 +44,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -54,7 +52,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -62,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd150512..20bc4e0d424 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/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/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java index ffa72405fa8..a0217acd1f2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -51,7 +48,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -59,7 +56,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -67,7 +64,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -75,7 +72,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -83,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java index 02f70ea913e..1b389a075be 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CatTest.java @@ -13,6 +13,7 @@ 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; @@ -20,27 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.CatAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -48,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -56,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -64,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java index 7f149cec854..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java index afac01e835c..6ef5c744fbc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java index cf90750a911..8028f11bc2b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java index 2903f6657e0..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/DogTest.java @@ -13,6 +13,7 @@ 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; @@ -20,26 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -47,7 +44,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +52,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -63,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 3130e2a5a05..4a755b0d442 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -18,26 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -45,7 +43,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -53,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..48aa1a737fc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/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/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java index eb783880536..b06e3eb195d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -18,25 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,7 +41,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -52,7 +49,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -60,7 +57,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -68,7 +65,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -76,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index c3c78aa3aa5..0048cb2c749 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -18,42 +18,41 @@ import 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.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 */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } /** - * Test the property 'file' + * Test the property '_file' */ @Test - public void fileTest() { - // TODO: test file + void _fileTest() { + // TODO: test _file } /** * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java index 0e626ca0f44..acd1cec8712 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -18,29 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; -import java.util.UUID; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +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 */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -48,7 +45,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -56,7 +53,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -64,7 +61,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -72,7 +69,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -80,7 +77,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -88,7 +85,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -96,7 +93,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -104,7 +101,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -112,7 +109,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -120,7 +117,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -128,7 +125,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -136,7 +133,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -144,7 +141,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -152,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index e28f7d7441b..908f0aff6ed 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -51,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java index 8d1b64dfce7..3752c5ba31f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -18,27 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 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 } @@ -46,7 +42,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -54,7 +50,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -62,7 +58,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -70,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index ea6eee23f88..0f47e193af8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -18,30 +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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -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 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 } @@ -49,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -57,7 +53,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -65,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 20dee01ae5d..5743b70142b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -51,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 5dfb76f406a..436e4abd59e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -51,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -59,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java index 5b3fde28d4b..f128d7b9ac2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java index 36755ee2bd6..92273f48d23 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java index a1517b158a5..1c5337654cd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java index d54b90ad166..1a6aa18fa20 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -51,7 +48,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -59,7 +56,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -67,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 4238632f54b..8623386a5e9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -18,25 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java index 007f1aaea8a..670c2535646 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,25 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -60,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -68,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -76,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -84,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 527a5df91af..870a977da94 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -18,25 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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 } @@ -44,7 +41,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -52,7 +49,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -60,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..0333ee657a0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/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/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java index 865e589be84..2e4303f1e4b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/PetTest.java @@ -18,30 +18,29 @@ import 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.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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 } @@ -49,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -57,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -65,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -73,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -81,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -89,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 5d460c3c697..c56da4290fa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -51,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index da6a64c20f6..9501cf722d6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java index 51852d80058..dc9cf9742ef 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 16918aa98d9..7ee75c35731 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -18,27 +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.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.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -46,7 +44,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -54,7 +52,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -62,7 +60,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -70,7 +68,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -78,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 53d531b37ea..5c77882f500 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -18,27 +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.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.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -46,7 +44,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -54,7 +52,7 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -62,7 +60,7 @@ public class TypeHolderExampleTest { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -70,7 +68,7 @@ public class TypeHolderExampleTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -78,7 +76,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -86,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java index 335a8f560bb..69d274133b9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,24 +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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -43,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -59,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -67,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -75,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -83,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -91,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -99,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/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java index d988813dbb2..d2e45fadf56 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -18,27 +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.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.junit.Assert; -import org.junit.Ignore; -import 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 } @@ -46,7 +44,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -54,7 +52,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -62,7 +60,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -70,7 +68,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -78,7 +76,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -86,7 +84,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -94,7 +92,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -102,7 +100,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -110,7 +108,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -118,7 +116,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -126,7 +124,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -134,7 +132,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -142,7 +140,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -150,7 +148,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -158,7 +156,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -166,7 +164,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -174,7 +172,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -182,7 +180,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -190,7 +188,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -198,7 +196,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -206,7 +204,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -214,7 +212,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -222,7 +220,7 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -230,7 +228,7 @@ public class XmlItemTest { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -238,7 +236,7 @@ public class XmlItemTest { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -246,7 +244,7 @@ public class XmlItemTest { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -254,7 +252,7 @@ public class XmlItemTest { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -262,7 +260,7 @@ public class XmlItemTest { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -270,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/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 269c0b60e85..f39d9ce699f 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -30,10 +30,10 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" vertx_version = "3.5.2" - junit_version = "4.13.2" + junit_version = "5.10.3" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" } @@ -49,6 +49,6 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 90e729124d0..bb041a21bbc 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -254,8 +254,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -270,10 +270,10 @@ UTF-8 3.5.2 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 - 4.13.2 + 5.10.3 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 85b3c9ae19d..9e5d7ef0062 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 @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c7ec666bb18..48cce2e1b92 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 @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3e5dfccd5dc..fd638012ad6 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 @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b73a6b95c5b..0fb7c3ccf51 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ffb6c03113c..4261ff3c03b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 41b29a30249..ef4b636e71d 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 accb755a668..cd221f2a733 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index ea026441f36..2aa380a9921 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed8e1e2da05..8a373c41fc1 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ChildWithNullable.java index d90495dcd16..cf37302c53d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..3a22cce40b5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..d9eb667823f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f142c01c211..2fe1e9548d5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..c026300889e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 58a77ffded8..f4de7bccc58 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 04f1adb80ea..9a2e37cf4a3 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 @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,10 +299,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -357,10 +357,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -382,10 +382,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,10 +407,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e2c63da4e8d..31b78812225 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 @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e149084b1a5..899d32a294d 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Foo.java index 336ab5f2a6d..6eb92e22720 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Foo.java @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 9977c248dee..c1eb15c6864 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 eb477bf6359..36e151fc056 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 @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,12 +136,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,12 +188,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,12 +215,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +242,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,10 +269,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,10 +319,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -344,10 +344,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,10 +369,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -394,10 +394,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,10 +419,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,10 +469,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -494,10 +494,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9fc24a2b7f4..7cab692c045 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ab073044ca9..a688bb1b598 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 136e37557dd..29f371af8b0 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4ec2bb53611..dd6f0ad59bb 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 517b2eb9f07..7c0af5e4781 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8f27c57192..4ca95892895 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..42e71d96a66 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..dd0d3fd9653 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..16728e09539 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 458314f0d83..fe05ad26482 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7ce7d5cb48a..2a887e6aa0e 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 @@ -100,10 +100,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -133,10 +133,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -166,10 +166,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -199,10 +199,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -232,10 +232,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -265,10 +265,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -310,10 +310,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -355,10 +355,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -396,10 +396,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -478,10 +478,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -519,10 +519,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..436cd1f2ba1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f573813253c..4dc8b588878 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 @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,11 +85,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -112,11 +112,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -147,11 +147,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 05dfbdaeefa..f8ab64dbb0a 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7045f92dd8f..1768fc9496d 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 9a077aa0970..b8172c169ed 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 0f980144308..15e84e897bc 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 180ee4787ba..a26c02589d1 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d585c01ecc3..08e36c5f03d 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index 26f99ed95e6..deb7b4074cc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 201029ba21a..181ed783218 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0d37480fa3f..5bf75e39a21 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -47,10 +47,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap requestBody = null; + api.testAdditionalPropertiesReference(requestBody, result -> { + // TODO: test validations + async.complete(); + }); + } /** * * For this test, the body has to be a binary file. @@ -214,7 +214,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * For this test, the body for this request must reference a schema named `File`. @@ -230,7 +229,6 @@ public class FakeApiTest { async.complete(); }); } - /** * * @@ -247,7 +245,6 @@ public class FakeApiTest { async.complete(); }); } - /** * To test \"client\" model * To test \"client\" model @@ -263,7 +260,6 @@ public class FakeApiTest { async.complete(); }); } - /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -292,7 +288,6 @@ public class FakeApiTest { async.complete(); }); } - /** * To test enum parameters * To test enum parameters @@ -316,7 +311,6 @@ public class FakeApiTest { async.complete(); }); } - /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -337,7 +331,6 @@ public class FakeApiTest { async.complete(); }); } - /** * test inline additionalProperties * @@ -353,7 +346,21 @@ public class FakeApiTest { async.complete(); }); } - + /** + * test inline free-form additionalProperties + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest(TestContext testContext) { + Async async = testContext.async(); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, result -> { + // TODO: test validations + async.complete(); + }); + } /** * test json serialization of form data * @@ -370,7 +377,21 @@ public class FakeApiTest { async.complete(); }); } - + /** + * test nullable parent property + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testNullableTest(TestContext testContext) { + Async async = testContext.async(); + ChildWithNullable childWithNullable = null; + api.testNullable(childWithNullable, result -> { + // TODO: test validations + async.complete(); + }); + } /** * * To test the collection format in query parameters @@ -392,5 +413,19 @@ public class FakeApiTest { async.complete(); }); } - + /** + * test referenced string map + * + * + * @param context Vertx test context for doing assertions + */ + @Test + public void testStringMapReferenceTest(TestContext testContext) { + Async async = testContext.async(); + Map requestBody = null; + api.testStringMapReference(requestBody, result -> { + // TODO: test validations + async.complete(); + }); + } } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 47a43e04405..692c23f6bd2 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.model.Client; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ import java.util.Map; /** * API tests for FakeClassnameTags123Api */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private FakeClassnameTags123Api api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new FakeClassnameTags123ApiImpl(); } - + /** * To test class name in snake case * To test class name in snake case @@ -74,5 +65,4 @@ public class FakeClassnameTags123ApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java index 0f640e564d3..18a10252a46 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -19,11 +19,10 @@ import java.util.Set; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -44,24 +43,16 @@ import java.util.Map; /** * API tests for PetApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class PetApiTest { private PetApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new PetApiImpl(); } - + /** * Add a new pet to the store * @@ -77,7 +68,6 @@ public class PetApiTest { async.complete(); }); } - /** * Deletes a pet * @@ -94,7 +84,6 @@ public class PetApiTest { async.complete(); }); } - /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -110,7 +99,6 @@ public class PetApiTest { async.complete(); }); } - /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -126,7 +114,6 @@ public class PetApiTest { async.complete(); }); } - /** * Find pet by ID * Returns a single pet @@ -142,7 +129,6 @@ public class PetApiTest { async.complete(); }); } - /** * Update an existing pet * @@ -158,7 +144,6 @@ public class PetApiTest { async.complete(); }); } - /** * Updates a pet in the store with form data * @@ -176,7 +161,6 @@ public class PetApiTest { async.complete(); }); } - /** * uploads an image * @@ -194,7 +178,6 @@ public class PetApiTest { async.complete(); }); } - /** * uploads an image (required) * @@ -212,5 +195,4 @@ public class PetApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java index d95bd4fe822..757b3a802cc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -16,11 +16,10 @@ import org.openapitools.client.model.Order; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -41,24 +40,16 @@ import java.util.Map; /** * API tests for StoreApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class StoreApiTest { private StoreApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new StoreApiImpl(); } - + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -74,7 +65,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -89,7 +79,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -105,7 +94,6 @@ public class StoreApiTest { async.complete(); }); } - /** * Place an order for a pet * @@ -121,5 +109,4 @@ public class StoreApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java index 166e90ee695..debaeec310f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -17,11 +17,10 @@ import org.openapitools.client.model.User; import org.openapitools.client.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -42,24 +41,16 @@ import java.util.Map; /** * API tests for UserApi */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class UserApiTest { private UserApi api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new UserApiImpl(); } - + /** * Create user * This can only be done by the logged in user. @@ -75,7 +66,6 @@ public class UserApiTest { async.complete(); }); } - /** * Creates list of users with given input array * @@ -91,7 +81,6 @@ public class UserApiTest { async.complete(); }); } - /** * Creates list of users with given input array * @@ -107,7 +96,6 @@ public class UserApiTest { async.complete(); }); } - /** * Delete user * This can only be done by the logged in user. @@ -123,7 +111,6 @@ public class UserApiTest { async.complete(); }); } - /** * Get user by user name * @@ -139,7 +126,6 @@ public class UserApiTest { async.complete(); }); } - /** * Logs user into the system * @@ -156,7 +142,6 @@ public class UserApiTest { async.complete(); }); } - /** * Logs out current logged in user session * @@ -171,7 +156,6 @@ public class UserApiTest { async.complete(); }); } - /** * Updated user * This can only be done by the logged in user. @@ -188,5 +172,4 @@ public class UserApiTest { async.complete(); }); } - } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 29bc5ae9694..6bdecfe07c9 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.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 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 } @@ -42,7 +42,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapProperty' */ @Test - public void mapPropertyTest() { + void mapPropertyTest() { // TODO: test mapProperty } @@ -50,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/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index dad0e9235de..f4b06d323d6 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.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.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 } @@ -41,7 +41,7 @@ public class AllOfWithSingleRefTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -49,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/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java index da5609b5489..24776d3cb51 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index cbc199f1575..6bbe877044d 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 762f9d6dc33..eaf908bb1ab 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 20dc34a8c51..99c6bcf5360 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 4fd3728ab89..a0217acd1f2 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java index d591bdd30ef..1b389a075be 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java index 12de38c0c08..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec3..a89d26497bc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java index d1936d85e81..6ef5c744fbc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java index 7aa0f5859ff..8028f11bc2b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index 65fd3cc0b76..b04c2097b20 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.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 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 } @@ -40,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/vertx/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java index 744c8a406fe..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 694e4196138..4a755b0d442 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java index 3f50e1bfb9e..48aa1a737fc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java index 0a1fd0f4268..1e65944cbdc 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/EnumTestTest.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 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 } @@ -48,7 +48,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -56,7 +56,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -64,7 +64,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -72,7 +72,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -80,7 +80,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } @@ -88,7 +88,7 @@ public class EnumTestTest { * Test the property 'outerEnumInteger' */ @Test - public void outerEnumIntegerTest() { + void outerEnumIntegerTest() { // TODO: test outerEnumInteger } @@ -96,7 +96,7 @@ public class EnumTestTest { * Test the property 'outerEnumDefaultValue' */ @Test - public void outerEnumDefaultValueTest() { + void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } @@ -104,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/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..3250ad91974 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index fb8827a1e88..0048cb2c749 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index cd15af86ee9..81bc69c9a7b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.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.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 } @@ -41,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/vertx/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java index 2a92367019b..a9e2c8c126e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FooTest.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 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 } @@ -40,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/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java index 137d96ba0f4..1d42701a454 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/vertx/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 'decimal' */ @Test - public void decimalTest() { + void decimalTest() { // TODO: test decimal } @@ -101,7 +101,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -109,7 +109,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -117,7 +117,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -125,7 +125,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -133,7 +133,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -141,7 +141,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -149,7 +149,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -157,7 +157,7 @@ public class FormatTestTest { * Test the property 'patternWithDigits' */ @Test - public void patternWithDigitsTest() { + void patternWithDigitsTest() { // TODO: test patternWithDigits } @@ -165,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/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index bf777b061cc..908f0aff6ed 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index e96ffaa18f4..0f45c2fcd5b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,21 +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 } @@ -44,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/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java index 50e909f0381..3752c5ba31f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b16858dc17e..0f47e193af8 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dd90f6799d3..5743b70142b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index e63f2ae5e9c..436e4abd59e 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java index 264249edc1c..f128d7b9ac2 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java index 81fd2dcc6a6..92273f48d23 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 5840d4f8f0c..1c5337654cd 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java index 9280c171539..1a6aa18fa20 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java index c79c6366f83..d960ef76e5c 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -30,21 +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/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 63b5bc0440e..8623386a5e9 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index 4203b62f784..aa755cf8cb4 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -23,21 +23,21 @@ 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/vertx/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java index e0fbb529af6..670c2535646 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 840cf65c8d0..870a977da94 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 5b9bae28ec6..d818b23c7d5 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.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 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/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index 731acbf905f..1d7b3338bca 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.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 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/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 234945cec0f..cacda46a76f 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.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 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/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java index b312b11a09e..0333ee657a0 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 964d1281b21..ac7169192a5 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.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.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 } @@ -41,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/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13..2e4de561806 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java index ca23198fbf1..2e4303f1e4b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b356d6993c5..c56da4290fa 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 920d02c930c..476e4ca161b 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SingleRefTypeTest.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 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/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 8eb0b1bd269..9501cf722d6 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java index 6dc0868167c..dc9cf9742ef 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9d..edb986ca550 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/vertx/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/vertx/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java index b029d279409..69d274133b9 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/vertx/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/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/webclient-jakarta/build.gradle b/samples/client/petstore/java/webclient-jakarta/build.gradle index 2abcdab45b1..d9b1cf99575 100644 --- a/samples/client/petstore/java/webclient-jakarta/build.gradle +++ b/samples/client/petstore/java/webclient-jakarta/build.gradle @@ -116,8 +116,8 @@ ext { jakarta_annotation_version = "2.1.1" reactor_version = "3.5.12" reactor_netty_version = "1.1.13" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" junit_version = "5.10.2" } diff --git a/samples/client/petstore/java/webclient-jakarta/pom.xml b/samples/client/petstore/java/webclient-jakarta/pom.xml index 52542679310..7935ddb648c 100644 --- a/samples/client/petstore/java/webclient-jakarta/pom.xml +++ b/samples/client/petstore/java/webclient-jakarta/pom.xml @@ -120,8 +120,8 @@ UTF-8 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 3.0.12 2.1.1 diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java index 70d590dcd0b..94f90e3897a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -41,7 +41,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 978aa3397c4..f0afdd6841c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 7f77e3d3c26..4092a6cafda 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,8 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; 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 0a24ded8de6..54d9412fea9 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 @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 245502c27cb..c433fca7bf0 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 @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0ee7ca10136..5cf05089ba9 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 @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index eff2a4ab7d6..ddac958537d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a46ded84a9a..b9c84e51d1a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 e16fd175188..c2666c094c9 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7ff0d8d1c68..44a19508cee 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { 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) @@ -188,10 +188,10 @@ public class Capitalization { 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) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java index 275ac0a572a..881114869ef 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9937475f745..ce3d420120e 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java index deec65f5ecc..f8f404e66be 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java index dcd0d2ec424..10a9a7c63a2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java index 0eddf18ba0d..d8b3f613a1a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java index d89d61e6410..457513842dd 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java index 2721eb32f72..b0690af7411 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 4343ec3d02e..2cb8d2c8272 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 2981d30db90..439272c3aae 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 @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,10 +299,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -357,10 +357,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -382,10 +382,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,10 +407,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c3c6841eceb..753abd6095f 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 @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 11c45bc7358..b0e1ffd007c 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java index e9069943cec..b97483e507a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 2d464d604c8..02f487ee607 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c67a8985f9e..674233bf228 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 @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,12 +136,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,12 +188,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,12 +215,12 @@ public class FormatTest { 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) @@ -242,12 +242,12 @@ public class FormatTest { 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) @@ -269,10 +269,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,10 +319,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -344,10 +344,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,10 +369,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -394,10 +394,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,10 +419,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,10 +469,10 @@ public class FormatTest { 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) @@ -494,10 +494,10 @@ public class FormatTest { 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) 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 6ed089041e3..b0e52156684 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 5131a02efc6..0e175957b49 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @jakarta.annotation.Nullable @JsonIgnore 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 2591291dde6..ce6419f241e 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 1b5b35712a6..cced417b9be 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 6890500da26..2ef6607b664 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 5855bba3134..91d6ac0f272 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java index 536c114f7bf..3d734f3a626 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java index a54c89f4aef..d7a981d7c6d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java index 0ae4173b86e..65ecbae7361 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 0e5b485fe91..7dd1956b60d 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 5ece264983f..978f703b760 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 @@ -100,10 +100,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -133,10 +133,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -166,10 +166,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -199,10 +199,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -232,10 +232,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -265,10 +265,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -310,10 +310,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -355,10 +355,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -396,10 +396,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -478,10 +478,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @jakarta.annotation.Nullable @JsonIgnore @@ -519,10 +519,10 @@ public class NullableClass extends HashMap { 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) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java index ae83af4b079..d505cd848f2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f95a7635614..4c38e1c3cb5 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 @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,11 +85,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -112,11 +112,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -147,11 +147,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 31d5d4f19c5..11b1188e55f 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 03e67767714..39677c6bd31 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index eb11a70eecb..89d59fd4a4d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 f032bccf711..43b87af07d0 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @jakarta.annotation.Nullable @JsonIgnore 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 048e9d34f96..7b5e6ce3a76 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 806117333ca..33eb8b5e950 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java index 92a42c44734..e869ce8915c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 fb996d933b6..94481f0d92b 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 1239e610351..214defe13be 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -47,10 +47,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.7.17 1.3.5 diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java index 3f60d6b5b58..f63736b6c04 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -41,7 +41,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f62430f4b25..6bc5fb44aec 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 379f913033d..a1b702225ed 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,8 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; 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 28f25821f4c..c0b95461211 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 @@ -64,10 +64,10 @@ public class ByteArrayObject { return this; } - /** + /** * byte array. * @return nullableArray - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -97,10 +97,10 @@ public class ByteArrayObject { return this; } - /** + /** * byte array. * @return normalArray - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NORMAL_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,10 +122,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get nullableString * @return nullableString - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -155,10 +155,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get stringField * @return stringField - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING_FIELD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,10 +180,10 @@ public class ByteArrayObject { return this; } - /** + /** * Get intField * @return intField - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT_FIELD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml index 96dc260deb8..1eddf878948 100644 --- a/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-swagger2/api/openapi.yaml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/client/petstore/java/webclient-swagger2/build.gradle b/samples/client/petstore/java/webclient-swagger2/build.gradle index c5d3d6fa0ab..8aa7b57c503 100644 --- a/samples/client/petstore/java/webclient-swagger2/build.gradle +++ b/samples/client/petstore/java/webclient-swagger2/build.gradle @@ -117,8 +117,8 @@ ext { jakarta_annotation_version = "1.3.5" reactor_version = "3.4.34" reactor_netty_version = "1.0.39" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" junit_version = "5.10.2" } diff --git a/samples/client/petstore/java/webclient-swagger2/pom.xml b/samples/client/petstore/java/webclient-swagger2/pom.xml index 292125371ef..ca3052ed600 100644 --- a/samples/client/petstore/java/webclient-swagger2/pom.xml +++ b/samples/client/petstore/java/webclient-swagger2/pom.xml @@ -126,8 +126,8 @@ UTF-8 2.2.15 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.7.17 1.3.5 diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java index f4bd2d2b42b..7ed1d2bda15 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -41,7 +41,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f62430f4b25..6bc5fb44aec 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 379f913033d..a1b702225ed 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,8 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; 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 367b7aacf62..c5a065f5b3d 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 @@ -58,10 +58,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @@ -92,10 +92,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) 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 eb6264f8c1e..0e1210307fe 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 @@ -49,10 +49,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -75,10 +75,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) 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 4140a8a77f0..22ed3d60a33 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 @@ -61,10 +61,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CLASS_NAME) @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_COLOR) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 275082880e2..8b6967abb11 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9afb9afefff..624e06e6135 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) 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 071f9154856..d1e0290566b 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 @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @@ -98,10 +98,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @@ -132,10 +132,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) 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 2b18cdccc66..930c2f33288 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 @@ -64,10 +64,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @@ -116,10 +116,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @@ -142,10 +142,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @@ -168,10 +168,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @@ -194,10 +194,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the pet ") @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java index ce831f93c28..055a93d50b7 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java @@ -55,10 +55,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DECLAWED) 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 aaab997f826..567076d4092 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 @@ -48,10 +48,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java index 48090aad00b..a70ca46208a 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -56,10 +56,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java index c80f667831d..823c5fbcad1 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Client.java index a2ba612e491..27d2fc7c853 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Client.java @@ -44,10 +44,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CLIENT) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 97112ea3a4c..8f2fe985076 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -46,10 +46,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java index d510cbf690a..5b0cb4c3564 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java @@ -55,10 +55,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BREED) 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 d612234c666..6dca1287e6e 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 @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @@ -155,10 +155,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) 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 ef8a72db47b..c3d1ba331c5 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 @@ -225,10 +225,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING) @@ -251,10 +251,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @@ -277,10 +277,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @@ -303,10 +303,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @@ -329,10 +329,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -363,10 +363,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @@ -389,10 +389,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @@ -415,10 +415,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) 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 fe7c6a2904f..cfe0fc6685e 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 @@ -52,10 +52,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SOME_ID) @@ -86,10 +86,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SOME_MAP) 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 6d42e6f7f65..43f257b1bd5 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 @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FILE) @@ -86,10 +86,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FILES) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java index 2829bca7b44..bf2d5b8d9e7 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java @@ -44,10 +44,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index bd63c6f410e..c403df9e14d 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -46,10 +46,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_STRING) 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 651a81f588b..0ba2971d7e3 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 @@ -110,12 +110,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INTEGER) @@ -138,12 +138,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INT32) @@ -166,10 +166,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INT64) @@ -192,12 +192,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NUMBER) @@ -220,12 +220,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FLOAT) @@ -248,12 +248,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DOUBLE) @@ -276,10 +276,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DECIMAL) @@ -302,10 +302,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_STRING) @@ -328,10 +328,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BYTE) @@ -354,10 +354,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BINARY) @@ -380,10 +380,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE) @@ -406,10 +406,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @@ -432,10 +432,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_UUID) @@ -458,10 +458,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -484,10 +484,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.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) @@ -510,10 +510,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.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) 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 dafbeb39444..1ada5716036 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 @@ -43,8 +43,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -55,10 +55,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) @@ -70,10 +70,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FOO) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java index e609d39fad5..7ba4459a018 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -49,10 +49,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore 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 e209482ffa8..0422ddfcde7 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 @@ -101,10 +101,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @@ -169,10 +169,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @@ -203,10 +203,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) 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 db013f2cf1b..37d7c5c190b 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 @@ -57,10 +57,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_UUID) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @@ -117,10 +117,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 1da0b90733a..17e8214be85 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 @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -76,10 +76,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) 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 6c9b5c678ee..635c349f3d0 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 @@ -53,10 +53,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -105,10 +105,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java index b581189b9f7..b889650115c 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -46,10 +46,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Test capitalization") @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java index 91f3abe78d8..7c03391bf2d 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java @@ -45,10 +45,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_123LIST) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java index d350ab24ea2..afca1ecd9eb 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_RETURN) 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 5d0bf8858f6..b6d0d24e5b9 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 @@ -51,8 +51,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -69,10 +69,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -89,10 +89,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @@ -110,10 +110,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PROPERTY) @@ -130,10 +130,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 706b0b3c18b..ce74908ff57 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 @@ -101,10 +101,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -135,10 +135,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -169,10 +169,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -203,10 +203,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -237,10 +237,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -271,10 +271,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -317,10 +317,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -363,10 +363,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -405,10 +405,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @@ -443,10 +443,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -489,10 +489,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore @@ -531,10 +531,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java index 7ff12fce9a2..2e77835a659 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -45,10 +45,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_JUST_NUMBER) 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 2566632300b..a63c7823c07 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 @@ -61,10 +61,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_UUID) @@ -87,11 +87,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @@ -115,11 +115,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @@ -151,11 +151,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") 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 0834a675351..75ad74b0fe5 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 @@ -102,10 +102,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -154,10 +154,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -180,10 +180,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -206,10 +206,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -232,10 +232,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_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 7eec6d7d29f..8861f6f617d 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 @@ -53,10 +53,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_NUMBER) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_STRING) @@ -105,10 +105,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 7aaea0610b3..527dd4f63af 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -45,10 +45,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_VALUE) 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 288e9a22c32..3c66961fa74 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 @@ -97,10 +97,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -123,10 +123,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonIgnore 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 6c461cd7a30..7db2c85a9c0 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 @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -135,10 +135,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -195,10 +195,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -230,10 +230,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -256,10 +256,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "pet status in the store") @JsonProperty(JSON_PROPERTY_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 7a8e4df0049..0d0d35190e8 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 @@ -42,8 +42,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -52,10 +52,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAR) @@ -73,10 +73,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_BAZ) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java index 2b426b2fedb..01c90ee27cb 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -45,10 +45,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) 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 8477c92112a..54e23e02962 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 @@ -48,10 +48,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 5f426031543..75e657669e7 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -48,10 +48,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap UTF-8 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 2.7.17 1.3.5 diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index f4bd2d2b42b..7ed1d2bda15 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -41,7 +41,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index f62430f4b25..6bc5fb44aec 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 379f913033d..a1b702225ed 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,8 +1,5 @@ package org.openapitools.client.auth; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; - import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; 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 6ec15b3b259..af3ca4eccfb 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 @@ -57,10 +57,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c7ec666bb18..48cce2e1b92 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 @@ -48,10 +48,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class AllOfWithSingleRef { return this; } - /** + /** * Get singleRefType * @return singleRefType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3e5dfccd5dc..fd638012ad6 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 @@ -60,10 +60,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -85,10 +85,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 0b75df2e200..659adc22a40 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c164bc7d02b..57f5fbb1e97 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -55,10 +55,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 84b54e52155..338c605c92f 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 @@ -63,10 +63,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,10 +129,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 accb755a668..cd221f2a733 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 @@ -63,10 +63,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,10 +88,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,10 +113,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,10 +138,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,10 +188,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index ea026441f36..2aa380a9921 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -54,10 +54,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 ed8e1e2da05..8a373c41fc1 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 @@ -47,10 +47,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java index d90495dcd16..cf37302c53d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -55,10 +55,10 @@ public class ChildWithNullable extends ParentWithNullable { return this; } - /** + /** * Get otherProperty * @return otherProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..3a22cce40b5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -43,10 +43,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..d9eb667823f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -43,10 +43,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f142c01c211..2fe1e9548d5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -45,10 +45,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..c026300889e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -54,10 +54,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 100e5ba84e4..54343cd125f 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 @@ -120,10 +120,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 04f1adb80ea..9a2e37cf4a3 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 @@ -224,10 +224,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,10 +249,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,10 +274,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,10 +299,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,10 +324,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -357,10 +357,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -382,10 +382,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,10 +407,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 19cb2632c90..ebcc660114b 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 @@ -51,10 +51,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someId * @return someId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FakeBigDecimalMap200Response { return this; } - /** + /** * Get someMap * @return someMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 a1327245a90..41a556db275 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 @@ -51,10 +51,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,10 +84,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java index 336ab5f2a6d..6eb92e22720 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java @@ -43,10 +43,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 9977c248dee..c1eb15c6864 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -45,10 +45,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 f76f9b027ec..f628a150c08 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 @@ -109,12 +109,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,12 +136,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,10 +163,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,12 +188,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,12 +215,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +242,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,10 +269,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,10 +319,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -344,10 +344,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,10 +369,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -394,10 +394,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,10 +419,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,10 +444,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,10 +469,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -494,10 +494,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9fc24a2b7f4..7cab692c045 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 @@ -42,8 +42,8 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -54,10 +54,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +68,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ab073044ca9..a688bb1b598 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -47,10 +47,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 5838ebb17ef..aefc0afb3b0 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 @@ -100,10 +100,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,10 +166,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,10 +199,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 3da490046f0..f9aeae5dc6d 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 @@ -56,10 +56,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,10 +81,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,10 +114,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 517b2eb9f07..7c0af5e4781 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 @@ -48,10 +48,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,10 +73,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 c8f27c57192..4ca95892895 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 @@ -52,10 +52,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..42e71d96a66 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -44,10 +44,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..dd0d3fd9653 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -44,10 +44,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..16728e09539 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -44,10 +44,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 458314f0d83..fe05ad26482 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 @@ -49,8 +49,8 @@ public class Name { public Name() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -86,10 +86,10 @@ public class Name { this.name = name; } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,10 +106,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,10 +125,10 @@ public class Name { this.property = property; } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 9317f72b97e..e775c3727e7 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 @@ -100,10 +100,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -133,10 +133,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -166,10 +166,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -199,10 +199,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -232,10 +232,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -265,10 +265,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -310,10 +310,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -355,10 +355,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -396,10 +396,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -433,10 +433,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -478,10 +478,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -519,10 +519,10 @@ public class NullableClass extends HashMap { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..436cd1f2ba1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -44,10 +44,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 69cbd86f940..3723de28670 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 @@ -60,10 +60,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,11 +85,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -112,11 +112,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -147,11 +147,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_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 05dfbdaeefa..f8ab64dbb0a 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 @@ -101,10 +101,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,10 +126,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,10 +151,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,10 +176,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,10 +226,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 7045f92dd8f..1768fc9496d 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 @@ -52,10 +52,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,10 +77,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,10 +102,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 9a077aa0970..b8172c169ed 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -44,10 +44,10 @@ public class OuterObjectWithEnumProperty { return this; } - /** + /** * Get value * @return value - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) 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 0f980144308..15e84e897bc 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 @@ -96,10 +96,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,10 +121,10 @@ public class ParentWithNullable { return this; } - /** + /** * Get nullableProperty * @return nullableProperty - **/ + */ @javax.annotation.Nullable @JsonIgnore 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 db2a0eb0547..0faec5da9d8 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 @@ -108,10 +108,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -133,10 +133,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,10 +158,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,10 +191,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,10 +225,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,10 +250,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 d585c01ecc3..08e36c5f03d 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 @@ -41,8 +41,8 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } /** - * Constructor with only readonly parameters - */ + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -51,10 +51,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,10 +71,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 26f99ed95e6..deb7b4074cc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -44,10 +44,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) 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 201029ba21a..181ed783218 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 @@ -47,10 +47,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0d37480fa3f..5bf75e39a21 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -47,10 +47,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -187,9 +198,9 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 4.13.2 1.4.14 - 3.3.0 - 2.15.2 - 1.3.5 + 3.5.9 + 2.17.1 + 1.3.5 UTF-8 diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index 283b696df7f..edf9249f8cd 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -81,6 +81,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -187,9 +198,9 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 4.13.2 1.4.14 - 3.3.0 - 2.15.2 - 1.3.5 + 3.5.9 + 2.17.1 + 1.3.5 UTF-8 diff --git a/samples/client/petstore/jetbrains/http/client/.openapi-generator/FILES b/samples/client/petstore/jetbrains/http/client/.openapi-generator/FILES index 9df0ac6af97..16831018728 100644 --- a/samples/client/petstore/jetbrains/http/client/.openapi-generator/FILES +++ b/samples/client/petstore/jetbrains/http/client/.openapi-generator/FILES @@ -1,4 +1,5 @@ Apis/PetApi.http Apis/StoreApi.http Apis/UserApi.http +Apis/http-client.template.env.json README.md diff --git a/samples/client/petstore/jetbrains/http/client/Apis/PetApi.http b/samples/client/petstore/jetbrains/http/client/Apis/PetApi.http index b1490408c8d..27914d2c048 100644 --- a/samples/client/petstore/jetbrains/http/client/Apis/PetApi.http +++ b/samples/client/petstore/jetbrains/http/client/Apis/PetApi.http @@ -21,16 +21,17 @@ Accept: application/json ### Deletes a pet ## Deletes a pet DELETE http://petstore.swagger.io/v2/pet/{{petId}} +api_key: {{apiKey}} ### Finds Pets by status ## Finds Pets by status -GET http://petstore.swagger.io/v2/pet/findByStatus +GET http://petstore.swagger.io/v2/pet/findByStatus?status={{status}} Accept: application/xml Accept: application/json ### Finds Pets by tags ## Finds Pets by tags -GET http://petstore.swagger.io/v2/pet/findByTags +GET http://petstore.swagger.io/v2/pet/findByTags?tags={{tags}} Accept: application/xml Accept: application/json diff --git a/samples/client/petstore/jetbrains/http/client/Apis/UserApi.http b/samples/client/petstore/jetbrains/http/client/Apis/UserApi.http index 8cef7f35cce..d656dc0c2da 100644 --- a/samples/client/petstore/jetbrains/http/client/Apis/UserApi.http +++ b/samples/client/petstore/jetbrains/http/client/Apis/UserApi.http @@ -53,7 +53,7 @@ Accept: application/json ### Logs user into the system ## Logs user into the system -GET http://petstore.swagger.io/v2/user/login +GET http://petstore.swagger.io/v2/user/login?username={{username}}&password={{password}} Accept: application/xml Accept: application/json diff --git a/samples/client/petstore/jetbrains/http/client/Apis/http-client.template.env.json b/samples/client/petstore/jetbrains/http/client/Apis/http-client.template.env.json new file mode 100644 index 00000000000..156f88f39e0 --- /dev/null +++ b/samples/client/petstore/jetbrains/http/client/Apis/http-client.template.env.json @@ -0,0 +1,11 @@ +{ + "dev": { + "password" : "", + "petId" : "", + "api_key" : "", + "orderId" : "", + "status" : "", + "tags" : "", + "username" : "" + } +} \ No newline at end of file diff --git a/samples/client/petstore/julia/src/apis/api_PetApi.jl b/samples/client/petstore/julia/src/apis/api_PetApi.jl index 2b45fa87e6f..55d2658b4e4 100644 --- a/samples/client/petstore/julia/src/apis/api_PetApi.jl +++ b/samples/client/petstore/julia/src/apis/api_PetApi.jl @@ -82,7 +82,7 @@ const _returntypes_find_pets_by_status_PetApi = Dict{Regex,Type}( function _oacinternal_find_pets_by_status(_api::PetApi, status::Vector{String}; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_find_pets_by_status_PetApi, "/pet/findByStatus", ["petstore_auth", ]) - OpenAPI.Clients.set_param(_ctx.query, "status", status) # type Vector{String} + OpenAPI.Clients.set_param(_ctx.query, "status", status; style="form", is_explode=false) # type Vector{String} OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx @@ -114,7 +114,7 @@ const _returntypes_find_pets_by_tags_PetApi = Dict{Regex,Type}( function _oacinternal_find_pets_by_tags(_api::PetApi, tags::Vector{String}; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_find_pets_by_tags_PetApi, "/pet/findByTags", ["petstore_auth", ]) - OpenAPI.Clients.set_param(_ctx.query, "tags", tags) # type Vector{String} + OpenAPI.Clients.set_param(_ctx.query, "tags", tags; style="form", is_explode=false) # type Vector{String} OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx diff --git a/samples/client/petstore/julia/src/apis/api_UserApi.jl b/samples/client/petstore/julia/src/apis/api_UserApi.jl index 63e0df193ae..89ed37ed772 100644 --- a/samples/client/petstore/julia/src/apis/api_UserApi.jl +++ b/samples/client/petstore/julia/src/apis/api_UserApi.jl @@ -174,8 +174,8 @@ const _returntypes_login_user_UserApi = Dict{Regex,Type}( function _oacinternal_login_user(_api::UserApi, username::String, password::String; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_login_user_UserApi, "/user/login", []) - OpenAPI.Clients.set_param(_ctx.query, "username", username) # type String - OpenAPI.Clients.set_param(_ctx.query, "password", password) # type String + OpenAPI.Clients.set_param(_ctx.query, "username", username; style="form", is_explode=true) # type String + OpenAPI.Clients.set_param(_ctx.query, "password", password; style="form", is_explode=true) # type String OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 833a152e0f7..bcd13560876 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -19,8 +19,10 @@ const BASE_URL = "https://127.0.0.1/no_varaible"; // You might want to edit the value of this variable or remove calls to the sleep function on the script. const SLEEP_DURATION = 0.1; // Global variables should be initialized. +let globalApiKeyCookie = "TODO_EDIT_THE_GLOBAL_API_KEY_COOKIE"; let booleanGroup = "TODO_EDIT_THE_BOOLEAN_GROUP"; let header1 = "TODO_EDIT_THE_HEADER_1"; +let globalApiKeyHeader = "TODO_EDIT_THE_GLOBAL_API_KEY_HEADER"; let apiKey = "TODO_EDIT_THE_API_KEY"; let requiredBooleanGroup = "TODO_EDIT_THE_REQUIRED_BOOLEAN_GROUP"; let enumHeaderStringArray = "TODO_EDIT_THE_ENUM_HEADER_STRING_ARRAY"; @@ -39,7 +41,13 @@ export default function() { let url = BASE_URL + `/fake?enum_query_string_array=${enum_query_string_array}&enum_query_string=${enum_query_string}&enum_query_integer=${enum_query_integer}&enum_query_double=${enum_query_double}&enum_query_model_array=${enum_query_model_array}`; // TODO: edit the parameters of the request body. let body = {"enumFormStringArray": "list", "enumFormString": "string"}; - let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "enum_header_string_array": `${enumHeaderStringArray}`, "enum_header_string": `${enumHeaderString}`, "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/x-www-form-urlencoded", "enum_header_string_array": `${enumHeaderStringArray}`, "enum_header_string": `${enumHeaderString}`, "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.get(url, JSON.stringify(body), params); @@ -51,7 +59,13 @@ export default function() { let url = BASE_URL + `/fake`; // TODO: edit the parameters of the request body. let body = {"client": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.patch(url, JSON.stringify(body), params); check(request, { @@ -65,7 +79,13 @@ export default function() { // Request No. 1: fakeOuterBooleanSerialize { let url = BASE_URL + `/fake/outer/boolean`; - let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -81,7 +101,13 @@ export default function() { let url = BASE_URL + `/another-fake/dummy`; // TODO: edit the parameters of the request body. let body = {"client": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.patch(url, JSON.stringify(body), params); check(request, { @@ -97,7 +123,13 @@ export default function() { let url = BASE_URL + `/pet`; // TODO: edit the parameters of the request body. let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.put(url, JSON.stringify(body), params); check(request, { @@ -112,7 +144,13 @@ export default function() { let url = BASE_URL + `/pet`; // TODO: edit the parameters of the request body. let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -128,7 +166,13 @@ export default function() { let url = BASE_URL + `/fake/inline-freeform-additionalProperties`; // TODO: edit the parameters of the request body. let body = {"someProperty": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -143,7 +187,14 @@ export default function() { // Request No. 1: getUserByName { let url = BASE_URL + `/user/${username}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -155,7 +206,15 @@ export default function() { // Request No. 2: deleteUser { let url = BASE_URL + `/user/${username}`; - let request = http.del(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.del(url, {} , params); } }); @@ -165,7 +224,13 @@ export default function() { // Request No. 1: testBodyWithBinary { let url = BASE_URL + `/fake/body-with-binary`; - let params = {headers: {"Content-Type": "image/png", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "image/png", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.put(url, params); check(request, { @@ -181,7 +246,13 @@ export default function() { let url = BASE_URL + `/fake/nullable`; // TODO: edit the parameters of the request body. let body = {"type": "string", "nullableProperty": "string", "otherProperty": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -197,7 +268,13 @@ export default function() { let url = BASE_URL + `/fake_classname_test`; // TODO: edit the parameters of the request body. let body = {"client": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.patch(url, JSON.stringify(body), params); check(request, { @@ -211,7 +288,13 @@ export default function() { // Request No. 1: createUsersWithListInput { let url = BASE_URL + `/user/createWithList`; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -225,7 +308,13 @@ export default function() { // Request No. 1: testInlineAdditionalProperties { let url = BASE_URL + `/fake/inline-additionalProperties`; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -239,7 +328,14 @@ export default function() { // Request No. 1: getInventory { let url = BASE_URL + `/store/inventory`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -254,7 +350,14 @@ export default function() { // Request No. 1: loginUser { let url = BASE_URL + `/user/login?username=${username}&password=${password}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -267,7 +370,13 @@ export default function() { // Request No. 1: testStringMapReference { let url = BASE_URL + `/fake/stringMap-reference`; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -283,7 +392,13 @@ export default function() { let url = BASE_URL + `/fake/outer/composite`; // TODO: edit the parameters of the request body. let body = {"myNumber": "bigdecimal", "myString": "string", "myBoolean": "boolean"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -299,7 +414,13 @@ export default function() { let url = BASE_URL + `/fake/jsonFormData`; // TODO: edit the parameters of the request body. let body = {"param": "string", "param2": "string"}; - let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/x-www-form-urlencoded", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.get(url, JSON.stringify(body), params); check(request, { @@ -316,7 +437,13 @@ export default function() { let url = BASE_URL + `/fake/${petId}/uploadImageWithRequiredFile`; // TODO: edit the parameters of the request body. let body = {"additionalMetadata": "string", "requiredFile": http.file(open("/path/to/file.bin", "b"), "test.bin")}; - let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "multipart/form-data", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -331,7 +458,14 @@ export default function() { // Request No. 1: getPetById { let url = BASE_URL + `/pet/${petId}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -343,7 +477,13 @@ export default function() { // Request No. 2: deletePet { let url = BASE_URL + `/pet/${petId}`; - let params = {headers: {"api_key": `${apiKey}`, "Accept": "application/json"}}; + let params = { + headers: { + "api_key": `${apiKey}`, "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; // this is a DELETE method request - if params are also set, empty body must be passed let request = http.del(url, {} , params); @@ -358,7 +498,14 @@ export default function() { // Request No. 1: { let url = BASE_URL + `/foo`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "response": (r) => r.status === 200 @@ -371,7 +518,13 @@ export default function() { // Request No. 1: fakeOuterStringSerialize { let url = BASE_URL + `/fake/outer/string`; - let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -392,7 +545,14 @@ export default function() { // Request No. 1: testQueryParameterCollectionFormat { let url = BASE_URL + `/fake/test-query-parameters?pipe=${pipe}&ioutil=${ioutil}&http=${http}&url=${url}&context=${context}&language=${language}&allowEmpty=${allowEmpty}`; - let request = http.put(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.put(url, params); check(request, { "Success": (r) => r.status === 200 @@ -406,7 +566,14 @@ export default function() { // Request No. 1: getOrderById { let url = BASE_URL + `/store/order/${order_id}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -418,7 +585,15 @@ export default function() { // Request No. 2: deleteOrder { let url = BASE_URL + `/store/order/${order_id}`; - let request = http.del(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.del(url, {} , params); } }); @@ -428,7 +603,13 @@ export default function() { // Request No. 1: testAdditionalPropertiesReference { let url = BASE_URL + `/fake/additionalProperties-reference`; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -443,7 +624,14 @@ export default function() { // Request No. 1: findPetsByStatus { let url = BASE_URL + `/pet/findByStatus?status=${status}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -459,7 +647,13 @@ export default function() { let url = BASE_URL + `/fake/body-with-query-params?query=${query}`; // TODO: edit the parameters of the request body. let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.put(url, JSON.stringify(body), params); check(request, { @@ -476,7 +670,13 @@ export default function() { let url = BASE_URL + `/pet/${petId}/uploadImage`; // TODO: edit the parameters of the request body. let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; - let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "multipart/form-data", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -493,7 +693,13 @@ export default function() { let url = BASE_URL + `/fake/http-signature-test?query_1=${query_1}`; // TODO: edit the parameters of the request body. let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "header_1": `${header1}`, "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "header_1": `${header1}`, "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.get(url, JSON.stringify(body), params); check(request, { @@ -509,7 +715,13 @@ export default function() { let url = BASE_URL + `/user`; // TODO: edit the parameters of the request body. let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -525,7 +737,13 @@ export default function() { let url = BASE_URL + `/fake/property/enum-int`; // TODO: edit the parameters of the request body. let body = {"value": "outerenuminteger"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -539,7 +757,13 @@ export default function() { // Request No. 1: createUsersWithArrayInput { let url = BASE_URL + `/user/createWithArray`; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { @@ -555,7 +779,13 @@ export default function() { let url = BASE_URL + `/fake/body-with-file-schema`; // TODO: edit the parameters of the request body. let body = {"file": http.file(open("/path/to/file.bin", "b"), "test.bin"), "files": "list"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.put(url, JSON.stringify(body), params); check(request, { @@ -570,7 +800,14 @@ export default function() { // Request No. 1: findPetsByTags { let url = BASE_URL + `/pet/findByTags?tags=${tags}`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -585,7 +822,13 @@ export default function() { let url = BASE_URL + `/store/order`; // TODO: edit the parameters of the request body. let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, JSON.stringify(body), params); check(request, { @@ -599,7 +842,14 @@ export default function() { // Request No. 1: logoutUser { let url = BASE_URL + `/user/logout`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -612,7 +862,14 @@ export default function() { // Request No. 1: fakeBigDecimalMap { let url = BASE_URL + `/fake/BigDecimalMap`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "successful operation": (r) => r.status === 200 @@ -625,7 +882,14 @@ export default function() { // Request No. 1: { let url = BASE_URL + `/fake/health`; - let request = http.get(url); + let params = { + headers: { + "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "application/json" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; + let request = http.get(url, params); check(request, { "The instance started successfully": (r) => r.status === 200 @@ -638,7 +902,13 @@ export default function() { // Request No. 1: fakeOuterNumberSerialize { let url = BASE_URL + `/fake/outer/number`; - let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let params = { + headers: { + "Content-Type": "application/json", "global_api_key_header": `${globalApiKeyHeader}`, "Accept": "*/*" + }, cookies: { + "global_api_key_cookie": `${globalApiKeyCookie}` + } + }; let request = http.post(url, params); check(request, { diff --git a/samples/client/petstore/kotlin-allOff-discriminator/README.md b/samples/client/petstore/kotlin-allOff-discriminator/README.md index db5620171dc..3a703c1f64f 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/README.md +++ b/samples/client/petstore/kotlin-allOff-discriminator/README.md @@ -44,9 +44,9 @@ This runs all tests and packages the library. All URIs are relative to *http://example.org* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*BirdApi* | [**getBird**](docs/BirdApi.md#getbird) | **GET** /v1/bird/{id} | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *BirdApi* | [**getBird**](docs/BirdApi.md#getbird) | **GET** /v1/bird/{id} | | diff --git a/samples/client/petstore/kotlin-allOff-discriminator/docs/Animal.md b/samples/client/petstore/kotlin-allOff-discriminator/docs/Animal.md index 44b79cb929d..3c667f1557e 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/docs/Animal.md +++ b/samples/client/petstore/kotlin-allOff-discriminator/docs/Animal.md @@ -2,9 +2,9 @@ # Animal ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | [**java.util.UUID**](java.util.UUID.md) | | +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | [**java.util.UUID**](java.util.UUID.md) | | | diff --git a/samples/client/petstore/kotlin-allOff-discriminator/docs/Bird.md b/samples/client/petstore/kotlin-allOff-discriminator/docs/Bird.md index 850f9342bb0..855925d1aee 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/docs/Bird.md +++ b/samples/client/petstore/kotlin-allOff-discriminator/docs/Bird.md @@ -2,9 +2,9 @@ # Bird ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**featherType** | **kotlin.String** | | +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **featherType** | **kotlin.String** | | | diff --git a/samples/client/petstore/kotlin-allOff-discriminator/docs/BirdApi.md b/samples/client/petstore/kotlin-allOff-discriminator/docs/BirdApi.md index 61dcdb135c4..60283e9b7cd 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/docs/BirdApi.md +++ b/samples/client/petstore/kotlin-allOff-discriminator/docs/BirdApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://example.org* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getBird**](BirdApi.md#getBird) | **GET** /v1/bird/{id} | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getBird**](BirdApi.md#getBird) | **GET** /v1/bird/{id} | | @@ -34,10 +34,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **java.util.UUID**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **java.util.UUID**| | | ### Return type diff --git a/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat b/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat +++ b/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt index 50d02a563a7..9382d5519b2 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -30,5 +30,6 @@ interface Animal { @Json(name = "id") val id: java.util.UUID + } diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt index 59863e86180..c368f1fd260 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -36,5 +36,8 @@ data class Bird ( @Json(name = "featherType") val featherType: kotlin.String -) : Animal +) : Animal { + + +} diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md index 93493dd4a11..19d5d9bb96e 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | | diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/docs/DefaultApi.md b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/docs/DefaultApi.md index 39a71e41a1c..46a83408ddf 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | | @@ -33,10 +33,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } 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 9d0ce634cb1..107acd32c4e 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,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/README.md b/samples/client/petstore/kotlin-array-simple-string-multiplatform/README.md index 5167025e57e..ec6e6904cf2 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/README.md +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/README.md @@ -34,9 +34,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | | diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/docs/DefaultApi.md b/samples/client/petstore/kotlin-array-simple-string-multiplatform/docs/DefaultApi.md index 39a71e41a1c..46a83408ddf 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | | @@ -33,10 +33,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/README.md b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/README.md index 719edc10984..8da9c0c2fc5 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/README.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/README.md @@ -34,9 +34,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**testPost**](docs/DefaultApi.md#testpost) | **POST** /test | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**testPost**](docs/DefaultApi.md#testpost) | **POST** /test | | diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/Apa.md b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/Apa.md index 52b85cbc3f3..3bd7a6214d6 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/Apa.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/Apa.md @@ -2,14 +2,14 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bepa** | **kotlin.Double** | | -**cepa** | **kotlin.Double** | | -**depa** | **kotlin.Double** | | [optional] -**epa** | **kotlin.Double** | | [optional] -**fepa** | **kotlin.Double** | | [optional] -**gepa** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **bepa** | **kotlin.Double** | | | +| **cepa** | **kotlin.Double** | | | +| **depa** | **kotlin.Double** | | [optional] | +| **epa** | **kotlin.Double** | | [optional] | +| **fepa** | **kotlin.Double** | | [optional] | +| **gepa** | **kotlin.Double** | | [optional] | diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/DefaultApi.md b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/DefaultApi.md index cd47c985617..dc5045f61e9 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testPost**](DefaultApi.md#testPost) | **POST** /test | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testPost**](DefaultApi.md#testPost) | **POST** /test | | @@ -33,10 +33,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apa** | [**Apa**](Apa.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apa** | [**Apa**](Apa.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt index 08e06c597b4..463c7ccc623 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt @@ -47,5 +47,8 @@ data class Apa ( @SerialName(value = "gepa") val gepa: kotlin.Double? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md index a3ba91a0246..4d1dd3c2abe 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**testPost**](docs/DefaultApi.md#testpost) | **POST** /test | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**testPost**](docs/DefaultApi.md#testpost) | **POST** /test | | diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/Apa.md b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/Apa.md index 2831e9acf48..ec0e0b04812 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/Apa.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/Apa.md @@ -2,14 +2,14 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**cepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**depa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**epa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**fepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] -**gepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **bepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | +| **cepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | +| **depa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **epa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **fepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **gepa** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/DefaultApi.md b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/DefaultApi.md index cd47c985617..dc5045f61e9 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testPost**](DefaultApi.md#testPost) | **POST** /test | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testPost**](DefaultApi.md#testPost) | **POST** /test | | @@ -33,10 +33,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apa** | [**Apa**](Apa.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apa** | [**Apa**](Apa.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt index f40cde8caa4..b4117ed35da 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -52,5 +52,8 @@ data class Apa ( @Json(name = "gepa") val gepa: java.math.BigDecimal? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md index edbfb9742c1..5d747c7e662 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** /test | Tests default values +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** /test | Tests default values | diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md index cde9dd9cda0..c83f71851c2 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md @@ -2,12 +2,12 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**i0** | **kotlin.Int** | | -**n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**i1** | **kotlin.Int** | | [optional] -**n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **i0** | **kotlin.Int** | | | +| **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | +| **i1** | **kotlin.Int** | | [optional] | +| **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md index 1a992fdc282..dd1534cf92f 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test**](DefaultApi.md#test) | **POST** /test | Tests default values +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**test**](DefaultApi.md#test) | **POST** /test | Tests default values | @@ -63,38 +63,37 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pi0** | **kotlin.Int**| | [default to 10] - **pi1** | **kotlin.Int**| | - **pn0** | **java.math.BigDecimal**| | [default to 10.0] - **pn1** | **java.math.BigDecimal**| | - **qi0** | **kotlin.Int**| | [optional] [default to 10] - **qi1** | **kotlin.Int**| | [default to 71] - **qi2** | **kotlin.Int**| | [optional] - **qi3** | **kotlin.Int**| | - **qn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **qn1** | **java.math.BigDecimal**| | [default to 71.0] - **qn2** | **java.math.BigDecimal**| | [optional] - **qn3** | **java.math.BigDecimal**| | - **hi0** | **kotlin.Int**| | [optional] [default to 10] - **hi1** | **kotlin.Int**| | [default to 71] - **hi2** | **kotlin.Int**| | [optional] - **hi3** | **kotlin.Int**| | - **hn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **hn1** | **java.math.BigDecimal**| | [default to 71.0] - **hn2** | **java.math.BigDecimal**| | [optional] - **hn3** | **java.math.BigDecimal**| | - **fi0** | **kotlin.Int**| | [optional] [default to 10] - **fi1** | **kotlin.Int**| | [default to 71] - **fi2** | **kotlin.Int**| | [optional] - **fi3** | **kotlin.Int**| | - **fn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **fn1** | **java.math.BigDecimal**| | [default to 71.0] - **fn2** | **java.math.BigDecimal**| | [optional] - **fn3** | **java.math.BigDecimal**| | - **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | +| **pi0** | **kotlin.Int**| | [default to 10] | +| **pi1** | **kotlin.Int**| | | +| **pn0** | **java.math.BigDecimal**| | [default to 10.0] | +| **pn1** | **java.math.BigDecimal**| | | +| **qi0** | **kotlin.Int**| | [optional] [default to 10] | +| **qi1** | **kotlin.Int**| | [default to 71] | +| **qi2** | **kotlin.Int**| | [optional] | +| **qi3** | **kotlin.Int**| | | +| **qn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **qn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **qn2** | **java.math.BigDecimal**| | [optional] | +| **qn3** | **java.math.BigDecimal**| | | +| **hi0** | **kotlin.Int**| | [optional] [default to 10] | +| **hi1** | **kotlin.Int**| | [default to 71] | +| **hi2** | **kotlin.Int**| | [optional] | +| **hi3** | **kotlin.Int**| | | +| **hn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **hn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **hn2** | **java.math.BigDecimal**| | [optional] | +| **hn3** | **java.math.BigDecimal**| | | +| **fi0** | **kotlin.Int**| | [optional] [default to 10] | +| **fi1** | **kotlin.Int**| | [default to 71] | +| **fi2** | **kotlin.Int**| | [optional] | +| **fi3** | **kotlin.Int**| | | +| **fn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **fn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **fn2** | **java.math.BigDecimal**| | [optional] | +| **fn3** | **java.math.BigDecimal**| | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt index 565c282b025..db786666d4d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -43,5 +43,8 @@ data class Apa ( @Json(name = "n1") val n1: java.math.BigDecimal? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md index da823b75aa5..6d2197d10c8 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** test | Tests default values +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** test | Tests default values | diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md index cde9dd9cda0..c83f71851c2 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md @@ -2,12 +2,12 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**i0** | **kotlin.Int** | | -**n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**i1** | **kotlin.Int** | | [optional] -**n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **i0** | **kotlin.Int** | | | +| **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | +| **i1** | **kotlin.Int** | | [optional] | +| **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md index 25c9faaddb1..0545066c005 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test**](DefaultApi.md#test) | **POST** test | Tests default values +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**test**](DefaultApi.md#test) | **POST** test | Tests default values | @@ -55,38 +55,37 @@ webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pi0** | **kotlin.Int**| | [default to 10] - **pi1** | **kotlin.Int**| | - **pn0** | **java.math.BigDecimal**| | [default to 10.0] - **pn1** | **java.math.BigDecimal**| | - **qi0** | **kotlin.Int**| | [optional] [default to 10] - **qi1** | **kotlin.Int**| | [default to 71] - **qi2** | **kotlin.Int**| | [optional] - **qi3** | **kotlin.Int**| | - **qn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **qn1** | **java.math.BigDecimal**| | [default to 71.0] - **qn2** | **java.math.BigDecimal**| | [optional] - **qn3** | **java.math.BigDecimal**| | - **hi0** | **kotlin.Int**| | [optional] [default to 10] - **hi1** | **kotlin.Int**| | [default to 71] - **hi2** | **kotlin.Int**| | [optional] - **hi3** | **kotlin.Int**| | - **hn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **hn1** | **java.math.BigDecimal**| | [default to 71.0] - **hn2** | **java.math.BigDecimal**| | [optional] - **hn3** | **java.math.BigDecimal**| | - **fi0** | **kotlin.Int**| | [optional] [default to 10] - **fi1** | **kotlin.Int**| | [default to 71] - **fi2** | **kotlin.Int**| | [optional] - **fi3** | **kotlin.Int**| | - **fn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] - **fn1** | **java.math.BigDecimal**| | [default to 71.0] - **fn2** | **java.math.BigDecimal**| | [optional] - **fn3** | **java.math.BigDecimal**| | - **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | +| **pi0** | **kotlin.Int**| | [default to 10] | +| **pi1** | **kotlin.Int**| | | +| **pn0** | **java.math.BigDecimal**| | [default to 10.0] | +| **pn1** | **java.math.BigDecimal**| | | +| **qi0** | **kotlin.Int**| | [optional] [default to 10] | +| **qi1** | **kotlin.Int**| | [default to 71] | +| **qi2** | **kotlin.Int**| | [optional] | +| **qi3** | **kotlin.Int**| | | +| **qn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **qn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **qn2** | **java.math.BigDecimal**| | [optional] | +| **qn3** | **java.math.BigDecimal**| | | +| **hi0** | **kotlin.Int**| | [optional] [default to 10] | +| **hi1** | **kotlin.Int**| | [default to 71] | +| **hi2** | **kotlin.Int**| | [optional] | +| **hi3** | **kotlin.Int**| | | +| **hn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **hn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **hn2** | **java.math.BigDecimal**| | [optional] | +| **hn3** | **java.math.BigDecimal**| | | +| **fi0** | **kotlin.Int**| | [optional] [default to 10] | +| **fi1** | **kotlin.Int**| | [default to 71] | +| **fi2** | **kotlin.Int**| | [optional] | +| **fi3** | **kotlin.Int**| | | +| **fn0** | **java.math.BigDecimal**| | [optional] [default to 10.0] | +| **fn1** | **java.math.BigDecimal**| | [default to 71.0] | +| **fn2** | **java.math.BigDecimal**| | [optional] | +| **fn3** | **java.math.BigDecimal**| | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4342699c5d6..3d5b4592eb5 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -17,7 +17,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -92,7 +92,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt index 565c282b025..db786666d4d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -43,5 +43,8 @@ data class Apa ( @Json(name = "n1") val n1: java.math.BigDecimal? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md index cde9dd9cda0..c83f71851c2 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/docs/Apa.md @@ -2,12 +2,12 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**i0** | **kotlin.Int** | | -**n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | -**i1** | **kotlin.Int** | | [optional] -**n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **i0** | **kotlin.Int** | | | +| **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | +| **i1** | **kotlin.Int** | | [optional] | +| **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt index aca90dd3533..6e7e8e340b6 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt @@ -54,5 +54,6 @@ i1 = this.i1, n1 = this.n1, ) + } diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/README.md b/samples/client/petstore/kotlin-default-values-multiplatform/README.md index d13c93cc0af..bf0c8398338 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/README.md +++ b/samples/client/petstore/kotlin-default-values-multiplatform/README.md @@ -34,9 +34,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** /test | Tests default values +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**test**](docs/DefaultApi.md#test) | **POST** /test | Tests default values | diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md b/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md index 73b613418cc..078a2731055 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md @@ -2,12 +2,12 @@ # Apa ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**i0** | **kotlin.Int** | | -**n0** | **kotlin.Double** | | -**i1** | **kotlin.Int** | | [optional] -**n1** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **i0** | **kotlin.Int** | | | +| **n0** | **kotlin.Double** | | | +| **i1** | **kotlin.Int** | | [optional] | +| **n1** | **kotlin.Double** | | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md index a390a08d48d..65928b19347 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test**](DefaultApi.md#test) | **POST** /test | Tests default values +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**test**](DefaultApi.md#test) | **POST** /test | Tests default values | @@ -63,38 +63,37 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pi0** | **kotlin.Int**| | [default to 10] - **pi1** | **kotlin.Int**| | - **pn0** | **kotlin.Double**| | [default to 10.0] - **pn1** | **kotlin.Double**| | - **qi0** | **kotlin.Int**| | [optional] [default to 10] - **qi1** | **kotlin.Int**| | [default to 71] - **qi2** | **kotlin.Int**| | [optional] - **qi3** | **kotlin.Int**| | - **qn0** | **kotlin.Double**| | [optional] [default to 10.0] - **qn1** | **kotlin.Double**| | [default to 71.0] - **qn2** | **kotlin.Double**| | [optional] - **qn3** | **kotlin.Double**| | - **hi0** | **kotlin.Int**| | [optional] [default to 10] - **hi1** | **kotlin.Int**| | [default to 71] - **hi2** | **kotlin.Int**| | [optional] - **hi3** | **kotlin.Int**| | - **hn0** | **kotlin.Double**| | [optional] [default to 10.0] - **hn1** | **kotlin.Double**| | [default to 71.0] - **hn2** | **kotlin.Double**| | [optional] - **hn3** | **kotlin.Double**| | - **fi0** | **kotlin.Int**| | [optional] [default to 10] - **fi1** | **kotlin.Int**| | [default to 71] - **fi2** | **kotlin.Int**| | [optional] - **fi3** | **kotlin.Int**| | - **fn0** | **kotlin.Double**| | [optional] [default to 10.0] - **fn1** | **kotlin.Double**| | [default to 71.0] - **fn2** | **kotlin.Double**| | [optional] - **fn3** | **kotlin.Double**| | - **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | +| **pi0** | **kotlin.Int**| | [default to 10] | +| **pi1** | **kotlin.Int**| | | +| **pn0** | **kotlin.Double**| | [default to 10.0] | +| **pn1** | **kotlin.Double**| | | +| **qi0** | **kotlin.Int**| | [optional] [default to 10] | +| **qi1** | **kotlin.Int**| | [default to 71] | +| **qi2** | **kotlin.Int**| | [optional] | +| **qi3** | **kotlin.Int**| | | +| **qn0** | **kotlin.Double**| | [optional] [default to 10.0] | +| **qn1** | **kotlin.Double**| | [default to 71.0] | +| **qn2** | **kotlin.Double**| | [optional] | +| **qn3** | **kotlin.Double**| | | +| **hi0** | **kotlin.Int**| | [optional] [default to 10] | +| **hi1** | **kotlin.Int**| | [default to 71] | +| **hi2** | **kotlin.Int**| | [optional] | +| **hi3** | **kotlin.Int**| | | +| **hn0** | **kotlin.Double**| | [optional] [default to 10.0] | +| **hn1** | **kotlin.Double**| | [default to 71.0] | +| **hn2** | **kotlin.Double**| | [optional] | +| **hn3** | **kotlin.Double**| | | +| **fi0** | **kotlin.Int**| | [optional] [default to 10] | +| **fi1** | **kotlin.Int**| | [default to 71] | +| **fi2** | **kotlin.Int**| | [optional] | +| **fi3** | **kotlin.Int**| | | +| **fn0** | **kotlin.Double**| | [optional] [default to 10.0] | +| **fn1** | **kotlin.Double**| | [default to 71.0] | +| **fn2** | **kotlin.Double**| | [optional] | +| **fn3** | **kotlin.Double**| | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt index 339fa40ec1b..3098a799784 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt @@ -40,5 +40,8 @@ data class Apa ( @SerialName(value = "n1") val n1: kotlin.Double? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-default-values-numbers/docs/ModelWithPropertyHavingDefault.md b/samples/client/petstore/kotlin-default-values-numbers/docs/ModelWithPropertyHavingDefault.md index 0d41a58b198..f9b59cc2c4b 100644 --- a/samples/client/petstore/kotlin-default-values-numbers/docs/ModelWithPropertyHavingDefault.md +++ b/samples/client/petstore/kotlin-default-values-numbers/docs/ModelWithPropertyHavingDefault.md @@ -2,16 +2,16 @@ # ModelWithPropertyHavingDefault ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyInt** | **kotlin.Int** | | [optional] -**propertyLong** | **kotlin.Long** | | [optional] -**propertyFloat1** | **kotlin.Float** | | [optional] -**propertyFloat2** | **kotlin.Float** | | [optional] -**propertyFloat3** | **kotlin.Float** | | [optional] -**propertyDouble1** | **kotlin.Double** | | [optional] -**propertyDouble2** | **kotlin.Double** | | [optional] -**propertyDouble3** | **kotlin.Double** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertyInt** | **kotlin.Int** | | [optional] | +| **propertyLong** | **kotlin.Long** | | [optional] | +| **propertyFloat1** | **kotlin.Float** | | [optional] | +| **propertyFloat2** | **kotlin.Float** | | [optional] | +| **propertyFloat3** | **kotlin.Float** | | [optional] | +| **propertyDouble1** | **kotlin.Double** | | [optional] | +| **propertyDouble2** | **kotlin.Double** | | [optional] | +| **propertyDouble3** | **kotlin.Double** | | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt b/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt index 97e1f304f1b..b6ef2973e11 100644 --- a/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt @@ -58,5 +58,8 @@ data class ModelWithPropertyHavingDefault ( @SerializedName("propertyDouble3") val propertyDouble3: kotlin.Double? = 0.01 -) +) { + + +} diff --git a/samples/client/petstore/kotlin-enum-default-value/README.md b/samples/client/petstore/kotlin-enum-default-value/README.md index 79c8ee537b4..2f9fda50a0c 100644 --- a/samples/client/petstore/kotlin-enum-default-value/README.md +++ b/samples/client/petstore/kotlin-enum-default-value/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**operation**](docs/DefaultApi.md#operation) | **GET** / | +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *DefaultApi* | [**operation**](docs/DefaultApi.md#operation) | **GET** / | | diff --git a/samples/client/petstore/kotlin-enum-default-value/docs/DefaultApi.md b/samples/client/petstore/kotlin-enum-default-value/docs/DefaultApi.md index 3a7312c1255..7e9b7d6a5eb 100644 --- a/samples/client/petstore/kotlin-enum-default-value/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-enum-default-value/docs/DefaultApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**operation**](DefaultApi.md#operation) | **GET** / | +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**operation**](DefaultApi.md#operation) | **GET** / | | diff --git a/samples/client/petstore/kotlin-enum-default-value/docs/ModelWithEnumPropertyHavingDefault.md b/samples/client/petstore/kotlin-enum-default-value/docs/ModelWithEnumPropertyHavingDefault.md index 78e81a749c7..6af6745c5cc 100644 --- a/samples/client/petstore/kotlin-enum-default-value/docs/ModelWithEnumPropertyHavingDefault.md +++ b/samples/client/petstore/kotlin-enum-default-value/docs/ModelWithEnumPropertyHavingDefault.md @@ -2,16 +2,16 @@ # ModelWithEnumPropertyHavingDefault ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyName** | [**inline**](#PropertyName) | | +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **propertyName** | [**inline**](#PropertyName) | | | ## Enum: propertyName -Name | Value ----- | ----- -propertyName | VALUE +| Name | Value | +| ---- | ----- | +| propertyName | VALUE | diff --git a/samples/client/petstore/kotlin-enum-default-value/docs/PropertyOfDay.md b/samples/client/petstore/kotlin-enum-default-value/docs/PropertyOfDay.md index 1b642d0d043..9ddb16035d9 100644 --- a/samples/client/petstore/kotlin-enum-default-value/docs/PropertyOfDay.md +++ b/samples/client/petstore/kotlin-enum-default-value/docs/PropertyOfDay.md @@ -2,35 +2,35 @@ # PropertyOfDay ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | Name of property of day | -**description** | **kotlin.String** | Description of the property of day | [optional] -**daysOfWeek** | [**inline**](#DaysOfWeek) | Days of week | [optional] -**monthOfYear** | [**inline**](#MonthOfYear) | Month of year | [optional] -**dayOfYear** | **kotlin.Int** | Day of year | [optional] -**holidayTypes** | [**inline**](#HolidayTypes) | Holiday types | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | Name of property of day | | +| **description** | **kotlin.String** | Description of the property of day | [optional] | +| **daysOfWeek** | [**inline**](#DaysOfWeek) | Days of week | [optional] | +| **monthOfYear** | [**inline**](#MonthOfYear) | Month of year | [optional] | +| **dayOfYear** | **kotlin.Int** | Day of year | [optional] | +| **holidayTypes** | [**inline**](#HolidayTypes) | Holiday types | [optional] | ## Enum: daysOfWeek -Name | Value ----- | ----- -daysOfWeek | MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, WEEKDAYS, WEEKEND, EVERYDAY +| Name | Value | +| ---- | ----- | +| daysOfWeek | MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, WEEKDAYS, WEEKEND, EVERYDAY | ## Enum: monthOfYear -Name | Value ----- | ----- -monthOfYear | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 +| Name | Value | +| ---- | ----- | +| monthOfYear | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 | ## Enum: holidayTypes -Name | Value ----- | ----- -holidayTypes | NOT_HOLIDAY, LOCAL_HOLIDAY, NATIONAL_HOLIDAY, ANY_HOLIDAY, WORKING_DAY, ANY_DAY, NEW_YEARS_DAY, PALM_SUNDAY, MAUNDY_THURSDAY, GOOD_FRIDAY, EASTER_SUNDAY, EASTER_MONDAY, LABOUR_DAY, CONSTITUTION_DAY, ASCENSION_DAY, WHIT_SUNDAY, WHIT_MONDAY, CHRISTMAS_DAY, BOXING_DAY +| Name | Value | +| ---- | ----- | +| holidayTypes | NOT_HOLIDAY, LOCAL_HOLIDAY, NATIONAL_HOLIDAY, ANY_HOLIDAY, WORKING_DAY, ANY_DAY, NEW_YEARS_DAY, PALM_SUNDAY, MAUNDY_THURSDAY, GOOD_FRIDAY, EASTER_SUNDAY, EASTER_MONDAY, LABOUR_DAY, CONSTITUTION_DAY, ASCENSION_DAY, WHIT_SUNDAY, WHIT_MONDAY, CHRISTMAS_DAY, BOXING_DAY | diff --git a/samples/client/petstore/kotlin-enum-default-value/gradlew.bat b/samples/client/petstore/kotlin-enum-default-value/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-enum-default-value/gradlew.bat +++ b/samples/client/petstore/kotlin-enum-default-value/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt index 7e80dc4cb1f..f870c3b38d8 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt @@ -47,5 +47,6 @@ data class ModelWithEnumPropertyHavingDefault ( @Json(name = "VALUE") VALUE("VALUE"), @Json(name = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/PropertyOfDay.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/PropertyOfDay.kt index 08053669c73..d0acf89342c 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/PropertyOfDay.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/PropertyOfDay.kt @@ -131,5 +131,6 @@ data class PropertyOfDay ( @Json(name = "BOXING_DAY") BOXING_DAY("BOXING_DAY"), @Json(name = "11184809") unknown_default_open_api("11184809"); } + } diff --git a/samples/client/petstore/kotlin-gson/README.md b/samples/client/petstore/kotlin-gson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-gson/README.md +++ b/samples/client/petstore/kotlin-gson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-gson/docs/Category.md b/samples/client/petstore/kotlin-gson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-gson/docs/Category.md +++ b/samples/client/petstore/kotlin-gson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-gson/docs/Order.md b/samples/client/petstore/kotlin-gson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-gson/docs/Order.md +++ b/samples/client/petstore/kotlin-gson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-gson/docs/Pet.md b/samples/client/petstore/kotlin-gson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-gson/docs/Pet.md +++ b/samples/client/petstore/kotlin-gson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-gson/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-gson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-gson/docs/Tag.md b/samples/client/petstore/kotlin-gson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-gson/docs/Tag.md +++ b/samples/client/petstore/kotlin-gson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-gson/docs/User.md b/samples/client/petstore/kotlin-gson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-gson/docs/User.md +++ b/samples/client/petstore/kotlin-gson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-gson/docs/UserApi.md b/samples/client/petstore/kotlin-gson/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-gson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-gson/gradlew.bat b/samples/client/petstore/kotlin-gson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-gson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index af0f359940b..7fb0c39b94f 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @SerializedName(value = "available") available("available"), @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold") + @SerializedName(value = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9f4495c4dcf..05ad9375514 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.google.gson.reflect.TypeToken - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -119,14 +120,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -220,33 +259,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 2601d6552e7..87eacb1365a 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -34,5 +34,8 @@ data class Category ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 683e7501919..fe2d51d4ef0 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -38,5 +38,8 @@ data class ModelApiResponse ( @SerializedName("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 81eb2947f31..b9f182f53b5 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -63,5 +63,6 @@ data class Order ( @SerializedName(value = "approved") approved("approved"), @SerializedName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 8cbd43cc64f..57c97dd3d08 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -65,5 +65,6 @@ data class Pet ( @SerializedName(value = "pending") pending("pending"), @SerializedName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index c2962c214a1..f66db9ea55e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -34,5 +34,8 @@ data class Tag ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 8c93d094308..62b3ce81f9b 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -59,5 +59,8 @@ data class User ( @SerializedName("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jackson/README.md b/samples/client/petstore/kotlin-jackson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jackson/README.md +++ b/samples/client/petstore/kotlin-jackson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jackson/build.gradle b/samples/client/petstore/kotlin-jackson/build.gradle index 13cac8bc447..9f357107676 100644 --- a/samples/client/petstore/kotlin-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jackson/build.gradle @@ -55,8 +55,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" implementation "com.squareup.okhttp3:okhttp:4.12.0" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jackson/docs/Category.md b/samples/client/petstore/kotlin-jackson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jackson/docs/Category.md +++ b/samples/client/petstore/kotlin-jackson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jackson/docs/Order.md b/samples/client/petstore/kotlin-jackson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jackson/docs/Order.md +++ b/samples/client/petstore/kotlin-jackson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jackson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jackson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jackson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jackson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jackson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jackson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jackson/docs/User.md b/samples/client/petstore/kotlin-jackson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jackson/docs/User.md +++ b/samples/client/petstore/kotlin-jackson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jackson/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jackson/gradlew.bat b/samples/client/petstore/kotlin-jackson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jackson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bcafbbef17c..9f2ac885ebf 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -194,6 +194,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A @JsonProperty(value = "available") AVAILABLE("available"), @JsonProperty(value = "pending") PENDING("pending"), @JsonProperty(value = "sold") SOLD("sold"), + @JsonProperty(value = "unknown_default_open_api") UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 73a5859dd95..8d46482a93d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.fasterxml.jackson.core.type.TypeReference - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -119,14 +120,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -220,33 +259,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index 5d72e185d7f..557527ac07d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") DELIVERED("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index c9863eb6c32..ba16885da8c 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { @@ -67,5 +67,6 @@ data class Pet ( @JsonProperty(value = "sold") SOLD("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-json-request-string/README.md b/samples/client/petstore/kotlin-json-request-string/README.md index b33508e3580..99b5cb6dfc6 100644 --- a/samples/client/petstore/kotlin-json-request-string/README.md +++ b/samples/client/petstore/kotlin-json-request-string/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getAllPets**](docs/PetApi.md#getallpets) | **GET** /pet/getAll | Get all pets -*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 +| 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* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags | +| *PetApi* | [**getAllPets**](docs/PetApi.md#getallpets) | **GET** /pet/getAll | Get all pets | +| *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 | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/Category.md b/samples/client/petstore/kotlin-json-request-string/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/Category.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/Order.md b/samples/client/petstore/kotlin-json-request-string/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/Order.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/Pet.md b/samples/client/petstore/kotlin-json-request-string/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/Pet.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 9fb6cf76a0b..318ca7c9e1e 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -2,16 +2,16 @@ 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 -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getAllPets**](PetApi.md#getAllPets) | **GET** /pet/getAll | Get all pets -[**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 +| 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 | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getAllPets**](PetApi.md#getAllPets) | **GET** /pet/getAll | Get all pets | +| [**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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -184,10 +181,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **lastUpdated** | **java.time.OffsetDateTime**| When this endpoint was hit last to help identify if the client already has the latest copy. | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **lastUpdated** | **java.time.OffsetDateTime**| When this endpoint was hit last to help identify if the client already has the latest copy. | [optional] | ### Return type @@ -233,10 +229,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -280,10 +275,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -328,12 +322,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -379,12 +372,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-json-request-string/docs/Tag.md b/samples/client/petstore/kotlin-json-request-string/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/Tag.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/User.md b/samples/client/petstore/kotlin-json-request-string/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/User.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-json-request-string/gradlew.bat b/samples/client/petstore/kotlin-json-request-string/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-json-request-string/gradlew.bat +++ b/samples/client/petstore/kotlin-json-request-string/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0855652e45e..cb166a4d2bc 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -27,10 +27,11 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -121,17 +122,55 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + val tempFile = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - java.nio.file.Files.createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null).toFile() + java.nio.file.Files.createTempFile(prefix, suffix).toFile() } else { @Suppress("DEPRECATION") - createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null) + createTempFile(prefix, suffix) } tempFile.deleteOnExit() body.byteStream().use { inputStream -> @@ -226,33 +265,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 11197683145..b1b4fcc5f20 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -44,5 +44,8 @@ data class Category ( @SerialName(value = "name") val name: kotlin.String? = null -) : Parcelable +) : Parcelable { + + +} diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 9eced3daa38..4cda49a253a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -48,5 +48,8 @@ data class ModelApiResponse ( @SerialName(value = "message") val message: kotlin.String? = null -) : Parcelable +) : Parcelable { + + +} diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt index be99a7f3482..ea9cd7d4bbb 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -90,5 +90,6 @@ data class Order ( encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) } } + } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1f70e4317dd..16800beb37c 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -92,5 +92,6 @@ data class Pet ( encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) } } + } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index dfbf3a6be9b..82c2b16be4c 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -44,5 +44,8 @@ data class Tag ( @SerialName(value = "name") val name: kotlin.String? = null -) : Parcelable +) : Parcelable { + + +} diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt index e2103333485..79dae9e05bc 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -69,5 +69,8 @@ data class User ( @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) : Parcelable +) : Parcelable { + + +} diff --git a/samples/client/petstore/kotlin-jvm-jackson/README.md b/samples/client/petstore/kotlin-jvm-jackson/README.md index a13aaaa0bdc..e59b075a178 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/README.md +++ b/samples/client/petstore/kotlin-jvm-jackson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-jackson/build.gradle index ad7aa14b2af..d086a66db95 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-jackson/build.gradle @@ -56,8 +56,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" 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" diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-jackson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/Category.md b/samples/client/petstore/kotlin-jvm-jackson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/Order.md b/samples/client/petstore/kotlin-jvm-jackson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-jackson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md index 0d9d5f4a8cb..01ad4cac619 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ val result : Pet = webService.addPet(pet) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -73,11 +72,10 @@ webService.deletePet(petId, apiKey) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -112,10 +110,9 @@ val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -150,10 +147,9 @@ val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -188,10 +184,9 @@ val result : Pet = webService.getPetById(petId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -226,10 +221,9 @@ val result : Pet = webService.updatePet(pet) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -266,12 +260,11 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -308,12 +301,11 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md index 591623f8993..34b0e0700a7 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -30,10 +30,9 @@ webService.deleteOrder(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -102,10 +101,9 @@ val result : Order = webService.getOrderById(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -140,10 +138,9 @@ val result : Order = webService.placeOrder(order) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-jackson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/User.md b/samples/client/petstore/kotlin-jvm-jackson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md index 0d238432fd6..20a1ac7703b 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ webService.createUser(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -72,10 +71,9 @@ webService.createUsersWithArrayInput(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -110,10 +108,9 @@ webService.createUsersWithListInput(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -148,10 +145,9 @@ webService.deleteUser(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -186,10 +182,9 @@ val result : User = webService.getUserByName(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -225,11 +220,10 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -299,11 +293,10 @@ webService.updateUser(username, user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 14a9210110a..7b178218b0a 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,7 +23,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: ObjectMapper = Serializer.jacksonObjectMapper, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -103,9 +103,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -115,9 +115,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -127,10 +127,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -139,12 +139,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -159,10 +159,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -203,7 +203,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index ded639bcd58..25adfbd2e07 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") delivered("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 62240499eb9..ac0ae8c1a15 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -68,5 +68,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Category.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Order.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md index 851879ed2f4..94d0a303a87 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md index d111b2911d7..27694e9e710 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/User.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md index afcdb070dbb..6a4403972b4 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 2601d6552e7..87eacb1365a 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -34,5 +34,8 @@ data class Category ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 683e7501919..fe2d51d4ef0 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -38,5 +38,8 @@ data class ModelApiResponse ( @SerializedName("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 5c99ae176b0..156297028fc 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -64,5 +64,6 @@ data class Order ( @SerializedName(value = "delivered") delivered("delivered"), @SerializedName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 3cedacbde97..47a0509474c 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -66,5 +66,6 @@ data class Pet ( @SerializedName(value = "sold") sold("sold"), @SerializedName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index c2962c214a1..f66db9ea55e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -34,5 +34,8 @@ data class Tag ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 8c93d094308..62b3ce81f9b 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -59,5 +59,8 @@ data class User ( @SerializedName("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle index 02e7419ed59..c308a9bc68f 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle @@ -56,8 +56,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" implementation "io.ktor:ktor-client-core:$ktor_version" implementation "io.ktor:ktor-client-content-negotiation:$ktor_version" implementation "io.ktor:ktor-client-jackson:$ktor_version" diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Category.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Order.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md index 851879ed2f4..94d0a303a87 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md index d111b2911d7..27694e9e710 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/User.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md index afcdb070dbb..6a4403972b4 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index ded639bcd58..25adfbd2e07 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") delivered("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2aafc065faf..5d23b6fba1d 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Pet.Status? = null ) { @@ -67,5 +67,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/README.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Category.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Order.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Pet.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md index 940a62a6f6c..b6eff247cc2 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Tag.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/User.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt index 08b8d68af6c..85657c5904f 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -36,5 +36,8 @@ data class Category ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 8c25f99624e..43078d5d1e2 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -40,5 +40,8 @@ data class ModelApiResponse ( @SerialName(value = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt index e3fdd49212b..dcd2e9a437e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -66,5 +66,6 @@ data class Order ( @SerialName(value = "approved") approved("approved"), @SerialName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1bc6066ab9d..bdc59355c72 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -69,5 +69,6 @@ data class Pet ( @SerialName(value = "pending") pending("pending"), @SerialName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt index c1da8b84446..25f4d9e01af 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -36,5 +36,8 @@ data class Tag ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt index 2d87dc6b38b..6e269aa599e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt @@ -61,5 +61,8 @@ data class User ( @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index ac031cb2d6a..5ddf39f4321 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -195,7 +195,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @SerializedName(value = "available") available("available"), @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold") + @SerializedName(value = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 3870d97065b..f738070af76 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,12 +26,13 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException import kotlinx.coroutines.suspendCancellableCoroutine import com.google.gson.reflect.TypeToken - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -122,14 +123,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -234,33 +273,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt index e52d3776b4a..f2ee725a1b1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -40,5 +40,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 544e4cb37f3..e810679725b 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -44,5 +44,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt index a3700c21275..8cfb5fb3a39 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -67,5 +67,6 @@ data class Order ( @SerializedName(value = "approved") approved("approved"), @SerializedName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt index 3888433f78a..dbee7c39476 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -69,5 +69,6 @@ data class Pet ( @SerializedName(value = "pending") pending("pending"), @SerializedName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt index 6594820a4b1..9916a156485 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -40,5 +40,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt index c20fc41911f..a7e8121c056 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -65,5 +65,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/README.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/README.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | 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 06cdabfd2e5..3bfc090978f 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle @@ -56,8 +56,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" 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/petstore/kotlin-jvm-spring-2-webclient/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Category.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Order.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Pet.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Tag.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/User.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt index ded639bcd58..25adfbd2e07 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") delivered("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 62240499eb9..ac0ae8c1a15 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -68,5 +68,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/README.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/README.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | 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 2fc16aeeb5c..c25d660f674 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle @@ -61,8 +61,8 @@ kotlin { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Category.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Order.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Pet.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Tag.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/User.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt index ded639bcd58..25adfbd2e07 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") delivered("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 62240499eb9..ac0ae8c1a15 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -68,5 +68,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/README.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/README.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | 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 99192219a9d..786c00c321d 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle @@ -62,8 +62,8 @@ kotlin { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" 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/petstore/kotlin-jvm-spring-3-webclient/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Category.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Order.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Pet.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Tag.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/User.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt index ff41aedca0b..1da41b886ac 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 2a59a8f3acd..a7d222512aa 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,14 +30,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt index ded639bcd58..25adfbd2e07 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -65,5 +65,6 @@ data class Order ( @JsonProperty(value = "delivered") delivered("delivered"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt index 62240499eb9..ac0ae8c1a15 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -68,5 +68,6 @@ data class Pet ( @JsonProperty(value = "sold") sold("sold"), @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknown_default_open_api("unknown_default_open_api"); } + } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt index bfff056241c..84d47825895 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,11 +29,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt index 48cabe85898..ed66cc04570 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,30 +35,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/README.md b/samples/client/petstore/kotlin-jvm-vertx-gson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/README.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 2601d6552e7..87eacb1365a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -34,5 +34,8 @@ data class Category ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 683e7501919..fe2d51d4ef0 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -38,5 +38,8 @@ data class ModelApiResponse ( @SerializedName("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 81eb2947f31..b9f182f53b5 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -63,5 +63,6 @@ data class Order ( @SerializedName(value = "approved") approved("approved"), @SerializedName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 724e4845b7c..ee5d18ec990 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -66,5 +66,6 @@ data class Pet ( @SerializedName(value = "pending") pending("pending"), @SerializedName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index c2962c214a1..f66db9ea55e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -34,5 +34,8 @@ data class Tag ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 8c93d094308..62b3ce81f9b 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -59,5 +59,8 @@ data class User ( @SerializedName("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | 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 554df629ee2..30f78ef1114 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle @@ -57,8 +57,8 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0" 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" implementation "io.vertx:vertx-web-client:$vertx_version" implementation "io.vertx:vertx-core:$vertx_version" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt index 71a7d74b06f..4a68d1a3ebd 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -28,11 +28,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 5590e88cd83..2583efc725f 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -29,14 +29,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt index 94bc4e3be10..c9c227da18e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,23 +32,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -63,5 +63,6 @@ data class Order ( @JsonProperty(value = "approved") approved("approved"), @JsonProperty(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2e5cefb83cd..43bacb547ed 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -34,23 +34,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -66,5 +66,6 @@ data class Pet ( @JsonProperty(value = "pending") pending("pending"), @JsonProperty(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt index f5f600cc374..7a2db5f9329 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -28,11 +28,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt index 7872ed7da4d..6e28ef27d09 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -34,30 +34,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle index 4fa9b2de93e..105b4d04070 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle @@ -56,8 +56,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" implementation "io.vertx:vertx-web-client:$vertx_version" implementation "io.vertx:vertx-core:$vertx_version" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 71a7d74b06f..4a68d1a3ebd 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -28,11 +28,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 5590e88cd83..2583efc725f 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -29,14 +29,17 @@ import com.fasterxml.jackson.annotation.JsonProperty data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index 94bc4e3be10..c9c227da18e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,23 +32,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { @@ -63,5 +63,6 @@ data class Order ( @JsonProperty(value = "approved") approved("approved"), @JsonProperty(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2e5cefb83cd..43bacb547ed 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -34,23 +34,23 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -66,5 +66,6 @@ data class Pet ( @JsonProperty(value = "pending") pending("pending"), @JsonProperty(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index f5f600cc374..7a2db5f9329 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -28,11 +28,14 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index 7872ed7da4d..6e28ef27d09 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -34,30 +34,33 @@ import com.fasterxml.jackson.annotation.JsonProperty data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md index 000d91fd381..9eb15f0e701 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -43,10 +43,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -92,11 +91,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -142,10 +140,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -191,10 +188,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -240,10 +236,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -290,10 +285,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -340,12 +334,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -393,12 +386,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md index 76ca75818c6..aac02408ec7 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -178,10 +176,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md index cc033aebee6..055b9506b4d 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -91,10 +90,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -140,10 +138,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -189,10 +186,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -239,10 +235,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -287,11 +282,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -380,11 +374,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt index 4d74348ecd0..bca19d5c690 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e9e9fe4870d..ea6bc0a04f8 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt index 508dad11426..ecd257a433a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt index 76d82b13875..0c70f0558c3 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -68,5 +68,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt index b21fbab6580..54bbd138c48 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt index e5269f5d5d3..5115585d1a4 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/User.md b/samples/client/petstore/kotlin-jvm-volley/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-jvm-volley/docs/User.md +++ b/samples/client/petstore/kotlin-jvm-volley/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt index affc2b522f7..46188c0bc68 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt @@ -44,5 +44,6 @@ data class Category ( name = this.name, ) + } diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt index f5ac0753e58..8f0f3e89cf4 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt @@ -49,5 +49,6 @@ type = this.type, message = this.message, ) + } diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt index 608ac750337..4a6dfd6cc85 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt @@ -75,5 +75,6 @@ complete = this.complete, @SerializedName(value = "approved") approved("approved"), @SerializedName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt index 191dd5d0283..07c67fa9ea8 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt @@ -77,5 +77,6 @@ status = this.status, @SerializedName(value = "pending") pending("pending"), @SerializedName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt index f32788176b8..0afafa73777 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt @@ -44,5 +44,6 @@ data class Tag ( name = this.name, ) + } diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt index a18aceca9b2..2cec836e1f2 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt @@ -75,5 +75,6 @@ phone = this.phone, userStatus = this.userStatus, ) + } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/README.md b/samples/client/petstore/kotlin-kotlinx-datetime/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/README.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/ApiResponse.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Category.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Category.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Order.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Order.md index 84e068bef3f..6764fc5308d 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Order.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Pet.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Pet.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Tag.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/Tag.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/User.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/User.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat +++ b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3263d52ffeb..d4ec2ae6e4c 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Category.kt index 4d74348ecd0..bca19d5c690 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e9e9fe4870d..ea6bc0a04f8 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Order.kt index bbfae8a8b2d..17e3942b9e6 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Pet.kt index cc35b5164c5..502297c92b0 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Tag.kt index b21fbab6580..54bbd138c48 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/User.kt index e5269f5d5d3..5115585d1a4 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-kotlinx-datetime/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES b/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES index 9326c4589ec..2b66c25862d 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES @@ -1,6 +1,8 @@ README.md build.gradle docs/Annotation.md +docs/AnyOfUserOrPet.md +docs/AnyOfUserOrPetOrArrayString.md docs/ApiResponse.md docs/Category.md docs/FakeApi.md @@ -11,6 +13,8 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md +docs/UserOrPet.md +docs/UserOrPetOrArrayString.md gradle/wrapper/gradle-wrapper.jar gradle/wrapper/gradle-wrapper.properties gradlew @@ -33,9 +37,13 @@ src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/models/ApiAnnotation.kt +src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt +src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt src/main/kotlin/org/openapitools/client/models/ApiCategory.kt src/main/kotlin/org/openapitools/client/models/ApiOrder.kt src/main/kotlin/org/openapitools/client/models/ApiPet.kt src/main/kotlin/org/openapitools/client/models/ApiTag.kt src/main/kotlin/org/openapitools/client/models/ApiUser.kt +src/main/kotlin/org/openapitools/client/models/ApiUserOrPet.kt +src/main/kotlin/org/openapitools/client/models/ApiUserOrPetOrArrayString.kt diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md index 63d540b4a76..5e9a5e07d6c 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md @@ -43,41 +43,45 @@ This runs all tests and packages the library. All URIs are relative to *http://petstore.swagger.io/v2* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*FakeApi* | [**annotations**](docs/FakeApi.md#annotations) | **POST** fake/annotations | annotate -*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 +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *FakeApi* | [**annotations**](docs/FakeApi.md#annotations) | **POST** fake/annotations | annotate | +| *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 - [org.openapitools.client.models.ApiAnnotation](docs/ApiAnnotation.md) + - [org.openapitools.client.models.ApiAnyOfUserOrPet](docs/ApiAnyOfUserOrPet.md) + - [org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString](docs/ApiAnyOfUserOrPetOrArrayString.md) - [org.openapitools.client.models.ApiApiResponse](docs/ApiApiResponse.md) - [org.openapitools.client.models.ApiCategory](docs/ApiCategory.md) - [org.openapitools.client.models.ApiOrder](docs/ApiOrder.md) - [org.openapitools.client.models.ApiPet](docs/ApiPet.md) - [org.openapitools.client.models.ApiTag](docs/ApiTag.md) - [org.openapitools.client.models.ApiUser](docs/ApiUser.md) + - [org.openapitools.client.models.ApiUserOrPet](docs/ApiUserOrPet.md) + - [org.openapitools.client.models.ApiUserOrPetOrArrayString](docs/ApiUserOrPetOrArrayString.md) diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Annotation.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Annotation.md index 7bf1a65e97a..376576e4af4 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Annotation.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Annotation.md @@ -2,9 +2,9 @@ # ApiAnnotation ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | [**java.util.UUID**](java.util.UUID.md) | | [optional] | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPet.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPet.md new file mode 100644 index 00000000000..fe24e24f47c --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPet.md @@ -0,0 +1,29 @@ + +# ApiAnyOfUserOrPet + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPetOrArrayString.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPetOrArrayString.md new file mode 100644 index 00000000000..94b65b04752 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/AnyOfUserOrPetOrArrayString.md @@ -0,0 +1,29 @@ + +# ApiAnyOfUserOrPetOrArrayString + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/ApiResponse.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/ApiResponse.md index eea339dd9df..b8a2227ca19 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ApiApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Category.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Category.md index 4445602c2d4..6b06645c5e7 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Category.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Category.md @@ -2,10 +2,10 @@ # ApiCategory ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md index 6df4082fb3e..f66027e7db9 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://petstore.swagger.io/v2* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**annotations**](FakeApi.md#annotations) | **POST** fake/annotations | annotate +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**annotations**](FakeApi.md#annotations) | **POST** fake/annotations | annotate | @@ -27,10 +27,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiAnnotation** | [**ApiAnnotation**](ApiAnnotation.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiAnnotation** | [**ApiAnnotation**](ApiAnnotation.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Order.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Order.md index 22465419b23..cc832c9828b 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Order.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Order.md @@ -2,21 +2,21 @@ # ApiOrder ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Pet.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Pet.md index f525df0ffd8..e7552df1e07 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Pet.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Pet.md @@ -2,21 +2,21 @@ # ApiPet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**ApiCategory**](ApiCategory.md) | | [optional] -**tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md index 2fb1fdbaf39..39e16a953bc 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -36,10 +36,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | | ### Return type @@ -77,11 +76,10 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -118,10 +116,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -158,10 +155,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -198,10 +194,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -238,10 +233,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiPet** | [**ApiPet**](ApiPet.md)| Pet object that needs to be added to the store | | ### Return type @@ -280,12 +274,11 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -324,12 +317,11 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **RequestBody**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **RequestBody**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md index 8bedce7d2c1..53388dff303 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -32,10 +32,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -108,10 +107,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -148,10 +146,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiOrder** | [**ApiOrder**](ApiOrder.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiOrder** | [**ApiOrder**](ApiOrder.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Tag.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Tag.md index 91a171469a4..11567f173fc 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Tag.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/Tag.md @@ -2,10 +2,10 @@ # ApiTag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/User.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/User.md index ccf8c9966eb..4aded1f504d 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/User.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/User.md @@ -2,16 +2,16 @@ # ApiUser ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md index 920211e7c0b..758eb5efced 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -36,10 +36,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiUser** | [**ApiUser**](ApiUser.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiUser** | [**ApiUser**](ApiUser.md)| Created user object | | ### Return type @@ -76,10 +75,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiUser** | [**kotlin.collections.List<ApiUser>**](ApiUser.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiUser** | [**kotlin.collections.List<ApiUser>**](ApiUser.md)| List of user object | | ### Return type @@ -116,10 +114,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiUser** | [**kotlin.collections.List<ApiUser>**](ApiUser.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiUser** | [**kotlin.collections.List<ApiUser>**](ApiUser.md)| List of user object | | ### Return type @@ -156,10 +153,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -196,10 +192,9 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -237,11 +232,10 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -315,11 +309,10 @@ launch(Dispatchers.IO) { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **apiUser** | [**ApiUser**](ApiUser.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiUser** | [**ApiUser**](ApiUser.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPet.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPet.md new file mode 100644 index 00000000000..290bbb20018 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPet.md @@ -0,0 +1,29 @@ + +# ApiUserOrPet + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPetOrArrayString.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPetOrArrayString.md new file mode 100644 index 00000000000..0ec0493c434 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserOrPetOrArrayString.md @@ -0,0 +1,29 @@ + +# ApiUserOrPetOrArrayString + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**ApiCategory**](ApiCategory.md) | | [optional] | +| **tags** | [**kotlin.collections.List<ApiTag>**](ApiTag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + 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 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 891cb7c59d9..31df363c9bb 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,8 +23,8 @@ import retrofit2.converter.gson.GsonConverterFactory class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - private val callFactory : Call.Factory? = null, + private val serializerBuilder: GsonBuilder = registerTypeAdapterFactoryForAllModels(Serializer.gsonBuilder), + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -84,6 +84,17 @@ class ApiClient( addAuthorization(authName, auth) } } + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnnotation.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPet.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiApiResponse.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) + serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPetOrArrayString.CustomTypeAdapterFactory()) } constructor( @@ -104,9 +115,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -116,9 +127,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -128,10 +139,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -140,12 +151,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -160,10 +171,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -196,6 +207,14 @@ class ApiClient( return retrofitBuilder.callFactory(usedCallFactory).build().create(serviceClass) } + /** + * Gets the serializer builder. + * @return serial builder + */ + fun getSerializerBuilder(): GsonBuilder { + return serializerBuilder + } + private fun normalizeBaseUrl() { if (!baseUrl.endsWith("/")) { baseUrl += "/" @@ -204,7 +223,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } @@ -221,3 +240,24 @@ class ApiClient( } } } + +/** + * Registers all models with the type adapter factory. + * + * @param gsonBuilder gson builder + * @return GSON builder + */ +fun registerTypeAdapterFactoryForAllModels(gsonBuilder: GsonBuilder): GsonBuilder { + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnnotation.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPet.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiApiResponse.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPetOrArrayString.CustomTypeAdapterFactory()) + return gsonBuilder +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnnotation.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnnotation.kt index 98cc1ba5b34..bd33ca92746 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnnotation.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnnotation.kt @@ -16,6 +16,15 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -30,5 +39,66 @@ data class ApiAnnotation ( @SerializedName("id") val id: java.util.UUID? = null -) +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiAnnotation::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiAnnotation' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiAnnotation::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiAnnotation) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiAnnotation { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("id") + + } + + /** + * 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 ApiAnnotation + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiAnnotation is not found in the empty JSON string", ApiAnnotation.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["id"] != null && !jsonObj["id"].isJsonNull) { + require(jsonObj.get("id").isJsonPrimitive) { + String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj["id"].toString()) + } + } + } + } + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt new file mode 100644 index 00000000000..3d523a450ea --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt @@ -0,0 +1,114 @@ +/** + * + * 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 org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName +import java.io.IOException + +/** + * + * + */ + + +data class ApiAnyOfUserOrPet(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiAnyOfUserOrPet::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiAnyOfUserOrPet' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val adapterApiUser = gson.getDelegateAdapter(this, TypeToken.get(ApiUser::class.java)) + val adapterApiPet = gson.getDelegateAdapter(this, TypeToken.get(ApiPet::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: ApiAnyOfUserOrPet?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + // check if the actual instance is of the type `ApiUser` + if (value.actualInstance is ApiUser) { + val element = adapterApiUser.toJsonTree(value.actualInstance as ApiUser?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `ApiPet` + if (value.actualInstance is ApiPet) { + val element = adapterApiPet.toJsonTree(value.actualInstance as ApiPet?) + elementAdapter.write(out, element) + return + } + throw IOException("Failed to serialize as the type doesn't match anyOf schemas: ApiPet, ApiUser") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiAnyOfUserOrPet { + val jsonElement = elementAdapter.read(jsonReader) + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> + val ret = ApiAnyOfUserOrPet() + + // deserialize ApiUser + try { + // validate the JSON object to see if any exception is thrown + ApiUser.validateJsonElement(jsonElement) + actualAdapter = adapterApiUser + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + //log.log(Level.FINER, "Input data matches schema 'ApiUser'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiUser failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiUser'", e) + } + // deserialize ApiPet + try { + // validate the JSON object to see if any exception is thrown + ApiPet.validateJsonElement(jsonElement) + actualAdapter = adapterApiPet + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + //log.log(Level.FINER, "Input data matches schema 'ApiPet'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiPet failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiPet'", e) + } + + throw IOException(String.format("Failed deserialization for ApiAnyOfUserOrPet: no schema match result. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt new file mode 100644 index 00000000000..1ec7549f45c --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt @@ -0,0 +1,147 @@ +/** + * + * 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 org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName +import java.io.IOException + +/** + * + * + */ + + +data class ApiAnyOfUserOrPetOrArrayString(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiAnyOfUserOrPetOrArrayString::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiAnyOfUserOrPetOrArrayString' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val adapterApiUser = gson.getDelegateAdapter(this, TypeToken.get(ApiUser::class.java)) + val adapterApiPet = gson.getDelegateAdapter(this, TypeToken.get(ApiPet::class.java)) + @Suppress("UNCHECKED_CAST") + val adapterkotlincollectionsListkotlinString = gson.getDelegateAdapter(this, TypeToken.get(object : TypeToken>() {}.type)) as TypeAdapter> + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: ApiAnyOfUserOrPetOrArrayString?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + // check if the actual instance is of the type `ApiUser` + if (value.actualInstance is ApiUser) { + val element = adapterApiUser.toJsonTree(value.actualInstance as ApiUser?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `ApiPet` + if (value.actualInstance is ApiPet) { + val element = adapterApiPet.toJsonTree(value.actualInstance as ApiPet?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `kotlin.collections.List` + if (value.actualInstance is List<*>) { + val list = value.actualInstance as List + if (list.get(0) is kotlin.String) { + val array = adapterkotlincollectionsListkotlinString.toJsonTree(value.actualInstance as kotlin.collections.List?).getAsJsonArray() + elementAdapter.write(out, array) + return + } + } + throw IOException("Failed to serialize as the type doesn't match anyOf schemas: ApiPet, ApiUser, kotlin.collections.List") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiAnyOfUserOrPetOrArrayString { + val jsonElement = elementAdapter.read(jsonReader) + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> + val ret = ApiAnyOfUserOrPetOrArrayString() + + // deserialize ApiUser + try { + // validate the JSON object to see if any exception is thrown + ApiUser.validateJsonElement(jsonElement) + actualAdapter = adapterApiUser + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + //log.log(Level.FINER, "Input data matches schema 'ApiUser'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiUser failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiUser'", e) + } + // deserialize ApiPet + try { + // validate the JSON object to see if any exception is thrown + ApiPet.validateJsonElement(jsonElement) + actualAdapter = adapterApiPet + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + //log.log(Level.FINER, "Input data matches schema 'ApiPet'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiPet failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiPet'", e) + } + // deserialize kotlin.collections.List + try { + // validate the JSON object to see if any exception is thrown + require(jsonElement.isJsonArray) { + String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString()) + } + + // validate array items + for(element in jsonElement.getAsJsonArray()) { + require(element.getAsJsonPrimitive().isString) { + String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString()) + } + } + actualAdapter = adapterkotlincollectionsListkotlinString + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + //log.log(Level.FINER, "Input data matches schema 'kotlin.collections.List'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for kotlin.collections.List failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'kotlin.collections.List'", e) + } + + throw IOException(String.format("Failed deserialization for ApiAnyOfUserOrPetOrArrayString: no schema match result. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt index 03ccc83950f..018bb458a12 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt @@ -16,6 +16,15 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -38,5 +47,73 @@ data class ApiApiResponse ( @SerializedName("message") val message: kotlin.String? = null -) +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiApiResponse::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiApiResponse' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiApiResponse::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiApiResponse) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiApiResponse { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("code") + openapiFields.add("type") + openapiFields.add("message") + + } + + /** + * 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 ApiApiResponse + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiApiResponse is not found in the empty JSON string", ApiApiResponse.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["type"] != null && !jsonObj["type"].isJsonNull) { + require(jsonObj.get("type").isJsonPrimitive) { + String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj["type"].toString()) + } + } + if (jsonObj["message"] != null && !jsonObj["message"].isJsonNull) { + require(jsonObj.get("message").isJsonPrimitive) { + String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj["message"].toString()) + } + } + } + } + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt index 5820e268f1b..4d2ab888bb3 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiCategory.kt @@ -16,6 +16,15 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -34,5 +43,67 @@ data class ApiCategory ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiCategory::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiCategory' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiCategory::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiCategory) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiCategory { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("id") + openapiFields.add("name") + + } + + /** + * 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 ApiCategory + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiCategory is not found in the empty JSON string", ApiCategory.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["name"] != null && !jsonObj["name"].isJsonNull) { + require(jsonObj.get("name").isJsonPrimitive) { + String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj["name"].toString()) + } + } + } + } + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiOrder.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiOrder.kt index f2044587bad..af39fc31cfc 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiOrder.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiOrder.kt @@ -16,6 +16,15 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -63,5 +72,75 @@ data class ApiOrder ( @SerializedName(value = "approved") APPROVED("approved"), @SerializedName(value = "delivered") DELIVERED("delivered"); } + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiOrder::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiOrder' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiOrder::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiOrder) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiOrder { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("id") + openapiFields.add("petId") + openapiFields.add("quantity") + openapiFields.add("shipDate") + openapiFields.add("status") + openapiFields.add("complete") + + } + + /** + * 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 ApiOrder + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiOrder is not found in the empty JSON string", ApiOrder.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["status"] != null && !jsonObj["status"].isJsonNull) { + require(jsonObj.get("status").isJsonPrimitive) { + String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj["status"].toString()) + } + } + // validate the optional field `status` + if (jsonObj["status"] != null && !jsonObj["status"].isJsonNull) { + require(Status.values().any { it.value == jsonObj["status"].asString }) { + String.format("Expected the field `status` to be valid `Status` enum value in the JSON string but got `%s`", jsonObj["status"].toString()) + } + } + } + } + } diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt index 23db5373278..35871da8730 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPet.kt @@ -18,6 +18,15 @@ package org.openapitools.client.models import org.openapitools.client.models.ApiCategory import org.openapitools.client.models.ApiTag +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -66,5 +75,112 @@ data class ApiPet ( @SerializedName(value = "pending") PENDING("pending"), @SerializedName(value = "sold") SOLD("sold"); } + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiPet::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiPet' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiPet::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiPet) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiPet { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("name") + openapiFields.add("photoUrls") + openapiFields.add("id") + openapiFields.add("category") + openapiFields.add("tags") + openapiFields.add("status") + + // a set of required properties/fields (JSON key names) + 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 ApiPet + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiPet is not found in the empty JSON string", ApiPet.openapiRequiredFields.toString()) + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (requiredField in openapiRequiredFields) { + requireNotNull(jsonElement!!.getAsJsonObject()[requiredField]) { + String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + require(jsonObj["name"].isJsonPrimitive) { + String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj["name"].toString()) + } + // ensure the required json array is present + requireNotNull(jsonObj["photoUrls"]) { + "Expected the field `photoUrls` to be an array in the JSON string but got `null`" + } + require(jsonObj["photoUrls"].isJsonArray()) { + String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj["photoUrls"].toString()) + } + // validate the optional field `category` + if (jsonObj["category"] != null && !jsonObj["category"].isJsonNull) { + ApiCategory.validateJsonElement(jsonObj["category"]) + } + if (jsonObj["tags"] != null && !jsonObj["tags"].isJsonNull) { + if (jsonObj.getAsJsonArray("tags") != null) { + // ensure the json data is an array + require(jsonObj["tags"].isJsonArray) { + String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj["tags"].toString()) + } + + // validate the optional field `tags` (array) + for (i in 0 until jsonObj.getAsJsonArray("tags").size()) { + ApiTag.validateJsonElement(jsonObj.getAsJsonArray("tags").get(i)) + } + } + } + if (jsonObj["status"] != null && !jsonObj["status"].isJsonNull) { + require(jsonObj.get("status").isJsonPrimitive) { + String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj["status"].toString()) + } + } + // validate the optional field `status` + if (jsonObj["status"] != null && !jsonObj["status"].isJsonNull) { + require(Status.values().any { it.value == jsonObj["status"].asString }) { + String.format("Expected the field `status` to be valid `Status` enum value in the JSON string but got `%s`", jsonObj["status"].toString()) + } + } + } + } + } diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt index e943518f8fd..8f4b05dcd09 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiTag.kt @@ -16,6 +16,15 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** @@ -34,5 +43,67 @@ data class ApiTag ( @SerializedName("name") val name: kotlin.String? = null -) +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiTag::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiTag' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiTag::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiTag) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiTag { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("id") + openapiFields.add("name") + + } + + /** + * 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 ApiTag + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiTag is not found in the empty JSON string", ApiTag.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["name"] != null && !jsonObj["name"].isJsonNull) { + require(jsonObj.get("name").isJsonPrimitive) { + String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj["name"].toString()) + } + } + } + } + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUser.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUser.kt index d236965b764..d47f6636a72 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUser.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUser.kt @@ -16,13 +16,22 @@ package org.openapitools.client.models +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException import com.google.gson.annotations.SerializedName /** * A User who is purchasing from the pet store * - * @param id * @param username + * @param id * @param firstName * @param lastName * @param email @@ -34,12 +43,12 @@ import com.google.gson.annotations.SerializedName data class ApiUser ( + @SerializedName("username") + val username: kotlin.String, + @SerializedName("id") val id: kotlin.Long? = null, - @SerializedName("username") - val username: kotlin.String? = null, - @SerializedName("firstName") val firstName: kotlin.String? = null, @@ -59,5 +68,105 @@ data class ApiUser ( @SerializedName("userStatus") val userStatus: kotlin.Int? = null -) +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiUser::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiUser' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiUser::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiUser) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiUser { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("username") + openapiFields.add("id") + 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.add("username") + } + + /** + * 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 ApiUser + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiUser is not found in the empty JSON string", ApiUser.openapiRequiredFields.toString()) + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (requiredField in openapiRequiredFields) { + requireNotNull(jsonElement!!.getAsJsonObject()[requiredField]) { + String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + require(jsonObj["username"].isJsonPrimitive) { + String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj["username"].toString()) + } + if (jsonObj["firstName"] != null && !jsonObj["firstName"].isJsonNull) { + require(jsonObj.get("firstName").isJsonPrimitive) { + String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj["firstName"].toString()) + } + } + if (jsonObj["lastName"] != null && !jsonObj["lastName"].isJsonNull) { + require(jsonObj.get("lastName").isJsonPrimitive) { + String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj["lastName"].toString()) + } + } + if (jsonObj["email"] != null && !jsonObj["email"].isJsonNull) { + require(jsonObj.get("email").isJsonPrimitive) { + String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj["email"].toString()) + } + } + if (jsonObj["password"] != null && !jsonObj["password"].isJsonNull) { + require(jsonObj.get("password").isJsonPrimitive) { + String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj["password"].toString()) + } + } + if (jsonObj["phone"] != null && !jsonObj["phone"].isJsonNull) { + require(jsonObj.get("phone").isJsonPrimitive) { + String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj["phone"].toString()) + } + } + } + } + +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPet.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPet.kt new file mode 100644 index 00000000000..372906b0e56 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPet.kt @@ -0,0 +1,118 @@ +/** + * + * 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 org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName +import java.io.IOException + +/** + * + * + */ + + +data class ApiUserOrPet(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiUserOrPet::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiUserOrPet' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val adapterApiUser = gson.getDelegateAdapter(this, TypeToken.get(ApiUser::class.java)) + val adapterApiPet = gson.getDelegateAdapter(this, TypeToken.get(ApiPet::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: ApiUserOrPet?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + // check if the actual instance is of the type `ApiUser` + if (value.actualInstance is ApiUser) { + val element = adapterApiUser.toJsonTree(value.actualInstance as ApiUser?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `ApiPet` + if (value.actualInstance is ApiPet) { + val element = adapterApiPet.toJsonTree(value.actualInstance as ApiPet?) + elementAdapter.write(out, element) + return + } + throw IOException("Failed to serialize as the type doesn't match oneOf schemas: ApiPet, ApiUser") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiUserOrPet { + val jsonElement = elementAdapter.read(jsonReader) + var match = 0 + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> = elementAdapter + + // deserialize ApiUser + try { + // validate the JSON object to see if any exception is thrown + ApiUser.validateJsonElement(jsonElement) + actualAdapter = adapterApiUser + match++ + //log.log(Level.FINER, "Input data matches schema 'ApiUser'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiUser failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiUser'", e) + } + // deserialize ApiPet + try { + // validate the JSON object to see if any exception is thrown + ApiPet.validateJsonElement(jsonElement) + actualAdapter = adapterApiPet + match++ + //log.log(Level.FINER, "Input data matches schema 'ApiPet'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiPet failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiPet'", e) + } + + if (match == 1) { + val ret = ApiUserOrPet() + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + } + + throw IOException(String.format("Failed deserialization for ApiUserOrPet: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPetOrArrayString.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPetOrArrayString.kt new file mode 100644 index 00000000000..009b3bef523 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiUserOrPetOrArrayString.kt @@ -0,0 +1,150 @@ +/** + * + * 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 org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName +import java.io.IOException + +/** + * + * + */ + + +data class ApiUserOrPetOrArrayString(var actualInstance: Any? = null) { + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiUserOrPetOrArrayString::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiUserOrPetOrArrayString' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val adapterApiUser = gson.getDelegateAdapter(this, TypeToken.get(ApiUser::class.java)) + val adapterApiPet = gson.getDelegateAdapter(this, TypeToken.get(ApiPet::class.java)) + @Suppress("UNCHECKED_CAST") + val adapterkotlincollectionsListkotlinString = gson.getDelegateAdapter(this, TypeToken.get(object : TypeToken>() {}.type)) as TypeAdapter> + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter,value: ApiUserOrPetOrArrayString?) { + if (value?.actualInstance == null) { + elementAdapter.write(out, null) + return + } + + // check if the actual instance is of the type `ApiUser` + if (value.actualInstance is ApiUser) { + val element = adapterApiUser.toJsonTree(value.actualInstance as ApiUser?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `ApiPet` + if (value.actualInstance is ApiPet) { + val element = adapterApiPet.toJsonTree(value.actualInstance as ApiPet?) + elementAdapter.write(out, element) + return + } + // check if the actual instance is of the type `kotlin.collections.List` + if (value.actualInstance is List<*>) { + val list = value.actualInstance as List + if (list.get(0) is kotlin.String) { + val array = adapterkotlincollectionsListkotlinString.toJsonTree(value.actualInstance as kotlin.collections.List?).getAsJsonArray() + elementAdapter.write(out, array) + return + } + } + throw IOException("Failed to serialize as the type doesn't match oneOf schemas: ApiPet, ApiUser, kotlin.collections.List") + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiUserOrPetOrArrayString { + val jsonElement = elementAdapter.read(jsonReader) + var match = 0 + val errorMessages = ArrayList() + var actualAdapter: TypeAdapter<*> = elementAdapter + + // deserialize ApiUser + try { + // validate the JSON object to see if any exception is thrown + ApiUser.validateJsonElement(jsonElement) + actualAdapter = adapterApiUser + match++ + //log.log(Level.FINER, "Input data matches schema 'ApiUser'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiUser failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiUser'", e) + } + // deserialize ApiPet + try { + // validate the JSON object to see if any exception is thrown + ApiPet.validateJsonElement(jsonElement) + actualAdapter = adapterApiPet + match++ + //log.log(Level.FINER, "Input data matches schema 'ApiPet'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ApiPet failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'ApiPet'", e) + } + // deserialize kotlin.collections.List + try { + // validate the JSON object to see if any exception is thrown + require(jsonElement.isJsonArray) { + String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString()) + } + + // validate array items + for(element in jsonElement.getAsJsonArray()) { + require(element.getAsJsonPrimitive().isString) { + String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString()) + } + } + actualAdapter = adapterkotlincollectionsListkotlinString + match++ + //log.log(Level.FINER, "Input data matches schema 'kotlin.collections.List'") + } catch (e: Exception) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for kotlin.collections.List failed with `%s`.", e.message)) + //log.log(Level.FINER, "Input data does not match schema 'kotlin.collections.List'", e) + } + + if (match == 1) { + val ret = ApiUserOrPetOrArrayString() + ret.actualInstance = actualAdapter.fromJsonTree(jsonElement) + return ret + } + + throw IOException(String.format("Failed deserialization for ApiUserOrPetOrArrayString: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())) + } + }.nullSafe() as TypeAdapter + } + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt new file mode 100644 index 00000000000..f04e9154e70 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt @@ -0,0 +1,111 @@ +/** + * + * 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 io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString +import org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +class ApiAnyOfUserOrPetOrArrayStringTest : ShouldSpec() { + init { + // uncomment below to create an instance of ApiAnyOfUserOrPetOrArrayString + //val modelInstance = ApiAnyOfUserOrPetOrArrayString() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt new file mode 100644 index 00000000000..c3eeb87dbf1 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt @@ -0,0 +1,91 @@ +/** + * + * 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 com.google.gson.GsonBuilder +import com.google.gson.JsonSyntaxException +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec +import org.junit.jupiter.api.Assertions + +import org.openapitools.client.models.ApiAnyOfUserOrPet +import org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser +import java.lang.RuntimeException + +class ApiAnyOfUserOrPetTest : ShouldSpec() { + init { + should("test custom type adapter") { + val gson = GsonBuilder() + .registerTypeAdapterFactory(ApiUser.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(ApiCategory.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(ApiPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(ApiTag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(ApiAnyOfUserOrPet.CustomTypeAdapterFactory()) + .create() + + // test Category + val categoryJson = "{\"id\":123,\"name\":\"category\"}" + val category = gson.fromJson(categoryJson, ApiCategory::class.java) + //val category = gson.fromJson("{\"name\":\"category\"}", ApiCategory::class.java) + category.id shouldBe 123L + category.name shouldBe "category" + + // test Pet + val petJson = "{\"id\":123,\"name\":\"pet\",\"photoUrls\":[\"https://a.com\"],\"category\":{\"id\":456,\"name\":\"pet category\"},\"tags\":[{\"id\":678,\"name\":\"pet tag\"}],\"status\":\"available\"}" + val pet = gson.fromJson(petJson, ApiPet::class.java) + pet.id shouldBe 123L + pet.name shouldBe "pet" + pet.photoUrls shouldBe arrayOf("https://a.com") + pet.tags shouldBe arrayOf(ApiTag(678, "pet tag")) + pet.category shouldBe ApiCategory(456, "pet category") + pet.status shouldBe ApiPet.Status.AVAILABLE + + // test invalid json (missing required fields) + val petJsonMissingRequiredFields = "{\"id\":123,\"category\":{\"id\":456,\"name\":\"pet category\"},\"tags\":[{\"id\":678,\"name\":\"pet tag\"}],\"status\":\"available\"}" + Assertions.assertThrows(IllegalArgumentException::class.java) { + val failedPet = gson.fromJson(petJsonMissingRequiredFields, ApiPet::class.java) + failedPet.id shouldBe 123L + } + + // test AnyOfUserOrPet (anyOf schema) + // invalid json + Assertions.assertThrows(JsonSyntaxException::class.java) { + val failed = gson.fromJson(categoryJson, ApiAnyOfUserOrPet::class.java) + if (failed != null) { + throw RuntimeException("this exception shouldn't be thrown") + } + } + + // valid json, actualInstance should be Pet + val anyOfUserOrPet = gson.fromJson(petJson, ApiAnyOfUserOrPet::class.java) + (anyOfUserOrPet.actualInstance is ApiPet) shouldBe true + (anyOfUserOrPet.actualInstance is ApiUser) shouldBe false + + val petFromAnyOf: ApiPet = anyOfUserOrPet.actualInstance as ApiPet + + petFromAnyOf.id shouldBe 123L + petFromAnyOf.name shouldBe "pet" + petFromAnyOf.photoUrls shouldBe arrayOf("https://a.com") + petFromAnyOf.tags shouldBe arrayOf(ApiTag(678, "pet tag")) + petFromAnyOf.category shouldBe ApiCategory(456, "pet category") + petFromAnyOf.status shouldBe ApiPet.Status.AVAILABLE + } + + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt new file mode 100644 index 00000000000..e3389769c43 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt @@ -0,0 +1,111 @@ +/** + * + * 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 io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiUserOrPetOrArrayString +import org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser + +class ApiUserOrPetOrArrayStringTest : ShouldSpec() { + init { + // uncomment below to create an instance of ApiUserOrPetOrArrayString + //val modelInstance = ApiUserOrPetOrArrayString() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt new file mode 100644 index 00000000000..e33ae025bac --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt @@ -0,0 +1,89 @@ +/** + * + * 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 io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiUserOrPet +import org.openapitools.client.models.ApiCategory +import org.openapitools.client.models.ApiPet +import org.openapitools.client.models.ApiTag +import org.openapitools.client.models.ApiUser +import com.google.gson.GsonBuilder +import io.kotlintest.matchers.types.shouldBeSameInstanceAs +import io.kotlintest.shouldNotBe +import org.junit.jupiter.api.Assertions.assertThrows +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.registerTypeAdapterFactoryForAllModels +import java.io.IOException +import java.lang.RuntimeException + +class ApiUserOrPetTest : ShouldSpec() { + init { + + should("test custom type adapter") { + val gson = ApiClient().getSerializerBuilder().create() + + // test Category + val categoryJson = "{\"id\":123,\"name\":\"category\"}" + val category = gson.fromJson(categoryJson, ApiCategory::class.java) + //val category = gson.fromJson("{\"name\":\"category\"}", ApiCategory::class.java) + category.id shouldBe 123L + category.name shouldBe "category" + + // test Pet + val petJson = "{\"id\":123,\"name\":\"pet\",\"photoUrls\":[\"https://a.com\"],\"category\":{\"id\":456,\"name\":\"pet category\"},\"tags\":[{\"id\":678,\"name\":\"pet tag\"}],\"status\":\"available\"}" + val pet = gson.fromJson(petJson, ApiPet::class.java) + pet.id shouldBe 123L + pet.name shouldBe "pet" + pet.photoUrls shouldBe arrayOf("https://a.com") + pet.tags shouldBe arrayOf(ApiTag(678, "pet tag")) + pet.category shouldBe ApiCategory(456, "pet category") + pet.status shouldBe ApiPet.Status.AVAILABLE + + // test invalid json (missing required fields) + val petJsonMissingRequiredFields = "{\"id\":123,\"category\":{\"id\":456,\"name\":\"pet category\"},\"tags\":[{\"id\":678,\"name\":\"pet tag\"}],\"status\":\"available\"}" + assertThrows(IllegalArgumentException::class.java) { + val failedPet = gson.fromJson(petJsonMissingRequiredFields, ApiPet::class.java) + failedPet.id shouldBe 123L + } + + // test UserOrPet (oneOf schema) + // invalid json + assertThrows(com.google.gson.JsonSyntaxException::class.java) { + val failed = gson.fromJson(categoryJson, ApiUserOrPet::class.java) + if (failed != null) { + throw RuntimeException("this exception shouldn't be thrown") + } + } + + // valid json, actualInstance should be Pet + val userOrPet = gson.fromJson(petJson, ApiUserOrPet::class.java) + (userOrPet.actualInstance is ApiPet) shouldBe true + (userOrPet.actualInstance is ApiUser) shouldBe false + + val petFromOneOf: ApiPet = userOrPet.actualInstance as ApiPet + + petFromOneOf.id shouldBe 123L + petFromOneOf.name shouldBe "pet" + petFromOneOf.photoUrls shouldBe arrayOf("https://a.com") + petFromOneOf.tags shouldBe arrayOf(ApiTag(678, "pet tag")) + petFromOneOf.category shouldBe ApiCategory(456, "pet category") + petFromOneOf.status shouldBe ApiPet.Status.AVAILABLE + } + } +} diff --git a/samples/client/petstore/kotlin-modelMutable/README.md b/samples/client/petstore/kotlin-modelMutable/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-modelMutable/README.md +++ b/samples/client/petstore/kotlin-modelMutable/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/ApiResponse.md b/samples/client/petstore/kotlin-modelMutable/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/Category.md b/samples/client/petstore/kotlin-modelMutable/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/Category.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/Order.md b/samples/client/petstore/kotlin-modelMutable/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/Order.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/Pet.md b/samples/client/petstore/kotlin-modelMutable/docs/Pet.md index bc78b7d7e8a..9a97ed126b0 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/Pet.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.MutableList<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.MutableList<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.MutableList<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.MutableList<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md b/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md index a0ec9fb4937..e385754514f 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.MutableList<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.MutableList<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.MutableList<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.MutableList<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md b/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md index c1daafdb52d..9d9f4c673e6 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-modelMutable/docs/Tag.md b/samples/client/petstore/kotlin-modelMutable/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/Tag.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/User.md b/samples/client/petstore/kotlin-modelMutable/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/User.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md b/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md index 9fa3944313f..b13c0b7f4d7 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.MutableList<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.MutableList<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.MutableList<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.MutableList<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-modelMutable/gradlew.bat b/samples/client/petstore/kotlin-modelMutable/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-modelMutable/gradlew.bat +++ b/samples/client/petstore/kotlin-modelMutable/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index d1e8467efe5..69bcd7ae233 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt index 4ff54c86bc6..4f64b7bdf56 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") var name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 7b8fad21036..f0c2ca6dee3 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") var message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt index 40cb89fd92d..7113fcaee15 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt index 7749a7d8d29..9b8aa326815 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt index f09d54bae61..93cdeaee6dc 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") var name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt index aa29ad7d64e..9fc531984e9 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") var userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-moshi-codegen/README.md b/samples/client/petstore/kotlin-moshi-codegen/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/README.md +++ b/samples/client/petstore/kotlin-moshi-codegen/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/Category.md b/samples/client/petstore/kotlin-moshi-codegen/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/Category.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/Order.md b/samples/client/petstore/kotlin-moshi-codegen/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/Order.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/Pet.md b/samples/client/petstore/kotlin-moshi-codegen/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/Pet.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/Tag.md b/samples/client/petstore/kotlin-moshi-codegen/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/Tag.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/User.md b/samples/client/petstore/kotlin-moshi-codegen/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/User.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat b/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat +++ b/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3263d52ffeb..d4ec2ae6e4c 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt index 27d48282053..db0be0cf30d 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index c4db7ae9fe4..60fb214fc00 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt index 8a4f77e3bf5..df61b819dd1 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt index 6257198030a..de5f7897c59 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt index 5f956d87780..b02ad29b970 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt index 3e79d4fa60b..c7884e6d276 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/README.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/README.md index e70247faa5a..3c7d7803abd 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/README.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/README.md @@ -34,28 +34,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/ApiResponse.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Category.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Category.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Order.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Order.md index 84e068bef3f..6764fc5308d 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Order.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Pet.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Pet.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md index 851879ed2f4..94d0a303a87 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md index d111b2911d7..27694e9e710 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Tag.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Tag.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/User.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/User.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md index afcdb070dbb..6a4403972b4 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index 2e16584b4e4..9bc832793cb 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -34,5 +34,8 @@ data class Category ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt index c9c0a490824..df786952b42 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -37,5 +37,8 @@ data class ModelApiResponse ( @SerialName(value = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index e82f1e3fd7c..e763dafa539 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -60,5 +60,6 @@ data class Order ( @SerialName(value = "approved") approved("approved"), @SerialName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index a275dec03d7..cd3c3adaec2 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -62,5 +62,6 @@ data class Pet ( @SerialName(value = "pending") pending("pending"), @SerialName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index 1bfe2f85978..46af3323fd2 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -34,5 +34,8 @@ data class Tag ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 29413ad2b02..18a1d52df68 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -53,5 +53,8 @@ data class User ( /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform/README.md b/samples/client/petstore/kotlin-multiplatform/README.md index e70247faa5a..3c7d7803abd 100644 --- a/samples/client/petstore/kotlin-multiplatform/README.md +++ b/samples/client/petstore/kotlin-multiplatform/README.md @@ -34,28 +34,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/Category.md b/samples/client/petstore/kotlin-multiplatform/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/Category.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/Order.md b/samples/client/petstore/kotlin-multiplatform/docs/Order.md index 84e068bef3f..6764fc5308d 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/Order.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**kotlinx.datetime.Instant**](kotlinx.datetime.Instant.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/Pet.md b/samples/client/petstore/kotlin-multiplatform/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/Pet.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md index 851879ed2f4..94d0a303a87 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **io.ktor.client.request.forms.InputProvider**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md b/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md index d111b2911d7..27694e9e710 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform/docs/Tag.md b/samples/client/petstore/kotlin-multiplatform/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/Tag.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/User.md b/samples/client/petstore/kotlin-multiplatform/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/User.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md b/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md index afcdb070dbb..6a4403972b4 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index 2e16584b4e4..9bc832793cb 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -34,5 +34,8 @@ data class Category ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt index c9c0a490824..df786952b42 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -37,5 +37,8 @@ data class ModelApiResponse ( @SerialName(value = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index e82f1e3fd7c..e763dafa539 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -60,5 +60,6 @@ data class Order ( @SerialName(value = "approved") approved("approved"), @SerialName(value = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index a275dec03d7..cd3c3adaec2 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -62,5 +62,6 @@ data class Pet ( @SerialName(value = "pending") pending("pending"), @SerialName(value = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index 1bfe2f85978..46af3323fd2 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -34,5 +34,8 @@ data class Tag ( @SerialName(value = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 29413ad2b02..18a1d52df68 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -53,5 +53,8 @@ data class User ( /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/README.md b/samples/client/petstore/kotlin-name-parameter-mappings/README.md index dbfbb2bf7fa..4e08bc29145 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/README.md +++ b/samples/client/petstore/kotlin-name-parameter-mappings/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://localhost* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*FakeApi* | [**getParameterNameMapping**](docs/FakeApi.md#getparameternamemapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *FakeApi* | [**getParameterNameMapping**](docs/FakeApi.md#getparameternamemapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test | diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/docs/Environment.md b/samples/client/petstore/kotlin-name-parameter-mappings/docs/Environment.md index 90250da0b67..7bdc083e9a7 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/docs/Environment.md +++ b/samples/client/petstore/kotlin-name-parameter-mappings/docs/Environment.md @@ -2,9 +2,9 @@ # Environment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dummy** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dummy** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md b/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md index 46c7a5435fc..42a6f3a9551 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md +++ b/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://localhost* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getParameterNameMapping**](FakeApi.md#getParameterNameMapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getParameterNameMapping**](FakeApi.md#getParameterNameMapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test | @@ -37,13 +37,12 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **underscoreType** | **kotlin.Long**| _type | - **type** | **kotlin.String**| type | - **typeWithUnderscore** | **kotlin.String**| type_ | - **httpDebugOption** | **kotlin.String**| http debug option (to test parameter naming option) | +| **underscoreType** | **kotlin.Long**| _type | | +| **type** | **kotlin.String**| type | | +| **typeWithUnderscore** | **kotlin.String**| type_ | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **httpDebugOption** | **kotlin.String**| http debug option (to test parameter naming option) | | ### Return type diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/docs/PropertyNameMapping.md b/samples/client/petstore/kotlin-name-parameter-mappings/docs/PropertyNameMapping.md index d84beeb3c7c..ad6bc95decf 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/docs/PropertyNameMapping.md +++ b/samples/client/petstore/kotlin-name-parameter-mappings/docs/PropertyNameMapping.md @@ -2,12 +2,12 @@ # PropertyNameMapping ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**httpDebugOperation** | **kotlin.String** | | [optional] -**underscoreType** | **kotlin.String** | | [optional] -**type** | **kotlin.String** | | [optional] -**typeWithUnderscore** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **httpDebugOperation** | **kotlin.String** | | [optional] | +| **underscoreType** | **kotlin.String** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **typeWithUnderscore** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat +++ b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 432e132033b..23d0c01273c 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/Environment.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/Environment.kt index 7a4c656b0a3..2f296143a65 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/Environment.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/Environment.kt @@ -31,5 +31,8 @@ data class Environment ( @Json(name = "dummy") val dummy: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/PropertyNameMapping.kt b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/PropertyNameMapping.kt index 6f317087773..7bda8570622 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/PropertyNameMapping.kt +++ b/samples/client/petstore/kotlin-name-parameter-mappings/src/main/kotlin/org/openapitools/client/models/PropertyNameMapping.kt @@ -43,5 +43,8 @@ data class PropertyNameMapping ( @Json(name = "type_") val typeWithUnderscore: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-nonpublic/README.md b/samples/client/petstore/kotlin-nonpublic/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-nonpublic/README.md +++ b/samples/client/petstore/kotlin-nonpublic/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/Category.md b/samples/client/petstore/kotlin-nonpublic/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/Category.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/Order.md b/samples/client/petstore/kotlin-nonpublic/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/Order.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/Pet.md b/samples/client/petstore/kotlin-nonpublic/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/Pet.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-nonpublic/docs/Tag.md b/samples/client/petstore/kotlin-nonpublic/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/Tag.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/User.md b/samples/client/petstore/kotlin-nonpublic/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/User.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-nonpublic/gradlew.bat b/samples/client/petstore/kotlin-nonpublic/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-nonpublic/gradlew.bat +++ b/samples/client/petstore/kotlin-nonpublic/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 2dbf87ecb0f..b391779f68e 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpC internal enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 16f9ff98fa7..856f97f4270 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter -internal val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +internal val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() internal open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { internal companion object { @@ -120,14 +121,52 @@ internal open class ApiClient(val baseUrl: String, val client: OkHttpClient = de } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ internal open class ApiClient(val baseUrl: String, val client: OkHttpClient = de // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt index 0a8246ee0f0..73a0bfdf252 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ internal data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d8c2a6d7393..feb4ba413e2 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ internal data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt index 313094f5f79..982adb551e3 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ internal data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt index cede065e9b1..9d38f849e0f 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ internal data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt index b6d52e5b4b4..7b8cc143688 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ internal data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt index 09cebd03384..84f66428177 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ internal data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-nullable/README.md b/samples/client/petstore/kotlin-nullable/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-nullable/README.md +++ b/samples/client/petstore/kotlin-nullable/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nullable/docs/Category.md b/samples/client/petstore/kotlin-nullable/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-nullable/docs/Category.md +++ b/samples/client/petstore/kotlin-nullable/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nullable/docs/Order.md b/samples/client/petstore/kotlin-nullable/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-nullable/docs/Order.md +++ b/samples/client/petstore/kotlin-nullable/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-nullable/docs/Pet.md b/samples/client/petstore/kotlin-nullable/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-nullable/docs/Pet.md +++ b/samples/client/petstore/kotlin-nullable/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index f0abe6d6282..02061114df2 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md index ddbe2dc5a1f..3643359fd10 100644 --- a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-nullable/docs/Tag.md b/samples/client/petstore/kotlin-nullable/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-nullable/docs/Tag.md +++ b/samples/client/petstore/kotlin-nullable/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-nullable/docs/User.md b/samples/client/petstore/kotlin-nullable/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-nullable/docs/User.md +++ b/samples/client/petstore/kotlin-nullable/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-nullable/docs/UserApi.md b/samples/client/petstore/kotlin-nullable/docs/UserApi.md index f3efec08f4d..358b8a32ab0 100644 --- a/samples/client/petstore/kotlin-nullable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-nullable/gradlew.bat b/samples/client/petstore/kotlin-nullable/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-nullable/gradlew.bat +++ b/samples/client/petstore/kotlin-nullable/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7a748692370..cf5beeb71f8 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt index 62bb71a96e9..cde43a83f0c 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -41,5 +41,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 082e0974d88..a4bef25364d 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -45,5 +45,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt index a0253b825c1..a51d95c1776 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -69,5 +69,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt index d4c37fe3b11..b231b7819f2 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -71,5 +71,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt index 65564b26551..3618e8680eb 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -41,5 +41,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt index b307a939dda..cabb3df832c 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -66,5 +66,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt deleted file mode 100644 index e39a6e70463..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.EnumJsonAdapter - -object SerializerHelper { - fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { - return moshiBuilder - .add(org.openapitools.client.models.Order.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Order.Status::class.java) - .withUnknownFallback(org.openapitools.client.models.Order.Status.unknown_default_open_api)) - .add(org.openapitools.client.models.Pet.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Pet.Status::class.java) - .withUnknownFallback(org.openapitools.client.models.Pet.Status.unknown_default_open_api)) - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt deleted file mode 100644 index d706c19b9aa..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - * 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 com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * An order for a pets from the pet store - * - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - - -data class Order ( - - @Json(name = "id") - val id: kotlin.Long? = null, - - @Json(name = "petId") - val petId: kotlin.Long? = null, - - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - - @Json(name = "complete") - val complete: kotlin.Boolean? = false - -) { - - /** - * Order Status - * - * Values: placed,approved,delivered,unknown_default_open_api - */ - @JsonClass(generateAdapter = false) - enum class Status(val value: kotlin.String) { - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"), - @Json(name = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/README.md b/samples/client/petstore/kotlin-retrofit2-jackson/README.md index a13aaaa0bdc..e59b075a178 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/README.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle b/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle index ad7aa14b2af..d086a66db95 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle @@ -56,8 +56,8 @@ test { 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 "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1" 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" diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Category.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Category.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Order.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Order.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Pet.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Pet.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md index 0d9d5f4a8cb..01ad4cac619 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ val result : Pet = webService.addPet(pet) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -73,11 +72,10 @@ webService.deletePet(petId, apiKey) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -112,10 +110,9 @@ val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -150,10 +147,9 @@ val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -188,10 +184,9 @@ val result : Pet = webService.getPetById(petId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -226,10 +221,9 @@ val result : Pet = webService.updatePet(pet) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -266,12 +260,11 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -308,12 +301,11 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md index 591623f8993..34b0e0700a7 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -30,10 +30,9 @@ webService.deleteOrder(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -102,10 +101,9 @@ val result : Order = webService.getOrderById(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -140,10 +138,9 @@ val result : Order = webService.placeOrder(order) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Tag.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/Tag.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/User.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/User.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md index 0d238432fd6..20a1ac7703b 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ webService.createUser(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -72,10 +71,9 @@ webService.createUsersWithArrayInput(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -110,10 +108,9 @@ webService.createUsersWithListInput(user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -148,10 +145,9 @@ webService.deleteUser(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -186,10 +182,9 @@ val result : User = webService.getUserByName(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -225,11 +220,10 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -299,11 +293,10 @@ webService.updateUser(username, user) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 14a9210110a..7b178218b0a 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,7 +23,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: ObjectMapper = Serializer.jacksonObjectMapper, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -103,9 +103,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -115,9 +115,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -127,10 +127,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -139,12 +139,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -159,10 +159,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -203,7 +203,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 2694931cfe7..d855082fa40 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -29,10 +29,10 @@ import java.io.Serializable data class Category ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) : Serializable { @@ -40,5 +40,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 1e466ac13e0..bf611b66b93 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -30,13 +30,13 @@ import java.io.Serializable data class ModelApiResponse ( - @field:JsonProperty("code") + @get:JsonProperty("code") val code: kotlin.Int? = null, - @field:JsonProperty("type") + @get:JsonProperty("type") val type: kotlin.String? = null, - @field:JsonProperty("message") + @get:JsonProperty("message") val message: kotlin.String? = null ) : Serializable { @@ -44,5 +44,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index 5a0e580f52a..8918e30e9f8 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -33,23 +33,23 @@ import java.io.Serializable data class Order ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("petId") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - @field:JsonProperty("status") + @get:JsonProperty("status") val status: Order.Status? = null, - @field:JsonProperty("complete") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false ) : Serializable { @@ -67,5 +67,6 @@ data class Order ( @JsonProperty(value = "approved") APPROVED("approved"), @JsonProperty(value = "delivered") DELIVERED("delivered"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 9f765699f1a..e991db289fb 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -35,23 +35,23 @@ import java.io.Serializable data class Pet ( - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String, - @field:JsonProperty("photoUrls") + @get:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("category") + @get:JsonProperty("category") val category: Category? = null, - @field:JsonProperty("tags") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, /* pet status in the store */ - @field:JsonProperty("status") + @get:JsonProperty("status") @Deprecated(message = "This property is deprecated.") val status: Pet.Status? = null @@ -70,5 +70,6 @@ data class Pet ( @JsonProperty(value = "pending") PENDING("pending"), @JsonProperty(value = "sold") SOLD("sold"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index edc30f52ae6..fe5730a01d3 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -29,10 +29,10 @@ import java.io.Serializable data class Tag ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("name") + @get:JsonProperty("name") val name: kotlin.String? = null ) : Serializable { @@ -40,5 +40,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index c0f8ad5788e..204111b9446 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -35,29 +35,29 @@ import java.io.Serializable data class User ( - @field:JsonProperty("id") + @get:JsonProperty("id") val id: kotlin.Long? = null, - @field:JsonProperty("username") + @get:JsonProperty("username") val username: kotlin.String? = null, - @field:JsonProperty("firstName") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, - @field:JsonProperty("email") + @get:JsonProperty("email") val email: kotlin.String? = null, - @field:JsonProperty("password") + @get:JsonProperty("password") val password: kotlin.String? = null, - @field:JsonProperty("phone") + @get:JsonProperty("phone") val phone: kotlin.String? = null, /* User Status */ - @field:JsonProperty("userStatus") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) : Serializable { @@ -65,5 +65,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md index a13aaaa0bdc..e59b075a178 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Category.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Category.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Order.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Order.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Pet.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Pet.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md index 3997c8cf390..7325e9a5412 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -32,10 +32,9 @@ webService.addPet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -69,11 +68,10 @@ webService.deletePet(petId, apiKey) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -108,10 +106,9 @@ val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -146,10 +143,9 @@ val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -184,10 +180,9 @@ val result : Pet = webService.getPetById(petId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -220,10 +215,9 @@ webService.updatePet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -258,12 +252,11 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -298,12 +291,11 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md index 78688cd5f19..18640563db3 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -30,10 +30,9 @@ webService.deleteOrder(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -102,10 +101,9 @@ val result : Order = webService.getOrderById(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -138,10 +136,9 @@ val result : Order = webService.placeOrder(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Tag.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Tag.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/User.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/User.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md index 6d27b5096f6..ccd41ae2a46 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ webService.createUser(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -70,10 +69,9 @@ webService.createUsersWithArrayInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -106,10 +104,9 @@ webService.createUsersWithListInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -144,10 +141,9 @@ webService.deleteUser(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -180,10 +176,9 @@ val result : User = webService.getUserByName(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -217,11 +212,10 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -289,11 +283,10 @@ webService.updateUser(username, body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega 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 4c3ba1e58dd..a8a3f6dab18 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 @@ -23,7 +23,7 @@ import okhttp3.MediaType.Companion.toMediaType class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -103,9 +103,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -115,9 +115,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -127,10 +127,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -139,12 +139,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -159,10 +159,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -203,7 +203,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt index 8679742a9c0..ff6bdfb61ad 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -42,5 +42,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e2eb431d005..f262e9a7e03 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -46,5 +46,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt index fe9a5675934..774a303b3dd 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -70,5 +70,6 @@ data class Order ( @SerialName(value = "approved") APPROVED("approved"), @SerialName(value = "delivered") DELIVERED("delivered"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt index 5a6276ac25f..bb4c31e2c96 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -72,5 +72,6 @@ data class Pet ( @SerialName(value = "pending") PENDING("pending"), @SerialName(value = "sold") SOLD("sold"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt index c88920f6fd6..1f533975b2b 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -42,5 +42,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt index e9798c88637..f803bc7ff69 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt @@ -67,5 +67,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/README.md b/samples/client/petstore/kotlin-retrofit2-rx3/README.md index a13aaaa0bdc..e59b075a178 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/README.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Category.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Category.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Order.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Order.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Pet.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Pet.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md index 3997c8cf390..7325e9a5412 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -32,10 +32,9 @@ webService.addPet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -69,11 +68,10 @@ webService.deletePet(petId, apiKey) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -108,10 +106,9 @@ val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -146,10 +143,9 @@ val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -184,10 +180,9 @@ val result : Pet = webService.getPetById(petId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -220,10 +215,9 @@ webService.updatePet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -258,12 +252,11 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -298,12 +291,11 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md index 78688cd5f19..18640563db3 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -30,10 +30,9 @@ webService.deleteOrder(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -102,10 +101,9 @@ val result : Order = webService.getOrderById(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -138,10 +136,9 @@ val result : Order = webService.placeOrder(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Tag.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/Tag.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/User.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/User.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md index 6d27b5096f6..ccd41ae2a46 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ webService.createUser(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -70,10 +69,9 @@ webService.createUsersWithArrayInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -106,10 +104,9 @@ webService.createUsersWithListInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -144,10 +141,9 @@ webService.deleteUser(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -180,10 +176,9 @@ val result : User = webService.getUserByName(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -217,11 +212,10 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -289,11 +283,10 @@ webService.updateUser(username, body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9dfc8903789..a394560fc86 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -24,7 +24,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( RxJava3CallAdapterFactory.create(), ), @@ -105,9 +105,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -117,9 +117,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -129,10 +129,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -141,12 +141,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -161,10 +161,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -205,7 +205,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt index 4d74348ecd0..bca19d5c690 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e9e9fe4870d..ea6bc0a04f8 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt index 508dad11426..ecd257a433a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt index cc35b5164c5..502297c92b0 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt index b21fbab6580..54bbd138c48 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt index e5269f5d5d3..5115585d1a4 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2/README.md b/samples/client/petstore/kotlin-retrofit2/README.md index a13aaaa0bdc..e59b075a178 100644 --- a/samples/client/petstore/kotlin-retrofit2/README.md +++ b/samples/client/petstore/kotlin-retrofit2/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/Category.md b/samples/client/petstore/kotlin-retrofit2/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/Category.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/Order.md b/samples/client/petstore/kotlin-retrofit2/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/Order.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/Pet.md b/samples/client/petstore/kotlin-retrofit2/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/Pet.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md index 3997c8cf390..7325e9a5412 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -32,10 +32,9 @@ webService.addPet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -69,11 +68,10 @@ webService.deletePet(petId, apiKey) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -108,10 +106,9 @@ val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -146,10 +143,9 @@ val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -184,10 +180,9 @@ val result : Pet = webService.getPetById(petId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -220,10 +215,9 @@ webService.updatePet(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -258,12 +252,11 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -298,12 +291,11 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md index 78688cd5f19..18640563db3 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -30,10 +30,9 @@ webService.deleteOrder(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -102,10 +101,9 @@ val result : Order = webService.getOrderById(orderId) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -138,10 +136,9 @@ val result : Order = webService.placeOrder(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2/docs/Tag.md b/samples/client/petstore/kotlin-retrofit2/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/Tag.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/User.md b/samples/client/petstore/kotlin-retrofit2/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/User.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md index 6d27b5096f6..ccd41ae2a46 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -34,10 +34,9 @@ webService.createUser(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -70,10 +69,9 @@ webService.createUsersWithArrayInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -106,10 +104,9 @@ webService.createUsersWithListInput(body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -144,10 +141,9 @@ webService.deleteUser(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -180,10 +176,9 @@ val result : User = webService.getUserByName(username) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -217,11 +212,10 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -289,11 +283,10 @@ webService.updateUser(username, body) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2/gradlew.bat b/samples/client/petstore/kotlin-retrofit2/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-retrofit2/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e41d6a99f53..022a46483c3 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,7 +23,7 @@ class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val callFactory : Call.Factory? = null, + private val callFactory: Call.Factory? = null, private val callAdapterFactories: List = listOf( ), private val converterFactories: List = listOf( @@ -103,9 +103,9 @@ class ApiClient( } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ fun getTokenEndPoint(): TokenRequestBuilder? { var result: TokenRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -115,9 +115,9 @@ class ApiClient( } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { var result: AuthenticationRequestBuilder? = null apiAuthorizations.values.runOnFirst { @@ -127,10 +127,10 @@ class ApiClient( } /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ fun setAccessToken(accessToken: String): ApiClient { apiAuthorizations.values.runOnFirst { setAccessToken(accessToken) @@ -139,12 +139,12 @@ class ApiClient( } /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { apiAuthorizations.values.runOnFirst { tokenRequestBuilder @@ -159,10 +159,10 @@ class ApiClient( } /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { apiAuthorizations.values.runOnFirst { registerAccessTokenListener(accessTokenListener) @@ -203,7 +203,7 @@ class ApiClient( private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { for (element in this) { - if (element is U) { + if (element is U) { callback.invoke(element) break } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt index 4d74348ecd0..bca19d5c690 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e9e9fe4870d..ea6bc0a04f8 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt index 508dad11426..ecd257a433a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt index cc35b5164c5..502297c92b0 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt index b21fbab6580..54bbd138c48 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt index e5269f5d5d3..5115585d1a4 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-string/README.md b/samples/client/petstore/kotlin-string/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-string/README.md +++ b/samples/client/petstore/kotlin-string/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-string/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-string/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-string/docs/Category.md b/samples/client/petstore/kotlin-string/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-string/docs/Category.md +++ b/samples/client/petstore/kotlin-string/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-string/docs/Order.md b/samples/client/petstore/kotlin-string/docs/Order.md index f4dcee6911b..536547f457f 100644 --- a/samples/client/petstore/kotlin-string/docs/Order.md +++ b/samples/client/petstore/kotlin-string/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | **kotlin.String** | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | **kotlin.String** | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-string/docs/Pet.md b/samples/client/petstore/kotlin-string/docs/Pet.md index fd228b90c94..43e4f11394b 100644 --- a/samples/client/petstore/kotlin-string/docs/Pet.md +++ b/samples/client/petstore/kotlin-string/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index 6c4987ca054..81f97cef914 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiKey** | **kotlin.String**| | [optional] - **petId** | **kotlin.Long**| Pet id to delete | +| **apiKey** | **kotlin.String**| | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-string/docs/StoreApi.md b/samples/client/petstore/kotlin-string/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-string/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-string/docs/Tag.md b/samples/client/petstore/kotlin-string/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-string/docs/Tag.md +++ b/samples/client/petstore/kotlin-string/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-string/docs/User.md b/samples/client/petstore/kotlin-string/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-string/docs/User.md +++ b/samples/client/petstore/kotlin-string/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-string/docs/UserApi.md b/samples/client/petstore/kotlin-string/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-string/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-string/gradlew.bat b/samples/client/petstore/kotlin-string/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-string/gradlew.bat +++ b/samples/client/petstore/kotlin-string/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 44f24344ce7..601b71b143d 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 62bb71a96e9..cde43a83f0c 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -41,5 +41,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 082e0974d88..a4bef25364d 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -45,5 +45,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt index 55ffc1570ec..3d17352dbcc 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -69,5 +69,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index 26edc91dc77..9679a58490b 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -71,5 +71,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index 65564b26551..3618e8680eb 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -41,5 +41,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt index b307a939dda..cabb3df832c 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -66,5 +66,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-threetenbp/README.md b/samples/client/petstore/kotlin-threetenbp/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin-threetenbp/README.md +++ b/samples/client/petstore/kotlin-threetenbp/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/Category.md b/samples/client/petstore/kotlin-threetenbp/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/Category.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/Order.md b/samples/client/petstore/kotlin-threetenbp/docs/Order.md index f340d1f5591..72a418dabd4 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/Order.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**org.threeten.bp.OffsetDateTime**](org.threeten.bp.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**org.threeten.bp.OffsetDateTime**](org.threeten.bp.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/Pet.md b/samples/client/petstore/kotlin-threetenbp/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/Pet.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin-threetenbp/docs/Tag.md b/samples/client/petstore/kotlin-threetenbp/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/Tag.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/User.md b/samples/client/petstore/kotlin-threetenbp/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/User.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-threetenbp/gradlew.bat b/samples/client/petstore/kotlin-threetenbp/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-threetenbp/gradlew.bat +++ b/samples/client/petstore/kotlin-threetenbp/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3263d52ffeb..d4ec2ae6e4c 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 240690330d9..13dcea71519 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -21,6 +21,7 @@ import java.io.FileWriter import java.io.IOException import java.net.URLConnection import java.util.Locale +import java.util.regex.Pattern import org.threeten.bp.LocalDate import org.threeten.bp.LocalDateTime import org.threeten.bp.LocalTime @@ -28,7 +29,7 @@ import org.threeten.bp.OffsetDateTime import org.threeten.bp.OffsetTime import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt index 4d74348ecd0..bca19d5c690 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,5 +35,8 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index e9e9fe4870d..ea6bc0a04f8 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -39,5 +39,8 @@ data class ModelApiResponse ( @Json(name = "message") val message: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt index edbff70d970..2612191cb21 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -65,5 +65,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt index cc35b5164c5..502297c92b0 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -67,5 +67,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt index b21fbab6580..54bbd138c48 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,5 +35,8 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt index e5269f5d5d3..5115585d1a4 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt @@ -60,5 +60,8 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) { + + +} diff --git a/samples/client/petstore/kotlin-uppercase-enum/README.md b/samples/client/petstore/kotlin-uppercase-enum/README.md index 0620f631f4a..768353e7eb1 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/README.md +++ b/samples/client/petstore/kotlin-uppercase-enum/README.md @@ -43,9 +43,9 @@ This runs all tests and packages the library. All URIs are relative to *http://petstore.swagger.io/v2* -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*EnumApi* | [**getEnum**](docs/EnumApi.md#getenum) | **GET** /enum | Get enums +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *EnumApi* | [**getEnum**](docs/EnumApi.md#getenum) | **GET** /enum | Get enums | diff --git a/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md index 94dcfcdaa83..1d4005488da 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md +++ b/samples/client/petstore/kotlin-uppercase-enum/docs/EnumApi.md @@ -2,9 +2,9 @@ All URIs are relative to *http://petstore.swagger.io/v2* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getEnum**](EnumApi.md#getEnum) | **GET** /enum | Get enums +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getEnum**](EnumApi.md#getEnum) | **GET** /enum | Get enums | diff --git a/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat b/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat +++ b/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e70bb974955..606cc8283d7 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,10 +26,11 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie else -> throw UnsupportedOperationException("requestBody currently only supports JSON body, byte body and File body.") } - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -202,33 +241,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin/README.md b/samples/client/petstore/kotlin/README.md index 48f7ca6c520..8be797dfdf3 100644 --- a/samples/client/petstore/kotlin/README.md +++ b/samples/client/petstore/kotlin/README.md @@ -43,28 +43,28 @@ This runs all tests and packages the library. 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 +| 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 | diff --git a/samples/client/petstore/kotlin/docs/ApiResponse.md b/samples/client/petstore/kotlin/docs/ApiResponse.md index 12f08d5cdef..059525a9951 100644 --- a/samples/client/petstore/kotlin/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin/docs/ApiResponse.md @@ -2,11 +2,11 @@ # ModelApiResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin/docs/Category.md b/samples/client/petstore/kotlin/docs/Category.md index 2c28a670fc7..baba5657eb2 100644 --- a/samples/client/petstore/kotlin/docs/Category.md +++ b/samples/client/petstore/kotlin/docs/Category.md @@ -2,10 +2,10 @@ # Category ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin/docs/Order.md b/samples/client/petstore/kotlin/docs/Order.md index c0c951b22d3..7b7a399f7f7 100644 --- a/samples/client/petstore/kotlin/docs/Order.md +++ b/samples/client/petstore/kotlin/docs/Order.md @@ -2,21 +2,21 @@ # Order ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#Status) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | ## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | diff --git a/samples/client/petstore/kotlin/docs/Pet.md b/samples/client/petstore/kotlin/docs/Pet.md index da70fca06e6..287312efaf9 100644 --- a/samples/client/petstore/kotlin/docs/Pet.md +++ b/samples/client/petstore/kotlin/docs/Pet.md @@ -2,21 +2,21 @@ # Pet ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.collections.List<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#Status) | pet status in the store | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | ## Enum: status -Name | Value ----- | ----- -status | available, pending, sold +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index bb8451def0d..6856ea516da 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -40,10 +40,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -87,11 +86,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -137,10 +135,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | ### Return type @@ -186,10 +183,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | ### Return type @@ -235,10 +231,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | ### Return type @@ -282,10 +277,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type @@ -330,12 +324,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -381,12 +374,11 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index 9515ccd6d0c..53ff17b1667 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -2,12 +2,12 @@ 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 +| 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 | @@ -38,10 +38,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.String**| ID of the order that needs to be deleted | | ### Return type @@ -131,10 +130,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | | ### Return type @@ -176,10 +174,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type diff --git a/samples/client/petstore/kotlin/docs/Tag.md b/samples/client/petstore/kotlin/docs/Tag.md index 60ce1bcdbad..dc8fa3cb555 100644 --- a/samples/client/petstore/kotlin/docs/Tag.md +++ b/samples/client/petstore/kotlin/docs/Tag.md @@ -2,10 +2,10 @@ # Tag ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/petstore/kotlin/docs/User.md b/samples/client/petstore/kotlin/docs/User.md index e801729b5ed..a9f35788637 100644 --- a/samples/client/petstore/kotlin/docs/User.md +++ b/samples/client/petstore/kotlin/docs/User.md @@ -2,16 +2,16 @@ # User ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **username** | **kotlin.String** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md index fdf75275cb9..82c8d606027 100644 --- a/samples/client/petstore/kotlin/docs/UserApi.md +++ b/samples/client/petstore/kotlin/docs/UserApi.md @@ -2,16 +2,16 @@ 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 +| 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 | @@ -42,10 +42,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Created user object | | ### Return type @@ -86,10 +85,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -130,10 +128,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | | ### Return type @@ -176,10 +173,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | ### Return type @@ -221,10 +217,9 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | | ### Return type @@ -267,11 +262,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -355,11 +349,10 @@ try { ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin/gradlew.bat b/samples/client/petstore/kotlin/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/client/petstore/kotlin/gradlew.bat +++ b/samples/client/petstore/kotlin/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3263d52ffeb..d4ec2ae6e4c 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -193,7 +193,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A enum class StatusFindPetsByStatus(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold") + @Json(name = "sold") sold("sold"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = "$value" } /** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 26f85869b68..7ea62cf6f93 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,9 +26,10 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime import java.util.Locale +import java.util.regex.Pattern import com.squareup.moshi.adapter - val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() +val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody() open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) { companion object { @@ -120,14 +121,52 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie } @OptIn(ExperimentalStdlibApi::class) - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + protected inline fun responseBody(response: Response, mediaType: String? = JsonMediaType): T? { + val body = response.body if(body == null) { return null } if (T::class.java == File::class.java) { // return tempFile + val contentDisposition = response.header("Content-Disposition") + + val fileName = if (contentDisposition != null) { + // Get filename from the Content-Disposition header. + val pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?") + val matcher = pattern.matcher(contentDisposition) + if (matcher.find()) { + matcher.group(1) + ?.replace(".*[/\\\\]", "") + ?.replace(";", "") + } else { + null + } + } else { + null + } + + var prefix: String? + val suffix: String? + if (fileName == null) { + prefix = "download" + suffix = "" + } else { + val pos = fileName.lastIndexOf(".") + if (pos == -1) { + prefix = fileName + suffix = null + } 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" + } + } + // Attention: if you are developing an android app that supports API Level 25 and bellow, please check flag supportAndroidApiLevel25AndBelow in https://openapi-generator.tech/docs/generators/kotlin#config-options - val tempFile = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + val tempFile = java.nio.file.Files.createTempFile(prefix, suffix).toFile() tempFile.deleteOnExit() body.byteStream().use { inputStream -> tempFile.outputStream().use { tempFileOutputStream -> @@ -221,33 +260,35 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie // TODO: handle specific mapping types. e.g. Map> @Suppress("UNNECESSARY_SAFE_CALL") - return when { - response.isRedirect -> Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) + return response.use { + when { + it.isRedirect -> Redirection( + it.code, + it.headers.toMultimap() + ) + it.isInformational -> Informational( + it.message, + it.code, + it.headers.toMultimap() + ) + it.isSuccessful -> Success( + responseBody(it, accept), + it.code, + it.headers.toMultimap() + ) + it.isClientError -> ClientError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + else -> ServerError( + it.message, + it.body?.string(), + it.code, + it.headers.toMultimap() + ) + } } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 62bb71a96e9..cde43a83f0c 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -41,5 +41,6 @@ data class Category ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 082e0974d88..a4bef25364d 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -45,5 +45,6 @@ data class ModelApiResponse ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index a0253b825c1..a51d95c1776 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -69,5 +69,6 @@ data class Order ( @Json(name = "approved") approved("approved"), @Json(name = "delivered") delivered("delivered"); } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index d4c37fe3b11..b231b7819f2 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -71,5 +71,6 @@ data class Pet ( @Json(name = "pending") pending("pending"), @Json(name = "sold") sold("sold"); } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 65564b26551..3618e8680eb 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -41,5 +41,6 @@ data class Tag ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index b307a939dda..cabb3df832c 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -66,5 +66,6 @@ data class User ( private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php index 875e0fb422b..bffc807b9a2 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response headerr * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php index cd136ac3091..95d18f1267a 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ApiException.php @@ -48,7 +48,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected ?array $responseHeaders; @@ -64,10 +64,10 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as stdClass or string + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string */ - public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], mixed $responseBody = null) + public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -77,7 +77,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders(): ?array { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 0e28adf09dc..6968ae65bb5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -78,7 +78,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/samples/client/petstore/php/psr-18/lib/ApiException.php b/samples/client/petstore/php/psr-18/lib/ApiException.php index 909b0f09af6..34834b2ada3 100644 --- a/samples/client/petstore/php/psr-18/lib/ApiException.php +++ b/samples/client/petstore/php/psr-18/lib/ApiException.php @@ -53,7 +53,7 @@ class ApiException extends RequestException /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -81,7 +81,7 @@ class ApiException extends RequestException /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 index 0ffb6cd7f3b..88d502e95c9 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSFakeClassnameTags123Api.ps1 @@ -63,8 +63,13 @@ function Test-PSClassname { $LocalVarBodyParameter = $Client | ConvertTo-Json -Depth 100 + if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_query_name"]) { + $apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_query_name"] + } else { + $apiKeyPrefix = "" + } if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_query_name"]) { - $LocalVarQueryParameters['api_key_query_name'] = $Configuration["ApiKey"]["api_key_query_name"] + $LocalVarQueryParameters['api_key_query_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_query_name"] Write-Verbose ("Using API key `api_key_query_name` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand) } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 index e28ffcabca0..863d7864a1a 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 @@ -405,8 +405,13 @@ function Get-PSPetById { } $LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId)) + if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_name"]) { + $apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_name"] + } else { + $apiKeyPrefix = "" + } if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_name"]) { - $LocalVarHeaderParameters['api_key_name'] = $Configuration["ApiKey"]["api_key_name"] + $LocalVarHeaderParameters['api_key_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_name"] Write-Verbose ("Using API key 'api_key_name' in the header for authentication in {0}" -f $MyInvocation.MyCommand) } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 index 40fd1e0c64f..6061c8c56c1 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 @@ -118,8 +118,13 @@ function Get-PSInventory { $LocalVarUri = '/store/inventory' + if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_name"]) { + $apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_name"] + } else { + $apiKeyPrefix = "" + } if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_name"]) { - $LocalVarHeaderParameters['api_key_name'] = $Configuration["ApiKey"]["api_key_name"] + $LocalVarHeaderParameters['api_key_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_name"] Write-Verbose ("Using API key 'api_key_name' in the header for authentication in {0}" -f $MyInvocation.MyCommand) } diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/another_fake_api.rb index c5c9f37f46f..a42451028fa 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/another_fake_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/default_api.rb index 757162b93ad..cca58981919 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/default_api.rb @@ -41,7 +41,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb index fc693ec7c39..f25e278fe27 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_api.rb @@ -43,7 +43,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -98,7 +98,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -225,7 +225,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -287,7 +287,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -349,7 +349,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -411,7 +411,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -477,7 +477,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -804,7 +804,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_classname_tags123_api.rb index 148f45de5a9..ccd7f861722 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/fake_classname_tags123_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/pet_api.rb index 5da0deb473c..fa9f9db5925 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/pet_api.rb @@ -182,7 +182,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -246,7 +246,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -309,7 +309,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -514,7 +514,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -592,7 +592,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/store_api.rb index cdd287a36c3..8e0c226f5f2 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/store_api.rb @@ -106,7 +106,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -177,7 +177,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -240,7 +240,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api/user_api.rb index 1a4bc147189..ee33793f7d4 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api/user_api.rb @@ -310,7 +310,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -381,7 +381,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb b/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb index 47202936a68..d2e0d6d170b 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb @@ -79,6 +79,14 @@ module Petstore # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module Petstore @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module Petstore # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index c5c9f37f46f..a42451028fa 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index 757162b93ad..cca58981919 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -41,7 +41,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index fc693ec7c39..f25e278fe27 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -43,7 +43,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -98,7 +98,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -225,7 +225,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -287,7 +287,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -349,7 +349,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -411,7 +411,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -477,7 +477,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -804,7 +804,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 148f45de5a9..ccd7f861722 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 37ad1808593..aaaf465d8a7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -182,7 +182,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -246,7 +246,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -309,7 +309,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -514,7 +514,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -592,7 +592,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index eacba86b5e9..2838e017c8a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -106,7 +106,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -177,7 +177,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -240,7 +240,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 6dfef4ac5a6..de6325b46ec 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -310,7 +310,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -381,7 +381,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} 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 517f5f5604f..ee018f32d77 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -164,35 +164,41 @@ module Petstore request.options.on_data = Proc.new do |chunk, overall_received_bytes| stream << chunk end + stream end def deserialize_file(response, stream) - body = response.body - if @config.return_binary_data == true - # return byte stream - encoding = body.encoding - stream.join.force_encoding(encoding) + body = response.body + encoding = body.encoding + + # reconstruct content + content = stream.join + content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary' + content = content.force_encoding(encoding) + + # return byte stream + return content if @config.return_binary_data == true + + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) else - # return file instead of binary data - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - tempfile.write(stream.join.force_encoding(encoding)) - tempfile.close - config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - tempfile + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(content) + tempfile.close + + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile end def connection(opts) diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index edc4657541a..4f375bbf960 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -79,6 +79,14 @@ module Petstore # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -170,6 +178,7 @@ module Petstore @return_binary_data = false @params_encoder = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -204,6 +213,7 @@ module Petstore # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/petstore/ruby-faraday/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/custom/configuration_spec.rb index 59405313127..5f8bc10bb30 100644 --- a/samples/client/petstore/ruby-faraday/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/custom/configuration_spec.rb @@ -55,6 +55,15 @@ describe Petstore::Configuration do expect(config.base_url).to eq('https://localhost:8080/v2') end + it 'ignores the operation server settings and uses the custom base url' do + config.scheme = 'https' + config.host = 'api.example.com' + config.base_path = '/v2' + config.ignore_operation_servers = true + expect(config.base_url).to eq('https://api.example.com/v2') + expect(config.base_url(:'PetApi.add_pet')).to eq('https://api.example.com/v2') + end + it 'throws argument error when attempting to use a server index that is out of bounds' do config.server_operation_index = { :'PetApi.add_pet' => 10 diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb index c5c9f37f46f..a42451028fa 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb index 757162b93ad..cca58981919 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb @@ -41,7 +41,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb index 2e1a93f49f5..eacc86483f3 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb @@ -43,7 +43,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -98,7 +98,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -225,7 +225,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -287,7 +287,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -349,7 +349,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -411,7 +411,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -477,7 +477,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -885,7 +885,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb index 148f45de5a9..ccd7f861722 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb index 37ad1808593..aaaf465d8a7 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb @@ -182,7 +182,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -246,7 +246,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -309,7 +309,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -514,7 +514,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -592,7 +592,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb index eacba86b5e9..2838e017c8a 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb @@ -106,7 +106,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -177,7 +177,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -240,7 +240,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb index 6dfef4ac5a6..de6325b46ec 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb @@ -310,7 +310,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -381,7 +381,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb index 7f04341a157..4e1a92527d4 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb @@ -79,6 +79,14 @@ module Petstore # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -134,6 +142,7 @@ module Petstore @timeout = 60 @configure_session_blocks = [] @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -168,6 +177,7 @@ module Petstore # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index c5c9f37f46f..a42451028fa 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index 757162b93ad..cca58981919 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -41,7 +41,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 56d559e93ed..dbcf8ac36e8 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -43,7 +43,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -98,7 +98,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -225,7 +225,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -287,7 +287,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -349,7 +349,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -411,7 +411,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -477,7 +477,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -885,7 +885,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 148f45de5a9..ccd7f861722 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -51,7 +51,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 5da0deb473c..fa9f9db5925 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -182,7 +182,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -246,7 +246,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -309,7 +309,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -514,7 +514,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -592,7 +592,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index cdd287a36c3..8e0c226f5f2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -106,7 +106,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -177,7 +177,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -240,7 +240,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 1a4bc147189..ee33793f7d4 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -310,7 +310,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -381,7 +381,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 6ed4fb4ef98..c66355f343b 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -79,6 +79,14 @@ module Petstore # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module Petstore @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module Petstore # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb index 5ee8f3ea1c4..36e3d851548 100644 --- a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb @@ -55,6 +55,15 @@ describe Petstore::Configuration do expect(config.base_url).to eq('https://localhost:8080/v2') end + it 'ignores the operation server settings and uses the custom base url' do + config.scheme = 'https' + config.host = 'api.example.com' + config.base_path = '/v2' + config.ignore_operation_servers = true + expect(config.base_url).to eq('https://api.example.com/v2') + expect(config.base_url(:'PetApi.add_pet')).to eq('https://api.example.com/v2') + end + it 'throws argument error when attempting to use a server index that is out of bounds' do config.server_operation_index = { :'PetApi.add_pet' => 10 diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index eb23185b873..078bc10bcb4 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -45,6 +46,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs diff --git a/samples/client/petstore/rust/hyper/petstore/Cargo.toml b/samples/client/petstore/rust/hyper/petstore/Cargo.toml index d8b82608d37..a9eedf18dea 100644 --- a/samples/client/petstore/rust/hyper/petstore/Cargo.toml +++ b/samples/client/petstore/rust/hyper/petstore/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -hyper = { version = "~0.14", features = ["full"] } -hyper-tls = "~0.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } http = "~0.2" base64 = "~0.7.0" futures = "^0.3" diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index f27a9ee03b4..d9379e434db 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/NumericEnumTesting.md b/samples/client/petstore/rust/hyper/petstore/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/client.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs index c38f01cdc55..0847578a83c 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs @@ -1,6 +1,7 @@ use std::rc::Rc; use hyper; +use hyper_util::client::legacy::connect::Connect; use super::configuration::Configuration; pub struct APIClient { @@ -12,7 +13,7 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient + pub fn new(configuration: Configuration) -> APIClient where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs index ae41a752976..be6df1cd28e 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs @@ -9,12 +9,16 @@ */ use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; -pub struct Configuration +pub struct Configuration where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, - pub client: hyper::client::Client, + pub client: Client, pub basic_auth: Option, pub oauth_access_token: Option, pub api_key: Option, @@ -28,9 +32,41 @@ pub struct ApiKey { pub key: String, } -impl Configuration +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// let api_config = { + /// api_key: "my-api-key", + /// ...Configuration::new() + /// } + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration where C: Clone + std::marker::Send + Sync { - pub fn new(client: hyper::client::Client) -> Configuration { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { Configuration { base_path: "http://petstore.swagger.io/v2".to_owned(), user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), @@ -41,3 +77,10 @@ impl Configuration } } } + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs index 685b7262fff..dcbe3fb669f 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct FakeApiClient +pub struct FakeApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl FakeApiClient +impl FakeApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> FakeApiClient { FakeApiClient { @@ -39,7 +40,7 @@ pub trait FakeApi { fn test_nullable_required_param(&self, username: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>) -> Pin>>>; } -implFakeApi for FakeApiClient +implFakeApi for FakeApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn test_nullable_required_param(&self, username: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>) -> Pin>>> { 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 df848ad3c6b..888d6b88236 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs @@ -1,25 +1,38 @@ -use http; +use std::fmt; +use std::fmt::Debug; + use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; use serde_json; #[derive(Debug)] pub enum Error { Api(ApiError), - Header(hyper::http::header::InvalidHeaderValue), + Header(http::header::InvalidHeaderValue), Http(http::Error), Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), Serde(serde_json::Error), UriError(http::uri::InvalidUri), } -#[derive(Debug)] pub struct ApiError { pub code: hyper::StatusCode, - pub body: hyper::body::Body, + pub body: hyper::body::Incoming, } -impl From<(hyper::StatusCode, hyper::body::Body)> for Error { - fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { Error::Api(ApiError { code: e.0, body: e.1, @@ -33,6 +46,12 @@ impl From for Error { } } +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + impl From for Error { fn from(e: hyper::Error) -> Self { Error::Hyper(e) diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index a81f1291681..ecff2f24485 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct PetApiClient +pub struct PetApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl PetApiClient +impl PetApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> PetApiClient { PetApiClient { @@ -46,7 +47,7 @@ pub trait PetApi { fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; } -implPetApi for PetApiClient +implPetApi for PetApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn add_pet(&self, pet: models::Pet) -> Pin>>> { diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs index db4d55e47b1..b92c977b726 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs @@ -4,7 +4,9 @@ use std::pin::Pin; use futures; use futures::Future; use futures::future::*; +use http_body_util::BodyExt; use hyper; +use hyper_util::client::legacy::connect::Connect; use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -109,7 +111,7 @@ impl Request { conf: &configuration::Configuration, ) -> Pin> + 'a>> where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + C: Connect + Clone + std::marker::Send + Sync, U: Sized + std::marker::Send + 'a, for<'de> U: serde::Deserialize<'de>, { @@ -203,13 +205,13 @@ impl Request { for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req_builder.body(hyper::Body::from(enc.finish())) + req_builder.body(enc.finish()) } else if let Some(body) = self.serialized_body { req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); req_headers.insert(CONTENT_LENGTH, body.len().into()); - req_builder.body(hyper::Body::from(body)) + req_builder.body(body) } else { - req_builder.body(hyper::Body::default()) + req_builder.body(String::new()) }; let request = match request_result { Ok(request) => request, @@ -233,9 +235,12 @@ impl Request { // need to impl default for all models. futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(|e| Error::from(e)).boxed() + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() } })) } diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index d1984b9e698..67cbbe4fd4b 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct StoreApiClient +pub struct StoreApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl StoreApiClient +impl StoreApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> StoreApiClient { StoreApiClient { @@ -42,7 +43,7 @@ pub trait StoreApi { fn place_order(&self, order: models::Order) -> Pin>>>; } -implStoreApi for StoreApiClient +implStoreApi for StoreApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn delete_order(&self, order_id: &str) -> Pin>>> { diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs index a7df972d733..c7444f54f53 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct TestingApiClient +pub struct TestingApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl TestingApiClient +impl TestingApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> TestingApiClient { TestingApiClient { @@ -40,7 +41,7 @@ pub trait TestingApi { fn tests_type_testing_get(&self, ) -> Pin>>>; } -implTestingApi for TestingApiClient +implTestingApi for TestingApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn tests_file_response_get(&self, ) -> Pin>>> { diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index 3511933ac8b..d3ff8e9cda6 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -15,18 +15,19 @@ use std::pin::Pin; use std::option::Option; use hyper; +use hyper_util::client::legacy::connect::Connect; use futures::Future; use crate::models; use super::{Error, configuration}; use super::request as __internal_request; -pub struct UserApiClient +pub struct UserApiClient where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl UserApiClient +impl UserApiClient where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> UserApiClient { UserApiClient { @@ -46,7 +47,7 @@ pub trait UserApi { fn update_user(&self, username: &str, user: models::User) -> Pin>>>; } -implUserApi for UserApiClient +implUserApi for UserApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] fn create_user(&self, user: models::User) -> Pin>>> { diff --git a/samples/client/petstore/rust/hyper/petstore/src/lib.rs b/samples/client/petstore/rust/hyper/petstore/src/lib.rs index 1de74d07cff..f5cfd231540 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/lib.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/.gitignore b/samples/client/petstore/rust/hyper0x/petstore/.gitignore new file mode 100644 index 00000000000..6aa106405a4 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator-ignore b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/.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/rust/hyper0x/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES new file mode 100644 index 00000000000..6d5eacd5c07 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES @@ -0,0 +1,55 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/ActionContainer.md +docs/ApiResponse.md +docs/ArrayItemRefTest.md +docs/Baz.md +docs/Category.md +docs/EnumArrayTesting.md +docs/FakeApi.md +docs/NullableArray.md +docs/NumericEnumTesting.md +docs/OptionalTesting.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/PropertyTest.md +docs/Ref.md +docs/Return.md +docs/StoreApi.md +docs/Tag.md +docs/TestingApi.md +docs/TypeTesting.md +docs/UniqueItemArrayTesting.md +docs/User.md +docs/UserApi.md +git_push.sh +src/apis/configuration.rs +src/apis/fake_api.rs +src/apis/mod.rs +src/apis/pet_api.rs +src/apis/store_api.rs +src/apis/testing_api.rs +src/apis/user_api.rs +src/lib.rs +src/models/action_container.rs +src/models/api_response.rs +src/models/array_item_ref_test.rs +src/models/baz.rs +src/models/category.rs +src/models/enum_array_testing.rs +src/models/mod.rs +src/models/model_ref.rs +src/models/model_return.rs +src/models/nullable_array.rs +src/models/numeric_enum_testing.rs +src/models/optional_testing.rs +src/models/order.rs +src/models/pet.rs +src/models/property_test.rs +src/models/tag.rs +src/models/type_testing.rs +src/models/unique_item_array_testing.rs +src/models/user.rs diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/rust/hyper0x/petstore/.travis.yml b/samples/client/petstore/rust/hyper0x/petstore/.travis.yml new file mode 100644 index 00000000000..22761ba7ee1 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/hyper0x/petstore/Cargo.toml b/samples/client/petstore/rust/hyper0x/petstore/Cargo.toml new file mode 100644 index 00000000000..a1b39ea2340 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "petstore-hyper0x" +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 = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +http = "~0.2" +base64 = "~0.7.0" +futures = "^0.3" diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md new file mode 100644 index 00000000000..6e99aa7f34c --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -0,0 +1,85 @@ +# Rust API client for petstore-hyper0x + +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 API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://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.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `petstore-hyper0x` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +petstore-hyper0x = { path = "./petstore-hyper0x" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*FakeApi* | [**test_nullable_required_param**](docs/FakeApi.md#test_nullable_required_param) | **GET** /fake/user/{username} | To test nullable required parameters +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file +*TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [ActionContainer](docs/ActionContainer.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayItemRefTest](docs/ArrayItemRefTest.md) + - [Baz](docs/Baz.md) + - [Category](docs/Category.md) + - [EnumArrayTesting](docs/EnumArrayTesting.md) + - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) + - [OptionalTesting](docs/OptionalTesting.md) + - [Order](docs/Order.md) + - [Pet](docs/Pet.md) + - [PropertyTest](docs/PropertyTest.md) + - [Ref](docs/Ref.md) + - [Return](docs/Return.md) + - [Tag](docs/Tag.md) + - [TypeTesting](docs/TypeTesting.md) + - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) + - [User](docs/User.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/ActionContainer.md b/samples/client/petstore/rust/hyper0x/petstore/docs/ActionContainer.md new file mode 100644 index 00000000000..4e0a0ba4961 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/ActionContainer.md @@ -0,0 +1,11 @@ +# ActionContainer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**models::Baz**](Baz.md) | | + +[[Back to Model list]](../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/hyper0x/petstore/docs/ApiResponse.md b/samples/client/petstore/rust/hyper0x/petstore/docs/ApiResponse.md new file mode 100644 index 00000000000..b5125ba685b --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/ApiResponse.md @@ -0,0 +1,13 @@ +# ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | Option<**i32**> | | [optional] +**r#type** | Option<**String**> | | [optional] +**message** | Option<**String**> | | [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/rust/hyper0x/petstore/docs/ArrayItemRefTest.md b/samples/client/petstore/rust/hyper0x/petstore/docs/ArrayItemRefTest.md new file mode 100644 index 00000000000..616deda7c4b --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/ArrayItemRefTest.md @@ -0,0 +1,12 @@ +# ArrayItemRefTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list_with_array_ref** | [**Vec>**](Vec.md) | | +**list_with_object_ref** | [**Vec>**](std::collections::HashMap.md) | | + +[[Back to Model list]](../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/hyper0x/petstore/docs/Baz.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Baz.md new file mode 100644 index 00000000000..e9c4c693d89 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Baz.md @@ -0,0 +1,14 @@ +# Baz + +## Enum Variants + +| Name | Value | +|---- | -----| +| A | A | +| B | B | +| Empty | | + + +[[Back to Model list]](../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/hyper0x/petstore/docs/Category.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Category.md new file mode 100644 index 00000000000..1cf67347c05 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Category.md @@ -0,0 +1,12 @@ +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [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/rust/hyper0x/petstore/docs/EnumArrayTesting.md b/samples/client/petstore/rust/hyper0x/petstore/docs/EnumArrayTesting.md new file mode 100644 index 00000000000..fb4c54df47d --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/EnumArrayTesting.md @@ -0,0 +1,11 @@ +# EnumArrayTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_enums** | **Vec** | | + +[[Back to Model list]](../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/hyper0x/petstore/docs/FakeApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md new file mode 100644 index 00000000000..55bf612aa21 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/FakeApi.md @@ -0,0 +1,41 @@ +# \FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_nullable_required_param**](FakeApi.md#test_nullable_required_param) | **GET** /fake/user/{username} | To test nullable required parameters + + + +## test_nullable_required_param + +> test_nullable_required_param(username, dummy_required_nullable_param, uppercase) +To test nullable required parameters + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | +**dummy_required_nullable_param** | Option<**String**> | To test nullable required parameters | [required] | +**uppercase** | Option<**String**> | To test parameter names in upper case | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/NullableArray.md b/samples/client/petstore/rust/hyper0x/petstore/docs/NullableArray.md new file mode 100644 index 00000000000..3b4aaa9668f --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/NullableArray.md @@ -0,0 +1,14 @@ +# NullableArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_nullable** | Option<**Vec**> | | [optional] +**just_array** | Option<**Vec**> | | [optional] +**nullable_string** | Option<**String**> | | [optional] +**just_string** | Option<**String**> | | [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/rust/hyper0x/petstore/docs/NumericEnumTesting.md b/samples/client/petstore/rust/hyper0x/petstore/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/hyper0x/petstore/docs/OptionalTesting.md b/samples/client/petstore/rust/hyper0x/petstore/docs/OptionalTesting.md new file mode 100644 index 00000000000..029e38eb977 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/OptionalTesting.md @@ -0,0 +1,14 @@ +# OptionalTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_nonnull** | Option<**String**> | | [optional] +**required_nonnull** | **String** | | +**optional_nullable** | Option<**String**> | | [optional] +**required_nullable** | Option<**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/hyper0x/petstore/docs/Order.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Order.md new file mode 100644 index 00000000000..d9a09c39743 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Order.md @@ -0,0 +1,16 @@ +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**pet_id** | Option<**i64**> | | [optional] +**quantity** | Option<**i32**> | | [optional] +**ship_date** | Option<**String**> | | [optional] +**status** | Option<**String**> | Order Status | [optional] +**complete** | Option<**bool**> | | [optional][default to false] + +[[Back to Model list]](../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/hyper0x/petstore/docs/Pet.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Pet.md new file mode 100644 index 00000000000..e7a72caa16e --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Pet.md @@ -0,0 +1,16 @@ +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**category** | Option<[**models::Category**](Category.md)> | | [optional] +**name** | **String** | | +**photo_urls** | **Vec** | | +**tags** | Option<[**Vec**](Tag.md)> | | [optional] +**status** | Option<**String**> | pet status in the store | [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/rust/hyper0x/petstore/docs/PetApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/PetApi.md new file mode 100644 index 00000000000..d503facb903 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/PetApi.md @@ -0,0 +1,261 @@ +# \PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +## add_pet + +> models::Pet add_pet(pet) +Add a new pet to the store + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] | + +### Return type + +[**models::Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_pet + +> delete_pet(pet_id, api_key) +Deletes a pet + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet_id** | **i64** | Pet id to delete | [required] | +**api_key** | Option<**String**> | | | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## find_pets_by_status + +> Vec find_pets_by_status(status) +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**status** | [**Vec**](String.md) | Status values that need to be considered for filter | [required] | + +### Return type + +[**Vec**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## find_pets_by_tags + +> Vec find_pets_by_tags(tags) +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tags** | [**Vec**](String.md) | Tags to filter by | [required] | + +### Return type + +[**Vec**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_pet_by_id + +> models::Pet get_pet_by_id(pet_id) +Find pet by ID + +Returns a single pet + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet_id** | **i64** | ID of pet to return | [required] | + +### Return type + +[**models::Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_pet + +> models::Pet update_pet(pet) +Update an existing pet + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | [required] | + +### Return type + +[**models::Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_pet_with_form + +> update_pet_with_form(pet_id, name, status) +Updates a pet in the store with form data + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet_id** | **i64** | ID of pet that needs to be updated | [required] | +**name** | Option<**String**> | Updated name of the pet | | +**status** | Option<**String**> | Updated status of the pet | | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## upload_file + +> models::ApiResponse upload_file(pet_id, additional_metadata, file) +uploads an image + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**pet_id** | **i64** | ID of pet to update | [required] | +**additional_metadata** | Option<**String**> | Additional data to pass to server | | +**file** | Option<**std::path::PathBuf**> | file to upload | | + +### Return type + +[**models::ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/PropertyTest.md b/samples/client/petstore/rust/hyper0x/petstore/docs/PropertyTest.md new file mode 100644 index 00000000000..3f36c163de0 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/PropertyTest.md @@ -0,0 +1,11 @@ +# PropertyTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | | [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/rust/hyper0x/petstore/docs/Ref.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Ref.md new file mode 100644 index 00000000000..04f9d0aa55a --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Ref.md @@ -0,0 +1,11 @@ +# Ref + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dummy** | Option<**String**> | | [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/rust/hyper0x/petstore/docs/Return.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Return.md new file mode 100644 index 00000000000..04710a019db --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Return.md @@ -0,0 +1,13 @@ +# Return + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#match** | Option<**i32**> | | [optional] +**r#async** | Option<**bool**> | | [optional] +**param_super** | Option<**bool**> | | [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/rust/hyper0x/petstore/docs/StoreApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/StoreApi.md new file mode 100644 index 00000000000..a513dfa1b5f --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/StoreApi.md @@ -0,0 +1,129 @@ +# \StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + + +## delete_order + +> delete_order(order_id) +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 | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**order_id** | **String** | ID of the order that needs to be deleted | [required] | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_inventory + +> std::collections::HashMap get_inventory() +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**std::collections::HashMap** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_order_by_id + +> models::Order get_order_by_id(order_id) +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 | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**order_id** | **i64** | ID of pet that needs to be fetched | [required] | + +### Return type + +[**models::Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## place_order + +> models::Order place_order(order) +Place an order for a pet + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**order** | [**Order**](Order.md) | order placed for purchasing the pet | [required] | + +### Return type + +[**models::Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/Tag.md b/samples/client/petstore/rust/hyper0x/petstore/docs/Tag.md new file mode 100644 index 00000000000..7bf71ab0e9d --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/Tag.md @@ -0,0 +1,12 @@ +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [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/rust/hyper0x/petstore/docs/TestingApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md new file mode 100644 index 00000000000..9c26af24912 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md @@ -0,0 +1,60 @@ +# \TestingApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file +[**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema + + + +## tests_file_response_get + +> std::path::PathBuf tests_file_response_get() +Returns an image file + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/jpeg + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## tests_type_testing_get + +> models::TypeTesting tests_type_testing_get() +Route to test the TypeTesting schema + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::TypeTesting**](TypeTesting.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/TypeTesting.md b/samples/client/petstore/rust/hyper0x/petstore/docs/TypeTesting.md new file mode 100644 index 00000000000..4f650eb1aa2 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/TypeTesting.md @@ -0,0 +1,18 @@ +# TypeTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**int32** | **i32** | | +**int64** | **i64** | | +**float** | **f32** | | +**double** | **f64** | | +**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/hyper0x/petstore/docs/UniqueItemArrayTesting.md b/samples/client/petstore/rust/hyper0x/petstore/docs/UniqueItemArrayTesting.md new file mode 100644 index 00000000000..6e103e2bb28 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/UniqueItemArrayTesting.md @@ -0,0 +1,11 @@ +# UniqueItemArrayTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unique_item_array** | **Vec** | Helper object for the unique item array test | + +[[Back to Model list]](../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/hyper0x/petstore/docs/User.md b/samples/client/petstore/rust/hyper0x/petstore/docs/User.md new file mode 100644 index 00000000000..19d813622ed --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/User.md @@ -0,0 +1,18 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**username** | **String** | | +**first_name** | Option<**String**> | | [optional] +**last_name** | **String** | | +**email** | Option<**String**> | | [optional] +**password** | Option<**String**> | | [optional] +**phone** | Option<**String**> | | [optional] +**user_status** | Option<**i32**> | User Status | [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/rust/hyper0x/petstore/docs/UserApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/UserApi.md new file mode 100644 index 00000000000..d536057ae15 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/UserApi.md @@ -0,0 +1,255 @@ +# \UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + + +## create_user + +> create_user(user) +Create user + +This can only be done by the logged in user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user** | [**User**](User.md) | Created user object | [required] | + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_users_with_array_input + +> create_users_with_array_input(user) +Creates list of users with given input array + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user** | [**Vec**](User.md) | List of user object | [required] | + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_users_with_list_input + +> create_users_with_list_input(user) +Creates list of users with given input array + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user** | [**Vec**](User.md) | List of user object | [required] | + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_user + +> delete_user(username) +Delete user + +This can only be done by the logged in user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | The name that needs to be deleted | [required] | + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_user_by_name + +> models::User get_user_by_name(username) +Get user by user name + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | The name that needs to be fetched. Use user1 for testing. | [required] | + +### Return type + +[**models::User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## login_user + +> String login_user(username, password) +Logs user into the system + + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | The user name for login | [required] | +**password** | **String** | The password for login in clear text | [required] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## logout_user + +> logout_user() +Logs out current logged in user session + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_user + +> update_user(username, user) +Updated user + +This can only be done by the logged in user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | name that need to be deleted | [required] | +**user** | [**User**](User.md) | Updated user object | [required] | + +### Return type + + (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/git_push.sh b/samples/client/petstore/rust/hyper0x/petstore/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/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/rust/hyper0x/petstore/src/apis/configuration.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/configuration.rs new file mode 100644 index 00000000000..ae41a752976 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/configuration.rs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: hyper::client::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + pub fn new(client: hyper::client::Client) -> Configuration { + Configuration { + base_path: "http://petstore.swagger.io/v2".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs new file mode 100644 index 00000000000..685b7262fff --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct FakeApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl FakeApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> FakeApiClient { + FakeApiClient { + configuration, + } + } +} + +pub trait FakeApi { + fn test_nullable_required_param(&self, username: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>) -> Pin>>>; +} + +implFakeApi for FakeApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn test_nullable_required_param(&self, username: &str, dummy_required_nullable_param: Option<&str>, uppercase: Option<&str>) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{username}".to_string()) + ; + req = req.with_path_param("username".to_string(), username.to_string()); + match dummy_required_nullable_param { + Some(param_value) => { req = req.with_header_param("dummy_required_nullable_param".to_string(), param_value.to_string()); }, + None => { req = req.with_header_param("dummy_required_nullable_param".to_string(), "".to_string()); }, + } + if let Some(param_value) = uppercase { + req = req.with_header_param("UPPERCASE".to_string(), param_value.to_string()); + } + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/mod.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/mod.rs new file mode 100644 index 00000000000..df848ad3c6b --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/mod.rs @@ -0,0 +1,62 @@ +use http; +use hyper; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Body, +} + +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +mod request; + +mod fake_api; +pub use self::fake_api::{ FakeApi, FakeApiClient }; +mod pet_api; +pub use self::pet_api::{ PetApi, PetApiClient }; +mod store_api; +pub use self::store_api::{ StoreApi, StoreApiClient }; +mod testing_api; +pub use self::testing_api::{ TestingApi, TestingApiClient }; +mod user_api; +pub use self::user_api::{ UserApi, UserApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/pet_api.rs new file mode 100644 index 00000000000..a81f1291681 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/pet_api.rs @@ -0,0 +1,152 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct PetApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl PetApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> PetApiClient { + PetApiClient { + configuration, + } + } +} + +pub trait PetApi { + fn add_pet(&self, pet: models::Pet) -> Pin>>>; + fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>>; + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; + fn update_pet(&self, pet: models::Pet) -> Pin>>>; + fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>>; + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; +} + +implPetApi for PetApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn add_pet(&self, pet: models::Pet) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_body_param(pet); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/pet/{petId}".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_path_param("petId".to_string(), pet_id.to_string()); + if let Some(param_value) = api_key { + req = req.with_header_param("api_key".to_string(), param_value.to_string()); + } + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_query_param("status".to_string(), status.join(",").to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByTags".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_query_param("tags".to_string(), tags.join(",").to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/{petId}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_path_param("petId".to_string(), pet_id.to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn update_pet(&self, pet: models::Pet) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_body_param(pet); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_path_param("petId".to_string(), pet_id.to_string()); + if let Some(param_value) = name { + req = req.with_form_param("name".to_string(), param_value.to_string()); + } + if let Some(param_value) = status { + req = req.with_form_param("status".to_string(), param_value.to_string()); + } + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}/uploadImage".to_string()) + .with_auth(__internal_request::Auth::Oauth) + ; + req = req.with_path_param("petId".to_string(), pet_id.to_string()); + if let Some(param_value) = additional_metadata { + req = req.with_form_param("additionalMetadata".to_string(), param_value.to_string()); + } + if let Some(param_value) = file { + req = req.with_form_param("file".to_string(), unimplemented!()); + } + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/store_api.rs new file mode 100644 index 00000000000..d1984b9e698 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/store_api.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct StoreApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl StoreApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> StoreApiClient { + StoreApiClient { + configuration, + } + } +} + +pub trait StoreApi { + fn delete_order(&self, order_id: &str) -> Pin>>>; + fn get_inventory(&self, ) -> Pin, Error>>>>; + fn get_order_by_id(&self, order_id: i64) -> Pin>>>; + fn place_order(&self, order: models::Order) -> Pin>>>; +} + +implStoreApi for StoreApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn delete_order(&self, order_id: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/store/order/{orderId}".to_string()) + ; + req = req.with_path_param("orderId".to_string(), order_id.to_string()); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn get_inventory(&self, ) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/inventory".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn get_order_by_id(&self, order_id: i64) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/order/{orderId}".to_string()) + ; + req = req.with_path_param("orderId".to_string(), order_id.to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn place_order(&self, order: models::Order) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string()) + ; + req = req.with_body_param(order); + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs new file mode 100644 index 00000000000..a7df972d733 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct TestingApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl TestingApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> TestingApiClient { + TestingApiClient { + configuration, + } + } +} + +pub trait TestingApi { + fn tests_file_response_get(&self, ) -> Pin>>>; + fn tests_type_testing_get(&self, ) -> Pin>>>; +} + +implTestingApi for TestingApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn tests_file_response_get(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/fileResponse".to_string()) + ; + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn tests_type_testing_get(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/typeTesting".to_string()) + ; + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/user_api.rs new file mode 100644 index 00000000000..3511933ac8b --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/user_api.rs @@ -0,0 +1,160 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use std::rc::Rc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct UserApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Rc>, +} + +impl UserApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Rc>) -> UserApiClient { + UserApiClient { + configuration, + } + } +} + +pub trait UserApi { + fn create_user(&self, user: models::User) -> Pin>>>; + fn create_users_with_array_input(&self, user: Vec) -> Pin>>>; + fn create_users_with_list_input(&self, user: Vec) -> Pin>>>; + fn delete_user(&self, username: &str) -> Pin>>>; + fn get_user_by_name(&self, username: &str) -> Pin>>>; + fn login_user(&self, username: &str, password: &str) -> Pin>>>; + fn logout_user(&self, ) -> Pin>>>; + fn update_user(&self, username: &str, user: models::User) -> Pin>>>; +} + +implUserApi for UserApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn create_user(&self, user: models::User) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_body_param(user); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn create_users_with_array_input(&self, user: Vec) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithArray".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_body_param(user); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn create_users_with_list_input(&self, user: Vec) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithList".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_body_param(user); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn delete_user(&self, username: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_path_param("username".to_string(), username.to_string()); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn get_user_by_name(&self, username: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/{username}".to_string()) + ; + req = req.with_path_param("username".to_string(), username.to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn login_user(&self, username: &str, password: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/login".to_string()) + ; + req = req.with_query_param("username".to_string(), username.to_string()); + req = req.with_query_param("password".to_string(), password.to_string()); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn logout_user(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/logout".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn update_user(&self, username: &str, user: models::User) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::PUT, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) + ; + req = req.with_path_param("username".to_string(), username.to_string()); + req = req.with_body_param(user); + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/lib.rs b/samples/client/petstore/rust/hyper0x/petstore/src/lib.rs new file mode 100644 index 00000000000..f5cfd231540 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/lib.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/action_container.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/action_container.rs new file mode 100644 index 00000000000..11d2f0b8712 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/action_container.rs @@ -0,0 +1,27 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ActionContainer { + #[serde(rename = "action")] + pub action: Box, +} + +impl ActionContainer { + pub fn new(action: models::Baz) -> ActionContainer { + ActionContainer { + action: Box::new(action), + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/api_response.rs new file mode 100644 index 00000000000..0a60da0f477 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/api_response.rs @@ -0,0 +1,35 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// ApiResponse : Describes the result of uploading an image resource +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApiResponse { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +impl ApiResponse { + /// Describes the result of uploading an image resource + pub fn new() -> ApiResponse { + ApiResponse { + code: None, + r#type: None, + message: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/array_item_ref_test.rs new file mode 100644 index 00000000000..4ac1e8a2fe9 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/array_item_ref_test.rs @@ -0,0 +1,32 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// ArrayItemRefTest : Test handling of object reference in arrays +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ArrayItemRefTest { + #[serde(rename = "list_with_array_ref")] + pub list_with_array_ref: Vec>, + #[serde(rename = "list_with_object_ref")] + pub list_with_object_ref: Vec>, +} + +impl ArrayItemRefTest { + /// Test handling of object reference in arrays + pub fn new(list_with_array_ref: Vec>, list_with_object_ref: Vec>) -> ArrayItemRefTest { + ArrayItemRefTest { + list_with_array_ref, + list_with_object_ref, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/baz.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/baz.rs new file mode 100644 index 00000000000..17b42c0bd4f --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/baz.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Baz : Test handling of empty variants +/// Test handling of empty variants +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Baz { + #[serde(rename = "A")] + A, + #[serde(rename = "B")] + B, + #[serde(rename = "")] + Empty, + +} + +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), + } + } +} + +impl Default for Baz { + fn default() -> Baz { + Self::A + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/category.rs new file mode 100644 index 00000000000..9ecf89d354d --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/category.rs @@ -0,0 +1,32 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Category : A category for a pet +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Category { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl Category { + /// A category for a pet + pub fn new() -> Category { + Category { + id: None, + name: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/enum_array_testing.rs new file mode 100644 index 00000000000..2ac40c30775 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/enum_array_testing.rs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// EnumArrayTesting : Test of enum array +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnumArrayTesting { + #[serde(rename = "required_enums")] + pub required_enums: Vec, +} + +impl EnumArrayTesting { + /// Test of enum array + pub fn new(required_enums: Vec) -> EnumArrayTesting { + EnumArrayTesting { + required_enums, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RequiredEnums { + #[serde(rename = "A")] + A, + #[serde(rename = "B")] + B, + #[serde(rename = "C")] + C, +} + +impl Default for RequiredEnums { + fn default() -> RequiredEnums { + Self::A + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs new file mode 100644 index 00000000000..b7e684d8071 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs @@ -0,0 +1,36 @@ +pub mod action_container; +pub use self::action_container::ActionContainer; +pub mod api_response; +pub use self::api_response::ApiResponse; +pub mod array_item_ref_test; +pub use self::array_item_ref_test::ArrayItemRefTest; +pub mod baz; +pub use self::baz::Baz; +pub mod category; +pub use self::category::Category; +pub mod enum_array_testing; +pub use self::enum_array_testing::EnumArrayTesting; +pub mod nullable_array; +pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; +pub mod optional_testing; +pub use self::optional_testing::OptionalTesting; +pub mod order; +pub use self::order::Order; +pub mod pet; +pub use self::pet::Pet; +pub mod property_test; +pub use self::property_test::PropertyTest; +pub mod model_ref; +pub use self::model_ref::Ref; +pub mod model_return; +pub use self::model_return::Return; +pub mod tag; +pub use self::tag::Tag; +pub mod type_testing; +pub use self::type_testing::TypeTesting; +pub mod unique_item_array_testing; +pub use self::unique_item_array_testing::UniqueItemArrayTesting; +pub mod user; +pub use self::user::User; diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/model_ref.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/model_ref.rs new file mode 100644 index 00000000000..9862cb1a48e --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/model_ref.rs @@ -0,0 +1,29 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Ref : using reserved word as model name +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Ref { + #[serde(rename = "dummy", skip_serializing_if = "Option::is_none")] + pub dummy: Option, +} + +impl Ref { + /// using reserved word as model name + pub fn new() -> Ref { + Ref { + dummy: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/model_return.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/model_return.rs new file mode 100644 index 00000000000..07d9268e6e6 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/model_return.rs @@ -0,0 +1,35 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Return : Test using keywords +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Return { + #[serde(rename = "match", skip_serializing_if = "Option::is_none")] + pub r#match: Option, + #[serde(rename = "async", skip_serializing_if = "Option::is_none")] + pub r#async: Option, + #[serde(rename = "super", skip_serializing_if = "Option::is_none")] + pub param_super: Option, +} + +impl Return { + /// Test using keywords + pub fn new() -> Return { + Return { + r#match: None, + r#async: None, + param_super: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/nullable_array.rs new file mode 100644 index 00000000000..a155ea1176a --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/nullable_array.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NullableArray { + #[serde(rename = "array_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub array_nullable: Option>>, + #[serde(rename = "just_array", skip_serializing_if = "Option::is_none")] + pub just_array: Option>, + #[serde(rename = "nullable_string", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nullable_string: Option>, + #[serde(rename = "just_string", skip_serializing_if = "Option::is_none")] + pub just_string: Option, +} + +impl NullableArray { + pub fn new() -> NullableArray { + NullableArray { + array_nullable: None, + just_array: None, + nullable_string: None, + just_string: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/optional_testing.rs new file mode 100644 index 00000000000..72e5a009a62 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/optional_testing.rs @@ -0,0 +1,38 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// OptionalTesting : Test handling of optional and nullable fields +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OptionalTesting { + #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] + pub optional_nonnull: Option, + #[serde(rename = "required_nonnull")] + pub required_nonnull: String, + #[serde(rename = "optional_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub optional_nullable: Option>, + #[serde(rename = "required_nullable", deserialize_with = "Option::deserialize")] + pub required_nullable: Option, +} + +impl OptionalTesting { + /// Test handling of optional and nullable fields + pub fn new(required_nonnull: String, required_nullable: Option) -> OptionalTesting { + OptionalTesting { + optional_nonnull: None, + required_nonnull, + optional_nullable: None, + required_nullable, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/order.rs new file mode 100644 index 00000000000..e81f64a2980 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/order.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Order : An order for a pets from the pet store +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Order { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "petId", skip_serializing_if = "Option::is_none")] + pub pet_id: Option, + #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")] + pub quantity: Option, + #[serde(rename = "shipDate", skip_serializing_if = "Option::is_none")] + pub ship_date: Option, + /// Order Status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "complete", skip_serializing_if = "Option::is_none")] + pub complete: Option, +} + +impl Order { + /// An order for a pets from the pet store + pub fn new() -> Order { + Order { + id: None, + pet_id: None, + quantity: None, + ship_date: None, + status: None, + complete: None, + } + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/pet.rs new file mode 100644 index 00000000000..785fb5390be --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/pet.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Pet : A pet for sale in the pet store +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Pet { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "category", skip_serializing_if = "Option::is_none")] + pub category: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "photoUrls")] + pub photo_urls: Vec, + #[serde(rename = "tags", skip_serializing_if = "Option::is_none")] + pub tags: Option>, + /// pet status in the store + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl Pet { + /// A pet for sale in the pet store + pub fn new(name: String, photo_urls: Vec) -> Pet { + Pet { + id: None, + category: None, + name, + photo_urls, + tags: None, + status: None, + } + } +} +/// pet status in the store +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "available")] + Available, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "sold")] + Sold, +} + +impl Default for Status { + fn default() -> Status { + Self::Available + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/property_test.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/property_test.rs new file mode 100644 index 00000000000..c98e7c762b5 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/property_test.rs @@ -0,0 +1,29 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// PropertyTest : A model to test various formats, e.g. UUID +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyTest { + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, +} + +impl PropertyTest { + /// A model to test various formats, e.g. UUID + pub fn new() -> PropertyTest { + PropertyTest { + uuid: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/tag.rs new file mode 100644 index 00000000000..8fe4eebd723 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/tag.rs @@ -0,0 +1,32 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Tag : A tag for a pet +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Tag { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl Tag { + /// A tag for a pet + pub fn new() -> Tag { + Tag { + id: None, + name: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/type_testing.rs new file mode 100644 index 00000000000..dba87bdb3cf --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/type_testing.rs @@ -0,0 +1,54 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +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")] + pub int32: i32, + #[serde(rename = "int64")] + pub int64: i64, + #[serde(rename = "float")] + pub float: f32, + #[serde(rename = "double")] + pub double: f64, + #[serde(rename = "string")] + pub string: String, + #[serde(rename = "boolean")] + 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, bytes: Vec) -> TypeTesting { + TypeTesting { + int32, + int64, + float, + double, + string, + boolean, + uuid, + bytes, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/unique_item_array_testing.rs new file mode 100644 index 00000000000..2a1f18ca9ce --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/unique_item_array_testing.rs @@ -0,0 +1,46 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// UniqueItemArrayTesting : Test handling of enum array with unique items +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UniqueItemArrayTesting { + /// Helper object for the unique item array test + #[serde(rename = "unique_item_array")] + pub unique_item_array: std::collections::HashSet, +} + +impl UniqueItemArrayTesting { + /// Test handling of enum array with unique items + pub fn new(unique_item_array: std::collections::HashSet) -> UniqueItemArrayTesting { + UniqueItemArrayTesting { + unique_item_array, + } + } +} +/// Helper object for the unique item array test +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UniqueItemArray { + #[serde(rename = "unique_item_1")] + Variant1, + #[serde(rename = "unique_item_2")] + Variant2, + #[serde(rename = "unique_item_3")] + Variant3, +} + +impl Default for UniqueItemArray { + fn default() -> UniqueItemArray { + Self::Variant1 + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/user.rs new file mode 100644 index 00000000000..c88c469a4eb --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/user.rs @@ -0,0 +1,51 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// User : A User who is purchasing from the pet store +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "username")] + pub username: String, + #[serde(rename = "firstName", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(rename = "lastName")] + pub last_name: String, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "phone", skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// User Status + #[serde(rename = "userStatus", skip_serializing_if = "Option::is_none")] + pub user_status: Option, +} + +impl User { + /// A User who is purchasing from the pet store + pub fn new(username: String, last_name: String) -> User { + User { + id: None, + username, + first_name: None, + last_name, + email: None, + password: None, + phone: None, + user_status: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml b/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml index 120ba16c882..172f74f4e1f 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml @@ -9,6 +9,7 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/lib.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES index bcfaf169317..6d5eacd5c07 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -43,6 +44,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs 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 cd7d83abaa6..2bbf314d7e8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" 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-middleware/README.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md index 19da1c861e7..030d7813481 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/NumericEnumTesting.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs index a1837b966dc..e1520628d76 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES index bcfaf169317..6d5eacd5c07 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -43,6 +44,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml index 8fa64e90a2f..3803423fe92 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index c1a9e4946da..68a8f7b3218 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/NumericEnumTesting.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES index bcfaf169317..6d5eacd5c07 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -43,6 +44,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs 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 99fe8589bc8..a3312a3a7ee 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/README.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md index b46b44dfe9e..abfc7d32682 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/NumericEnumTesting.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/lib.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/lib.rs index a1837b966dc..e1520628d76 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,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES index bcfaf169317..6d5eacd5c07 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -43,6 +44,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml index 31b50f4eed1..d5a2bac56a2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } aws-sigv4 = "0.3.0" diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index bb8c55c9142..1f21ac6d6f6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/NumericEnumTesting.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/lib.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index bcfaf169317..6d5eacd5c07 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -10,6 +10,7 @@ docs/Category.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md +docs/NumericEnumTesting.md docs/OptionalTesting.md docs/Order.md docs/Pet.md @@ -43,6 +44,7 @@ src/models/mod.rs src/models/model_ref.rs src/models/model_return.rs src/models/nullable_array.rs +src/models/numeric_enum_testing.rs src/models/optional_testing.rs src/models/order.rs src/models/pet.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml index 5e0e14f5120..0dd7e914941 100644 --- a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" serde = { version = "^1.0", features = ["derive"] } serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" +serde_repr = "^0.1" 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/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index 63496037c0c..ce1dca2ab39 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -60,6 +60,7 @@ Class | Method | HTTP request | Description - [Category](docs/Category.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) + - [NumericEnumTesting](docs/NumericEnumTesting.md) - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/NumericEnumTesting.md b/samples/client/petstore/rust/reqwest/petstore/docs/NumericEnumTesting.md new file mode 100644 index 00000000000..6e99038d397 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/NumericEnumTesting.md @@ -0,0 +1,15 @@ +# NumericEnumTesting + +## Enum Variants + +| Name | Value | +|---- | -----| +| Variant0 | 0 | +| Variant1 | 1 | +| Variant2 | 2 | +| Variant3 | 3 | + + +[[Back to Model list]](../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/lib.rs b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs index a1837b966dc..e1520628d76 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs index 884357e8604..b7e684d8071 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -12,6 +12,8 @@ pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; pub use self::nullable_array::NullableArray; +pub mod numeric_enum_testing; +pub use self::numeric_enum_testing::NumericEnumTesting; pub mod optional_testing; pub use self::optional_testing::OptionalTesting; pub mod order; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/numeric_enum_testing.rs new file mode 100644 index 00000000000..9b8f0cb0465 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/numeric_enum_testing.rs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_repr::{Serialize_repr,Deserialize_repr}; +/// NumericEnumTesting : testing that numeric enums are converted correctly +/// testing that numeric enums are converted correctly +#[repr(i64)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr)] +pub enum NumericEnumTesting { + Variant0 = 0, + Variant1 = 1, + Variant2 = 2, + Variant3 = 3, + +} + +impl ToString for NumericEnumTesting { + fn to_string(&self) -> String { + match self { + Self::Variant0 => String::from("0"), + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant3 => String::from("3"), + } + } +} +impl Default for NumericEnumTesting { + fn default() -> NumericEnumTesting { + Self::Variant0 + } +} + diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index e3d73db48a7..afa3be91ca4 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -59,7 +59,7 @@ public class Pet { /** * Get atType * @return atType - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("@type") @@ -79,7 +79,7 @@ public class Pet { /** * Get age * @return age - */ + */ @ApiModelProperty(value = "") @JsonProperty("age") @@ -99,7 +99,7 @@ public class Pet { /** * Get happy * @return happy - */ + */ @ApiModelProperty(value = "") @JsonProperty("happy") @@ -119,7 +119,7 @@ public class Pet { /** * Get price * @return price - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("price") @@ -139,7 +139,7 @@ public class Pet { /** * Get lastFeed * @return lastFeed - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("lastFeed") @@ -159,7 +159,7 @@ public class Pet { /** * Get dateOfBirth * @return dateOfBirth - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateOfBirth") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Order.java index ac2afa0b584..74d03841b4d 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Order.java @@ -85,7 +85,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -105,7 +105,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -125,7 +125,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -145,7 +145,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -165,7 +165,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -185,7 +185,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java index 8e69892758f..06a3def2c5a 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -169,7 +169,7 @@ public class Pet { * Get photoUrls * @return photoUrls * @deprecated - */ + */ @NotNull @Schema(name = "photoUrls", deprecated = true, requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -180,7 +180,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -202,7 +202,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -222,7 +222,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java index 4fef055be74..41657e13fc5 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java @@ -35,7 +35,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java index 08e835d2f13..38addbd62ab 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -39,7 +39,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -59,7 +59,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -79,7 +79,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java index db094aeeff2..77599a36e1e 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java @@ -84,7 +84,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -104,7 +104,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -124,7 +124,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -144,7 +144,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -164,7 +164,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -184,7 +184,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index e5b70ffeac8..32fb467c4d8 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -101,7 +101,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -121,7 +121,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -141,7 +141,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -169,7 +169,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -197,7 +197,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -218,7 +218,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -229,7 +229,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java index 69326d65d2a..472550a641e 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java @@ -35,7 +35,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java index e3559b7509b..644719e5fbb 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java @@ -47,7 +47,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -67,7 +67,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -87,7 +87,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -107,7 +107,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -127,7 +127,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -147,7 +147,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -167,7 +167,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -187,7 +187,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java index 022ba32d031..ab7b292aab9 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java @@ -35,7 +35,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Category { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java index 08e835d2f13..38addbd62ab 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -39,7 +39,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -59,7 +59,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -79,7 +79,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java index db094aeeff2..77599a36e1e 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java @@ -84,7 +84,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -104,7 +104,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -124,7 +124,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -144,7 +144,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -164,7 +164,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -184,7 +184,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java index e64f70f2b90..c1c6e0fb654 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -216,7 +216,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java index 69326d65d2a..472550a641e 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java @@ -35,7 +35,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java index e3559b7509b..644719e5fbb 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java @@ -47,7 +47,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -67,7 +67,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -87,7 +87,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -107,7 +107,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -127,7 +127,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -147,7 +147,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -167,7 +167,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -187,7 +187,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index 4fef055be74..41657e13fc5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -35,7 +35,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index 08e835d2f13..38addbd62ab 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -39,7 +39,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -59,7 +59,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -79,7 +79,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index db094aeeff2..77599a36e1e 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -84,7 +84,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -104,7 +104,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -124,7 +124,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -144,7 +144,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -164,7 +164,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -184,7 +184,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index e5b70ffeac8..32fb467c4d8 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -101,7 +101,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -121,7 +121,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -141,7 +141,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -169,7 +169,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -197,7 +197,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -218,7 +218,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -229,7 +229,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index 69326d65d2a..472550a641e 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -35,7 +35,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index e3559b7509b..644719e5fbb 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -47,7 +47,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -67,7 +67,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -87,7 +87,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -107,7 +107,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -127,7 +127,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -147,7 +147,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -167,7 +167,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -187,7 +187,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b33813ee3cf..33433303d9e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 912bd253a41..642c7a18f3a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -34,7 +34,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f7662f87889..73a271f6364 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 1c0c3443b65..cc6445fcb7f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @JsonProperty("map_string") public Map getMapString() { @@ -99,7 +99,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @JsonProperty("map_number") public Map getMapNumber() { @@ -126,7 +126,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @JsonProperty("map_integer") public Map getMapInteger() { @@ -153,7 +153,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @JsonProperty("map_boolean") public Map getMapBoolean() { @@ -180,7 +180,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { @@ -207,7 +207,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { @@ -234,7 +234,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @JsonProperty("map_map_string") public Map> getMapMapString() { @@ -261,7 +261,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { @@ -280,7 +280,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @JsonProperty("anytype_1") public Object getAnytype1() { @@ -299,7 +299,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @JsonProperty("anytype_2") public JsonNullable getAnytype2() { @@ -318,7 +318,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @JsonProperty("anytype_3") public Object getAnytype3() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index b0b7181eee4..190887606e2 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -33,7 +33,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 0aa1bd32d2b..a9b190f6afd 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -34,7 +34,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index da8dcd0c5dc..bdfdf426e8b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -34,7 +34,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 163c25b09a7..4bb6d59b29c 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -33,7 +33,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java index 80c8a2a0b28..fa2c0cbef87 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java @@ -56,7 +56,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @JsonProperty("className") public String getClassName() { @@ -75,7 +75,7 @@ public class Animal { /** * Get color * @return color - */ + */ @JsonProperty("color") public String getColor() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index f61aa193aab..ca0e80b2a70 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -42,7 +42,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 33713df195f..5dd4d352b01 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -42,7 +42,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @JsonProperty("ArrayNumber") public List getArrayNumber() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java index b9c802c1a05..277121af550 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -48,7 +48,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @JsonProperty("array_of_string") public List getArrayOfString() { @@ -75,7 +75,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { @@ -102,7 +102,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java index 914824210d1..b443d4e323b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -85,7 +85,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @JsonProperty("kind") public KindEnum getKind() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java index aba9ed0fea9..d21364a5ef9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -39,7 +39,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @JsonProperty("smallCamel") public String getSmallCamel() { @@ -58,7 +58,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @JsonProperty("CapitalCamel") public String getCapitalCamel() { @@ -77,7 +77,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @JsonProperty("small_Snake") public String getSmallSnake() { @@ -96,7 +96,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @JsonProperty("Capital_Snake") public String getCapitalSnake() { @@ -115,7 +115,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { @@ -134,7 +134,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @JsonProperty("ATT_NAME") public String getATTNAME() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java index 1e089419de2..f462b9358d4 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java @@ -53,7 +53,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @JsonProperty("declawed") public Boolean getDeclawed() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java index 659de406dd1..ee47108de03 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java @@ -42,7 +42,7 @@ public class Category { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -61,7 +61,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java index 3d4313c8f89..e0afd170f69 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -37,7 +37,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @JsonProperty("otherProperty") public String getOtherProperty() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java index 61a5490ce53..d8300a92484 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -29,7 +29,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @JsonProperty("_class") public String getPropertyClass() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java index d5e0299c76f..f2042baa7a1 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java @@ -29,7 +29,7 @@ public class Client { /** * Get client * @return client - */ + */ @JsonProperty("client") public String getClient() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 252c6ad45e3..9de317ada3d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -64,7 +64,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { @@ -91,7 +91,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @JsonProperty("nullable_required_array") public JsonNullable> getNullableRequiredArray() { @@ -118,7 +118,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @JsonProperty("required_array") public List getRequiredArray() { @@ -145,7 +145,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @JsonProperty("nullable_array_with_default") public JsonNullable> getNullableArrayWithDefault() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java index 8caf4655b01..851016a5e14 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java @@ -45,7 +45,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @JsonProperty("breed") public String getBreed() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java index 3be08d78ba8..da0d39bd35e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -106,7 +106,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { @@ -133,7 +133,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @JsonProperty("array_enum") public List getArrayEnum() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java index cfbc1153b3d..0e9feb3952b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -196,7 +196,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @JsonProperty("enum_string") public EnumStringEnum getEnumString() { @@ -215,7 +215,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { @@ -234,7 +234,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { @@ -253,7 +253,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { @@ -272,7 +272,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java index ad744809f56..ded18d6310c 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java @@ -29,7 +29,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @JsonProperty("sourceURI") public String getSourceURI() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 405b88fee2f..aaff60250ae 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -36,7 +36,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @JsonProperty("file") public File getFile() { @@ -63,7 +63,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @JsonProperty("files") public List getFiles() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java index 13927abf82b..84d3c31b8e8 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -81,7 +81,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @JsonProperty("integer") public Integer getInteger() { @@ -102,7 +102,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @JsonProperty("int32") public Integer getInt32() { @@ -121,7 +121,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @JsonProperty("int64") public Long getInt64() { @@ -142,7 +142,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @JsonProperty("number") public BigDecimal getNumber() { @@ -163,7 +163,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @JsonProperty("float") public Float getFloat() { @@ -184,7 +184,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @JsonProperty("double") public Double getDouble() { @@ -203,7 +203,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @JsonProperty("string") public String getString() { @@ -222,7 +222,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @JsonProperty("byte") public byte[] getByte() { @@ -241,7 +241,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { @@ -260,7 +260,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @JsonProperty("date") public LocalDate getDate() { @@ -279,7 +279,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @JsonProperty("dateTime") public OffsetDateTime getDateTime() { @@ -298,7 +298,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @JsonProperty("uuid") public UUID getUuid() { @@ -317,7 +317,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @JsonProperty("password") public String getPassword() { @@ -336,7 +336,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index f34468008a4..faedabbfa5a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @JsonProperty("bar") public String getBar() { @@ -52,7 +52,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @JsonProperty("foo") public String getFoo() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java index d551b5060ee..f79d3d81aa6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -85,7 +85,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { @@ -112,7 +112,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { @@ -139,7 +139,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @JsonProperty("direct_map") public Map getDirectMap() { @@ -166,7 +166,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @JsonProperty("indirect_map") public Map getIndirectMap() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index fc28471f231..eacc8ce2142 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,7 +41,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @JsonProperty("uuid") public UUID getUuid() { @@ -60,7 +60,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @JsonProperty("dateTime") public OffsetDateTime getDateTime() { @@ -87,7 +87,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @JsonProperty("map") public Map getMap() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java index 8cd0265b9ba..ec8592dac25 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -33,7 +33,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @JsonProperty("name") public Integer getName() { @@ -52,7 +52,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @JsonProperty("class") public String getPropertyClass() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index a48234e8dd1..eeaca7c19e1 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -35,7 +35,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @JsonProperty("code") public Integer getCode() { @@ -54,7 +54,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @JsonProperty("type") public String getType() { @@ -73,7 +73,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @JsonProperty("message") public String getMessage() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java index 5505d4f335d..f6ee1b906d8 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -31,7 +31,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @JsonProperty("123-list") public String get123list() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 419d94aa2ea..5b1ff50871e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -31,7 +31,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @JsonProperty("return") public Integer getReturn() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java index 79a5a0043ef..7262636f1d4 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java @@ -46,7 +46,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public Integer getName() { @@ -65,7 +65,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @JsonProperty("snake_case") public Integer getSnakeCase() { @@ -84,7 +84,7 @@ public class Name { /** * Get property * @return property - */ + */ @JsonProperty("property") public String getProperty() { @@ -103,7 +103,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @JsonProperty("123Number") public Integer get123number() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index b26614f9dff..adb7a60efa5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -43,7 +43,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java index ea187ebfb2f..8c55fc065d6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -30,7 +30,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @JsonProperty("JustNumber") public BigDecimal getJustNumber() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java index 138565a514f..d963ea6786f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java @@ -80,7 +80,7 @@ public class Order { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -99,7 +99,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @JsonProperty("petId") public Long getPetId() { @@ -118,7 +118,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @JsonProperty("quantity") public Integer getQuantity() { @@ -137,7 +137,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @JsonProperty("shipDate") public OffsetDateTime getShipDate() { @@ -156,7 +156,7 @@ public class Order { /** * Order Status * @return status - */ + */ @JsonProperty("status") public StatusEnum getStatus() { @@ -175,7 +175,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @JsonProperty("complete") public Boolean getComplete() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java index cf1bf4b804d..bbc768f5322 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -34,7 +34,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @JsonProperty("my_number") public BigDecimal getMyNumber() { @@ -53,7 +53,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @JsonProperty("my_string") public String getMyString() { @@ -72,7 +72,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @JsonProperty("my_boolean") public Boolean getMyBoolean() { 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 36ccc937fe5..f17b50608c3 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 @@ -80,7 +80,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @JsonProperty("type") public TypeEnum getType() { @@ -99,7 +99,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 5ea277558fb..3f92c520768 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @JsonProperty("category") public Category getCategory() { @@ -138,7 +138,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { @@ -165,7 +165,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @JsonProperty("photoUrls") public Set getPhotoUrls() { @@ -193,7 +193,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @JsonProperty("tags") public List getTags() { @@ -213,7 +213,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @JsonProperty("status") @Deprecated @@ -223,7 +223,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 8f316283d0a..b8ed678673c 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -31,7 +31,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @JsonProperty("bar") public String getBar() { @@ -50,7 +50,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @JsonProperty("baz") public String getBaz() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 4c79802d4d9..a77f9f15311 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -35,7 +35,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @JsonProperty("normalPropertyName") public String getNormalPropertyName() { @@ -54,7 +54,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public String getUPPERCASEPROPERTYSNAKE() { @@ -73,7 +73,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @JsonProperty("lower-case-property-dashes") public String getLowerCasePropertyDashes() { @@ -92,7 +92,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @JsonProperty("property name with spaces") public String getPropertyNameWithSpaces() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index d4e0c4a6c7d..564449f4eaf 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -31,7 +31,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java index 4517c0acd8a..79062fcd813 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java @@ -31,7 +31,7 @@ public class Tag { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -50,7 +50,7 @@ public class Tag { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 997de60552b..7054e21b69e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -57,7 +57,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @JsonProperty("string_item") public String getStringItem() { @@ -76,7 +76,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @JsonProperty("number_item") public BigDecimal getNumberItem() { @@ -95,7 +95,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @JsonProperty("integer_item") public Integer getIntegerItem() { @@ -114,7 +114,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @JsonProperty("bool_item") public Boolean getBoolItem() { @@ -141,7 +141,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @JsonProperty("array_item") public List getArrayItem() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 6c25f8ca0c9..803fd1b52db 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -60,7 +60,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @JsonProperty("string_item") public String getStringItem() { @@ -79,7 +79,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @JsonProperty("number_item") public BigDecimal getNumberItem() { @@ -98,7 +98,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @JsonProperty("float_item") public Float getFloatItem() { @@ -117,7 +117,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @JsonProperty("integer_item") public Integer getIntegerItem() { @@ -136,7 +136,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @JsonProperty("bool_item") public Boolean getBoolItem() { @@ -163,7 +163,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @JsonProperty("array_item") public List getArrayItem() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java index b370f5c7b70..f3130ee9b2e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java @@ -43,7 +43,7 @@ public class User { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -62,7 +62,7 @@ public class User { /** * Get username * @return username - */ + */ @JsonProperty("username") public String getUsername() { @@ -81,7 +81,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @JsonProperty("firstName") public String getFirstName() { @@ -100,7 +100,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @JsonProperty("lastName") public String getLastName() { @@ -119,7 +119,7 @@ public class User { /** * Get email * @return email - */ + */ @JsonProperty("email") public String getEmail() { @@ -138,7 +138,7 @@ public class User { /** * Get password * @return password - */ + */ @JsonProperty("password") public String getPassword() { @@ -157,7 +157,7 @@ public class User { /** * Get phone * @return phone - */ + */ @JsonProperty("phone") public String getPhone() { @@ -176,7 +176,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @JsonProperty("userStatus") public Integer getUserStatus() { diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java index 5af985a3ce7..178ea81b344 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -98,7 +98,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @JsonProperty("attribute_string") public String getAttributeString() { @@ -117,7 +117,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { @@ -136,7 +136,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @JsonProperty("attribute_integer") public Integer getAttributeInteger() { @@ -155,7 +155,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { @@ -182,7 +182,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @JsonProperty("wrapped_array") public List getWrappedArray() { @@ -201,7 +201,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @JsonProperty("name_string") public String getNameString() { @@ -220,7 +220,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @JsonProperty("name_number") public BigDecimal getNameNumber() { @@ -239,7 +239,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @JsonProperty("name_integer") public Integer getNameInteger() { @@ -258,7 +258,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @JsonProperty("name_boolean") public Boolean getNameBoolean() { @@ -285,7 +285,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @JsonProperty("name_array") public List getNameArray() { @@ -312,7 +312,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { @@ -331,7 +331,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @JsonProperty("prefix_string") public String getPrefixString() { @@ -350,7 +350,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { @@ -369,7 +369,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @JsonProperty("prefix_integer") public Integer getPrefixInteger() { @@ -388,7 +388,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { @@ -415,7 +415,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @JsonProperty("prefix_array") public List getPrefixArray() { @@ -442,7 +442,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { @@ -461,7 +461,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @JsonProperty("namespace_string") public String getNamespaceString() { @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { @@ -499,7 +499,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { @@ -518,7 +518,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { @@ -545,7 +545,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @JsonProperty("namespace_array") public List getNamespaceArray() { @@ -572,7 +572,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { @@ -591,7 +591,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @JsonProperty("prefix_ns_string") public String getPrefixNsString() { @@ -610,7 +610,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { @@ -629,7 +629,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { @@ -648,7 +648,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { @@ -675,7 +675,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { @@ -702,7 +702,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 41e5e99a53c..fab01af0900 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyTypeDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index 118d0ccc07b..da8c9bdc60b 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArrayDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 29b522abc28..25b38b9a420 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBooleanDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 9448dcc0127..aa2cb83e255 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapString * @return mapString - */ + */ @JsonProperty("map_string") public Map getMapString() { @@ -101,7 +101,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapNumber * @return mapNumber - */ + */ @JsonProperty("map_number") public Map getMapNumber() { @@ -128,7 +128,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapInteger * @return mapInteger - */ + */ @JsonProperty("map_integer") public Map getMapInteger() { @@ -155,7 +155,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapBoolean * @return mapBoolean - */ + */ @JsonProperty("map_boolean") public Map getMapBoolean() { @@ -182,7 +182,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { @@ -209,7 +209,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { @@ -236,7 +236,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapMapString * @return mapMapString - */ + */ @JsonProperty("map_map_string") public Map> getMapMapString() { @@ -263,7 +263,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { @@ -282,7 +282,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype1 * @return anytype1 - */ + */ @JsonProperty("anytype_1") public Object getAnytype1() { @@ -301,7 +301,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype2 * @return anytype2 - */ + */ @JsonProperty("anytype_2") public JsonNullable getAnytype2() { @@ -320,7 +320,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype3 * @return anytype3 - */ + */ @JsonProperty("anytype_3") public Object getAnytype3() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index 3b3a43e74f6..36b95b7c17c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesIntegerDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index bf3c14ad784..db94de0f2fa 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumberDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index 46b7619321e..80c0d713177 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObjectDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 09fb5ca0411..d2e733ea748 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesStringDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { 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 6b281ab9992..4a849fdaac9 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 @@ -50,7 +50,7 @@ public class AnimalDto { /** * Get className * @return className - */ + */ @NotNull @JsonProperty("className") public String getClassName() { @@ -69,7 +69,7 @@ public class AnimalDto { /** * Get color * @return color - */ + */ @JsonProperty("color") public String getColor() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java index 0420c53a77e..c89f0a8712c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -35,7 +35,7 @@ public class ApiResponseDto { /** * Get code * @return code - */ + */ @JsonProperty("code") public Integer getCode() { @@ -54,7 +54,7 @@ public class ApiResponseDto { /** * Get type * @return type - */ + */ @JsonProperty("type") public String getType() { @@ -73,7 +73,7 @@ public class ApiResponseDto { /** * Get message * @return message - */ + */ @JsonProperty("message") public String getMessage() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index b67b542feea..2c477476085 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnlyDto { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index b1f745593a9..6f5fc362b52 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnlyDto { /** * Get arrayNumber * @return arrayNumber - */ + */ @JsonProperty("ArrayNumber") public List getArrayNumber() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java index 00205288f2c..434fb9d1ad9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -50,7 +50,7 @@ public class ArrayTestDto { /** * Get arrayOfString * @return arrayOfString - */ + */ @JsonProperty("array_of_string") public List getArrayOfString() { @@ -77,7 +77,7 @@ public class ArrayTestDto { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { @@ -104,7 +104,7 @@ public class ArrayTestDto { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { 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 a177673856d..900885ec7d9 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 @@ -80,7 +80,7 @@ public class BigCatDto extends CatDto { /** * Get kind * @return kind - */ + */ @JsonProperty("kind") public KindEnum getKind() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java index 0ed1cbde6c2..3f805533340 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -41,7 +41,7 @@ public class CapitalizationDto { /** * Get smallCamel * @return smallCamel - */ + */ @JsonProperty("smallCamel") public String getSmallCamel() { @@ -60,7 +60,7 @@ public class CapitalizationDto { /** * Get capitalCamel * @return capitalCamel - */ + */ @JsonProperty("CapitalCamel") public String getCapitalCamel() { @@ -79,7 +79,7 @@ public class CapitalizationDto { /** * Get smallSnake * @return smallSnake - */ + */ @JsonProperty("small_Snake") public String getSmallSnake() { @@ -98,7 +98,7 @@ public class CapitalizationDto { /** * Get capitalSnake * @return capitalSnake - */ + */ @JsonProperty("Capital_Snake") public String getCapitalSnake() { @@ -117,7 +117,7 @@ public class CapitalizationDto { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { @@ -136,7 +136,7 @@ public class CapitalizationDto { /** * Name of the pet * @return ATT_NAME - */ + */ @JsonProperty("ATT_NAME") public String getATTNAME() { 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 384aa7450d5..cce95e3d9db 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 @@ -47,7 +47,7 @@ public class CatDto extends AnimalDto { /** * Get declawed * @return declawed - */ + */ @JsonProperty("declawed") public Boolean getDeclawed() { 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 a617ced8cf9..9e3b7c90a45 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 @@ -37,7 +37,7 @@ public class CategoryDto { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -56,7 +56,7 @@ public class CategoryDto { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 52fca4f4592..213368a8a43 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -39,7 +39,7 @@ public class ChildWithNullableDto extends ParentWithNullableDto { /** * Get otherProperty * @return otherProperty - */ + */ @JsonProperty("otherProperty") public String getOtherProperty() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java index 96e6f5bc3fc..aceb3fbb92b 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java @@ -31,7 +31,7 @@ public class ClassModelDto { /** * Get propertyClass * @return propertyClass - */ + */ @JsonProperty("_class") public String getPropertyClass() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java index 819e6e292ae..3fc47b4d865 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java @@ -31,7 +31,7 @@ public class ClientDto { /** * Get client * @return client - */ + */ @JsonProperty("client") public String getClient() { 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 59fab041ed6..7223b0dcade 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 @@ -58,7 +58,7 @@ public class ContainerDefaultValueDto { /** * Get nullableArray * @return nullableArray - */ + */ @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { @@ -85,7 +85,7 @@ public class ContainerDefaultValueDto { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @JsonProperty("nullable_required_array") public JsonNullable> getNullableRequiredArray() { @@ -112,7 +112,7 @@ public class ContainerDefaultValueDto { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @JsonProperty("required_array") public List getRequiredArray() { @@ -139,7 +139,7 @@ public class ContainerDefaultValueDto { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @JsonProperty("nullable_array_with_default") public JsonNullable> getNullableArrayWithDefault() { 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 88a62768f4c..3ee44a5757d 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 @@ -40,7 +40,7 @@ public class DogDto extends AnimalDto { /** * Get breed * @return breed - */ + */ @JsonProperty("breed") public String getBreed() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java index ef98262c149..70f7fb1c192 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -108,7 +108,7 @@ public class EnumArraysDto { /** * Get justSymbol * @return justSymbol - */ + */ @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { @@ -135,7 +135,7 @@ public class EnumArraysDto { /** * Get arrayEnum * @return arrayEnum - */ + */ @JsonProperty("array_enum") public List getArrayEnum() { 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 c048ba67384..6dcbe41ba4a 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 @@ -189,7 +189,7 @@ public class EnumTestDto { /** * Get enumString * @return enumString - */ + */ @JsonProperty("enum_string") public EnumStringEnum getEnumString() { @@ -208,7 +208,7 @@ public class EnumTestDto { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { @@ -227,7 +227,7 @@ public class EnumTestDto { /** * Get enumInteger * @return enumInteger - */ + */ @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { @@ -246,7 +246,7 @@ public class EnumTestDto { /** * Get enumNumber * @return enumNumber - */ + */ @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { @@ -265,7 +265,7 @@ public class EnumTestDto { /** * Get outerEnum * @return outerEnum - */ + */ @JsonProperty("outerEnum") public OuterEnumDto getOuterEnum() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java index de16968492b..65e2ae610f6 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java @@ -31,7 +31,7 @@ public class FileDto { /** * Test capitalization * @return sourceURI - */ + */ @JsonProperty("sourceURI") public String getSourceURI() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index 98bffa625de..05c5df65b1e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -38,7 +38,7 @@ public class FileSchemaTestClassDto { /** * Get file * @return file - */ + */ @JsonProperty("file") public FileDto getFile() { @@ -65,7 +65,7 @@ public class FileSchemaTestClassDto { /** * Get files * @return files - */ + */ @JsonProperty("files") public List getFiles() { 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 7cef7c76cd0..d4d755f1d88 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 @@ -71,7 +71,7 @@ public class FormatTestDto { * minimum: 10 * maximum: 100 * @return integer - */ + */ @JsonProperty("integer") public Integer getInteger() { @@ -92,7 +92,7 @@ public class FormatTestDto { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @JsonProperty("int32") public Integer getInt32() { @@ -111,7 +111,7 @@ public class FormatTestDto { /** * Get int64 * @return int64 - */ + */ @JsonProperty("int64") public Long getInt64() { @@ -132,7 +132,7 @@ public class FormatTestDto { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @JsonProperty("number") public BigDecimal getNumber() { @@ -153,7 +153,7 @@ public class FormatTestDto { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @JsonProperty("float") public Float getFloat() { @@ -174,7 +174,7 @@ public class FormatTestDto { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @JsonProperty("double") public Double getDouble() { @@ -193,7 +193,7 @@ public class FormatTestDto { /** * Get string * @return string - */ + */ @JsonProperty("string") public String getString() { @@ -212,7 +212,7 @@ public class FormatTestDto { /** * Get _byte * @return _byte - */ + */ @NotNull @JsonProperty("byte") public byte[] getByte() { @@ -231,7 +231,7 @@ public class FormatTestDto { /** * Get binary * @return binary - */ + */ @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { @@ -250,7 +250,7 @@ public class FormatTestDto { /** * Get date * @return date - */ + */ @NotNull @JsonProperty("date") public LocalDate getDate() { @@ -269,7 +269,7 @@ public class FormatTestDto { /** * Get dateTime * @return dateTime - */ + */ @JsonProperty("dateTime") public OffsetDateTime getDateTime() { @@ -288,7 +288,7 @@ public class FormatTestDto { /** * Get uuid * @return uuid - */ + */ @JsonProperty("uuid") public UUID getUuid() { @@ -307,7 +307,7 @@ public class FormatTestDto { /** * Get password * @return password - */ + */ @NotNull @JsonProperty("password") public String getPassword() { @@ -326,7 +326,7 @@ public class FormatTestDto { /** * Get bigDecimal * @return bigDecimal - */ + */ @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index 23412547d56..616579f20b1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -33,7 +33,7 @@ public class HasOnlyReadOnlyDto { /** * Get bar * @return bar - */ + */ @JsonProperty("bar") public String getBar() { @@ -52,7 +52,7 @@ public class HasOnlyReadOnlyDto { /** * Get foo * @return foo - */ + */ @JsonProperty("foo") public String getFoo() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java index 3d009155cdd..24e8a3e9509 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java @@ -31,7 +31,7 @@ public class ListDto { /** * Get _123list * @return _123list - */ + */ @JsonProperty("123-list") public String get123list() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java index d6f6941af6a..36191a8b8bd 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java @@ -87,7 +87,7 @@ public class MapTestDto { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { @@ -114,7 +114,7 @@ public class MapTestDto { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { @@ -141,7 +141,7 @@ public class MapTestDto { /** * Get directMap * @return directMap - */ + */ @JsonProperty("direct_map") public Map getDirectMap() { @@ -168,7 +168,7 @@ public class MapTestDto { /** * Get indirectMap * @return indirectMap - */ + */ @JsonProperty("indirect_map") public Map getIndirectMap() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 910d18d8be7..81e32b0a0ab 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get uuid * @return uuid - */ + */ @JsonProperty("uuid") public UUID getUuid() { @@ -62,7 +62,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get dateTime * @return dateTime - */ + */ @JsonProperty("dateTime") public OffsetDateTime getDateTime() { @@ -89,7 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get map * @return map - */ + */ @JsonProperty("map") public Map getMap() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java index 8cca10bc0b0..ad4b04b6729 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -33,7 +33,7 @@ public class Model200ResponseDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public Integer getName() { @@ -52,7 +52,7 @@ public class Model200ResponseDto { /** * Get propertyClass * @return propertyClass - */ + */ @JsonProperty("class") public String getPropertyClass() { 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 5771894fdad..0556eb7b3be 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 @@ -41,7 +41,7 @@ public class NameDto { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public Integer getName() { @@ -60,7 +60,7 @@ public class NameDto { /** * Get snakeCase * @return snakeCase - */ + */ @JsonProperty("snake_case") public Integer getSnakeCase() { @@ -79,7 +79,7 @@ public class NameDto { /** * Get property * @return property - */ + */ @JsonProperty("property") public String getProperty() { @@ -98,7 +98,7 @@ public class NameDto { /** * Get _123number * @return _123number - */ + */ @JsonProperty("123Number") public Integer get123number() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index d6cb68d732d..cf06ffb13ba 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -45,7 +45,7 @@ public class NullableMapPropertyDto { /** * Get languageValues * @return languageValues - */ + */ @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java index 8d793c3c05c..6b15ee291f1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -32,7 +32,7 @@ public class NumberOnlyDto { /** * Get justNumber * @return justNumber - */ + */ @JsonProperty("JustNumber") public BigDecimal getJustNumber() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java index 1c7cce759c8..5fa7d84a1da 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java @@ -82,7 +82,7 @@ public class OrderDto { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -101,7 +101,7 @@ public class OrderDto { /** * Get petId * @return petId - */ + */ @JsonProperty("petId") public Long getPetId() { @@ -120,7 +120,7 @@ public class OrderDto { /** * Get quantity * @return quantity - */ + */ @JsonProperty("quantity") public Integer getQuantity() { @@ -139,7 +139,7 @@ public class OrderDto { /** * Get shipDate * @return shipDate - */ + */ @JsonProperty("shipDate") public OffsetDateTime getShipDate() { @@ -158,7 +158,7 @@ public class OrderDto { /** * Order Status * @return status - */ + */ @JsonProperty("status") public StatusEnum getStatus() { @@ -177,7 +177,7 @@ public class OrderDto { /** * Get complete * @return complete - */ + */ @JsonProperty("complete") public Boolean getComplete() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java index 9b96761112d..9bb6c4e714f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -36,7 +36,7 @@ public class OuterCompositeDto { /** * Get myNumber * @return myNumber - */ + */ @JsonProperty("my_number") public BigDecimal getMyNumber() { @@ -55,7 +55,7 @@ public class OuterCompositeDto { /** * Get myString * @return myString - */ + */ @JsonProperty("my_string") public String getMyString() { @@ -74,7 +74,7 @@ public class OuterCompositeDto { /** * Get myBoolean * @return myBoolean - */ + */ @JsonProperty("my_boolean") public Boolean getMyBoolean() { 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 b255f28b18e..bc2f12fa633 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 @@ -81,7 +81,7 @@ public class ParentWithNullableDto { /** * Get type * @return type - */ + */ @JsonProperty("type") public TypeEnum getType() { @@ -100,7 +100,7 @@ public class ParentWithNullableDto { /** * Get nullableProperty * @return nullableProperty - */ + */ @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { 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 0706d7a2748..c3c8432e920 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 @@ -94,7 +94,7 @@ public class PetDto { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -113,7 +113,7 @@ public class PetDto { /** * Get category * @return category - */ + */ @JsonProperty("category") public CategoryDto getCategory() { @@ -132,7 +132,7 @@ public class PetDto { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { @@ -159,7 +159,7 @@ public class PetDto { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @JsonProperty("photoUrls") public Set getPhotoUrls() { @@ -187,7 +187,7 @@ public class PetDto { /** * Get tags * @return tags - */ + */ @JsonProperty("tags") public List getTags() { @@ -207,7 +207,7 @@ public class PetDto { * pet status in the store * @return status * @deprecated - */ + */ @JsonProperty("status") @Deprecated @@ -217,7 +217,7 @@ public class PetDto { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index dab6dc54a9a..557ebcc3f73 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -33,7 +33,7 @@ public class ReadOnlyFirstDto { /** * Get bar * @return bar - */ + */ @JsonProperty("bar") public String getBar() { @@ -52,7 +52,7 @@ public class ReadOnlyFirstDto { /** * Get baz * @return baz - */ + */ @JsonProperty("baz") public String getBaz() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index 204e88e8435..865fa8428b3 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @JsonProperty("normalPropertyName") public String getNormalPropertyName() { @@ -56,7 +56,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public String getUPPERCASEPROPERTYSNAKE() { @@ -75,7 +75,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @JsonProperty("lower-case-property-dashes") public String getLowerCasePropertyDashes() { @@ -94,7 +94,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @JsonProperty("property name with spaces") public String getPropertyNameWithSpaces() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java index c65497937f6..c029fc4f615 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java @@ -31,7 +31,7 @@ public class ReturnDto { /** * Get _return * @return _return - */ + */ @JsonProperty("return") public Integer getReturn() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java index f554780dae1..c497781b8ba 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -31,7 +31,7 @@ public class SpecialModelNameDto { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java index c6fe079f86f..0542665de02 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java @@ -33,7 +33,7 @@ public class TagDto { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -52,7 +52,7 @@ public class TagDto { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { 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 ffea7b9edae..b95143bd158 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 @@ -48,7 +48,7 @@ public class TypeHolderDefaultDto { /** * Get stringItem * @return stringItem - */ + */ @NotNull @JsonProperty("string_item") public String getStringItem() { @@ -67,7 +67,7 @@ public class TypeHolderDefaultDto { /** * Get numberItem * @return numberItem - */ + */ @NotNull @JsonProperty("number_item") public BigDecimal getNumberItem() { @@ -86,7 +86,7 @@ public class TypeHolderDefaultDto { /** * Get integerItem * @return integerItem - */ + */ @NotNull @JsonProperty("integer_item") public Integer getIntegerItem() { @@ -105,7 +105,7 @@ public class TypeHolderDefaultDto { /** * Get boolItem * @return boolItem - */ + */ @NotNull @JsonProperty("bool_item") public Boolean getBoolItem() { @@ -132,7 +132,7 @@ public class TypeHolderDefaultDto { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @JsonProperty("array_item") public List getArrayItem() { 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 8426a0a632f..41e2e8ebd49 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 @@ -50,7 +50,7 @@ public class TypeHolderExampleDto { /** * Get stringItem * @return stringItem - */ + */ @NotNull @JsonProperty("string_item") public String getStringItem() { @@ -69,7 +69,7 @@ public class TypeHolderExampleDto { /** * Get numberItem * @return numberItem - */ + */ @NotNull @JsonProperty("number_item") public BigDecimal getNumberItem() { @@ -88,7 +88,7 @@ public class TypeHolderExampleDto { /** * Get floatItem * @return floatItem - */ + */ @NotNull @JsonProperty("float_item") public Float getFloatItem() { @@ -107,7 +107,7 @@ public class TypeHolderExampleDto { /** * Get integerItem * @return integerItem - */ + */ @NotNull @JsonProperty("integer_item") public Integer getIntegerItem() { @@ -126,7 +126,7 @@ public class TypeHolderExampleDto { /** * Get boolItem * @return boolItem - */ + */ @NotNull @JsonProperty("bool_item") public Boolean getBoolItem() { @@ -153,7 +153,7 @@ public class TypeHolderExampleDto { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @JsonProperty("array_item") public List getArrayItem() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java index 864560f83f5..4e5020ce24e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java @@ -45,7 +45,7 @@ public class UserDto { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -64,7 +64,7 @@ public class UserDto { /** * Get username * @return username - */ + */ @JsonProperty("username") public String getUsername() { @@ -83,7 +83,7 @@ public class UserDto { /** * Get firstName * @return firstName - */ + */ @JsonProperty("firstName") public String getFirstName() { @@ -102,7 +102,7 @@ public class UserDto { /** * Get lastName * @return lastName - */ + */ @JsonProperty("lastName") public String getLastName() { @@ -121,7 +121,7 @@ public class UserDto { /** * Get email * @return email - */ + */ @JsonProperty("email") public String getEmail() { @@ -140,7 +140,7 @@ public class UserDto { /** * Get password * @return password - */ + */ @JsonProperty("password") public String getPassword() { @@ -159,7 +159,7 @@ public class UserDto { /** * Get phone * @return phone - */ + */ @JsonProperty("phone") public String getPhone() { @@ -178,7 +178,7 @@ public class UserDto { /** * User Status * @return userStatus - */ + */ @JsonProperty("userStatus") public Integer getUserStatus() { diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java index 7bd63740106..8f82059fc2a 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java @@ -100,7 +100,7 @@ public class XmlItemDto { /** * Get attributeString * @return attributeString - */ + */ @JsonProperty("attribute_string") public String getAttributeString() { @@ -119,7 +119,7 @@ public class XmlItemDto { /** * Get attributeNumber * @return attributeNumber - */ + */ @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { @@ -138,7 +138,7 @@ public class XmlItemDto { /** * Get attributeInteger * @return attributeInteger - */ + */ @JsonProperty("attribute_integer") public Integer getAttributeInteger() { @@ -157,7 +157,7 @@ public class XmlItemDto { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { @@ -184,7 +184,7 @@ public class XmlItemDto { /** * Get wrappedArray * @return wrappedArray - */ + */ @JsonProperty("wrapped_array") public List getWrappedArray() { @@ -203,7 +203,7 @@ public class XmlItemDto { /** * Get nameString * @return nameString - */ + */ @JsonProperty("name_string") public String getNameString() { @@ -222,7 +222,7 @@ public class XmlItemDto { /** * Get nameNumber * @return nameNumber - */ + */ @JsonProperty("name_number") public BigDecimal getNameNumber() { @@ -241,7 +241,7 @@ public class XmlItemDto { /** * Get nameInteger * @return nameInteger - */ + */ @JsonProperty("name_integer") public Integer getNameInteger() { @@ -260,7 +260,7 @@ public class XmlItemDto { /** * Get nameBoolean * @return nameBoolean - */ + */ @JsonProperty("name_boolean") public Boolean getNameBoolean() { @@ -287,7 +287,7 @@ public class XmlItemDto { /** * Get nameArray * @return nameArray - */ + */ @JsonProperty("name_array") public List getNameArray() { @@ -314,7 +314,7 @@ public class XmlItemDto { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { @@ -333,7 +333,7 @@ public class XmlItemDto { /** * Get prefixString * @return prefixString - */ + */ @JsonProperty("prefix_string") public String getPrefixString() { @@ -352,7 +352,7 @@ public class XmlItemDto { /** * Get prefixNumber * @return prefixNumber - */ + */ @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { @@ -371,7 +371,7 @@ public class XmlItemDto { /** * Get prefixInteger * @return prefixInteger - */ + */ @JsonProperty("prefix_integer") public Integer getPrefixInteger() { @@ -390,7 +390,7 @@ public class XmlItemDto { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { @@ -417,7 +417,7 @@ public class XmlItemDto { /** * Get prefixArray * @return prefixArray - */ + */ @JsonProperty("prefix_array") public List getPrefixArray() { @@ -444,7 +444,7 @@ public class XmlItemDto { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { @@ -463,7 +463,7 @@ public class XmlItemDto { /** * Get namespaceString * @return namespaceString - */ + */ @JsonProperty("namespace_string") public String getNamespaceString() { @@ -482,7 +482,7 @@ public class XmlItemDto { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { @@ -501,7 +501,7 @@ public class XmlItemDto { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { @@ -520,7 +520,7 @@ public class XmlItemDto { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { @@ -547,7 +547,7 @@ public class XmlItemDto { /** * Get namespaceArray * @return namespaceArray - */ + */ @JsonProperty("namespace_array") public List getNamespaceArray() { @@ -574,7 +574,7 @@ public class XmlItemDto { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { @@ -593,7 +593,7 @@ public class XmlItemDto { /** * Get prefixNsString * @return prefixNsString - */ + */ @JsonProperty("prefix_ns_string") public String getPrefixNsString() { @@ -612,7 +612,7 @@ public class XmlItemDto { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { @@ -631,7 +631,7 @@ public class XmlItemDto { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { @@ -650,7 +650,7 @@ public class XmlItemDto { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { @@ -677,7 +677,7 @@ public class XmlItemDto { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { @@ -704,7 +704,7 @@ public class XmlItemDto { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift index 952c7313304..94a82a25ec6 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift @@ -53,9 +53,9 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/pet" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/pet" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -107,10 +107,10 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/pet/{petId}" - path = path.replacingOccurrences(of: "{petId}", with: "\(petId)") - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/pet/{petId}" + localVarPath = localVarPath.replacingOccurrences(of: "{petId}", with: "\(petId)") + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -170,9 +170,9 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/pet/findByStatus" - let url = baseURL.appendingPathComponent(path) - var components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/pet/findByStatus" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + var components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) var queryItems: [URLQueryItem] = [] queryItems.append(URLQueryItem(name: "status", value: status.map { $0.rawValue }.joined(separator: ","))) components?.queryItems = queryItems @@ -225,9 +225,9 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/pet/findByTags" - let url = baseURL.appendingPathComponent(path) - var components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/pet/findByTags" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + var components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) var queryItems: [URLQueryItem] = [] queryItems.append(URLQueryItem(name: "tags", value: tags.joined(separator: ","))) components?.queryItems = queryItems @@ -283,10 +283,10 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/pet/{petId}" - path = path.replacingOccurrences(of: "{petId}", with: "\(petId)") - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/pet/{petId}" + localVarPath = localVarPath.replacingOccurrences(of: "{petId}", with: "\(petId)") + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -349,9 +349,9 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/pet" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/pet" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -410,10 +410,10 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/pet/{petId}" - path = path.replacingOccurrences(of: "{petId}", with: "\(petId)") - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/pet/{petId}" + localVarPath = localVarPath.replacingOccurrences(of: "{petId}", with: "\(petId)") + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -458,10 +458,10 @@ open class PetAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/pet/{petId}/uploadImage" - path = path.replacingOccurrences(of: "{petId}", with: "\(petId)") - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/pet/{petId}/uploadImage" + localVarPath = localVarPath.replacingOccurrences(of: "{petId}", with: "\(petId)") + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift index ffd6596b147..e0bd1eb56eb 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift @@ -54,10 +54,10 @@ open class StoreAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: orderId) - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/store/order/{orderId}" + localVarPath = localVarPath.replacingOccurrences(of: "{orderId}", with: orderId) + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -97,9 +97,9 @@ open class StoreAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/store/inventory" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/store/inventory" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -143,10 +143,10 @@ open class StoreAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/store/order/{orderId}" - path = path.replacingOccurrences(of: "{orderId}", with: "\(orderId)") - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/store/order/{orderId}" + localVarPath = localVarPath.replacingOccurrences(of: "{orderId}", with: "\(orderId)") + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -195,9 +195,9 @@ open class StoreAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/store/order" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/store/order" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift index f2e7504053c..cd0e6b0611f 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift @@ -42,9 +42,9 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/user" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/user" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -78,9 +78,9 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/user/createWithArray" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/user/createWithArray" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -114,9 +114,9 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/user/createWithList" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/user/createWithList" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -165,10 +165,10 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/user/{username}" - path = path.replacingOccurrences(of: "{username}", with: username) - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/user/{username}" + localVarPath = localVarPath.replacingOccurrences(of: "{username}", with: username) + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -221,10 +221,10 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/user/{username}" - path = path.replacingOccurrences(of: "{username}", with: username) - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/user/{username}" + localVarPath = localVarPath.replacingOccurrences(of: "{username}", with: username) + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -275,9 +275,9 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/user/login" - let url = baseURL.appendingPathComponent(path) - var components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/user/login" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + var components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) var queryItems: [URLQueryItem] = [] queryItems.append(URLQueryItem(name: "username", value: username)) queryItems.append(URLQueryItem(name: "password", value: password)) @@ -318,9 +318,9 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - let path = "/user/logout" - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + let localVarPath = "/user/logout" + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } @@ -368,10 +368,10 @@ open class UserAPI { guard let baseURL = self.transport.baseURL ?? self.baseURL else { throw OpenAPITransportError.badURLError() } - var path = "/user/{username}" - path = path.replacingOccurrences(of: "{username}", with: username) - let url = baseURL.appendingPathComponent(path) - let components = URLComponents(url: url, resolvingAgainstBaseURL: false) + var localVarPath = "/user/{username}" + localVarPath = localVarPath.replacingOccurrences(of: "{username}", with: username) + let localVarURL = baseURL.appendingPathComponent(localVarPath) + let components = URLComponents(url: localVarURL, resolvingAgainstBaseURL: false) guard let requestURL = components?.url else { throw OpenAPITransportError.badURLError() } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/OpenAPIDateWithoutTime.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/OpenAPIDateWithoutTime.swift index 3cbc5a18912..57f3ecca372 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/OpenAPIDateWithoutTime.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/OpenAPIDateWithoutTime.swift @@ -81,3 +81,18 @@ extension OpenAPIDateWithoutTime: JSONEncodable { return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate()) } } + +extension OpenAPIDateWithoutTime: RawRepresentable { + public typealias RawValue = String + public init?(rawValue: String) { + if let date = OpenISO8601DateFormatter.withoutTime.date(from: rawValue) { + self.init(wrappedDate: date) + } else { + return nil + } + } + + public var rawValue: String { + OpenISO8601DateFormatter.withoutTime.string(from: normalizedWrappedDate()) + } +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index abd848e5836..394619c072c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -17,6 +17,7 @@ public struct Pet: Codable, JSONEncodable, Hashable { case pending = "pending" case sold = "sold" } + static let photoUrlsRule = ArrayRule(minItems: nil, maxItems: nil, uniqueItems: true) public var id: Int64? public var category: Category? public var name: String diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 0859be7e994..cf437d75dec 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ internal struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Validation.swift index 912ba84c909..ced1069dd45 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ internal struct NumericRule { internal var multipleOf: T? } +internal struct ArrayRule { + internal var minItems: Int? + internal var maxItems: Int? + internal var uniqueItems: Bool +} + internal enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ internal enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +internal enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + internal struct ValidationError: Error { internal fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ internal struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + internal static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift index a58981710b1..5eb857cb6a9 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift @@ -13,14 +13,18 @@ import AnyCodable public struct Banana: Codable, JSONEncodable, Hashable { static let countRule = NumericRule(minimum: 10, exclusiveMinimum: true, maximum: 100, exclusiveMaximum: true, multipleOf: 5) + static let idsRule = ArrayRule(minItems: 1, maxItems: 10, uniqueItems: false) public var count: Int? + public var ids: [Int]? - public init(count: Int? = nil) { + public init(count: Int? = nil, ids: [Int]? = nil) { self.count = count + self.ids = ids } public enum CodingKeys: String, CodingKey, CaseIterable { case count + case ids } // Encodable protocol methods @@ -28,6 +32,7 @@ public struct Banana: Codable, JSONEncodable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(count, forKey: .count) + try container.encodeIfPresent(ids, forKey: .ids) } } diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/validation/docs/Banana.md b/samples/client/petstore/swift5/validation/docs/Banana.md index 3c90b8d7d98..56da27c9049 100644 --- a/samples/client/petstore/swift5/validation/docs/Banana.md +++ b/samples/client/petstore/swift5/validation/docs/Banana.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **count** | **Int** | | [optional] +**ids** | **[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/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift index 90481c91ece..73c5b9d0b65 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -18,6 +18,7 @@ public final class Pet: Content, Hashable { case pending = "pending" case sold = "sold" } + static let photoUrlsRule = ArrayRule(minItems: nil, maxItems: nil, uniqueItems: true) public var id: Int64? public var category: Category? public var name: String diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 6dd1b44cb36..7c975bb6c9b 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -61,6 +61,8 @@ public struct APIHelper { return collection .compactMap { value in convertAnyToString(value) } .joined(separator: ",") + } else if let value = source as? any RawRepresentable { + return "\(value.rawValue)" } return source } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Validation.swift index b520bd7e5a7..6a0d4c9da1a 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -20,6 +20,12 @@ public struct NumericRule { public var multipleOf: T? } +public struct ArrayRule { + public var minItems: Int? + public var maxItems: Int? + public var uniqueItems: Bool +} + public enum StringValidationErrorKind: Error { case minLength, maxLength, pattern } @@ -28,6 +34,10 @@ public enum NumericValidationErrorKind: Error { case minimum, maximum, multipleOf } +public enum ArrayValidationErrorKind: Error { + case minItems, maxItems, uniqueItems +} + public struct ValidationError: Error { public fileprivate(set) var kinds: Set } @@ -123,4 +133,29 @@ public struct Validator { } return numeric } + + /// Validate a array against a rule. + /// - Parameter array: The Array you wish to validate. + /// - Parameter rule: The ArrayRule you wish to use for validation. + /// - Returns: A validated array. + /// - Throws: `ValidationError` if the string is invalid against the rule. + public static func validate(_ array: Array, against rule: ArrayRule) throws -> Array { + var error = ValidationError(kinds: []) + if let minItems = rule.minItems, !(minItems <= array.count) { + error.kinds.insert(.minItems) + } + if let maxItems = rule.maxItems, !(array.count <= maxItems) { + error.kinds.insert(.maxItems) + } + if rule.uniqueItems { + let unique = Set(array) + if unique.count != array.count { + error.kinds.insert(.uniqueItems) + } + } + guard error.kinds.isEmpty else { + throw error + } + return array + } } diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.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/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 00000000000..6e213a61aa6 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +param.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md new file mode 100644 index 00000000000..de16f95a8bd --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/README.md @@ -0,0 +1,226 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api.module.ts new file mode 100644 index 00000000000..58d341fbd2e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 00000000000..f4659b9300a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,783 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiResponse } from '../model/apiResponse'; +// @ts-ignore +import { Pet } from '../model/pet'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @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. + */ + public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @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. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * 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 + * @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. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...status].join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByStatus`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * 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 + * @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. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + [...tags].join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/findByTags`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @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. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @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. + */ + public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: pet, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @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. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @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. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 00000000000..043bb8efa12 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,369 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { Order } from '../model/order'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * 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 + * @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. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @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. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/inventory`; + return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * 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 + * @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. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @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. + */ + public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/store/order`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: order, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 00000000000..2f3945435db --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,708 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @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. + */ + public createUser(user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUser(user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @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. + */ + public createUsersWithArrayInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithArrayInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithArrayInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithArray`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @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. + */ + public createUsersWithListInput(user: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public createUsersWithListInput(user: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public createUsersWithListInput(user: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/createWithList`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @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. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @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. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @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. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/login`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * + * @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. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/logout`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @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. + */ + public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUser(username: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts new file mode 100644 index 00000000000..4ad26d0bdcb --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,186 @@ +import { HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; + } + else { + this.encodeParam = param => this.defaultEncodeParam(param); + } + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/encoder.ts new file mode 100644 index 00000000000..138c4d5cf2c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/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/typescript-angular-v18-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/index.ts new file mode 100644 index 00000000000..104dd3d21e3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/index.ts @@ -0,0 +1,6 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './param'; diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts new file mode 100644 index 00000000000..a29bebe4906 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * 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. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 00000000000..c6c02b01f16 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,40 @@ +/** + * 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. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + * @deprecated + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * 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. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/param.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/param.ts new file mode 100644 index 00000000000..78a2d20a643 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts index d759ff39906..1941b1646e7 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts @@ -343,7 +343,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - filePost(filePostRequest?: FilePostRequest, options?: any): AxiosPromise { + filePost(filePostRequest?: FilePostRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.filePost(filePostRequest, options).then((request) => request(axios, basePath)); }, /** @@ -352,7 +352,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest | null, options?: any): AxiosPromise { + petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest | null, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.petsFilteredPatch(petsFilteredPatchRequest, options).then((request) => request(axios, basePath)); }, /** @@ -361,7 +361,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - petsPatch(petsPatchRequest?: PetsPatchRequest | null, options?: any): AxiosPromise { + petsPatch(petsPatchRequest?: PetsPatchRequest | null, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.petsPatch(petsPatchRequest, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 0d32b2e8da0..df0c45abc78 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -736,7 +736,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -747,7 +747,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -757,7 +757,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -768,7 +768,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -778,7 +778,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -788,7 +788,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -800,7 +800,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -812,7 +812,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1160,7 +1160,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1169,7 +1169,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1179,7 +1179,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1189,7 +1189,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1680,7 +1680,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1690,7 +1690,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1700,7 +1700,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1710,7 +1710,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1720,7 +1720,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1731,7 +1731,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1740,7 +1740,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1751,7 +1751,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index 0d32b2e8da0..df0c45abc78 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -736,7 +736,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -747,7 +747,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -757,7 +757,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -768,7 +768,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -778,7 +778,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -788,7 +788,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -800,7 +800,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -812,7 +812,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1160,7 +1160,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1169,7 +1169,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1179,7 +1179,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1189,7 +1189,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1680,7 +1680,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1690,7 +1690,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1700,7 +1700,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1710,7 +1710,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1720,7 +1720,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1731,7 +1731,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1740,7 +1740,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1751,7 +1751,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts index 2d63feaab3a..9e6fbd62d62 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -910,6 +910,46 @@ export interface List { */ export type Mammal = Pig | Whale | Zebra; +/** + * + * @export + * @interface MammalAnyof + */ +export interface MammalAnyof { + /** + * + * @type {boolean} + * @memberof MammalAnyof + */ + 'hasBaleen'?: boolean; + /** + * + * @type {boolean} + * @memberof MammalAnyof + */ + 'hasTeeth'?: boolean; + /** + * + * @type {string} + * @memberof MammalAnyof + */ + 'className': string; + /** + * + * @type {string} + * @memberof MammalAnyof + */ + 'type'?: MammalAnyofTypeEnum; +} + +export const MammalAnyofTypeEnum = { + Plains: 'plains', + Mountain: 'mountain', + Grevys: 'grevys' +} as const; + +export type MammalAnyofTypeEnum = typeof MammalAnyofTypeEnum[keyof typeof MammalAnyofTypeEnum]; + /** * * @export @@ -1089,16 +1129,16 @@ export interface NullableClass { 'array_nullable_prop'?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - 'array_and_items_nullable_prop'?: Array | null; + 'array_and_items_nullable_prop'?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - 'array_items_nullable'?: Array; + 'array_items_nullable'?: Array; /** * * @type {{ [key: string]: object; }} @@ -1778,7 +1818,7 @@ export const AnotherFakeApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - _123testSpecialTags(client: Client, options?: any): AxiosPromise { + _123testSpecialTags(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp._123testSpecialTags(client, options).then((request) => request(axios, basePath)); }, }; @@ -1877,7 +1917,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fooGet(options?: any): AxiosPromise { + fooGet(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fooGet(options).then((request) => request(axios, basePath)); }, }; @@ -3064,7 +3104,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeHealthGet(options?: any): AxiosPromise { + fakeHealthGet(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeHealthGet(options).then((request) => request(axios, basePath)); }, /** @@ -3073,7 +3113,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterBooleanSerialize(body?: boolean, options?: any): AxiosPromise { + fakeOuterBooleanSerialize(body?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterBooleanSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -3082,7 +3122,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterCompositeSerialize(outerComposite?: OuterComposite, options?: any): AxiosPromise { + fakeOuterCompositeSerialize(outerComposite?: OuterComposite, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterCompositeSerialize(outerComposite, options).then((request) => request(axios, basePath)); }, /** @@ -3091,7 +3131,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterNumberSerialize(body?: number, options?: any): AxiosPromise { + fakeOuterNumberSerialize(body?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterNumberSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -3100,7 +3140,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterStringSerialize(body?: string, options?: any): AxiosPromise { + fakeOuterStringSerialize(body?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterStringSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -3109,7 +3149,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getArrayOfEnums(options?: any): AxiosPromise> { + getArrayOfEnums(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getArrayOfEnums(options).then((request) => request(axios, basePath)); }, /** @@ -3119,7 +3159,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - postArrayOfString(requestBody?: Array, options?: any): AxiosPromise { + postArrayOfString(requestBody?: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.postArrayOfString(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -3129,7 +3169,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: any): AxiosPromise { + testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAdditionalPropertiesReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -3138,7 +3178,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, options?: any): AxiosPromise { + testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyWithFileSchema(fileSchemaTestClass, options).then((request) => request(axios, basePath)); }, /** @@ -3148,7 +3188,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyWithQueryParams(query: string, user: User, options?: any): AxiosPromise { + testBodyWithQueryParams(query: string, user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyWithQueryParams(query, user, options).then((request) => request(axios, basePath)); }, /** @@ -3158,7 +3198,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testClientModel(client: Client, options?: any): AxiosPromise { + testClientModel(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testClientModel(client, options).then((request) => request(axios, basePath)); }, /** @@ -3181,7 +3221,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: File, date?: string, dateTime?: string, password?: string, callback?: string, options?: any): AxiosPromise { + testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: File, date?: string, dateTime?: string, password?: string, callback?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, options).then((request) => request(axios, basePath)); }, /** @@ -3198,7 +3238,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEnumParameters(enumHeaderStringArray?: Array, enumHeaderString?: TestEnumParametersEnumHeaderStringEnum, enumQueryStringArray?: Array, enumQueryString?: TestEnumParametersEnumQueryStringEnum, enumQueryInteger?: TestEnumParametersEnumQueryIntegerEnum, enumQueryDouble?: TestEnumParametersEnumQueryDoubleEnum, enumFormStringArray?: Array, enumFormString?: TestEnumParametersEnumFormStringEnum, options?: any): AxiosPromise { + testEnumParameters(enumHeaderStringArray?: Array, enumHeaderString?: TestEnumParametersEnumHeaderStringEnum, enumQueryStringArray?: Array, enumQueryString?: TestEnumParametersEnumQueryStringEnum, enumQueryInteger?: TestEnumParametersEnumQueryIntegerEnum, enumQueryDouble?: TestEnumParametersEnumQueryDoubleEnum, enumFormStringArray?: Array, enumFormString?: TestEnumParametersEnumFormStringEnum, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, options).then((request) => request(axios, basePath)); }, /** @@ -3213,7 +3253,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, options?: any): AxiosPromise { + testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, options).then((request) => request(axios, basePath)); }, /** @@ -3223,7 +3263,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -3233,7 +3273,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: any): AxiosPromise { + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(axios, basePath)); }, /** @@ -3244,7 +3284,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testJsonFormData(param: string, param2: string, options?: any): AxiosPromise { + testJsonFormData(param: string, param2: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testJsonFormData(param, param2, options).then((request) => request(axios, basePath)); }, /** @@ -3257,7 +3297,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: any): AxiosPromise { + testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(axios, basePath)); }, /** @@ -3267,7 +3307,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); }, }; @@ -3685,7 +3725,7 @@ export const FakeClassnameTags123ApiFactory = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testClassname(client: Client, options?: any): AxiosPromise { + testClassname(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testClassname(client, options).then((request) => request(axios, basePath)); }, }; @@ -4280,7 +4320,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(pet: Pet, options?: any): AxiosPromise { + addPet(pet: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -4291,7 +4331,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -4301,7 +4341,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -4312,7 +4352,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -4322,7 +4362,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -4332,7 +4372,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(pet: Pet, options?: any): AxiosPromise { + updatePet(pet: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -4344,7 +4384,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -4356,7 +4396,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, /** @@ -4368,7 +4408,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFileWithRequiredFile(petId: number, requiredFile: File, additionalMetadata?: string, options?: any): AxiosPromise { + uploadFileWithRequiredFile(petId: number, requiredFile: File, additionalMetadata?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, options).then((request) => request(axios, basePath)); }, }; @@ -4730,7 +4770,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -4739,7 +4779,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -4749,7 +4789,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -4759,7 +4799,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(order: Order, options?: any): AxiosPromise { + placeOrder(order: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(order, options).then((request) => request(axios, basePath)); }, }; @@ -5250,7 +5290,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(user: User, options?: any): AxiosPromise { + createUser(user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(user, options).then((request) => request(axios, basePath)); }, /** @@ -5260,7 +5300,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(user: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -5270,7 +5310,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(user: Array, options?: any): AxiosPromise { + createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -5280,7 +5320,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -5290,7 +5330,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -5301,7 +5341,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -5310,7 +5350,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -5321,7 +5361,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, user: User, options?: any): AxiosPromise { + updateUser(username: string, user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, user, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 1ac8fc7796f..a373dc21fe5 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -776,7 +776,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(pet: Pet, header1?: Pet, header2?: Array, accept?: MediaType, options?: any): AxiosPromise { + addPet(pet: Pet, header1?: Pet, header2?: Array, accept?: MediaType, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(pet, header1, header2, accept, options).then((request) => request(axios, basePath)); }, /** @@ -787,7 +787,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -797,7 +797,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -808,7 +808,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -818,7 +818,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -828,7 +828,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(pet: Pet, options?: any): AxiosPromise { + updatePet(pet: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -840,7 +840,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -852,7 +852,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1203,7 +1203,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1212,7 +1212,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1222,7 +1222,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1232,7 +1232,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(order: Order, options?: any): AxiosPromise { + placeOrder(order: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(order, options).then((request) => request(axios, basePath)); }, }; @@ -1723,7 +1723,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(user: User, options?: any): AxiosPromise { + createUser(user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(user, options).then((request) => request(axios, basePath)); }, /** @@ -1733,7 +1733,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(user: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -1743,7 +1743,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(user: Array, options?: any): AxiosPromise { + createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -1753,7 +1753,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1763,7 +1763,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1774,7 +1774,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1783,7 +1783,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1794,7 +1794,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, user: User, options?: any): AxiosPromise { + updateUser(username: string, user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, user, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts index c0f214239f1..84e27a4c705 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts @@ -857,16 +857,16 @@ export interface NullableClass { 'array_nullable_prop'?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - 'array_and_items_nullable_prop'?: Array | null; + 'array_and_items_nullable_prop'?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - 'array_items_nullable'?: Array; + 'array_items_nullable'?: Array; /** * * @type {{ [key: string]: object; }} @@ -1432,7 +1432,7 @@ export const AnotherFakeApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - _123testSpecialTags(client: Client, options?: any): AxiosPromise { + _123testSpecialTags(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp._123testSpecialTags(client, options).then((request) => request(axios, basePath)); }, }; @@ -1531,7 +1531,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fooGet(options?: any): AxiosPromise { + fooGet(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fooGet(options).then((request) => request(axios, basePath)); }, }; @@ -2686,7 +2686,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeHealthGet(options?: any): AxiosPromise { + fakeHealthGet(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeHealthGet(options).then((request) => request(axios, basePath)); }, /** @@ -2695,7 +2695,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterBooleanSerialize(body?: boolean, options?: any): AxiosPromise { + fakeOuterBooleanSerialize(body?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterBooleanSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -2704,7 +2704,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterCompositeSerialize(outerComposite?: OuterComposite, options?: any): AxiosPromise { + fakeOuterCompositeSerialize(outerComposite?: OuterComposite, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterCompositeSerialize(outerComposite, options).then((request) => request(axios, basePath)); }, /** @@ -2713,7 +2713,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterNumberSerialize(body?: number, options?: any): AxiosPromise { + fakeOuterNumberSerialize(body?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterNumberSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -2722,7 +2722,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - fakeOuterStringSerialize(body?: string, options?: any): AxiosPromise { + fakeOuterStringSerialize(body?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.fakeOuterStringSerialize(body, options).then((request) => request(axios, basePath)); }, /** @@ -2732,7 +2732,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: any): AxiosPromise { + testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAdditionalPropertiesReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -2741,7 +2741,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, options?: any): AxiosPromise { + testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyWithFileSchema(fileSchemaTestClass, options).then((request) => request(axios, basePath)); }, /** @@ -2751,7 +2751,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testBodyWithQueryParams(query: string, user: User, options?: any): AxiosPromise { + testBodyWithQueryParams(query: string, user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testBodyWithQueryParams(query, user, options).then((request) => request(axios, basePath)); }, /** @@ -2761,7 +2761,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testClientModel(client: Client, options?: any): AxiosPromise { + testClientModel(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testClientModel(client, options).then((request) => request(axios, basePath)); }, /** @@ -2784,7 +2784,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: File, date?: string, dateTime?: string, password?: string, callback?: string, options?: any): AxiosPromise { + testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: File, date?: string, dateTime?: string, password?: string, callback?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, options).then((request) => request(axios, basePath)); }, /** @@ -2801,7 +2801,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testEnumParameters(enumHeaderStringArray?: Array, enumHeaderString?: TestEnumParametersEnumHeaderStringEnum, enumQueryStringArray?: Array, enumQueryString?: TestEnumParametersEnumQueryStringEnum, enumQueryInteger?: TestEnumParametersEnumQueryIntegerEnum, enumQueryDouble?: TestEnumParametersEnumQueryDoubleEnum, enumFormStringArray?: Array, enumFormString?: TestEnumParametersEnumFormStringEnum, options?: any): AxiosPromise { + testEnumParameters(enumHeaderStringArray?: Array, enumHeaderString?: TestEnumParametersEnumHeaderStringEnum, enumQueryStringArray?: Array, enumQueryString?: TestEnumParametersEnumQueryStringEnum, enumQueryInteger?: TestEnumParametersEnumQueryIntegerEnum, enumQueryDouble?: TestEnumParametersEnumQueryDoubleEnum, enumFormStringArray?: Array, enumFormString?: TestEnumParametersEnumFormStringEnum, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, options).then((request) => request(axios, basePath)); }, /** @@ -2816,7 +2816,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, options?: any): AxiosPromise { + testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, options).then((request) => request(axios, basePath)); }, /** @@ -2826,7 +2826,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -2836,7 +2836,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: any): AxiosPromise { + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, options).then((request) => request(axios, basePath)); }, /** @@ -2847,7 +2847,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testJsonFormData(param: string, param2: string, options?: any): AxiosPromise { + testJsonFormData(param: string, param2: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testJsonFormData(param, param2, options).then((request) => request(axios, basePath)); }, /** @@ -2860,7 +2860,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: any): AxiosPromise { + testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, options).then((request) => request(axios, basePath)); }, /** @@ -2870,7 +2870,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference(requestBody: { [key: string]: string; }, options?: any): AxiosPromise { + testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -2880,7 +2880,7 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testUniqueItemsHeaderAndQueryParameterCollectionFormat(queryUnique: Set, headerUnique: Set, options?: any): AxiosPromise> { + testUniqueItemsHeaderAndQueryParameterCollectionFormat(queryUnique: Set, headerUnique: Set, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.testUniqueItemsHeaderAndQueryParameterCollectionFormat(queryUnique, headerUnique, options).then((request) => request(axios, basePath)); }, }; @@ -3287,7 +3287,7 @@ export const FakeClassnameTags123ApiFactory = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testClassname(client: Client, options?: any): AxiosPromise { + testClassname(client: Client, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testClassname(client, options).then((request) => request(axios, basePath)); }, }; @@ -3882,7 +3882,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(pet: Pet, options?: any): AxiosPromise { + addPet(pet: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -3893,7 +3893,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -3903,7 +3903,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -3914,7 +3914,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -3924,7 +3924,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -3934,7 +3934,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(pet: Pet, options?: any): AxiosPromise { + updatePet(pet: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(pet, options).then((request) => request(axios, basePath)); }, /** @@ -3946,7 +3946,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -3958,7 +3958,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, /** @@ -3970,7 +3970,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFileWithRequiredFile(petId: number, requiredFile: File, additionalMetadata?: string, options?: any): AxiosPromise { + uploadFileWithRequiredFile(petId: number, requiredFile: File, additionalMetadata?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, options).then((request) => request(axios, basePath)); }, }; @@ -4332,7 +4332,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -4341,7 +4341,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -4351,7 +4351,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -4361,7 +4361,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(order: Order, options?: any): AxiosPromise { + placeOrder(order: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(order, options).then((request) => request(axios, basePath)); }, }; @@ -4852,7 +4852,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(user: User, options?: any): AxiosPromise { + createUser(user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(user, options).then((request) => request(axios, basePath)); }, /** @@ -4862,7 +4862,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(user: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -4872,7 +4872,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(user: Array, options?: any): AxiosPromise { + createUsersWithListInput(user: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(user, options).then((request) => request(axios, basePath)); }, /** @@ -4882,7 +4882,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -4892,7 +4892,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -4903,7 +4903,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -4912,7 +4912,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -4923,7 +4923,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, user: User, options?: any): AxiosPromise { + updateUser(username: string, user: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, user, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 1c9b3e42986..e3035a1de51 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -736,7 +736,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -747,7 +747,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -757,7 +757,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -768,7 +768,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -778,7 +778,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -788,7 +788,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -800,7 +800,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -812,7 +812,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1254,7 +1254,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1263,7 +1263,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1273,7 +1273,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1283,7 +1283,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1821,7 +1821,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1831,7 +1831,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1841,7 +1841,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1851,7 +1851,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1861,7 +1861,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1872,7 +1872,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1881,7 +1881,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1892,7 +1892,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts index 01b529c0fda..8f972c32b2e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -740,7 +740,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -751,7 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -761,7 +761,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -772,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -782,7 +782,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -792,7 +792,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -804,7 +804,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -816,7 +816,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1162,7 +1162,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1171,7 +1171,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1181,7 +1181,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1191,7 +1191,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body?: Order, options?: any): AxiosPromise { + placeOrder(body?: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1682,7 +1682,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1692,7 +1692,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1702,7 +1702,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1712,7 +1712,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1722,7 +1722,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1733,7 +1733,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1742,7 +1742,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1753,7 +1753,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; 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 eba8f3d2937..4814af94ce4 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 @@ -515,7 +515,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -526,7 +526,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -536,7 +536,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -547,7 +547,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -557,7 +557,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -567,7 +567,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -579,7 +579,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -591,7 +591,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; 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 9671779d135..0fcfd906cc8 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 @@ -244,7 +244,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -253,7 +253,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -263,7 +263,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -273,7 +273,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; 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 ca169877a3a..7d6d6aeb2b6 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 @@ -451,7 +451,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -461,7 +461,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -471,7 +471,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -481,7 +481,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -491,7 +491,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -502,7 +502,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -511,7 +511,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -522,7 +522,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index 0d32b2e8da0..df0c45abc78 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -736,7 +736,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -747,7 +747,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -757,7 +757,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -768,7 +768,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -778,7 +778,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -788,7 +788,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -800,7 +800,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -812,7 +812,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1160,7 +1160,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1169,7 +1169,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1179,7 +1179,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1189,7 +1189,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1680,7 +1680,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1690,7 +1690,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1700,7 +1700,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1710,7 +1710,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1720,7 +1720,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1731,7 +1731,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1740,7 +1740,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1751,7 +1751,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts index ebd4a1ca230..b9f8757a661 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts @@ -740,7 +740,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any): AxiosPromise { + addPet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** @@ -751,7 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + deletePet(petId: number, apiKey?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** @@ -761,7 +761,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array, options?: any): AxiosPromise> { + findPetsByStatus(status: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** @@ -772,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @deprecated * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any): AxiosPromise> { + findPetsByTags(tags: Array, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** @@ -782,7 +782,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any): AxiosPromise { + getPetById(petId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** @@ -792,7 +792,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any): AxiosPromise { + updatePet(body: Pet, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** @@ -804,7 +804,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + updatePetWithForm(petId: number, name?: string, status?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** @@ -816,7 +816,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: any): AxiosPromise { + uploadFile(petId: number, additionalMetadata?: string, file?: File, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; @@ -1164,7 +1164,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any): AxiosPromise { + deleteOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1173,7 +1173,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1183,7 +1183,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any): AxiosPromise { + getOrderById(orderId: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** @@ -1193,7 +1193,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any): AxiosPromise { + placeOrder(body: Order, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; @@ -1684,7 +1684,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any): AxiosPromise { + createUser(body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** @@ -1694,7 +1694,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + createUsersWithArrayInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1704,7 +1704,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise { + createUsersWithListInput(body: Array, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** @@ -1714,7 +1714,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any): AxiosPromise { + deleteUser(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** @@ -1724,7 +1724,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any): AxiosPromise { + getUserByName(username: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** @@ -1735,7 +1735,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any): AxiosPromise { + loginUser(username: string, password: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** @@ -1744,7 +1744,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any): AxiosPromise { + logoutUser(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** @@ -1755,7 +1755,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any): AxiosPromise { + updateUser(username: string, body: User, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; 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 6f935b2048d..fade52e7172 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 @@ -31,7 +31,7 @@ export interface Club { * @type {Owner} * @memberof Club */ - owner?: Owner; + owner?: Owner | null; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 484c15265f5..12df4e51387 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -722,7 +722,7 @@ export class FakeApi extends runtime.BaseAPI { } if (requestParameters['dateTime'] != null) { - formParams.append('dateTime', requestParameters['dateTime'] as any); + formParams.append('dateTime', (requestParameters['dateTime'] as any).toISOString()); } if (requestParameters['password'] != null) { 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 2b247b983ff..4d81b3f9698 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 @@ -40,6 +40,8 @@ export interface AllOfWithSingleRef { singleRefType?: SingleRefType; } + + /** * Check if a given object implements the AllOfWithSingleRef interface. */ 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 d83d77aa5f5..c58c82e9256 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 @@ -28,7 +28,7 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { for (const key in EnumClass) { if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { - if (EnumClass[key] === value) { + if (EnumClass[key as keyof typeof EnumClass] === value) { return true; } } 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 b4ef265fd2d..0ed65225ddc 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 @@ -73,7 +73,7 @@ export interface EnumTest { * @type {OuterEnum} * @memberof EnumTest */ - outerEnum?: OuterEnum; + outerEnum?: OuterEnum | null; /** * * @type {OuterEnumInteger} 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 450b2c25043..c921f52f4c9 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 @@ -24,7 +24,7 @@ export interface HealthCheckResult { * @type {string} * @memberof HealthCheckResult */ - nullableMessage?: string; + nullableMessage?: string | null; } /** 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 2fbcea7c6ea..f20a3d1c509 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 @@ -25,67 +25,67 @@ export interface NullableClass { * @type {number} * @memberof NullableClass */ - integerProp?: number; + integerProp?: number | null; /** * * @type {number} * @memberof NullableClass */ - numberProp?: number; + numberProp?: number | null; /** * * @type {boolean} * @memberof NullableClass */ - booleanProp?: boolean; + booleanProp?: boolean | null; /** * * @type {string} * @memberof NullableClass */ - stringProp?: string; + stringProp?: string | null; /** * * @type {Date} * @memberof NullableClass */ - dateProp?: Date; + dateProp?: Date | null; /** * * @type {Date} * @memberof NullableClass */ - datetimeProp?: Date; + datetimeProp?: Date | null; /** * * @type {Array} * @memberof NullableClass */ - arrayNullableProp?: Array; + arrayNullableProp?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - arrayAndItemsNullableProp?: Array; + arrayAndItemsNullableProp?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - arrayItemsNullable?: Array; + arrayItemsNullable?: Array; /** * * @type {{ [key: string]: object; }} * @memberof NullableClass */ - objectNullableProp?: { [key: string]: object; }; + objectNullableProp?: { [key: string]: object; } | null; /** * * @type {{ [key: string]: object | null; }} * @memberof NullableClass */ - objectAndItemsNullableProp?: { [key: string]: object | null; }; + objectAndItemsNullableProp?: { [key: string]: object | null; } | null; /** * * @type {{ [key: string]: object | null; }} 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 a35b7561819..2c304d57400 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 @@ -28,7 +28,7 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { for (const key in OuterEnum) { if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { - if (OuterEnum[key] === value) { + if (OuterEnum[key as keyof typeof OuterEnum] === value) { return true; } } 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 08c50c71d68..c5aabe1ad68 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 @@ -28,7 +28,7 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { for (const key in OuterEnumDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { - if (OuterEnumDefaultValue[key] === value) { + if (OuterEnumDefaultValue[key as keyof typeof OuterEnumDefaultValue] === value) { return true; } } 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 4c017a1ceb5..cb5a0a25150 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 @@ -28,7 +28,7 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { for (const key in OuterEnumInteger) { if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { - if (OuterEnumInteger[key] === value) { + if (OuterEnumInteger[key as keyof typeof OuterEnumInteger] === value) { return true; } } 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 8e16b56eeda..1e9b73ce495 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 @@ -28,7 +28,7 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { for (const key in OuterEnumIntegerDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { - if (OuterEnumIntegerDefaultValue[key] === value) { + if (OuterEnumIntegerDefaultValue[key as keyof typeof OuterEnumIntegerDefaultValue] === value) { return true; } } 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 c8ca1734039..47e184b3414 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 @@ -34,6 +34,8 @@ export interface OuterObjectWithEnumProperty { value: OuterEnumInteger; } + + /** * Check if a given object implements the OuterObjectWithEnumProperty interface. */ 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 81195930614..934f2f9d633 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 @@ -31,7 +31,7 @@ export interface ParentWithNullable { * @type {string} * @memberof ParentWithNullable */ - nullableProperty?: string; + nullableProperty?: string | null; } 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 7dbee0a8e95..260be835d98 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 @@ -27,7 +27,7 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { for (const key in SingleRefType) { if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { - if (SingleRefType[key] === value) { + if (SingleRefType[key as keyof typeof SingleRefType] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index 2ce4f1d2cf4..88a965dfc12 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -40,9 +40,9 @@ export interface FakeEnumRequestGetInlineRequest { export interface FakeEnumRequestGetRefRequest { stringEnum?: StringEnum; - nullableStringEnum?: StringEnum; + nullableStringEnum?: StringEnum | null; numberEnum?: NumberEnum; - nullableNumberEnum?: NumberEnum; + nullableNumberEnum?: NumberEnum | null; } export interface FakeEnumRequestPostInlineRequest { 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 8f61f66faaa..576b5fde62d 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts @@ -43,7 +43,7 @@ export interface EnumPatternObject { * @type {StringEnum} * @memberof EnumPatternObject */ - nullableStringEnum?: StringEnum; + nullableStringEnum?: StringEnum | null; /** * * @type {NumberEnum} @@ -55,9 +55,11 @@ export interface EnumPatternObject { * @type {NumberEnum} * @memberof EnumPatternObject */ - nullableNumberEnum?: NumberEnum; + nullableNumberEnum?: NumberEnum | null; } + + /** * Check if a given object implements the EnumPatternObject interface. */ 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 a0c1b58a29e..1684281cc9a 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts @@ -28,7 +28,7 @@ export type NumberEnum = typeof NumberEnum[keyof typeof NumberEnum]; export function instanceOfNumberEnum(value: any): boolean { for (const key in NumberEnum) { if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { - if (NumberEnum[key] === value) { + if (NumberEnum[key as keyof typeof NumberEnum] === value) { return true; } } 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 c59850ed4b6..1b1a1f1e5ae 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts @@ -28,7 +28,7 @@ export type StringEnum = typeof StringEnum[keyof typeof StringEnum]; export function instanceOfStringEnum(value: any): boolean { for (const key in StringEnum) { if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { - if (StringEnum[key] === value) { + if (StringEnum[key as keyof typeof StringEnum] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.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/typescript-fetch/builds/oneOf/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES new file mode 100644 index 00000000000..1e29c70aeda --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/FILES @@ -0,0 +1,8 @@ +apis/DefaultApi.ts +apis/index.ts +index.ts +models/TestA.ts +models/TestB.ts +models/TestResponse.ts +models/index.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts new file mode 100644 index 00000000000..3383adf93df --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/DefaultApi.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * 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. + */ + + +import * as runtime from '../runtime'; +import type { + TestResponse, +} from '../models/index'; +import { + TestResponseFromJSON, + TestResponseToJSON, +} from '../models/index'; + +/** + * + */ +export class DefaultApi extends runtime.BaseAPI { + + /** + */ + async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/test`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TestResponseFromJSON(jsonValue)); + } + + /** + */ + async test(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testRaw(initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts new file mode 100644 index 00000000000..69c44c00fa0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/apis/index.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './DefaultApi'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts new file mode 100644 index 00000000000..bebe8bbbe20 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts new file mode 100644 index 00000000000..3b54d32cb57 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestA.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * 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. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TestA + */ +export interface TestA { + /** + * + * @type {string} + * @memberof TestA + */ + foo: string; +} + +/** + * Check if a given object implements the TestA interface. + */ +export function instanceOfTestA(value: object): value is TestA { + if (!('foo' in value) || value['foo'] === undefined) return false; + return true; +} + +export function TestAFromJSON(json: any): TestA { + return TestAFromJSONTyped(json, false); +} + +export function TestAFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestA { + if (json == null) { + return json; + } + return { + + 'foo': json['foo'], + }; +} + +export function TestAToJSON(value?: TestA | null): any { + if (value == null) { + return value; + } + return { + + 'foo': value['foo'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts new file mode 100644 index 00000000000..d40209b76d4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestB.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * 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. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TestB + */ +export interface TestB { + /** + * + * @type {string} + * @memberof TestB + */ + bar: string; +} + +/** + * Check if a given object implements the TestB interface. + */ +export function instanceOfTestB(value: object): value is TestB { + if (!('bar' in value) || value['bar'] === undefined) return false; + return true; +} + +export function TestBFromJSON(json: any): TestB { + return TestBFromJSONTyped(json, false); +} + +export function TestBFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestB { + if (json == null) { + return json; + } + return { + + 'bar': json['bar'], + }; +} + +export function TestBToJSON(value?: TestB | null): any { + if (value == null) { + return value; + } + return { + + 'bar': value['bar'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts new file mode 100644 index 00000000000..d37db87e324 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/TestResponse.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * 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. + */ + +import type { TestA } from './TestA'; +import { + instanceOfTestA, + TestAFromJSON, + TestAFromJSONTyped, + TestAToJSON, +} from './TestA'; +import type { TestB } from './TestB'; +import { + instanceOfTestB, + TestBFromJSON, + TestBFromJSONTyped, + TestBToJSON, +} from './TestB'; + +/** + * @type TestResponse + * + * @export + */ +export type TestResponse = TestA | TestB; + +export function TestResponseFromJSON(json: any): TestResponse { + return TestResponseFromJSONTyped(json, false); +} + +export function TestResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestResponse { + if (json == null) { + return json; + } + if (instanceOfTestA(json)) { + return TestAFromJSONTyped(json, true); + } + if (instanceOfTestB(json)) { + return TestBFromJSONTyped(json, true); + } + + return {} as any; +} + +export function TestResponseToJSON(value?: TestResponse | null): any { + if (value == null) { + return value; + } + + if (instanceOfTestA(value)) { + return TestAToJSON(value as TestA); + } + if (instanceOfTestB(value)) { + return TestBToJSON(value as TestB); + } + + return {}; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts new file mode 100644 index 00000000000..8da6963476f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/models/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './TestA'; +export * from './TestB'; +export * from './TestResponse'; diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts new file mode 100644 index 00000000000..9ccdf703735 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts @@ -0,0 +1,426 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * testing oneOf without discriminator + * 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. + */ + + +export const BASE_PATH = "http://localhost:3000".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts index a283bd47222..f1f83a90663 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/PetApi.ts @@ -76,7 +76,7 @@ export interface UpdatePetRequest { export interface UpdatePetRegionsRequest { petId: number; - newRegions: Array>; + newRegions: Array>; } export interface UpdatePetWithFormRequest { @@ -509,7 +509,7 @@ export class PetApi extends runtime.BaseAPI { /** * Updates the pet regions. */ - async updatePetRegions(petId: number, newRegions: Array>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async updatePetRegions(petId: number, newRegions: Array>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updatePetRegionsRaw({ petId: petId, newRegions: newRegions }, initOverrides); return await response.value(); } 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 481793ab0bd..6792815d839 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 @@ -28,7 +28,7 @@ export type BehaviorType = typeof BehaviorType[keyof typeof BehaviorType]; export function instanceOfBehaviorType(value: any): boolean { for (const key in BehaviorType) { if (Object.prototype.hasOwnProperty.call(BehaviorType, key)) { - if (BehaviorType[key] === value) { + if (BehaviorType[key as keyof typeof BehaviorType] === value) { 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 f04bfb6e45b..5ae82e7f2ef 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 @@ -37,7 +37,7 @@ export type DeploymentRequestStatus = typeof DeploymentRequestStatus[keyof typeo export function instanceOfDeploymentRequestStatus(value: any): boolean { for (const key in DeploymentRequestStatus) { if (Object.prototype.hasOwnProperty.call(DeploymentRequestStatus, key)) { - if (DeploymentRequestStatus[key] === value) { + if (DeploymentRequestStatus[key as keyof typeof DeploymentRequestStatus] === value) { return true; } } 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 13fe193a73f..7b85047567d 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 @@ -43,7 +43,7 @@ export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode]; export function instanceOfErrorCode(value: any): boolean { for (const key in ErrorCode) { if (Object.prototype.hasOwnProperty.call(ErrorCode, key)) { - if (ErrorCode[key] === value) { + if (ErrorCode[key as keyof typeof ErrorCode] === value) { 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 5de27f58461..f3d8f640f8b 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 @@ -46,6 +46,8 @@ export interface GetBehaviorTypeResponse { data?: BehaviorType; } + + /** * Check if a given object implements the GetBehaviorTypeResponse interface. */ 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 16ec3947673..5e2f514633c 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 @@ -46,6 +46,8 @@ export interface GetPetPartTypeResponse { data?: PetPartType; } + + /** * Check if a given object implements the GetPetPartTypeResponse interface. */ 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 35c173b55b3..b867676a4c9 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 @@ -166,10 +166,10 @@ export interface Pet { status: PetStatusEnum; /** * An array of all 15-minute time slots in 24 hours. - * @type {Array>} + * @type {Array>} * @memberof Pet */ - regions?: Array>; + regions?: Array>; } 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 1aa5863611e..0529649ea2d 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 @@ -28,7 +28,7 @@ export type PetPartType = typeof PetPartType[keyof typeof PetPartType]; export function instanceOfPetPartType(value: any): boolean { for (const key in PetPartType) { if (Object.prototype.hasOwnProperty.call(PetPartType, key)) { - if (PetPartType[key] === value) { + if (PetPartType[key as keyof typeof PetPartType] === value) { return true; } } 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 8430854a46c..be15dff74a1 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 @@ -34,10 +34,10 @@ export interface PetRegionsResponse { meta: ResponseMeta; /** * An array of all 15-minute time slots in 24 hours. - * @type {Array>} + * @type {Array>} * @memberof PetRegionsResponse */ - data?: Array>; + data?: Array>; } /** 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 4554cb6dff0..2ebc7a17f0a 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 @@ -28,7 +28,7 @@ export type WarningCode = typeof WarningCode[keyof typeof WarningCode]; export function instanceOfWarningCode(value: any): boolean { for (const key in WarningCode) { if (Object.prototype.hasOwnProperty.call(WarningCode, key)) { - if (WarningCode[key] === value) { + if (WarningCode[key as keyof typeof WarningCode] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts index dd1a525ac39..23e46bbf742 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts @@ -663,7 +663,7 @@ export class FakeApi extends runtime.BaseAPI { } if (requestParameters['dateTime'] != null) { - formParams.append('dateTime', requestParameters['dateTime'] as any); + formParams.append('dateTime', (requestParameters['dateTime'] as any).toISOString()); } if (requestParameters['password'] != null) { 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 2b247b983ff..4d81b3f9698 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 @@ -40,6 +40,8 @@ export interface AllOfWithSingleRef { singleRefType?: SingleRefType; } + + /** * Check if a given object implements the AllOfWithSingleRef interface. */ 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 d83d77aa5f5..c58c82e9256 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 @@ -28,7 +28,7 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { for (const key in EnumClass) { if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { - if (EnumClass[key] === value) { + if (EnumClass[key as keyof typeof EnumClass] === value) { return true; } } 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 b4ef265fd2d..0ed65225ddc 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 @@ -73,7 +73,7 @@ export interface EnumTest { * @type {OuterEnum} * @memberof EnumTest */ - outerEnum?: OuterEnum; + outerEnum?: OuterEnum | null; /** * * @type {OuterEnumInteger} 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 450b2c25043..c921f52f4c9 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 @@ -24,7 +24,7 @@ export interface HealthCheckResult { * @type {string} * @memberof HealthCheckResult */ - nullableMessage?: string; + nullableMessage?: string | null; } /** 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 2fbcea7c6ea..f20a3d1c509 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 @@ -25,67 +25,67 @@ export interface NullableClass { * @type {number} * @memberof NullableClass */ - integerProp?: number; + integerProp?: number | null; /** * * @type {number} * @memberof NullableClass */ - numberProp?: number; + numberProp?: number | null; /** * * @type {boolean} * @memberof NullableClass */ - booleanProp?: boolean; + booleanProp?: boolean | null; /** * * @type {string} * @memberof NullableClass */ - stringProp?: string; + stringProp?: string | null; /** * * @type {Date} * @memberof NullableClass */ - dateProp?: Date; + dateProp?: Date | null; /** * * @type {Date} * @memberof NullableClass */ - datetimeProp?: Date; + datetimeProp?: Date | null; /** * * @type {Array} * @memberof NullableClass */ - arrayNullableProp?: Array; + arrayNullableProp?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - arrayAndItemsNullableProp?: Array; + arrayAndItemsNullableProp?: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof NullableClass */ - arrayItemsNullable?: Array; + arrayItemsNullable?: Array; /** * * @type {{ [key: string]: object; }} * @memberof NullableClass */ - objectNullableProp?: { [key: string]: object; }; + objectNullableProp?: { [key: string]: object; } | null; /** * * @type {{ [key: string]: object | null; }} * @memberof NullableClass */ - objectAndItemsNullableProp?: { [key: string]: object | null; }; + objectAndItemsNullableProp?: { [key: string]: object | null; } | null; /** * * @type {{ [key: string]: object | null; }} 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 a35b7561819..2c304d57400 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 @@ -28,7 +28,7 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { for (const key in OuterEnum) { if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { - if (OuterEnum[key] === value) { + if (OuterEnum[key as keyof typeof OuterEnum] === value) { return true; } } 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 08c50c71d68..c5aabe1ad68 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 @@ -28,7 +28,7 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { for (const key in OuterEnumDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { - if (OuterEnumDefaultValue[key] === value) { + if (OuterEnumDefaultValue[key as keyof typeof OuterEnumDefaultValue] === value) { return true; } } 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 4c017a1ceb5..cb5a0a25150 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 @@ -28,7 +28,7 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { for (const key in OuterEnumInteger) { if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { - if (OuterEnumInteger[key] === value) { + if (OuterEnumInteger[key as keyof typeof OuterEnumInteger] === value) { return true; } } 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 8e16b56eeda..1e9b73ce495 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 @@ -28,7 +28,7 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { for (const key in OuterEnumIntegerDefaultValue) { if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { - if (OuterEnumIntegerDefaultValue[key] === value) { + if (OuterEnumIntegerDefaultValue[key as keyof typeof OuterEnumIntegerDefaultValue] === value) { return true; } } 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 c8ca1734039..47e184b3414 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 @@ -34,6 +34,8 @@ export interface OuterObjectWithEnumProperty { value: OuterEnumInteger; } + + /** * Check if a given object implements the OuterObjectWithEnumProperty interface. */ 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 7dbee0a8e95..260be835d98 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 @@ -27,7 +27,7 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { for (const key in SingleRefType) { if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { - if (SingleRefType[key] === value) { + if (SingleRefType[key as keyof typeof SingleRefType] === value) { return true; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts index e9c2a1b83cf..8eb16afcbf4 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts @@ -40,9 +40,9 @@ export interface FakeEnumRequestGetInlineRequest { export interface FakeEnumRequestGetRefRequest { stringEnum?: StringEnum; - nullableStringEnum?: StringEnum; + nullableStringEnum?: StringEnum | null; numberEnum?: NumberEnum; - nullableNumberEnum?: NumberEnum; + nullableNumberEnum?: NumberEnum | null; } export interface FakeEnumRequestPostInlineRequest { 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 8f61f66faaa..576b5fde62d 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 @@ -43,7 +43,7 @@ export interface EnumPatternObject { * @type {StringEnum} * @memberof EnumPatternObject */ - nullableStringEnum?: StringEnum; + nullableStringEnum?: StringEnum | null; /** * * @type {NumberEnum} @@ -55,9 +55,11 @@ export interface EnumPatternObject { * @type {NumberEnum} * @memberof EnumPatternObject */ - nullableNumberEnum?: NumberEnum; + nullableNumberEnum?: NumberEnum | null; } + + /** * Check if a given object implements the EnumPatternObject interface. */ 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 5b3ea298b9d..2181967c9a6 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 @@ -27,7 +27,7 @@ export enum NumberEnum { export function instanceOfNumberEnum(value: any): boolean { for (const key in NumberEnum) { if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { - if (NumberEnum[key] === value) { + if (NumberEnum[key as keyof typeof NumberEnum] === value) { return true; } } 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 21f232a76a9..bcb11c3d400 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 @@ -27,7 +27,7 @@ export enum StringEnum { export function instanceOfStringEnum(value: any): boolean { for (const key in StringEnum) { if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { - if (StringEnum[key] === value) { + if (StringEnum[key as keyof typeof StringEnum] === value) { return true; } } diff --git a/samples/client/petstore/zapier/apis/PetApi.js b/samples/client/petstore/zapier/apis/PetApi.js index f5a3465c922..98b42df84ca 100644 --- a/samples/client/petstore/zapier/apis/PetApi.js +++ b/samples/client/petstore/zapier/apis/PetApi.js @@ -36,7 +36,7 @@ module.exports = { ...Pet.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -84,7 +84,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -127,7 +127,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -170,7 +170,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -214,7 +214,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -254,7 +254,7 @@ module.exports = { ...Pet.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -307,7 +307,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -364,7 +364,7 @@ module.exports = { }, body: formData, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; diff --git a/samples/client/petstore/zapier/apis/StoreApi.js b/samples/client/petstore/zapier/apis/StoreApi.js index da883c1377a..ead3f914108 100644 --- a/samples/client/petstore/zapier/apis/StoreApi.js +++ b/samples/client/petstore/zapier/apis/StoreApi.js @@ -37,7 +37,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -74,7 +74,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return { data: results }; @@ -118,7 +118,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -158,7 +158,7 @@ module.exports = { ...Order.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; diff --git a/samples/client/petstore/zapier/apis/UserApi.js b/samples/client/petstore/zapier/apis/UserApi.js index aac909ffd1b..ed64420abf3 100644 --- a/samples/client/petstore/zapier/apis/UserApi.js +++ b/samples/client/petstore/zapier/apis/UserApi.js @@ -33,7 +33,7 @@ module.exports = { ...User.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -76,7 +76,7 @@ module.exports = { ...User.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -119,7 +119,7 @@ module.exports = { ...User.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -162,7 +162,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -206,7 +206,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -257,7 +257,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return { data: results }; @@ -294,7 +294,7 @@ module.exports = { body: { }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; @@ -339,7 +339,7 @@ module.exports = { ...User.mapping(bundle), }, } - return z.request(options).then((response) => { + return z.request(utils.requestOptionsMiddleware(z, bundle, options)).then((response) => { response.throwForStatus(); const results = response.json; return results; diff --git a/samples/client/petstore/zapier/utils/utils.js b/samples/client/petstore/zapier/utils/utils.js index 201a15fb582..b00174f3f7b 100644 --- a/samples/client/petstore/zapier/utils/utils.js +++ b/samples/client/petstore/zapier/utils/utils.js @@ -23,6 +23,13 @@ const searchMiddleware = (action) => { return action } +const requestOptionsMiddleware = (z, bundle, requestOptions) => { + // TODO: modify the request options for all outgoing request to your api + // if you are using session authentication without a Bearer token. + // This may be true if your API uses basic authentication or api keys. + return requestOptions +} + module.exports = { replacePathParameters: replacePathParameters, childMapping: childMapping, @@ -31,4 +38,5 @@ module.exports = { hasSearchRequisites: hasSearchRequisites, isSearchAction: isSearchAction, searchMiddleware: searchMiddleware, -} \ No newline at end of file + requestOptionsMiddleware: requestOptionsMiddleware, +} 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 33da123ab61..1e3b4bd14c0 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 @@ -493,18 +493,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go index c3a01ea6605..fa0b330b65a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package x_auth_id_alias import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index a7614c538f6..e1ac6a79f5f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt index 44b40e6740c..b5f91f274c7 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index 4a027fc12f9..d1d6000a8eb 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -329,8 +329,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index b14d2a2cbbc..9933d20800b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -208,7 +208,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -228,7 +228,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -248,7 +248,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -269,7 +269,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -290,7 +290,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -327,7 +327,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -343,7 +343,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -359,7 +359,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -375,7 +375,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -397,7 +397,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -413,7 +413,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -429,7 +429,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -451,7 +451,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -463,7 +463,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -483,7 +483,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -529,7 +529,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -551,7 +551,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -574,7 +574,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -595,7 +595,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -641,9 +641,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -669,9 +669,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 291992913d2..4d0d508278d 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -178,9 +178,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -197,7 +197,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -217,7 +217,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index c6e681a50fb..10b228cac12 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index 08489f75c16..94c45aab58c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -45,7 +45,7 @@ module XAuthIDAlias # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -102,7 +102,7 @@ module XAuthIDAlias # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -159,7 +159,7 @@ module XAuthIDAlias # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -216,7 +216,7 @@ module XAuthIDAlias # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index 9902f3e1257..0ba20088158 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -79,6 +79,14 @@ module XAuthIDAlias # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module XAuthIDAlias @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module XAuthIDAlias # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index 86e1edb7eaf..b8d612476a9 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -45,7 +45,7 @@ module DynamicServers # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -102,7 +102,7 @@ module DynamicServers # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index 3d5883ea8a0..cab750c8e37 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -79,6 +79,14 @@ module DynamicServers # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module DynamicServers @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module DynamicServers # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index cc35be28663..812c72bf71b 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -47,7 +47,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -111,7 +111,7 @@ module Petstore # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index 48a96d1a3b9..674f703cc3e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -79,6 +79,14 @@ module Petstore # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -166,6 +174,7 @@ module Petstore @timeout = 0 @params_encoding = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +209,7 @@ module Petstore # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart index d85a16fc6ad..bdddadb4c57 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart @@ -5,6 +5,7 @@ export 'package:openapi/src/api.dart'; export 'package:openapi/src/auth/api_key_auth.dart'; export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/bearer_auth.dart'; export 'package:openapi/src/auth/oauth.dart'; export 'package:openapi/src/serializers.dart'; export 'package:openapi/src/model/date.dart'; @@ -14,3 +15,4 @@ export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/model/apple.dart'; export 'package:openapi/src/model/banana.dart'; export 'package:openapi/src/model/fruit.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart index 797199ae174..64c4b4eff3b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart index a124752d7bf..80b852dd0d5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -5,6 +5,7 @@ export 'package:openapi/src/api.dart'; export 'package:openapi/src/auth/api_key_auth.dart'; export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/bearer_auth.dart'; export 'package:openapi/src/auth/oauth.dart'; export 'package:openapi/src/serializers.dart'; export 'package:openapi/src/model/date.dart'; @@ -30,3 +31,4 @@ export 'package:openapi/src/model/fruit_type.dart'; export 'package:openapi/src/model/pasta.dart'; export 'package:openapi/src/model/pizza.dart'; export 'package:openapi/src/model/pizza_speziale.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart index 5cad411a846..50e9bfbc2e9 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart index 4b67cdef3d0..a797ef4e805 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart index 220621d6961..cc70cf5fc6b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart @@ -5,6 +5,7 @@ export 'package:openapi/src/api.dart'; export 'package:openapi/src/auth/api_key_auth.dart'; export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/bearer_auth.dart'; export 'package:openapi/src/auth/oauth.dart'; export 'package:openapi/src/serializers.dart'; export 'package:openapi/src/model/date.dart'; @@ -13,3 +14,4 @@ export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/model/child.dart'; export 'package:openapi/src/model/example.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart index 4b5984b8e31..7d2841da6d0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 0d9629c9782..a462009ebf7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -5,6 +5,7 @@ export 'package:openapi/src/api.dart'; export 'package:openapi/src/auth/api_key_auth.dart'; export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/bearer_auth.dart'; export 'package:openapi/src/auth/oauth.dart'; @@ -66,3 +67,4 @@ export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; export 'package:openapi/src/model/user.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 8bb0e47afdb..8b407aba3bc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -5,6 +5,7 @@ export 'package:openapi/src/api.dart'; export 'package:openapi/src/auth/api_key_auth.dart'; export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/bearer_auth.dart'; export 'package:openapi/src/auth/oauth.dart'; export 'package:openapi/src/serializers.dart'; export 'package:openapi/src/model/date.dart'; @@ -67,3 +68,4 @@ export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart'; export 'package:openapi/src/model/user.dart'; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart index 37e9fdd31c7..5d287618307 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart index 2646f8a0b33..50fd4f279b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index 54282514f27..1cfaf9712ad 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart index 466b9356ee0..671ec766ab4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart index aad1031369c..a4da1c5ff6d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart index 46bb2237d4c..6f519ff8ee5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart index b4f78fd687b..2a7e5132a60 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; 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 72a2cdd8d13..8a721096670 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml @@ -9,9 +9,9 @@ homepage: 'homepage' environment: sdk: '>=2.12.0 <4.0.0' dependencies: - collection: '^1.17.0' - http: '>=0.13.0 <0.14.0' + collection: '>=1.17.0 <2.0.0' + http: '>=0.13.0 <2.0.0' intl: any - meta: '^1.1.8' + meta: '>=1.1.8 <2.0.0' dev_dependencies: test: '>=1.21.6 <1.22.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 72a2cdd8d13..8a721096670 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 @@ -9,9 +9,9 @@ homepage: 'homepage' environment: sdk: '>=2.12.0 <4.0.0' dependencies: - collection: '^1.17.0' - http: '>=0.13.0 <0.14.0' + collection: '>=1.17.0 <2.0.0' + http: '>=0.13.0 <2.0.0' intl: any - meta: '^1.1.8' + meta: '>=1.1.8 <2.0.0' dev_dependencies: test: '>=1.21.6 <1.22.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 3174a5c333e..37305e6f228 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go @@ -505,18 +505,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_category.go b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_category.go index 9a4775dd9cb..e962c7ef185 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_category.go +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_category.go @@ -20,7 +20,7 @@ var _ MappedNullable = &Category{} // Category A category for a pet type Category struct { Id *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` AdditionalProperties map[string]interface{} } diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/utils.go b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/utils.go index 794f72111af..beea36a8081 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/utils.go +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package petstore import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index c63441acc9c..1c45323b412 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -15,6 +15,7 @@ docs/AdditionalPropertiesClass.md docs/AllOfPrimitiveTypes.md docs/Animal.md docs/AnotherFakeAPI.md +docs/AnyOfPrimitiveType.md docs/ApiResponse.md docs/Apple.md docs/AppleReq.md @@ -47,6 +48,7 @@ docs/FruitReq.md docs/GmFruit.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md +docs/IDsWrapper.md docs/IncidentData.md docs/List.md docs/Mammal.md @@ -74,6 +76,7 @@ docs/PropertyNameMapping.md docs/ReadOnlyFirst.md docs/ReadOnlyWithDefault.md docs/Return.md +docs/SomeOpsRequiringRefIntRequest.md docs/SpecialModelName.md docs/StoreAPI.md docs/Tag.md @@ -91,6 +94,7 @@ model__special_model_name_.go model_additional_properties_class.go model_all_of_primitive_types.go model_animal.go +model_any_of_primitive_type.go model_api_response.go model_apple.go model_apple_req.go @@ -119,6 +123,7 @@ model_fruit_req.go model_gm_fruit.go model_has_only_read_only.go model_health_check_result.go +model_ids_wrapper.go model_incident_data.go model_list.go model_mammal.go @@ -144,6 +149,7 @@ model_property_name_mapping.go model_read_only_first.go model_read_only_with_default.go model_return.go +model_some_ops_requiring_ref_int_request.go model_tag.go model_test_inline_freeform_additional_properties_request.go model_user.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 5598d7ee221..7ec19020815 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -81,6 +81,7 @@ 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 | +*DefaultAPI* | [**SomeOpsRequiringRefInt**](docs/DefaultAPI.md#someopsrequiringrefint) | **Post** /fake/wrapped-integer-ref | *FakeAPI* | [**FakeHealthGet**](docs/FakeAPI.md#fakehealthget) | **Get** /fake/health | Health check endpoint *FakeAPI* | [**FakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | *FakeAPI* | [**FakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | @@ -130,6 +131,7 @@ Class | Method | HTTP request | Description - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [AllOfPrimitiveTypes](docs/AllOfPrimitiveTypes.md) - [Animal](docs/Animal.md) + - [AnyOfPrimitiveType](docs/AnyOfPrimitiveType.md) - [ApiResponse](docs/ApiResponse.md) - [Apple](docs/Apple.md) - [AppleReq](docs/AppleReq.md) @@ -159,6 +161,7 @@ Class | Method | HTTP request | Description - [GmFruit](docs/GmFruit.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [IDsWrapper](docs/IDsWrapper.md) - [IncidentData](docs/IncidentData.md) - [List](docs/List.md) - [Mammal](docs/Mammal.md) @@ -185,6 +188,7 @@ Class | Method | HTTP request | Description - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [ReadOnlyWithDefault](docs/ReadOnlyWithDefault.md) - [Return](docs/Return.md) + - [SomeOpsRequiringRefIntRequest](docs/SomeOpsRequiringRefIntRequest.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 426ad28a116..c63b467c807 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1233,6 +1233,22 @@ paths: summary: parameter name mapping test tags: - fake + /fake/wrapped-integer-ref: + post: + operationId: someOpsRequiringRefInt + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/someOpsRequiringRefInt_request' + required: true + responses: + "200": + content: + application/json: + schema: + type: object + description: success components: requestBodies: UserArray: @@ -2113,6 +2129,12 @@ components: items: type: string type: array + AnyOfPrimitiveType: + anyOf: + - $ref: '#/components/schemas/OneOfPrimitiveTypeChild' + - format: int32 + type: integer + - $ref: '#/components/schemas/OneOfArrayOfString' DuplicatedPropChild: allOf: - $ref: '#/components/schemas/DuplicatedPropParent' @@ -2171,6 +2193,11 @@ components: type: object type: array - type: object + IDsWrapper: + properties: + id: + type: integer + type: object _foo_get_default_response: example: string: @@ -2324,6 +2351,15 @@ components: required: - requiredFile type: object + someOpsRequiringRefInt_request: + properties: + MyIDs: + items: + $ref: '#/components/schemas/IDsWrapper/properties/id' + type: array + required: + - ids + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index 2779a9be8bb..b72de821f94 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -32,6 +32,18 @@ type DefaultAPI interface { // FooGetExecute executes the request // @return FooGetDefaultResponse FooGetExecute(r ApiFooGetRequest) (*FooGetDefaultResponse, *http.Response, error) + + /* + SomeOpsRequiringRefInt Method for SomeOpsRequiringRefInt + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSomeOpsRequiringRefIntRequest + */ + SomeOpsRequiringRefInt(ctx context.Context) ApiSomeOpsRequiringRefIntRequest + + // SomeOpsRequiringRefIntExecute executes the request + // @return map[string]interface{} + SomeOpsRequiringRefIntExecute(r ApiSomeOpsRequiringRefIntRequest) (map[string]interface{}, *http.Response, error) } // DefaultAPIService DefaultAPI service @@ -163,3 +175,111 @@ func (a *DefaultAPIService) FooGetExecute(r ApiFooGetRequest) (*FooGetDefaultRes return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiSomeOpsRequiringRefIntRequest struct { + ctx context.Context + ApiService DefaultAPI + someOpsRequiringRefIntRequest *SomeOpsRequiringRefIntRequest +} + +func (r ApiSomeOpsRequiringRefIntRequest) SomeOpsRequiringRefIntRequest(someOpsRequiringRefIntRequest SomeOpsRequiringRefIntRequest) ApiSomeOpsRequiringRefIntRequest { + r.someOpsRequiringRefIntRequest = &someOpsRequiringRefIntRequest + return r +} + +func (r ApiSomeOpsRequiringRefIntRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.SomeOpsRequiringRefIntExecute(r) +} + +/* +SomeOpsRequiringRefInt Method for SomeOpsRequiringRefInt + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSomeOpsRequiringRefIntRequest +*/ +func (a *DefaultAPIService) SomeOpsRequiringRefInt(ctx context.Context) ApiSomeOpsRequiringRefIntRequest { + return ApiSomeOpsRequiringRefIntRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultAPIService) SomeOpsRequiringRefIntExecute(r ApiSomeOpsRequiringRefIntRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.SomeOpsRequiringRefInt") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/wrapped-integer-ref" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.someOpsRequiringRefIntRequest == nil { + return localVarReturnValue, nil, reportError("someOpsRequiringRefIntRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.someOpsRequiringRefIntRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 5950806508b..42c1dfd0495 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -543,18 +543,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { 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 { diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AnyOfPrimitiveType.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AnyOfPrimitiveType.md new file mode 100644 index 00000000000..fadb3bf985e --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AnyOfPrimitiveType.md @@ -0,0 +1,56 @@ +# AnyOfPrimitiveType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAnyOfPrimitiveType + +`func NewAnyOfPrimitiveType() *AnyOfPrimitiveType` + +NewAnyOfPrimitiveType instantiates a new AnyOfPrimitiveType 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 + +### NewAnyOfPrimitiveTypeWithDefaults + +`func NewAnyOfPrimitiveTypeWithDefaults() *AnyOfPrimitiveType` + +NewAnyOfPrimitiveTypeWithDefaults instantiates a new AnyOfPrimitiveType 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 + +### GetName + +`func (o *AnyOfPrimitiveType) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AnyOfPrimitiveType) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AnyOfPrimitiveType) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AnyOfPrimitiveType) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md index 70aee51f630..f0cf1824fb0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**FooGet**](DefaultAPI.md#FooGet) | **Get** /foo | +[**SomeOpsRequiringRefInt**](DefaultAPI.md#SomeOpsRequiringRefInt) | **Post** /fake/wrapped-integer-ref | @@ -66,3 +67,67 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## SomeOpsRequiringRefInt + +> map[string]interface{} SomeOpsRequiringRefInt(ctx).SomeOpsRequiringRefIntRequest(someOpsRequiringRefIntRequest).Execute() + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + someOpsRequiringRefIntRequest := *openapiclient.NewSomeOpsRequiringRefIntRequest() // SomeOpsRequiringRefIntRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.SomeOpsRequiringRefInt(context.Background()).SomeOpsRequiringRefIntRequest(someOpsRequiringRefIntRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.SomeOpsRequiringRefInt``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SomeOpsRequiringRefInt`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.SomeOpsRequiringRefInt`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSomeOpsRequiringRefIntRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **someOpsRequiringRefIntRequest** | [**SomeOpsRequiringRefIntRequest**](SomeOpsRequiringRefIntRequest.md) | | + +### Return type + +**map[string]interface{}** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/IDsWrapper.md b/samples/openapi3/client/petstore/go/go-petstore/docs/IDsWrapper.md new file mode 100644 index 00000000000..30abdb54fb6 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/IDsWrapper.md @@ -0,0 +1,56 @@ +# IDsWrapper + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int32** | | [optional] + +## Methods + +### NewIDsWrapper + +`func NewIDsWrapper() *IDsWrapper` + +NewIDsWrapper instantiates a new IDsWrapper 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 + +### NewIDsWrapperWithDefaults + +`func NewIDsWrapperWithDefaults() *IDsWrapper` + +NewIDsWrapperWithDefaults instantiates a new IDsWrapper 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 + +### GetId + +`func (o *IDsWrapper) GetId() int32` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IDsWrapper) GetIdOk() (*int32, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IDsWrapper) SetId(v int32)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IDsWrapper) HasId() bool` + +HasId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/SomeOpsRequiringRefIntRequest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/SomeOpsRequiringRefIntRequest.md new file mode 100644 index 00000000000..1cb23cc5df0 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/SomeOpsRequiringRefIntRequest.md @@ -0,0 +1,56 @@ +# SomeOpsRequiringRefIntRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyIDs** | Pointer to **[]int32** | | [optional] + +## Methods + +### NewSomeOpsRequiringRefIntRequest + +`func NewSomeOpsRequiringRefIntRequest() *SomeOpsRequiringRefIntRequest` + +NewSomeOpsRequiringRefIntRequest instantiates a new SomeOpsRequiringRefIntRequest 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 + +### NewSomeOpsRequiringRefIntRequestWithDefaults + +`func NewSomeOpsRequiringRefIntRequestWithDefaults() *SomeOpsRequiringRefIntRequest` + +NewSomeOpsRequiringRefIntRequestWithDefaults instantiates a new SomeOpsRequiringRefIntRequest 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 + +### GetMyIDs + +`func (o *SomeOpsRequiringRefIntRequest) GetMyIDs() []int32` + +GetMyIDs returns the MyIDs field if non-nil, zero value otherwise. + +### GetMyIDsOk + +`func (o *SomeOpsRequiringRefIntRequest) GetMyIDsOk() (*[]int32, bool)` + +GetMyIDsOk returns a tuple with the MyIDs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyIDs + +`func (o *SomeOpsRequiringRefIntRequest) SetMyIDs(v []int32)` + +SetMyIDs sets MyIDs field to given value. + +### HasMyIDs + +`func (o *SomeOpsRequiringRefIntRequest) HasMyIDs() bool` + +HasMyIDs returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go new file mode 100644 index 00000000000..aa60b47e5cc --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_any_of_primitive_type.go @@ -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: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" + "fmt" +) + +// AnyOfPrimitiveType struct for AnyOfPrimitiveType +type AnyOfPrimitiveType struct { + OneOfPrimitiveTypeChild *OneOfPrimitiveTypeChild + ArrayOfString *[]string + Int32 *int32 +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *AnyOfPrimitiveType) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into OneOfPrimitiveTypeChild + err = json.Unmarshal(data, &dst.OneOfPrimitiveTypeChild); + if err == nil { + jsonOneOfPrimitiveTypeChild, _ := json.Marshal(dst.OneOfPrimitiveTypeChild) + if string(jsonOneOfPrimitiveTypeChild) == "{}" { // empty struct + dst.OneOfPrimitiveTypeChild = nil + } else { + return nil // data stored in dst.OneOfPrimitiveTypeChild, return on the first match + } + } else { + dst.OneOfPrimitiveTypeChild = nil + } + + // try to unmarshal JSON data into ArrayOfString + err = json.Unmarshal(data, &dst.ArrayOfString); + if err == nil { + jsonArrayOfString, _ := json.Marshal(dst.ArrayOfString) + if string(jsonArrayOfString) == "{}" { // empty struct + dst.ArrayOfString = nil + } else { + return nil // data stored in dst.ArrayOfString, return on the first match + } + } else { + dst.ArrayOfString = nil + } + + // try to unmarshal JSON data into Int32 + err = json.Unmarshal(data, &dst.Int32); + if err == nil { + jsonInt32, _ := json.Marshal(dst.Int32) + if string(jsonInt32) == "{}" { // empty struct + dst.Int32 = nil + } else { + return nil // data stored in dst.Int32, return on the first match + } + } else { + dst.Int32 = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(AnyOfPrimitiveType)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *AnyOfPrimitiveType) MarshalJSON() ([]byte, error) { + if src.OneOfPrimitiveTypeChild != nil { + return json.Marshal(&src.OneOfPrimitiveTypeChild) + } + + if src.ArrayOfString != nil { + return json.Marshal(&src.ArrayOfString) + } + + if src.Int32 != nil { + return json.Marshal(&src.Int32) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableAnyOfPrimitiveType struct { + value *AnyOfPrimitiveType + isSet bool +} + +func (v NullableAnyOfPrimitiveType) Get() *AnyOfPrimitiveType { + return v.value +} + +func (v *NullableAnyOfPrimitiveType) Set(val *AnyOfPrimitiveType) { + v.value = val + v.isSet = true +} + +func (v NullableAnyOfPrimitiveType) IsSet() bool { + return v.isSet +} + +func (v *NullableAnyOfPrimitiveType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnyOfPrimitiveType(val *AnyOfPrimitiveType) *NullableAnyOfPrimitiveType { + return &NullableAnyOfPrimitiveType{value: val, isSet: true} +} + +func (v NullableAnyOfPrimitiveType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnyOfPrimitiveType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index 6aef735d91e..5df6e8adf5b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -28,7 +28,7 @@ type FormatTest struct { Number float32 `json:"number"` Float *float32 `json:"float,omitempty"` Double *float64 `json:"double,omitempty"` - String *string `json:"string,omitempty"` + String *string `json:"string,omitempty" validate:"regexp=[a-z]/i"` Byte string `json:"byte"` Binary **os.File `json:"binary,omitempty"` Date string `json:"date"` @@ -36,9 +36,9 @@ type FormatTest struct { Uuid *string `json:"uuid,omitempty"` Password string `json:"password"` // A string that is a 10 digit number. Can have leading zeros. - PatternWithDigits *string `json:"pattern_with_digits,omitempty"` + PatternWithDigits *string `json:"pattern_with_digits,omitempty" validate:"regexp=^\\\\d{10}$"` // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` + PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty" validate:"regexp=^image_\\\\d{1,3}$/i"` AdditionalProperties map[string]interface{} } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go index de6c7867502..8bc39dc5070 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -47,7 +48,11 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { if string(jsonApple) == "{}" { // empty struct dst.Apple = nil } else { - match++ + if err = validator.Validate(dst.Apple); err != nil { + dst.Apple = nil + } else { + match++ + } } } else { dst.Apple = nil @@ -60,7 +65,11 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { if string(jsonBanana) == "{}" { // empty struct dst.Banana = nil } else { - match++ + if err = validator.Validate(dst.Banana); err != nil { + dst.Banana = nil + } else { + match++ + } } } else { dst.Banana = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go index 7dccf1d8128..d2b0a4f878a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -47,7 +48,11 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { if string(jsonAppleReq) == "{}" { // empty struct dst.AppleReq = nil } else { - match++ + if err = validator.Validate(dst.AppleReq); err != nil { + dst.AppleReq = nil + } else { + match++ + } } } else { dst.AppleReq = nil @@ -60,7 +65,11 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { if string(jsonBananaReq) == "{}" { // empty struct dst.BananaReq = nil } else { - match++ + if err = validator.Validate(dst.BananaReq); err != nil { + dst.BananaReq = nil + } else { + match++ + } } } else { dst.BananaReq = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_ids_wrapper.go b/samples/openapi3/client/petstore/go/go-petstore/model_ids_wrapper.go new file mode 100644 index 00000000000..76c7363f618 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_ids_wrapper.go @@ -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: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" +) + +// checks if the IDsWrapper type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IDsWrapper{} + +// IDsWrapper struct for IDsWrapper +type IDsWrapper struct { + Id *int32 `json:"id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IDsWrapper IDsWrapper + +// NewIDsWrapper instantiates a new IDsWrapper 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 NewIDsWrapper() *IDsWrapper { + this := IDsWrapper{} + return &this +} + +// NewIDsWrapperWithDefaults instantiates a new IDsWrapper 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 NewIDsWrapperWithDefaults() *IDsWrapper { + this := IDsWrapper{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IDsWrapper) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IDsWrapper) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IDsWrapper) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *IDsWrapper) SetId(v int32) { + o.Id = &v +} + +func (o IDsWrapper) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IDsWrapper) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IDsWrapper) UnmarshalJSON(data []byte) (err error) { + varIDsWrapper := _IDsWrapper{} + + err = json.Unmarshal(data, &varIDsWrapper) + + if err != nil { + return err + } + + *o = IDsWrapper(varIDsWrapper) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIDsWrapper struct { + value *IDsWrapper + isSet bool +} + +func (v NullableIDsWrapper) Get() *IDsWrapper { + return v.value +} + +func (v *NullableIDsWrapper) Set(val *IDsWrapper) { + v.value = val + v.isSet = true +} + +func (v NullableIDsWrapper) IsSet() bool { + return v.isSet +} + +func (v *NullableIDsWrapper) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIDsWrapper(val *IDsWrapper) *NullableIDsWrapper { + return &NullableIDsWrapper{value: val, isSet: true} +} + +func (v NullableIDsWrapper) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIDsWrapper) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go b/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go index b64338d7884..e2d1fd6beee 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_incident_data.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -52,7 +53,11 @@ func (dst *IncidentData) UnmarshalJSON(data []byte) error { if string(jsonArrayOfMapmapOfStringAny) == "{}" { // empty struct dst.ArrayOfMapmapOfStringAny = nil } else { - match++ + if err = validator.Validate(dst.ArrayOfMapmapOfStringAny); err != nil { + dst.ArrayOfMapmapOfStringAny = nil + } else { + match++ + } } } else { dst.ArrayOfMapmapOfStringAny = nil @@ -65,7 +70,11 @@ func (dst *IncidentData) UnmarshalJSON(data []byte) error { if string(jsonMapmapOfStringAny) == "{}" { // empty struct dst.MapmapOfStringAny = nil } else { - match++ + if err = validator.Validate(dst.MapmapOfStringAny); err != nil { + dst.MapmapOfStringAny = nil + } else { + match++ + } } } else { dst.MapmapOfStringAny = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go index 77a58b5d33b..dfc3359257a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -47,7 +48,11 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { if string(jsonWhale) == "{}" { // empty struct dst.Whale = nil } else { - match++ + if err = validator.Validate(dst.Whale); err != nil { + dst.Whale = nil + } else { + match++ + } } } else { dst.Whale = nil @@ -60,7 +65,11 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { if string(jsonZebra) == "{}" { // empty struct dst.Zebra = nil } else { - match++ + if err = validator.Validate(dst.Zebra); err != nil { + dst.Zebra = nil + } else { + match++ + } } } else { dst.Zebra = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go index fc8ba677f68..77c1786358c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "gopkg.in/validator.v2" "fmt" ) @@ -55,7 +56,11 @@ func (dst *OneOfPrimitiveType) UnmarshalJSON(data []byte) error { if string(jsonOneOfPrimitiveTypeChild) == "{}" { // empty struct dst.OneOfPrimitiveTypeChild = nil } else { - match++ + if err = validator.Validate(dst.OneOfPrimitiveTypeChild); err != nil { + dst.OneOfPrimitiveTypeChild = nil + } else { + match++ + } } } else { dst.OneOfPrimitiveTypeChild = nil @@ -68,7 +73,11 @@ func (dst *OneOfPrimitiveType) UnmarshalJSON(data []byte) error { if string(jsonArrayOfString) == "{}" { // empty struct dst.ArrayOfString = nil } else { - match++ + if err = validator.Validate(dst.ArrayOfString); err != nil { + dst.ArrayOfString = nil + } else { + match++ + } } } else { dst.ArrayOfString = nil @@ -81,7 +90,11 @@ func (dst *OneOfPrimitiveType) UnmarshalJSON(data []byte) error { if string(jsonInt32) == "{}" { // empty struct dst.Int32 = nil } else { - match++ + if err = validator.Validate(dst.Int32); err != nil { + dst.Int32 = nil + } else { + match++ + } } } else { dst.Int32 = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go index 767f08946d2..cd739f07abc 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go @@ -13,6 +13,7 @@ package petstore import ( "encoding/json" "time" + "gopkg.in/validator.v2" "fmt" ) @@ -48,7 +49,11 @@ func (dst *OneOfPrimitiveTypes) UnmarshalJSON(data []byte) error { if string(jsonString) == "{}" { // empty struct dst.String = nil } else { - match++ + if err = validator.Validate(dst.String); err != nil { + dst.String = nil + } else { + match++ + } } } else { dst.String = nil @@ -61,7 +66,11 @@ func (dst *OneOfPrimitiveTypes) UnmarshalJSON(data []byte) error { if string(jsonTimeTime) == "{}" { // empty struct dst.TimeTime = nil } else { - match++ + if err = validator.Validate(dst.TimeTime); err != nil { + dst.TimeTime = nil + } else { + match++ + } } } else { dst.TimeTime = nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_some_ops_requiring_ref_int_request.go b/samples/openapi3/client/petstore/go/go-petstore/model_some_ops_requiring_ref_int_request.go new file mode 100644 index 00000000000..f40fa4e4079 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_some_ops_requiring_ref_int_request.go @@ -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: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" +) + +// checks if the SomeOpsRequiringRefIntRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SomeOpsRequiringRefIntRequest{} + +// SomeOpsRequiringRefIntRequest struct for SomeOpsRequiringRefIntRequest +type SomeOpsRequiringRefIntRequest struct { + MyIDs []int32 `json:"MyIDs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SomeOpsRequiringRefIntRequest SomeOpsRequiringRefIntRequest + +// NewSomeOpsRequiringRefIntRequest instantiates a new SomeOpsRequiringRefIntRequest 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 NewSomeOpsRequiringRefIntRequest() *SomeOpsRequiringRefIntRequest { + this := SomeOpsRequiringRefIntRequest{} + return &this +} + +// NewSomeOpsRequiringRefIntRequestWithDefaults instantiates a new SomeOpsRequiringRefIntRequest 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 NewSomeOpsRequiringRefIntRequestWithDefaults() *SomeOpsRequiringRefIntRequest { + this := SomeOpsRequiringRefIntRequest{} + return &this +} + +// GetMyIDs returns the MyIDs field value if set, zero value otherwise. +func (o *SomeOpsRequiringRefIntRequest) GetMyIDs() []int32 { + if o == nil || IsNil(o.MyIDs) { + var ret []int32 + return ret + } + return o.MyIDs +} + +// GetMyIDsOk returns a tuple with the MyIDs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SomeOpsRequiringRefIntRequest) GetMyIDsOk() ([]int32, bool) { + if o == nil || IsNil(o.MyIDs) { + return nil, false + } + return o.MyIDs, true +} + +// HasMyIDs returns a boolean if a field has been set. +func (o *SomeOpsRequiringRefIntRequest) HasMyIDs() bool { + if o != nil && !IsNil(o.MyIDs) { + return true + } + + return false +} + +// SetMyIDs gets a reference to the given []int32 and assigns it to the MyIDs field. +func (o *SomeOpsRequiringRefIntRequest) SetMyIDs(v []int32) { + o.MyIDs = v +} + +func (o SomeOpsRequiringRefIntRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SomeOpsRequiringRefIntRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MyIDs) { + toSerialize["MyIDs"] = o.MyIDs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SomeOpsRequiringRefIntRequest) UnmarshalJSON(data []byte) (err error) { + varSomeOpsRequiringRefIntRequest := _SomeOpsRequiringRefIntRequest{} + + err = json.Unmarshal(data, &varSomeOpsRequiringRefIntRequest) + + if err != nil { + return err + } + + *o = SomeOpsRequiringRefIntRequest(varSomeOpsRequiringRefIntRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "MyIDs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSomeOpsRequiringRefIntRequest struct { + value *SomeOpsRequiringRefIntRequest + isSet bool +} + +func (v NullableSomeOpsRequiringRefIntRequest) Get() *SomeOpsRequiringRefIntRequest { + return v.value +} + +func (v *NullableSomeOpsRequiringRefIntRequest) Set(val *SomeOpsRequiringRefIntRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSomeOpsRequiringRefIntRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSomeOpsRequiringRefIntRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSomeOpsRequiringRefIntRequest(val *SomeOpsRequiringRefIntRequest) *NullableSomeOpsRequiringRefIntRequest { + return &NullableSomeOpsRequiringRefIntRequest{value: val, isSet: true} +} + +func (v NullableSomeOpsRequiringRefIntRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSomeOpsRequiringRefIntRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/utils.go b/samples/openapi3/client/petstore/go/go-petstore/utils.go index 5e3318857b3..a2dcd6eac4b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/utils.go +++ b/samples/openapi3/client/petstore/go/go-petstore/utils.go @@ -11,7 +11,9 @@ API version: 1.0.0 package petstore import ( + "bytes" "encoding/json" + "fmt" "reflect" "time" ) @@ -345,3 +347,15 @@ func IsNil(i interface{}) bool { type MappedNullable interface { ToMap() (map[string]interface{}, error) } + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go.mod b/samples/openapi3/client/petstore/go/go.mod index ecbacfffa87..b0b716e7930 100644 --- a/samples/openapi3/client/petstore/go/go.mod +++ b/samples/openapi3/client/petstore/go/go.mod @@ -5,8 +5,11 @@ go 1.16 replace go-petstore => ./go-petstore require ( - github.com/stretchr/testify v1.8.4 + cloud.google.com/go/compute v1.20.1 // indirect + github.com/stretchr/testify v1.9.0 go-petstore v0.0.0-00010101000000-000000000000 - golang.org/x/net v0.20.0 // indirect - golang.org/x/oauth2 v0.16.0 + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.20.0 + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/validator.v2 v2.0.1 // indirect ) diff --git a/samples/openapi3/client/petstore/go/go.sum b/samples/openapi3/client/petstore/go/go.sum index 15d0aced342..5c2f7679919 100644 --- a/samples/openapi3/client/petstore/go/go.sum +++ b/samples/openapi3/client/petstore/go/go.sum @@ -178,6 +178,7 @@ cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZ cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= @@ -841,6 +842,7 @@ github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcD github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -854,6 +856,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -889,6 +893,8 @@ golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1022,6 +1028,9 @@ golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1065,6 +1074,8 @@ golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1163,6 +1174,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1175,6 +1188,8 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1193,6 +1208,7 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1559,6 +1575,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= +gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index c174be78fc1..a6244858a86 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt index e13766fd5c1..76f25835b9c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index 5f742527c7f..732baf1283a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -329,8 +329,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index 34bbe066491..2ebb4e2b2ab 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -159,7 +159,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -179,7 +179,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -199,7 +199,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -220,7 +220,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -241,7 +241,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -278,7 +278,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -294,7 +294,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -310,7 +310,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -326,7 +326,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -348,7 +348,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -364,7 +364,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -380,7 +380,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -402,7 +402,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -414,7 +414,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -434,7 +434,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -456,7 +456,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -480,7 +480,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -502,7 +502,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -525,7 +525,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -546,7 +546,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 16260f3d871..643520362fc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java index 895c954f15d..c6e32cdacd8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java @@ -59,10 +59,10 @@ public class ChildSchema extends Parent { return this; } - /** + /** * Get prop1 * @return prop1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROP1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java index 4e89052ce90..1fc4e49435c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -60,10 +60,10 @@ public class MySchemaNameCharacters extends Parent { return this; } - /** + /** * Get prop2 * @return prop2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROP2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java index ccd7a90c94f..9dfa00ee526 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java @@ -58,10 +58,10 @@ public class Parent { return this; } - /** + /** * Get objectType * @return objectType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle index 9f672256fad..b3bfa1c7fbb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.sbt index 642221bd070..f8e07fa6fa8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml index 0105e682f5c..b549f6c5842 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml @@ -340,8 +340,8 @@ UTF-8 1.6.6 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java index 21dda1d0520..c197a225cf5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -177,7 +177,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -197,7 +197,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -218,7 +218,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -239,7 +239,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -260,7 +260,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -305,7 +305,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -321,7 +321,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -375,7 +375,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -391,7 +391,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -424,7 +424,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -457,7 +457,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -527,7 +527,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -539,7 +539,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -559,7 +559,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -581,7 +581,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -605,7 +605,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -627,7 +627,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -650,7 +650,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -671,7 +671,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java index 3dda1f63440..1c4e36e6411 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java @@ -83,7 +83,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{orderId}", apiClient.escapeString(orderId)); + .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java index c04bbef9164..418c3a86a75 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java @@ -204,7 +204,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -253,7 +253,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -391,7 +391,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 44cdfbfe81c..a0bea94ab60 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Category.java index d99181b8c18..27c20c244d1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Category.java @@ -52,10 +52,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -78,10 +78,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b49873bc190..47c28b2e062 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -57,10 +57,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -83,10 +83,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -109,10 +109,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Order.java index 53d2852b728..40b0a299155 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Order.java @@ -106,10 +106,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -132,10 +132,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -158,10 +158,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -184,10 +184,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -210,10 +210,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -236,10 +236,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_COMPLETE) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java index c0092c62d23..842479039c7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -110,10 +110,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -136,10 +136,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -162,10 +162,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -196,10 +196,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -230,10 +230,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -257,11 +257,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Tag.java index 04da3d408a8..5597f6b81b0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Tag.java @@ -52,10 +52,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -78,10 +78,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/User.java index 13dc14ed6e4..edb49d1eff5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/User.java @@ -76,10 +76,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @@ -102,10 +102,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -128,10 +128,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -154,10 +154,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -180,10 +180,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EMAIL) @@ -206,10 +206,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -232,10 +232,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PHONE) @@ -258,10 +258,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle index 9f672256fad..b3bfa1c7fbb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.sbt index 642221bd070..f8e07fa6fa8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml index 87405992f87..437ee5f4386 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml @@ -340,8 +340,8 @@ UTF-8 2.2.15 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java index 21dda1d0520..c197a225cf5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -177,7 +177,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -197,7 +197,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -218,7 +218,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -239,7 +239,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -260,7 +260,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -305,7 +305,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -321,7 +321,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -353,7 +353,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -375,7 +375,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -391,7 +391,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -407,7 +407,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -424,7 +424,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -440,7 +440,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -457,7 +457,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -527,7 +527,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -539,7 +539,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -559,7 +559,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -581,7 +581,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -605,7 +605,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -627,7 +627,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -650,7 +650,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -671,7 +671,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java index 3dda1f63440..1c4e36e6411 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -83,7 +83,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{orderId}", apiClient.escapeString(orderId)); + .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/UserApi.java index c04bbef9164..418c3a86a75 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/api/UserApi.java @@ -204,7 +204,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -253,7 +253,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -391,7 +391,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 44cdfbfe81c..a0bea94ab60 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Category.java index cc8e38cc131..066bf0af4ff 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -51,10 +51,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -77,10 +77,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index edd472c99a3..32719cdbefe 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -56,10 +56,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CODE) @@ -82,10 +82,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TYPE) @@ -108,10 +108,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Order.java index 3b281b2c0bd..3d78a7980e3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -105,10 +105,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -131,10 +131,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PET_ID) @@ -157,10 +157,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -183,10 +183,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -209,10 +209,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @@ -235,10 +235,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_COMPLETE) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Pet.java index b5594b967a5..cadedd73ab7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -109,10 +109,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -135,10 +135,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @@ -161,10 +161,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) @@ -195,10 +195,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -229,10 +229,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_TAGS) @@ -256,11 +256,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "pet status in the store") diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Tag.java index 74ea122f162..aec050847a4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -51,10 +51,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -77,10 +77,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/User.java index 5db6977197b..7377241c9fa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -75,10 +75,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_ID) @@ -101,10 +101,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_USERNAME) @@ -127,10 +127,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -153,10 +153,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -179,10 +179,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_EMAIL) @@ -205,10 +205,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -231,10 +231,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") @JsonProperty(JSON_PROPERTY_PHONE) @@ -257,10 +257,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES index 4fbcb8fd20b..78d8fe209b3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -46,6 +46,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/Mammal.md +docs/MammalAnyof.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -158,6 +159,7 @@ 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/IsoscelesTriangle.java src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MammalAnyof.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 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/README.md b/samples/openapi3/client/petstore/java/jersey2-java8/README.md index d1d9f5a522d..7a3c02f80b5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/README.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/README.md @@ -224,6 +224,7 @@ Class | Method | HTTP request | Description - [HealthCheckResult](docs/HealthCheckResult.md) - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Mammal](docs/Mammal.md) + - [MammalAnyof](docs/MammalAnyof.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 86a4762bc48..25e78fa9e30 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -2059,6 +2059,13 @@ components: - $ref: '#/components/schemas/whale' - $ref: '#/components/schemas/zebra' - $ref: '#/components/schemas/Pig' + mammal_anyof: + anyOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className whale: properties: hasBaleen: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 8102b879b4e..e395c9d2d6f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index 2667ad6f51b..73d21d4824b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -16,10 +16,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/MammalAnyof.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MammalAnyof.md new file mode 100644 index 00000000000..3fb117e293e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MammalAnyof.md @@ -0,0 +1,46 @@ + + +# MammalAnyof + +## anyOf schemas +* [Pig](Pig.md) +* [Whale](Whale.md) +* [Zebra](Zebra.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.MammalAnyof; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +public class Example { + public static void main(String[] args) { + MammalAnyof exampleMammalAnyof = new MammalAnyof(); + + // create a new Pig + Pig examplePig = new Pig(); + // set MammalAnyof to Pig + exampleMammalAnyof.setActualInstance(examplePig); + // to get back the Pig set earlier + Pig testPig = (Pig) exampleMammalAnyof.getActualInstance(); + + // create a new Whale + Whale exampleWhale = new Whale(); + // set MammalAnyof to Whale + exampleMammalAnyof.setActualInstance(exampleWhale); + // to get back the Whale set earlier + Whale testWhale = (Whale) exampleMammalAnyof.getActualInstance(); + + // create a new Zebra + Zebra exampleZebra = new Zebra(); + // set MammalAnyof to Zebra + exampleMammalAnyof.setActualInstance(exampleZebra); + // to get back the Zebra set earlier + Zebra testZebra = (Zebra) exampleMammalAnyof.getActualInstance(); + } +} +``` + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index cde0e1d2633..084329bf033 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -339,8 +339,8 @@ UTF-8 2.37 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 0.2.6 1.3.5 5.10.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index d479a30f497..09a4a582274 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -275,7 +275,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field httpClient.

    * * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -295,7 +295,7 @@ public class ApiClient extends JavaTimeFormatter { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -316,7 +316,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field servers.

    * * @param servers a {@link java.util.List} of servers. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -337,7 +337,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverIndex.

    * * @param serverIndex the server index - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -358,7 +358,7 @@ public class ApiClient extends JavaTimeFormatter { *

    Setter for the field serverVariables.

    * * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -403,7 +403,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -419,7 +419,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -435,7 +435,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -451,7 +451,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -473,7 +473,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -489,7 +489,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -505,7 +505,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -522,7 +522,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -538,7 +538,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -555,7 +555,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param username the user name * @param password the user password - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -571,7 +571,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -587,7 +587,7 @@ public class ApiClient extends JavaTimeFormatter { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -603,7 +603,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -625,7 +625,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The header's key * @param value The header's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -637,7 +637,7 @@ public class ApiClient extends JavaTimeFormatter { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -657,7 +657,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -679,7 +679,7 @@ public class ApiClient extends JavaTimeFormatter { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -703,7 +703,7 @@ public class ApiClient extends JavaTimeFormatter { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -725,7 +725,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -748,7 +748,7 @@ public class ApiClient extends JavaTimeFormatter { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -769,7 +769,7 @@ public class ApiClient extends JavaTimeFormatter { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link org.openapitools.client.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 9befec0c09f..d578aca1b5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -179,9 +179,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -198,7 +198,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -218,7 +218,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java index f216874de1c..53b5ece9541 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -83,7 +83,7 @@ public class StoreApi { // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index 14d91f7400a..cbc7aa4a1a4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -201,7 +201,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -249,7 +249,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); @@ -386,7 +386,7 @@ public class UserApi { // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{username}", apiClient.escapeString(username)); + .replaceAll("\\{username}", apiClient.escapeString(username.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 15335780fed..2cc1a9bbc58 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 600dcba564f..3a7775fcd06 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -87,10 +87,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapProperty * @return mapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -120,10 +120,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapOfMapProperty * @return mapOfMapProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -145,10 +145,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get anytype1 * @return anytype1 - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -178,10 +178,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,10 +203,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,10 +236,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -261,10 +261,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMPTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,10 +294,10 @@ public class AdditionalPropertiesClass { return this; } - /** + /** * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 6a7fd139ffe..593dbdfccb4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -62,10 +62,10 @@ public class Animal { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,10 +87,10 @@ public class Animal { return this; } - /** + /** * Get color * @return color - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index bf88f3fc0de..8cfe55fe078 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -50,10 +50,10 @@ public class Apple { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Apple { return this; } - /** + /** * Get origin * @return origin - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 09414391c07..018ba3db188 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -50,10 +50,10 @@ public class AppleReq { return this; } - /** + /** * Get cultivar * @return cultivar - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CULTIVAR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -75,10 +75,10 @@ public class AppleReq { return this; } - /** + /** * Get mealy * @return mealy - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MEALY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 8e681b33761..4cf0854cd9f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4f6f32c16e1..138899b8719 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -56,10 +56,10 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber * @return arrayNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index fefd82a02a8..4bfcf690407 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -64,10 +64,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString * @return arrayOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,10 +97,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,10 +130,10 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index 309508dd699..91628dc99f4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -47,10 +47,10 @@ public class Banana { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index b8fe4ac796b..db5ad08ea45 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -51,10 +51,10 @@ public class BananaReq { return this; } - /** + /** * Get lengthCm * @return lengthCm - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LENGTH_CM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -76,10 +76,10 @@ public class BananaReq { return this; } - /** + /** * Get sweet * @return sweet - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SWEET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java index 6362ec84664..2373425c57a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -45,10 +45,10 @@ public class BasquePig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 88158f86a67..18d2b6cb2c2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -65,10 +65,10 @@ public class Capitalization { return this; } - /** + /** * Get smallCamel * @return smallCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,10 +90,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalCamel * @return capitalCamel - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -115,10 +115,10 @@ public class Capitalization { return this; } - /** + /** * Get smallSnake * @return smallSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,10 +140,10 @@ public class Capitalization { return this; } - /** + /** * Get capitalSnake * @return capitalSnake - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,10 +165,10 @@ public class Capitalization { return this; } - /** + /** * Get scAETHFlowPoints * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,10 +190,10 @@ public class Capitalization { return this; } - /** + /** * Name of the pet * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 4bac94b7cc7..1165f725774 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -60,10 +60,10 @@ public class Cat extends Animal { return this; } - /** + /** * Get declawed * @return declawed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 2eab9c20f34..79852f6f51b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -49,10 +49,10 @@ public class Category { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index 91e10119e43..9d7b956904a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -65,10 +65,10 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,10 +98,10 @@ public class ChildCat extends ParentPet { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 9a20e671038..91ed1c5728e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -45,10 +45,10 @@ public class ClassModel { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 076a8a5b323..ff8cb2970a9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -45,10 +45,10 @@ public class Client { return this; } - /** + /** * Get client * @return client - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index c11a969550d..9db25c94b19 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -53,10 +53,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -78,10 +78,10 @@ public class ComplexQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java index f7ea54f60b3..93a7b5fac40 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -45,10 +45,10 @@ public class DanishPig { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 8ad3b0aacc8..44e7ac2bd19 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -47,10 +47,10 @@ public class DeprecatedObject { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 6c65945b861..9171177f936 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -59,10 +59,10 @@ public class Dog extends Animal { return this; } - /** + /** * Get breed * @return breed - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index c578bd200fc..34a295aa95f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -71,10 +71,10 @@ public class Drawing { return this; } - /** + /** * Get mainShape * @return mainShape - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,10 +96,10 @@ public class Drawing { return this; } - /** + /** * Get shapeOrNull * @return shapeOrNull - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -129,10 +129,10 @@ public class Drawing { return this; } - /** + /** * Get nullableShape * @return nullableShape - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -170,10 +170,10 @@ public class Drawing { return this; } - /** + /** * Get shapes * @return shapes - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHAPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 8068c291c86..f6cb5ffefa5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -121,10 +121,10 @@ public class EnumArrays { return this; } - /** + /** * Get justSymbol * @return justSymbol - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,10 +154,10 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum * @return arrayEnum - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index fb59caa6677..d123a1af5fb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -265,10 +265,10 @@ public class EnumTest { return this; } - /** + /** * Get enumString * @return enumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,10 +290,10 @@ public class EnumTest { return this; } - /** + /** * Get enumStringRequired * @return enumStringRequired - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -315,10 +315,10 @@ public class EnumTest { return this; } - /** + /** * Get enumInteger * @return enumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -340,10 +340,10 @@ public class EnumTest { return this; } - /** + /** * Get enumIntegerOnly * @return enumIntegerOnly - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -365,10 +365,10 @@ public class EnumTest { return this; } - /** + /** * Get enumNumber * @return enumNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -390,10 +390,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnum * @return outerEnum - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -423,10 +423,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumInteger * @return outerEnumInteger - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,10 +448,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumDefaultValue * @return outerEnumDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -473,10 +473,10 @@ public class EnumTest { return this; } - /** + /** * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 9022e998810..d68af0d3205 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -53,10 +53,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -78,10 +78,10 @@ public class EquilateralTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eb1f8ababde..55076414fd4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -52,10 +52,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get _file * @return _file - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -85,10 +85,10 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files * @return files - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index 86303af7a59..a70fb952132 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -45,10 +45,10 @@ public class Foo { return this; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 8aed27b3693..75287b52ef4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -47,10 +47,10 @@ public class FooGetDefaultResponse { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index a6f616b4f67..6c208a4db05 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -111,12 +111,12 @@ public class FormatTest { return this; } - /** + /** * Get integer * minimum: 10 * maximum: 100 * @return integer - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,12 +138,12 @@ public class FormatTest { return this; } - /** + /** * Get int32 * minimum: 20 * maximum: 200 * @return int32 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,10 +165,10 @@ public class FormatTest { return this; } - /** + /** * Get int64 * @return int64 - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +190,12 @@ public class FormatTest { return this; } - /** + /** * Get number * minimum: 32.1 * maximum: 543.2 * @return number - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -217,12 +217,12 @@ public class FormatTest { return this; } - /** + /** * Get _float * minimum: 54.3 * maximum: 987.6 * @return _float - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -244,12 +244,12 @@ public class FormatTest { return this; } - /** + /** * Get _double * minimum: 67.8 * maximum: 123.4 * @return _double - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -271,10 +271,10 @@ public class FormatTest { return this; } - /** + /** * Get decimal * @return decimal - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -296,10 +296,10 @@ public class FormatTest { return this; } - /** + /** * Get string * @return string - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,10 +321,10 @@ public class FormatTest { return this; } - /** + /** * Get _byte * @return _byte - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -346,10 +346,10 @@ public class FormatTest { return this; } - /** + /** * Get binary * @return binary - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -371,10 +371,10 @@ public class FormatTest { return this; } - /** + /** * Get date * @return date - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -396,10 +396,10 @@ public class FormatTest { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -421,10 +421,10 @@ public class FormatTest { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -446,10 +446,10 @@ public class FormatTest { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -471,10 +471,10 @@ public class FormatTest { return this; } - /** + /** * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,10 +496,10 @@ public class FormatTest { return this; } - /** + /** * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index 1b680d760b8..e1098bfacd4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -142,7 +142,7 @@ public class Fruit extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Fruit() { super("oneOf", Boolean.FALSE); @@ -167,7 +167,7 @@ public class Fruit extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Fruit.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 027e1045c39..850a9a5d4f1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -142,7 +142,7 @@ public class FruitReq extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public FruitReq() { super("oneOf", Boolean.TRUE); @@ -167,7 +167,7 @@ public class FruitReq extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return FruitReq.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index 509fb945fd5..07684130341 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -122,7 +122,7 @@ public class GmFruit extends AbstractOpenApiSchema { } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public GmFruit() { super("anyOf", Boolean.FALSE); @@ -147,7 +147,7 @@ public class GmFruit extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return GmFruit.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 77638631c67..09f944142ad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -58,10 +58,10 @@ public class GrandparentAnimal { return this; } - /** + /** * Get petType * @return petType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PET_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 8a3fa9350cc..657166b59a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -55,10 +55,10 @@ public class HasOnlyReadOnly { this.foo = foo; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -70,10 +70,10 @@ public class HasOnlyReadOnly { - /** + /** * Get foo * @return foo - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 33e37b50a46..4e71c980f76 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -49,10 +49,10 @@ public class HealthCheckResult { return this; } - /** + /** * Get nullableMessage * @return nullableMessage - **/ + */ @javax.annotation.Nullable @JsonIgnore diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 8fd6bd87e19..3136a9203ec 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -49,10 +49,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -74,10 +74,10 @@ public class IsoscelesTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index e517a13230a..a6d515748ec 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -185,7 +185,7 @@ public class Mammal extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Mammal() { super("oneOf", Boolean.FALSE); @@ -273,7 +273,7 @@ public class Mammal extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Mammal.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java new file mode 100644 index 00000000000..2b2129070dd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.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.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +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 java.util.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class) +@JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class) +public class MammalAnyof extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MammalAnyof.class.getName()); + + public static class MammalAnyofSerializer extends StdSerializer { + public MammalAnyofSerializer(Class t) { + super(t); + } + + public MammalAnyofSerializer() { + this(null); + } + + @Override + public void serialize(MammalAnyof value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class MammalAnyofDeserializer extends StdDeserializer { + public MammalAnyofDeserializer() { + this(MammalAnyof.class); + } + + public MammalAnyofDeserializer(Class vc) { + super(vc); + } + + @Override + public MammalAnyof deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + Class cls = JSON.getClassForElement(tree, new MammalAnyof().getClass()); + if (cls != null) { + // When the OAS schema includes a discriminator, use the discriminator value to + // discriminate the anyOf schemas. + // Get the discriminator mapping value to get the class. + deserialized = tree.traverse(jp.getCodec()).readValueAs(cls); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } + // deserialize Pig + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + // deserialize Whale + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + // deserialize Zebra + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + MammalAnyof ret = new MammalAnyof(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + } + + throw new IOException(String.format("Failed deserialization for MammalAnyof: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "MammalAnyof cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap<>(); + + public MammalAnyof() { + super("anyOf", Boolean.FALSE); + } + /** + * 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. + */ + @JsonAnySetter + public MammalAnyof 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. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this mammal_anyof object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } + public MammalAnyof(Pig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public MammalAnyof(Whale o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public MammalAnyof(Zebra o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Pig", new GenericType() { + }); + schemas.put("Whale", new GenericType() { + }); + schemas.put("Zebra", new GenericType() { + }); + JSON.registerDescendants(MammalAnyof.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Pig", Pig.class); + mappings.put("whale", Whale.class); + mappings.put("zebra", Zebra.class); + mappings.put("mammal_anyof", MammalAnyof.class); + JSON.registerDiscriminator(MammalAnyof.class, "className", mappings); + } + + @Override + public Map> getSchemas() { + return MammalAnyof.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Pig, Whale, Zebra + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + + /** + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + + /** + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 723696541fa..c03044c81f9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -102,10 +102,10 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,10 +135,10 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class MapTest { return this; } - /** + /** * Get directMap * @return directMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -201,10 +201,10 @@ public class MapTest { return this; } - /** + /** * Get indirectMap * @return indirectMap - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 61259993f88..c88f952e6cb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -58,10 +58,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -83,10 +83,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get dateTime * @return dateTime - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map * @return map - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index d38a6bf453a..a0c1cf630d6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -50,10 +50,10 @@ public class Model200Response { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class Model200Response { return this; } - /** + /** * Get propertyClass * @return propertyClass - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d41b65dd3f7..c821f25700a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -54,10 +54,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index 90a694b50a7..133103caad8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -46,10 +46,10 @@ public class ModelFile { return this; } - /** + /** * Test capitalization * @return sourceURI - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index f3f7b550ee6..601bfa200fa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -46,10 +46,10 @@ public class ModelList { return this; } - /** + /** * Get _123list * @return _123list - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 23ca526f635..d7919c9d674 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -46,10 +46,10 @@ public class ModelReturn { return this; } - /** + /** * Get _return * @return _return - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 5665c45484a..6a81682684a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -67,10 +67,10 @@ public class Name { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,10 +87,10 @@ public class Name { } - /** + /** * Get snakeCase * @return snakeCase - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,10 +107,10 @@ public class Name { return this; } - /** + /** * Get property * @return property - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,10 +127,10 @@ public class Name { } - /** + /** * Get _123number * @return _123number - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index 6e55998b128..483f6e61a5b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -104,10 +104,10 @@ public class NullableClass { return this; } - /** + /** * Get integerProp * @return integerProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -137,10 +137,10 @@ public class NullableClass { return this; } - /** + /** * Get numberProp * @return numberProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -170,10 +170,10 @@ public class NullableClass { return this; } - /** + /** * Get booleanProp * @return booleanProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -203,10 +203,10 @@ public class NullableClass { return this; } - /** + /** * Get stringProp * @return stringProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -236,10 +236,10 @@ public class NullableClass { return this; } - /** + /** * Get dateProp * @return dateProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -269,10 +269,10 @@ public class NullableClass { return this; } - /** + /** * Get datetimeProp * @return datetimeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -314,10 +314,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayNullableProp * @return arrayNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -359,10 +359,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -400,10 +400,10 @@ public class NullableClass { return this; } - /** + /** * Get arrayItemsNullable * @return arrayItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -437,10 +437,10 @@ public class NullableClass { return this; } - /** + /** * Get objectNullableProp * @return objectNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -482,10 +482,10 @@ public class NullableClass { return this; } - /** + /** * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -523,10 +523,10 @@ public class NullableClass { return this; } - /** + /** * Get objectItemsNullable * @return objectItemsNullable - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index c6e485137a7..e6aa472b993 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -164,7 +164,7 @@ public class NullableShape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public NullableShape() { super("oneOf", Boolean.TRUE); @@ -244,7 +244,7 @@ public class NullableShape extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return NullableShape.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ee815a0182b..069be583d8c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -46,10 +46,10 @@ public class NumberOnly { return this; } - /** + /** * Get justNumber * @return justNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 7d892a18882..0bbb78869a8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -64,10 +64,10 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get uuid * @return uuid - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -90,11 +90,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get id * @return id * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @@ -119,11 +119,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get deprecatedRef * @return deprecatedRef * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) @@ -156,11 +156,11 @@ public class ObjectWithDeprecatedFields { return this; } - /** + /** * Get bars * @return bars * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BARS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 100666a4a45..3d27edbe194 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -103,10 +103,10 @@ public class Order { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,10 +128,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -153,10 +153,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -178,10 +178,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,10 +203,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -228,10 +228,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 2b89f20e8e7..e64e063a440 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -54,10 +54,10 @@ public class OuterComposite { return this; } - /** + /** * Get myNumber * @return myNumber - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class OuterComposite { return this; } - /** + /** * Get myString * @return myString - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class OuterComposite { return this; } - /** + /** * Get myBoolean * @return myBoolean - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index fedd7e74b30..dcb416c6b47 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -106,10 +106,10 @@ public class Pet { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +131,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,10 +156,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -189,10 +189,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -222,10 +222,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,10 +247,10 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index aa5fe18916e..fcffe78a479 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -164,7 +164,7 @@ public class Pig extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Pig() { super("oneOf", Boolean.FALSE); @@ -244,7 +244,7 @@ public class Pig extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Pig.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index edc10d9cd23..adbc7fabf74 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -164,7 +164,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Quadrilateral() { super("oneOf", Boolean.FALSE); @@ -244,7 +244,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Quadrilateral.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 160a0df00ec..b94a6a4134f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -45,10 +45,10 @@ public class QuadrilateralInterface { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0c3ba6ce34e..893928438c7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -52,10 +52,10 @@ public class ReadOnlyFirst { this.bar = bar; } - /** + /** * Get bar * @return bar - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,10 +72,10 @@ public class ReadOnlyFirst { return this; } - /** + /** * Get baz * @return baz - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index cff2375eab8..8865e5c9881 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -53,10 +53,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -78,10 +78,10 @@ public class ScaleneTriangle { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index bb60b6f9dde..60af18698d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -164,7 +164,7 @@ public class Shape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Shape() { super("oneOf", Boolean.FALSE); @@ -244,7 +244,7 @@ public class Shape extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Shape.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index 19aef54262c..2f6abb9a8f7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -45,10 +45,10 @@ public class ShapeInterface { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index a84cb067e73..82a0965d7bf 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -164,7 +164,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public ShapeOrNull() { super("oneOf", Boolean.TRUE); @@ -244,7 +244,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return ShapeOrNull.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 906ca4ec286..0db9f8386c7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -53,10 +53,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get shapeType * @return shapeType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -78,10 +78,10 @@ public class SimpleQuadrilateral { return this; } - /** + /** * Get quadrilateralType * @return quadrilateralType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 6d9232809e3..341220d6df7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -50,10 +50,10 @@ public class SpecialModelName { return this; } - /** + /** * Get $specialPropertyName * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,10 +75,10 @@ public class SpecialModelName { return this; } - /** + /** * Get specialModelName * @return specialModelName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index aed85c4e82f..250788cbb19 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -49,10 +49,10 @@ public class Tag { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,10 +74,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 16de478f12f..b0c2ff6cc7a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -50,10 +50,10 @@ public class TestInlineFreeformAdditionalPropertiesRequest { return this; } - /** + /** * Get someProperty * @return someProperty - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index c704d3f0bf9..c953f85800f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -185,7 +185,7 @@ public class Triangle extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public Triangle() { super("oneOf", Boolean.FALSE); @@ -273,7 +273,7 @@ public class Triangle extends AbstractOpenApiSchema { } @Override - public Map getSchemas() { + public Map> getSchemas() { return Triangle.schemas; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index b60005c8f68..8933946d0ae 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -45,10 +45,10 @@ public class TriangleInterface { return this; } - /** + /** * Get triangleType * @return triangleType - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 4d9ae28e356..c3fb54a882a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -93,10 +93,10 @@ public class User { return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,10 +118,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -143,10 +143,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,10 +168,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -193,10 +193,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,10 +218,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,10 +243,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,10 +268,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,10 +293,10 @@ public class User { return this; } - /** + /** * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. * @return objectWithNoDeclaredProps - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -318,10 +318,10 @@ public class User { return this; } - /** + /** * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. * @return objectWithNoDeclaredPropsNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -351,10 +351,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 * @return anyTypeProp - **/ + */ @javax.annotation.Nullable @JsonIgnore @@ -384,10 +384,10 @@ public class User { return this; } - /** + /** * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. * @return anyTypePropNullable - **/ + */ @javax.annotation.Nullable @JsonIgnore diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 3c1b2ab5e10..b49c933b89a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -54,10 +54,10 @@ public class Whale { return this; } - /** + /** * Get hasBaleen * @return hasBaleen - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_BALEEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,10 +79,10 @@ public class Whale { return this; } - /** + /** * Get hasTeeth * @return hasTeeth - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_TEETH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -104,10 +104,10 @@ public class Whale { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index fe830e6fc05..4e5d0707d11 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -91,10 +91,10 @@ public class Zebra { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,10 +116,10 @@ public class Zebra { return this; } - /** + /** * Get className * @return className - **/ + */ @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalAnyofTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalAnyofTest.java new file mode 100644 index 00000000000..a14bb512803 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalAnyofTest.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.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 java.util.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MammalAnyof + */ +public class MammalAnyofTest { + private final MammalAnyof model = new MammalAnyof(); + + /** + * Model tests for MammalAnyof + */ + @Test + public void testMammalAnyof() { + // TODO: test MammalAnyof + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES index 6b44ba44379..8b7953128a7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES @@ -101,9 +101,12 @@ docs/StoreApi.md docs/Tag.md docs/Task.md docs/TaskActivity.md +docs/TestEnum.md +docs/TestEnumWithDefault.md docs/TestErrorResponsesWithModel400Response.md docs/TestErrorResponsesWithModel404Response.md docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/TestModelWithEnumDefault.md docs/TestObjectForMultipartRequestsRequestMarker.md docs/Tiger.md docs/UnnamedDictWithAdditionalModelListProperties.md @@ -218,9 +221,12 @@ petstore_api/models/special_name.py petstore_api/models/tag.py petstore_api/models/task.py petstore_api/models/task_activity.py +petstore_api/models/test_enum.py +petstore_api/models/test_enum_with_default.py petstore_api/models/test_error_responses_with_model400_response.py petstore_api/models/test_error_responses_with_model404_response.py petstore_api/models/test_inline_freeform_additional_properties_request.py +petstore_api/models/test_model_with_enum_default.py petstore_api/models/test_object_for_multipart_requests_request_marker.py petstore_api/models/tiger.py petstore_api/models/unnamed_dict_with_additional_model_list_properties.py diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index 20a105cf2b9..7958ec0c1bc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -241,9 +241,12 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Task](docs/Task.md) - [TaskActivity](docs/TaskActivity.md) + - [TestEnum](docs/TestEnum.md) + - [TestEnumWithDefault](docs/TestEnumWithDefault.md) - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md) - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md) - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md) - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md) - [Tiger](docs/Tiger.md) - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumClass.md index 8097457bd55..725b617bdad 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumClass.md @@ -1,10 +1,13 @@ # EnumClass -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ABC` (value: `'_abc'`) + +* `MINUS_EFG` (value: `'-efg'`) + +* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(xyz)'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString1.md b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString1.md index 1e2b5eaa039..aa214538bca 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString1.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString1.md @@ -1,10 +1,11 @@ # EnumString1 -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `A` (value: `'a'`) + +* `B` (value: `'b'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString2.md b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString2.md index 15a466f322d..d1b49f8dddd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString2.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumString2.md @@ -1,10 +1,11 @@ # EnumString2 -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `C` (value: `'c'`) + +* `D` (value: `'d'`) [[Back to Model list]](../README.md#documentation-for-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 dd37f9cc7b4..72f5fbdae23 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md @@ -14,8 +14,8 @@ Name | Type | Description | Notes **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] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to OuterEnumDefaultValue.PLACED] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OuterEnumIntegerDefaultValue.NUMBER_0] ## Example diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md index a04e01c3df6..7d895e650b3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FakeApi.md @@ -130,7 +130,7 @@ configuration = petstore_api.Configuration( async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) - enum_ref = petstore_api.EnumClass() # EnumClass | enum reference (optional) + enum_ref = -efg # EnumClass | enum reference (optional) (default to -efg) try: # test enum reference query parameter @@ -146,7 +146,7 @@ async with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] + **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] [default to -efg] ### Return type diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnum.md index 948ce460ac3..9ba4f91069a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnum.md @@ -1,10 +1,13 @@ # OuterEnum -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumDefaultValue.md index bcb71d06764..0c97f8c9cb6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumDefaultValue.md @@ -1,10 +1,13 @@ # OuterEnumDefaultValue -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumInteger.md index c60cb25ddd6..052b5163814 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumInteger.md @@ -1,10 +1,13 @@ # OuterEnumInteger -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumIntegerDefaultValue.md index 0f982a2609b..66cd0abdb0a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterEnumIntegerDefaultValue.md @@ -1,10 +1,15 @@ # OuterEnumIntegerDefaultValue -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `NUMBER_MINUS_1` (value: `-1`) + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/SingleRefType.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SingleRefType.md index 728e7c214aa..8f0f60e5678 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SingleRefType.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SingleRefType.md @@ -1,10 +1,11 @@ # SingleRefType -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ADMIN` (value: `'admin'`) + +* `USER` (value: `'user'`) [[Back to Model list]](../README.md#documentation-for-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/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialCharacterEnum.md index b36a2831657..71a3affc4fe 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialCharacterEnum.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialCharacterEnum.md @@ -1,10 +1,27 @@ # SpecialCharacterEnum -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ENUM_456` (value: `'456'`) + +* `ENUM_123ABC` (value: `'123abc'`) + +* `UNDERSCORE` (value: `'_'`) + +* `SPACE` (value: `' '`) + +* `AMPERSAND` (value: `'&'`) + +* `DOLLAR` (value: `'$'`) + +* `GREATER_THAN_EQUAL` (value: `'>='`) + +* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`) + +* `IMPORT` (value: `'import'`) + +* `HELLO_WORLD` (value: `' hello world '`) [[Back to Model list]](../README.md#documentation-for-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/TestEnum.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestEnum.md new file mode 100644 index 00000000000..612b62bd4dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestEnum.md @@ -0,0 +1,16 @@ +# TestEnum + + +## Enum + +* `ONE` (value: `'ONE'`) + +* `TWO` (value: `'TWO'`) + +* `THREE` (value: `'THREE'`) + +* `FOUR` (value: `'foUr'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestEnumWithDefault.md new file mode 100644 index 00000000000..ac8591c95c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestEnumWithDefault.md @@ -0,0 +1,14 @@ +# TestEnumWithDefault + + +## Enum + +* `EIN` (value: `'EIN'`) + +* `ZWEI` (value: `'ZWEI'`) + +* `DREI` (value: `'DREI'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestModelWithEnumDefault.md new file mode 100644 index 00000000000..7d46e86deba --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestModelWithEnumDefault.md @@ -0,0 +1,33 @@ +# TestModelWithEnumDefault + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_enum** | [**TestEnum**](TestEnum.md) | | +**test_string** | **str** | | [optional] +**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] [default to TestEnumWithDefault.ZWEI] +**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey'] +**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B'] + +## Example + +```python +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +# TODO update the JSON string below +json = "{}" +# create an instance of TestModelWithEnumDefault from a JSON string +test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json) +# print the JSON string representation of the object +print(TestModelWithEnumDefault.to_json()) + +# convert the object into a dict +test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict() +# create an instance of TestModelWithEnumDefault from a dict +test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict) +``` +[[Back to Model list]](../README.md#documentation-for-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 3f6c3aabf13..efc802ab039 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -130,9 +130,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py index ebfbeec9157..f4d58775ffc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py @@ -266,11 +266,12 @@ class AnotherFakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py index d6e7bb55705..71cf62b03c2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py @@ -243,11 +243,12 @@ class DefaultApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py index 078561dd407..4fc62b6e196 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py @@ -772,11 +772,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1324,11 +1325,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1594,11 +1596,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1864,11 +1867,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2134,11 +2138,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2422,11 +2427,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2674,11 +2680,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -2913,11 +2920,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3152,11 +3160,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -3391,11 +3400,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3630,11 +3640,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -3869,11 +3880,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4108,11 +4120,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4347,11 +4360,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4586,11 +4600,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -4825,11 +4840,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6407,11 +6423,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -6941,11 +6958,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -7664,11 +7682,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py index 03c87d93a4c..85fac2a1727 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py @@ -266,11 +266,12 @@ class FakeClassnameTags123Api: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/import_test_datetime_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/import_test_datetime_api.py index 16a8ea0f323..bdcae214561 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/import_test_datetime_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/import_test_datetime_api.py @@ -246,11 +246,12 @@ class ImportTestDatetimeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py index 0ae1b2addb4..e9dc088da1c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py @@ -814,12 +814,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1083,12 +1084,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1349,12 +1351,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -2212,11 +2215,12 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2513,11 +2517,12 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py index d4150f7f9b9..430dffa6d23 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py @@ -506,11 +506,12 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -770,12 +771,13 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1031,12 +1033,13 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py index 20391c692cd..b1a7325ada5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py @@ -1317,12 +1317,13 @@ class UserApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1597,12 +1598,13 @@ class UserApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index 991b0d96cc1..db57dd1827b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -15,6 +15,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -66,6 +67,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -230,7 +232,7 @@ class ApiClient: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -317,10 +319,7 @@ class ApiClient: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -344,6 +343,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -369,6 +369,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -388,21 +390,35 @@ class ApiClient: for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -446,6 +462,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index 98ba8abce92..85c2e738c4e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -31,6 +31,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -55,6 +58,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -142,7 +146,11 @@ conf = petstore_api.Configuration( signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -157,6 +165,9 @@ conf = petstore_api.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -205,7 +216,10 @@ conf = petstore_api.Configuration( self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -245,7 +259,7 @@ conf = petstore_api.Configuration( self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation 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 30718c766d7..22498dd88fc 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 @@ -105,9 +105,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties 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 1e65d8a8018..bbbc4102de4 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 @@ -39,8 +39,8 @@ class EnumTest(BaseModel): 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") + outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=OuterEnumDefaultValue.PLACED, alias="outerEnumDefaultValue") + outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=OuterEnumIntegerDefaultValue.NUMBER_0, alias="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') @@ -175,8 +175,8 @@ class EnumTest(BaseModel): "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outerEnum": obj.get("outerEnum"), "outerEnumInteger": obj.get("outerEnumInteger"), - "outerEnumDefaultValue": obj.get("outerEnumDefaultValue"), - "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") + "outerEnumDefaultValue": obj.get("outerEnumDefaultValue") if obj.get("outerEnumDefaultValue") is not None else OuterEnumDefaultValue.PLACED, + "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") if obj.get("outerEnumIntegerDefaultValue") is not None else OuterEnumIntegerDefaultValue.NUMBER_0 }) return _obj diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py new file mode 100644 index 00000000000..8eae227a84e --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum.py @@ -0,0 +1,39 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class TestEnum(str, Enum): + """ + TestEnum + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py new file mode 100644 index 00000000000..9304d3ab849 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_enum_with_default.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class TestEnumWithDefault(str, Enum): + """ + TestEnumWithDefault + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnumWithDefault from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py new file mode 100644 index 00000000000..218fa8f16d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/test_model_with_enum_default.py @@ -0,0 +1,107 @@ +# 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 BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault +from typing import Optional, Set +from typing_extensions import Self + +class TestModelWithEnumDefault(BaseModel): + """ + TestModelWithEnumDefault + """ # noqa: E501 + test_enum: TestEnum + test_string: Optional[StrictStr] = None + test_enum_with_default: Optional[TestEnumWithDefault] = TestEnumWithDefault.ZWEI + test_string_with_default: Optional[StrictStr] = 'ahoy matey' + test_inline_defined_enum_with_default: Optional[StrictStr] = 'B' + __properties: ClassVar[List[str]] = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"] + + @field_validator('test_inline_defined_enum_with_default') + def test_inline_defined_enum_with_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['A', 'B', 'C']): + raise ValueError("must be one of enum values ('A', 'B', 'C')") + return 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 TestModelWithEnumDefault 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 TestModelWithEnumDefault from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_enum": obj.get("test_enum"), + "test_string": obj.get("test_string"), + "test_enum_with_default": obj.get("test_enum_with_default") if obj.get("test_enum_with_default") is not None else TestEnumWithDefault.ZWEI, + "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey', + "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B' + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py index 147076895fc..ffdf1f9d400 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py @@ -187,10 +187,10 @@ class RESTClientObject: data.add_field(k, v) args["data"] = data - # Pass a `bytes` parameter directly in the body to support + # Pass a `bytes` or `str` parameter directly in the body to support # other content types than Json when `body` argument is provided # in serialized form - elif isinstance(body, bytes): + elif isinstance(body, str) or isinstance(body, bytes): args["data"] = body else: # Cannot generate the request from given parameters diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum.py new file mode 100644 index 00000000000..aec65edf520 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum.py @@ -0,0 +1,33 @@ +# 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.test_enum import TestEnum + +class TestTestEnum(unittest.TestCase): + """TestEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnum(self): + """Test TestEnum""" + # inst = TestEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum_with_default.py new file mode 100644 index 00000000000..b51e4281955 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_enum_with_default.py @@ -0,0 +1,33 @@ +# 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.test_enum_with_default import TestEnumWithDefault + +class TestTestEnumWithDefault(unittest.TestCase): + """TestEnumWithDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnumWithDefault(self): + """Test TestEnumWithDefault""" + # inst = TestEnumWithDefault() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_model_with_enum_default.py new file mode 100644 index 00000000000..7d2029d0af9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_test_model_with_enum_default.py @@ -0,0 +1,56 @@ +# 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.test_model_with_enum_default import TestModelWithEnumDefault + +class TestTestModelWithEnumDefault(unittest.TestCase): + """TestModelWithEnumDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestModelWithEnumDefault: + """Test TestModelWithEnumDefault + 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 `TestModelWithEnumDefault` + """ + model = TestModelWithEnumDefault() + if include_optional: + return TestModelWithEnumDefault( + test_enum = 'ONE', + test_string = 'Just some string', + test_enum_with_default = 'ZWEI', + test_string_with_default = 'ahoy matey', + test_inline_defined_enum_with_default = 'B' + ) + else: + return TestModelWithEnumDefault( + test_enum = 'ONE', + ) + """ + + def testTestModelWithEnumDefault(self): + """Test TestModelWithEnumDefault""" + # 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/tests/test_api_client.py b/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py index d3daa10d51c..fbcd7485a9c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py @@ -8,6 +8,7 @@ import weakref from tests.util import async_test import petstore_api +HOST = 'http://localhost/v2' class TestApiClient(unittest.TestCase): @@ -20,3 +21,31 @@ class TestApiClient(unittest.TestCase): rest_pool_ref = client.rest_client.pool_manager self.assertTrue(rest_pool_ref.closed) + + @async_test + async def test_ignore_operation_servers(self): + config = petstore_api.Configuration(host=HOST) + client = petstore_api.ApiClient(config) + user_api_instance = petstore_api.api.user_api.UserApi(client) + + config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True) + client_ignore = petstore_api.ApiClient(config_ignore) + user_api_instance_ignore = petstore_api.api.user_api.UserApi(client_ignore) + + params_to_serialize = { + 'user': petstore_api.User(id=1, username='test'), + '_request_auth': None, + '_content_type': 'application/json', + '_headers': None, + '_host_index': 0 + } + + # operation servers should be used + _, url, *_ = user_api_instance._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url, 'http://petstore.swagger.io/v2/user') + + # operation servers should be ignored + _, url_ignore, *_ = user_api_instance_ignore._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url_ignore, HOST + '/user') diff --git a/samples/openapi3/client/petstore/python-aiohttp/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-aiohttp/tests/test_pet_api.py index 2746c923ffb..d6dcdebd146 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/tests/test_pet_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/tests/test_pet_api.py @@ -58,6 +58,26 @@ class TestPetApiTests(unittest.TestCase): self.test_file_dir = os.path.realpath(self.test_file_dir) self.foo = os.path.join(self.test_file_dir, "foo.png") + def test_accept_header_serialization(self): + (_, _, headers, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers=None, + _host_index=0 + ) + self.assertEqual(headers['Accept'], 'application/json') + + (_, _, headers_overwritten, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers={'Accept': 'text/plain'}, + _host_index=0 + ) + self.assertEqual(headers_overwritten['Accept'], 'text/plain') + + def test_separate_default_client_instances(self): pet_api = petstore_api.PetApi() pet_api2 = petstore_api.PetApi() 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 5bd01d52420..ae45c6c2c95 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 @@ -101,9 +101,12 @@ docs/StoreApi.md docs/Tag.md docs/Task.md docs/TaskActivity.md +docs/TestEnum.md +docs/TestEnumWithDefault.md docs/TestErrorResponsesWithModel400Response.md docs/TestErrorResponsesWithModel404Response.md docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/TestModelWithEnumDefault.md docs/TestObjectForMultipartRequestsRequestMarker.md docs/Tiger.md docs/UnnamedDictWithAdditionalModelListProperties.md @@ -218,9 +221,12 @@ petstore_api/models/special_name.py petstore_api/models/tag.py petstore_api/models/task.py petstore_api/models/task_activity.py +petstore_api/models/test_enum.py +petstore_api/models/test_enum_with_default.py petstore_api/models/test_error_responses_with_model400_response.py petstore_api/models/test_error_responses_with_model404_response.py petstore_api/models/test_inline_freeform_additional_properties_request.py +petstore_api/models/test_model_with_enum_default.py petstore_api/models/test_object_for_multipart_requests_request_marker.py petstore_api/models/tiger.py petstore_api/models/unnamed_dict_with_additional_model_list_properties.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 30bae1cf642..f25ac8060a3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md @@ -242,9 +242,12 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Task](docs/Task.md) - [TaskActivity](docs/TaskActivity.md) + - [TestEnum](docs/TestEnum.md) + - [TestEnumWithDefault](docs/TestEnumWithDefault.md) - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md) - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md) - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md) - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md) - [Tiger](docs/Tiger.md) - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumClass.md index 64830e3d1de..725b617bdad 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumClass.md @@ -1,9 +1,13 @@ # EnumClass -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ABC` (value: `'_abc'`) + +* `MINUS_EFG` (value: `'-efg'`) + +* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(xyz)'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString1.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString1.md index 194d65b48fa..aa214538bca 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString1.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString1.md @@ -1,9 +1,11 @@ # EnumString1 -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `A` (value: `'a'`) + +* `B` (value: `'b'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString2.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString2.md index 0d8568bfbef..d1b49f8dddd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString2.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumString2.md @@ -1,9 +1,11 @@ # EnumString2 -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `C` (value: `'c'`) + +* `D` (value: `'d'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnum.md index 4cb31437c7e..9ba4f91069a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnum.md @@ -1,9 +1,13 @@ # OuterEnum -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumDefaultValue.md index 4a5ba6428d8..0c97f8c9cb6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumDefaultValue.md @@ -1,9 +1,13 @@ # OuterEnumDefaultValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumInteger.md index fc84ec36585..052b5163814 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumInteger.md @@ -1,9 +1,13 @@ # OuterEnumInteger -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumIntegerDefaultValue.md index 0de4199a840..66cd0abdb0a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterEnumIntegerDefaultValue.md @@ -1,9 +1,15 @@ # OuterEnumIntegerDefaultValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `NUMBER_MINUS_1` (value: `-1`) + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/SingleRefType.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SingleRefType.md index 4178ac3b505..8f0f60e5678 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SingleRefType.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SingleRefType.md @@ -1,9 +1,11 @@ # SingleRefType -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ADMIN` (value: `'admin'`) + +* `USER` (value: `'user'`) [[Back to Model list]](../README.md#documentation-for-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/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialCharacterEnum.md index 801c3b5c845..71a3affc4fe 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialCharacterEnum.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialCharacterEnum.md @@ -1,9 +1,27 @@ # SpecialCharacterEnum -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ENUM_456` (value: `'456'`) + +* `ENUM_123ABC` (value: `'123abc'`) + +* `UNDERSCORE` (value: `'_'`) + +* `SPACE` (value: `' '`) + +* `AMPERSAND` (value: `'&'`) + +* `DOLLAR` (value: `'$'`) + +* `GREATER_THAN_EQUAL` (value: `'>='`) + +* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`) + +* `IMPORT` (value: `'import'`) + +* `HELLO_WORLD` (value: `' hello world '`) [[Back to Model list]](../README.md#documentation-for-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/TestEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestEnum.md new file mode 100644 index 00000000000..612b62bd4dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestEnum.md @@ -0,0 +1,16 @@ +# TestEnum + + +## Enum + +* `ONE` (value: `'ONE'`) + +* `TWO` (value: `'TWO'`) + +* `THREE` (value: `'THREE'`) + +* `FOUR` (value: `'foUr'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestEnumWithDefault.md new file mode 100644 index 00000000000..ac8591c95c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestEnumWithDefault.md @@ -0,0 +1,14 @@ +# TestEnumWithDefault + + +## Enum + +* `EIN` (value: `'EIN'`) + +* `ZWEI` (value: `'ZWEI'`) + +* `DREI` (value: `'DREI'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestModelWithEnumDefault.md new file mode 100644 index 00000000000..7adae701beb --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestModelWithEnumDefault.md @@ -0,0 +1,32 @@ +# TestModelWithEnumDefault + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_enum** | [**TestEnum**](TestEnum.md) | | +**test_string** | **str** | | [optional] +**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] +**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey'] +**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B'] + +## Example + +```python +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +# TODO update the JSON string below +json = "{}" +# create an instance of TestModelWithEnumDefault from a JSON string +test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json) +# print the JSON string representation of the object +print TestModelWithEnumDefault.to_json() + +# convert the object into a dict +test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict() +# create an instance of TestModelWithEnumDefault from a dict +test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict) +``` +[[Back to Model list]](../README.md#documentation-for-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 c0b99d8bf82..87a7d672b9a 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 @@ -130,9 +130,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties 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 2124d65dc34..ffa70bc3422 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 @@ -105,9 +105,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum.py new file mode 100644 index 00000000000..f25ab6a8d6d --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum.py @@ -0,0 +1,42 @@ +# 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 json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class TestEnum(str, Enum): + """ + TestEnum + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + + @classmethod + def from_json(cls, json_str: str) -> TestEnum: + """Create an instance of TestEnum from a JSON string""" + return TestEnum(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum_with_default.py new file mode 100644 index 00000000000..c14a488a041 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_enum_with_default.py @@ -0,0 +1,41 @@ +# 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 json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class TestEnumWithDefault(str, Enum): + """ + TestEnumWithDefault + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + + @classmethod + def from_json(cls, json_str: str) -> TestEnumWithDefault: + """Create an instance of TestEnumWithDefault from a JSON string""" + return TestEnumWithDefault(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_model_with_enum_default.py new file mode 100644 index 00000000000..7a3481e9d0c --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/test_model_with_enum_default.py @@ -0,0 +1,91 @@ +# 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 BaseModel, Field, StrictStr, validator +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault + +class TestModelWithEnumDefault(BaseModel): + """ + TestModelWithEnumDefault + """ + test_enum: TestEnum = Field(...) + test_string: Optional[StrictStr] = None + test_enum_with_default: Optional[TestEnumWithDefault] = None + test_string_with_default: Optional[StrictStr] = 'ahoy matey' + test_inline_defined_enum_with_default: Optional[StrictStr] = 'B' + __properties = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"] + + @validator('test_inline_defined_enum_with_default') + def test_inline_defined_enum_with_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('A', 'B', 'C'): + raise ValueError("must be one of enum values ('A', 'B', 'C')") + return 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) -> TestModelWithEnumDefault: + """Create an instance of TestModelWithEnumDefault 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) -> TestModelWithEnumDefault: + """Create an instance of TestModelWithEnumDefault from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TestModelWithEnumDefault.parse_obj(obj) + + _obj = TestModelWithEnumDefault.parse_obj({ + "test_enum": obj.get("test_enum"), + "test_string": obj.get("test_string"), + "test_enum_with_default": obj.get("test_enum_with_default"), + "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey', + "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B' + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum.py new file mode 100644 index 00000000000..960400d5bb4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum.py @@ -0,0 +1,34 @@ +# 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.test_enum import TestEnum # noqa: E501 + +class TestTestEnum(unittest.TestCase): + """TestEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnum(self): + """Test TestEnum""" + # inst = TestEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum_with_default.py new file mode 100644 index 00000000000..f21e3931747 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_enum_with_default.py @@ -0,0 +1,34 @@ +# 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.test_enum_with_default import TestEnumWithDefault # noqa: E501 + +class TestTestEnumWithDefault(unittest.TestCase): + """TestEnumWithDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnumWithDefault(self): + """Test TestEnumWithDefault""" + # inst = TestEnumWithDefault() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_model_with_enum_default.py new file mode 100644 index 00000000000..67fc4400dcb --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_test_model_with_enum_default.py @@ -0,0 +1,57 @@ +# 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.test_model_with_enum_default import TestModelWithEnumDefault # noqa: E501 + +class TestTestModelWithEnumDefault(unittest.TestCase): + """TestModelWithEnumDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestModelWithEnumDefault: + """Test TestModelWithEnumDefault + 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 `TestModelWithEnumDefault` + """ + model = TestModelWithEnumDefault() # noqa: E501 + if include_optional: + return TestModelWithEnumDefault( + test_enum = 'ONE', + test_string = 'Just some string', + test_enum_with_default = 'ZWEI', + test_string_with_default = 'ahoy matey', + test_inline_defined_enum_with_default = 'B' + ) + else: + return TestModelWithEnumDefault( + test_enum = 'ONE', + ) + """ + + def testTestModelWithEnumDefault(self): + """Test TestModelWithEnumDefault""" + # 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 5bd01d52420..ae45c6c2c95 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES @@ -101,9 +101,12 @@ docs/StoreApi.md docs/Tag.md docs/Task.md docs/TaskActivity.md +docs/TestEnum.md +docs/TestEnumWithDefault.md docs/TestErrorResponsesWithModel400Response.md docs/TestErrorResponsesWithModel404Response.md docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/TestModelWithEnumDefault.md docs/TestObjectForMultipartRequestsRequestMarker.md docs/Tiger.md docs/UnnamedDictWithAdditionalModelListProperties.md @@ -218,9 +221,12 @@ petstore_api/models/special_name.py petstore_api/models/tag.py petstore_api/models/task.py petstore_api/models/task_activity.py +petstore_api/models/test_enum.py +petstore_api/models/test_enum_with_default.py petstore_api/models/test_error_responses_with_model400_response.py petstore_api/models/test_error_responses_with_model404_response.py petstore_api/models/test_inline_freeform_additional_properties_request.py +petstore_api/models/test_model_with_enum_default.py petstore_api/models/test_object_for_multipart_requests_request_marker.py petstore_api/models/tiger.py petstore_api/models/unnamed_dict_with_additional_model_list_properties.py diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/README.md b/samples/openapi3/client/petstore/python-pydantic-v1/README.md index 2f58d74d3d2..1bf88aa3dfc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/README.md @@ -242,9 +242,12 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Task](docs/Task.md) - [TaskActivity](docs/TaskActivity.md) + - [TestEnum](docs/TestEnum.md) + - [TestEnumWithDefault](docs/TestEnumWithDefault.md) - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md) - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md) - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md) - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md) - [Tiger](docs/Tiger.md) - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumClass.md index 64830e3d1de..725b617bdad 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumClass.md @@ -1,9 +1,13 @@ # EnumClass -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ABC` (value: `'_abc'`) + +* `MINUS_EFG` (value: `'-efg'`) + +* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(xyz)'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString1.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString1.md index 194d65b48fa..aa214538bca 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString1.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString1.md @@ -1,9 +1,11 @@ # EnumString1 -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `A` (value: `'a'`) + +* `B` (value: `'b'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString2.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString2.md index 0d8568bfbef..d1b49f8dddd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString2.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumString2.md @@ -1,9 +1,11 @@ # EnumString2 -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `C` (value: `'c'`) + +* `D` (value: `'d'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnum.md index 4cb31437c7e..9ba4f91069a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnum.md @@ -1,9 +1,13 @@ # OuterEnum -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumDefaultValue.md index 4a5ba6428d8..0c97f8c9cb6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumDefaultValue.md @@ -1,9 +1,13 @@ # OuterEnumDefaultValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumInteger.md index fc84ec36585..052b5163814 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumInteger.md @@ -1,9 +1,13 @@ # OuterEnumInteger -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumIntegerDefaultValue.md index 0de4199a840..66cd0abdb0a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterEnumIntegerDefaultValue.md @@ -1,9 +1,15 @@ # OuterEnumIntegerDefaultValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `NUMBER_MINUS_1` (value: `-1`) + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/SingleRefType.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SingleRefType.md index 4178ac3b505..8f0f60e5678 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SingleRefType.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SingleRefType.md @@ -1,9 +1,11 @@ # SingleRefType -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ADMIN` (value: `'admin'`) + +* `USER` (value: `'user'`) [[Back to Model list]](../README.md#documentation-for-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/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialCharacterEnum.md index 801c3b5c845..71a3affc4fe 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialCharacterEnum.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialCharacterEnum.md @@ -1,9 +1,27 @@ # SpecialCharacterEnum -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ENUM_456` (value: `'456'`) + +* `ENUM_123ABC` (value: `'123abc'`) + +* `UNDERSCORE` (value: `'_'`) + +* `SPACE` (value: `' '`) + +* `AMPERSAND` (value: `'&'`) + +* `DOLLAR` (value: `'$'`) + +* `GREATER_THAN_EQUAL` (value: `'>='`) + +* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`) + +* `IMPORT` (value: `'import'`) + +* `HELLO_WORLD` (value: `' hello world '`) [[Back to Model list]](../README.md#documentation-for-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/TestEnum.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestEnum.md new file mode 100644 index 00000000000..612b62bd4dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestEnum.md @@ -0,0 +1,16 @@ +# TestEnum + + +## Enum + +* `ONE` (value: `'ONE'`) + +* `TWO` (value: `'TWO'`) + +* `THREE` (value: `'THREE'`) + +* `FOUR` (value: `'foUr'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestEnumWithDefault.md new file mode 100644 index 00000000000..ac8591c95c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestEnumWithDefault.md @@ -0,0 +1,14 @@ +# TestEnumWithDefault + + +## Enum + +* `EIN` (value: `'EIN'`) + +* `ZWEI` (value: `'ZWEI'`) + +* `DREI` (value: `'DREI'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestModelWithEnumDefault.md new file mode 100644 index 00000000000..7adae701beb --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestModelWithEnumDefault.md @@ -0,0 +1,32 @@ +# TestModelWithEnumDefault + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_enum** | [**TestEnum**](TestEnum.md) | | +**test_string** | **str** | | [optional] +**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] +**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey'] +**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B'] + +## Example + +```python +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +# TODO update the JSON string below +json = "{}" +# create an instance of TestModelWithEnumDefault from a JSON string +test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json) +# print the JSON string representation of the object +print TestModelWithEnumDefault.to_json() + +# convert the object into a dict +test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict() +# create an instance of TestModelWithEnumDefault from a dict +test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict) +``` +[[Back to Model list]](../README.md#documentation-for-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 c0b99d8bf82..87a7d672b9a 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 @@ -130,9 +130,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties 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 2124d65dc34..ffa70bc3422 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 @@ -105,9 +105,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum.py new file mode 100644 index 00000000000..f25ab6a8d6d --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum.py @@ -0,0 +1,42 @@ +# 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 json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class TestEnum(str, Enum): + """ + TestEnum + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + + @classmethod + def from_json(cls, json_str: str) -> TestEnum: + """Create an instance of TestEnum from a JSON string""" + return TestEnum(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum_with_default.py new file mode 100644 index 00000000000..c14a488a041 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_enum_with_default.py @@ -0,0 +1,41 @@ +# 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 json +import pprint +import re # noqa: F401 +from aenum import Enum, no_arg + + + + + +class TestEnumWithDefault(str, Enum): + """ + TestEnumWithDefault + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + + @classmethod + def from_json(cls, json_str: str) -> TestEnumWithDefault: + """Create an instance of TestEnumWithDefault from a JSON string""" + return TestEnumWithDefault(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_model_with_enum_default.py new file mode 100644 index 00000000000..092b584a360 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/test_model_with_enum_default.py @@ -0,0 +1,103 @@ +# 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 BaseModel, Field, StrictStr, validator +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault + +class TestModelWithEnumDefault(BaseModel): + """ + TestModelWithEnumDefault + """ + test_enum: TestEnum = Field(...) + test_string: Optional[StrictStr] = None + test_enum_with_default: Optional[TestEnumWithDefault] = None + test_string_with_default: Optional[StrictStr] = 'ahoy matey' + test_inline_defined_enum_with_default: Optional[StrictStr] = 'B' + additional_properties: Dict[str, Any] = {} + __properties = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"] + + @validator('test_inline_defined_enum_with_default') + def test_inline_defined_enum_with_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('A', 'B', 'C'): + raise ValueError("must be one of enum values ('A', 'B', 'C')") + return 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) -> TestModelWithEnumDefault: + """Create an instance of TestModelWithEnumDefault 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) -> TestModelWithEnumDefault: + """Create an instance of TestModelWithEnumDefault from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TestModelWithEnumDefault.parse_obj(obj) + + _obj = TestModelWithEnumDefault.parse_obj({ + "test_enum": obj.get("test_enum"), + "test_string": obj.get("test_string"), + "test_enum_with_default": obj.get("test_enum_with_default"), + "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey', + "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B' + }) + # 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_test_enum.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_enum.py new file mode 100644 index 00000000000..960400d5bb4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_enum.py @@ -0,0 +1,34 @@ +# 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.test_enum import TestEnum # noqa: E501 + +class TestTestEnum(unittest.TestCase): + """TestEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnum(self): + """Test TestEnum""" + # inst = TestEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_enum_with_default.py new file mode 100644 index 00000000000..f21e3931747 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_enum_with_default.py @@ -0,0 +1,34 @@ +# 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.test_enum_with_default import TestEnumWithDefault # noqa: E501 + +class TestTestEnumWithDefault(unittest.TestCase): + """TestEnumWithDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnumWithDefault(self): + """Test TestEnumWithDefault""" + # inst = TestEnumWithDefault() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_model_with_enum_default.py new file mode 100644 index 00000000000..67fc4400dcb --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_test_model_with_enum_default.py @@ -0,0 +1,57 @@ +# 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.test_model_with_enum_default import TestModelWithEnumDefault # noqa: E501 + +class TestTestModelWithEnumDefault(unittest.TestCase): + """TestModelWithEnumDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestModelWithEnumDefault: + """Test TestModelWithEnumDefault + 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 `TestModelWithEnumDefault` + """ + model = TestModelWithEnumDefault() # noqa: E501 + if include_optional: + return TestModelWithEnumDefault( + test_enum = 'ONE', + test_string = 'Just some string', + test_enum_with_default = 'ZWEI', + test_string_with_default = 'ahoy matey', + test_inline_defined_enum_with_default = 'B' + ) + else: + return TestModelWithEnumDefault( + test_enum = 'ONE', + ) + """ + + def testTestModelWithEnumDefault(self): + """Test TestModelWithEnumDefault""" + # 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 6b44ba44379..8b7953128a7 100755 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -101,9 +101,12 @@ docs/StoreApi.md docs/Tag.md docs/Task.md docs/TaskActivity.md +docs/TestEnum.md +docs/TestEnumWithDefault.md docs/TestErrorResponsesWithModel400Response.md docs/TestErrorResponsesWithModel404Response.md docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/TestModelWithEnumDefault.md docs/TestObjectForMultipartRequestsRequestMarker.md docs/Tiger.md docs/UnnamedDictWithAdditionalModelListProperties.md @@ -218,9 +221,12 @@ petstore_api/models/special_name.py petstore_api/models/tag.py petstore_api/models/task.py petstore_api/models/task_activity.py +petstore_api/models/test_enum.py +petstore_api/models/test_enum_with_default.py petstore_api/models/test_error_responses_with_model400_response.py petstore_api/models/test_error_responses_with_model404_response.py petstore_api/models/test_inline_freeform_additional_properties_request.py +petstore_api/models/test_model_with_enum_default.py petstore_api/models/test_object_for_multipart_requests_request_marker.py petstore_api/models/tiger.py petstore_api/models/unnamed_dict_with_additional_model_list_properties.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 8fadc3e3acb..8c6e08b6a69 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -241,9 +241,12 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Task](docs/Task.md) - [TaskActivity](docs/TaskActivity.md) + - [TestEnum](docs/TestEnum.md) + - [TestEnumWithDefault](docs/TestEnumWithDefault.md) - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md) - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md) - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md) - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md) - [Tiger](docs/Tiger.md) - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumClass.md b/samples/openapi3/client/petstore/python/docs/EnumClass.md index 8097457bd55..725b617bdad 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python/docs/EnumClass.md @@ -1,10 +1,13 @@ # EnumClass -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ABC` (value: `'_abc'`) + +* `MINUS_EFG` (value: `'-efg'`) + +* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(xyz)'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString1.md b/samples/openapi3/client/petstore/python/docs/EnumString1.md index 1e2b5eaa039..aa214538bca 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumString1.md +++ b/samples/openapi3/client/petstore/python/docs/EnumString1.md @@ -1,10 +1,11 @@ # EnumString1 -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `A` (value: `'a'`) + +* `B` (value: `'b'`) [[Back to Model list]](../README.md#documentation-for-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/EnumString2.md b/samples/openapi3/client/petstore/python/docs/EnumString2.md index 15a466f322d..d1b49f8dddd 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumString2.md +++ b/samples/openapi3/client/petstore/python/docs/EnumString2.md @@ -1,10 +1,11 @@ # EnumString2 -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `C` (value: `'c'`) + +* `D` (value: `'d'`) [[Back to Model list]](../README.md#documentation-for-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 dd37f9cc7b4..72f5fbdae23 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python/docs/EnumTest.md @@ -14,8 +14,8 @@ Name | Type | Description | Notes **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] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to OuterEnumDefaultValue.PLACED] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OuterEnumIntegerDefaultValue.NUMBER_0] ## Example diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index b5183d1123a..a45bd7670a8 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -130,7 +130,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) - enum_ref = petstore_api.EnumClass() # EnumClass | enum reference (optional) + enum_ref = -efg # EnumClass | enum reference (optional) (default to -efg) try: # test enum reference query parameter @@ -146,7 +146,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] + **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] [default to -efg] ### Return type diff --git a/samples/openapi3/client/petstore/python/docs/OuterEnum.md b/samples/openapi3/client/petstore/python/docs/OuterEnum.md index 948ce460ac3..9ba4f91069a 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/python/docs/OuterEnum.md @@ -1,10 +1,13 @@ # OuterEnum -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python/docs/OuterEnumDefaultValue.md index bcb71d06764..0c97f8c9cb6 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/python/docs/OuterEnumDefaultValue.md @@ -1,10 +1,13 @@ # OuterEnumDefaultValue -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PLACED` (value: `'placed'`) + +* `APPROVED` (value: `'approved'`) + +* `DELIVERED` (value: `'delivered'`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumInteger.md b/samples/openapi3/client/petstore/python/docs/OuterEnumInteger.md index c60cb25ddd6..052b5163814 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/python/docs/OuterEnumInteger.md @@ -1,10 +1,13 @@ # OuterEnumInteger -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python/docs/OuterEnumIntegerDefaultValue.md index 0f982a2609b..66cd0abdb0a 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/python/docs/OuterEnumIntegerDefaultValue.md @@ -1,10 +1,15 @@ # OuterEnumIntegerDefaultValue -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `NUMBER_MINUS_1` (value: `-1`) + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) [[Back to Model list]](../README.md#documentation-for-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/SingleRefType.md b/samples/openapi3/client/petstore/python/docs/SingleRefType.md index 728e7c214aa..8f0f60e5678 100644 --- a/samples/openapi3/client/petstore/python/docs/SingleRefType.md +++ b/samples/openapi3/client/petstore/python/docs/SingleRefType.md @@ -1,10 +1,11 @@ # SingleRefType -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ADMIN` (value: `'admin'`) + +* `USER` (value: `'user'`) [[Back to Model list]](../README.md#documentation-for-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/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python/docs/SpecialCharacterEnum.md index b36a2831657..71a3affc4fe 100644 --- a/samples/openapi3/client/petstore/python/docs/SpecialCharacterEnum.md +++ b/samples/openapi3/client/petstore/python/docs/SpecialCharacterEnum.md @@ -1,10 +1,27 @@ # SpecialCharacterEnum -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ENUM_456` (value: `'456'`) + +* `ENUM_123ABC` (value: `'123abc'`) + +* `UNDERSCORE` (value: `'_'`) + +* `SPACE` (value: `' '`) + +* `AMPERSAND` (value: `'&'`) + +* `DOLLAR` (value: `'$'`) + +* `GREATER_THAN_EQUAL` (value: `'>='`) + +* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`) + +* `IMPORT` (value: `'import'`) + +* `HELLO_WORLD` (value: `' hello world '`) [[Back to Model list]](../README.md#documentation-for-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/TestEnum.md b/samples/openapi3/client/petstore/python/docs/TestEnum.md new file mode 100644 index 00000000000..612b62bd4dc --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/TestEnum.md @@ -0,0 +1,16 @@ +# TestEnum + + +## Enum + +* `ONE` (value: `'ONE'`) + +* `TWO` (value: `'TWO'`) + +* `THREE` (value: `'THREE'`) + +* `FOUR` (value: `'foUr'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python/docs/TestEnumWithDefault.md new file mode 100644 index 00000000000..ac8591c95c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/TestEnumWithDefault.md @@ -0,0 +1,14 @@ +# TestEnumWithDefault + + +## Enum + +* `EIN` (value: `'EIN'`) + +* `ZWEI` (value: `'ZWEI'`) + +* `DREI` (value: `'DREI'`) + +[[Back to Model list]](../README.md#documentation-for-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/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python/docs/TestModelWithEnumDefault.md new file mode 100644 index 00000000000..7d46e86deba --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/TestModelWithEnumDefault.md @@ -0,0 +1,33 @@ +# TestModelWithEnumDefault + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_enum** | [**TestEnum**](TestEnum.md) | | +**test_string** | **str** | | [optional] +**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] [default to TestEnumWithDefault.ZWEI] +**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey'] +**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B'] + +## Example + +```python +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault + +# TODO update the JSON string below +json = "{}" +# create an instance of TestModelWithEnumDefault from a JSON string +test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json) +# print the JSON string representation of the object +print(TestModelWithEnumDefault.to_json()) + +# convert the object into a dict +test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict() +# create an instance of TestModelWithEnumDefault from a dict +test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict) +``` +[[Back to Model list]](../README.md#documentation-for-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 3f6c3aabf13..efc802ab039 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -130,9 +130,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 466a18cc0a3..4778db8c82c 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -266,11 +266,12 @@ class AnotherFakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 61061624030..89d164b4592 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -243,11 +243,12 @@ class DefaultApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 04e5e9cd15c..f5e0609ba88 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -772,11 +772,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1324,11 +1325,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1594,11 +1596,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1864,11 +1867,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2134,11 +2138,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2422,11 +2427,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - '*/*' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + '*/*' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2674,11 +2680,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -2913,11 +2920,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3152,11 +3160,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -3391,11 +3400,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3630,11 +3640,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -3869,11 +3880,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4108,11 +4120,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4347,11 +4360,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4586,11 +4600,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'plain/text' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'plain/text' + ] + ) # authentication setting @@ -4825,11 +4840,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6407,11 +6423,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -6941,11 +6958,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/plain' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) # authentication setting @@ -7664,11 +7682,12 @@ class FakeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 4fb9a7e98d9..598fdc02338 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -266,11 +266,12 @@ class FakeClassnameTags123Api: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/import_test_datetime_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/import_test_datetime_api.py index f2467c71f2a..28443a99f1c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/import_test_datetime_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/import_test_datetime_api.py @@ -246,11 +246,12 @@ class ImportTestDatetimeApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 2b238b6f28d..729dff8efd8 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -814,12 +814,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1083,12 +1084,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1349,12 +1351,13 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -2212,11 +2215,12 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2513,11 +2517,12 @@ class PetApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index c50d82d6a5b..7eb32d8769b 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -506,11 +506,12 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -770,12 +771,13 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1031,12 +1033,13 @@ class StoreApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 5131bce7d29..ce6299b037b 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -1317,12 +1317,13 @@ class UserApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting @@ -1597,12 +1598,13 @@ class UserApi: # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/xml', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/xml', + 'application/json' + ] + ) # authentication setting diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 7e17903a95f..cb831d0de81 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -15,6 +15,7 @@ import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os @@ -66,6 +67,7 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None @@ -227,7 +229,7 @@ class ApiClient: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -314,10 +316,7 @@ class ApiClient: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) - else: - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -341,6 +340,7 @@ class ApiClient: If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -366,6 +366,8 @@ class ApiClient: ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -385,21 +387,35 @@ class ApiClient: for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -443,6 +459,8 @@ class ApiClient: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index c6751d422b7..a9c837f3f35 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -32,6 +32,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -56,6 +59,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -143,7 +147,11 @@ conf = petstore_api.Configuration( signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -158,6 +166,9 @@ conf = petstore_api.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -206,7 +217,10 @@ conf = petstore_api.Configuration( self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -249,7 +263,7 @@ conf = petstore_api.Configuration( self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation 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 30718c766d7..22498dd88fc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -105,9 +105,12 @@ from petstore_api.models.special_name import SpecialName from petstore_api.models.tag import Tag from petstore_api.models.task import Task from petstore_api.models.task_activity import TaskActivity +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest +from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker from petstore_api.models.tiger import Tiger from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties 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 bd4e7746134..d6381966155 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 @@ -39,8 +39,8 @@ class EnumTest(BaseModel): 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") + outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=OuterEnumDefaultValue.PLACED, alias="outerEnumDefaultValue") + outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=OuterEnumIntegerDefaultValue.NUMBER_0, alias="outerEnumIntegerDefaultValue") additional_properties: Dict[str, Any] = {} __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"] @@ -183,8 +183,8 @@ class EnumTest(BaseModel): "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outerEnum": obj.get("outerEnum"), "outerEnumInteger": obj.get("outerEnumInteger"), - "outerEnumDefaultValue": obj.get("outerEnumDefaultValue"), - "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") + "outerEnumDefaultValue": obj.get("outerEnumDefaultValue") if obj.get("outerEnumDefaultValue") is not None else OuterEnumDefaultValue.PLACED, + "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") if obj.get("outerEnumIntegerDefaultValue") is not None else OuterEnumIntegerDefaultValue.NUMBER_0 }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py new file mode 100644 index 00000000000..8eae227a84e --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum.py @@ -0,0 +1,39 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class TestEnum(str, Enum): + """ + TestEnum + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py new file mode 100644 index 00000000000..9304d3ab849 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_enum_with_default.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class TestEnumWithDefault(str, Enum): + """ + TestEnumWithDefault + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestEnumWithDefault from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py new file mode 100644 index 00000000000..4bff5e699a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/test_model_with_enum_default.py @@ -0,0 +1,120 @@ +# 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 BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.test_enum import TestEnum +from petstore_api.models.test_enum_with_default import TestEnumWithDefault +from typing import Optional, Set +from typing_extensions import Self + +class TestModelWithEnumDefault(BaseModel): + """ + TestModelWithEnumDefault + """ # noqa: E501 + test_enum: TestEnum + test_string: Optional[StrictStr] = None + test_enum_with_default: Optional[TestEnumWithDefault] = TestEnumWithDefault.ZWEI + test_string_with_default: Optional[StrictStr] = 'ahoy matey' + test_inline_defined_enum_with_default: Optional[StrictStr] = 'B' + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"] + + @field_validator('test_inline_defined_enum_with_default') + def test_inline_defined_enum_with_default_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['A', 'B', 'C']): + raise ValueError("must be one of enum values ('A', 'B', 'C')") + return 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 TestModelWithEnumDefault 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 TestModelWithEnumDefault from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_enum": obj.get("test_enum"), + "test_string": obj.get("test_string"), + "test_enum_with_default": obj.get("test_enum_with_default") if obj.get("test_enum_with_default") is not None else TestEnumWithDefault.ZWEI, + "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey', + "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B' + }) + # 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_test_enum.py b/samples/openapi3/client/petstore/python/test/test_test_enum.py new file mode 100644 index 00000000000..aec65edf520 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_test_enum.py @@ -0,0 +1,33 @@ +# 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.test_enum import TestEnum + +class TestTestEnum(unittest.TestCase): + """TestEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnum(self): + """Test TestEnum""" + # inst = TestEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python/test/test_test_enum_with_default.py new file mode 100644 index 00000000000..b51e4281955 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_test_enum_with_default.py @@ -0,0 +1,33 @@ +# 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.test_enum_with_default import TestEnumWithDefault + +class TestTestEnumWithDefault(unittest.TestCase): + """TestEnumWithDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTestEnumWithDefault(self): + """Test TestEnumWithDefault""" + # inst = TestEnumWithDefault() + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python/test/test_test_model_with_enum_default.py new file mode 100644 index 00000000000..7d2029d0af9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_test_model_with_enum_default.py @@ -0,0 +1,56 @@ +# 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.test_model_with_enum_default import TestModelWithEnumDefault + +class TestTestModelWithEnumDefault(unittest.TestCase): + """TestModelWithEnumDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TestModelWithEnumDefault: + """Test TestModelWithEnumDefault + 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 `TestModelWithEnumDefault` + """ + model = TestModelWithEnumDefault() + if include_optional: + return TestModelWithEnumDefault( + test_enum = 'ONE', + test_string = 'Just some string', + test_enum_with_default = 'ZWEI', + test_string_with_default = 'ahoy matey', + test_inline_defined_enum_with_default = 'B' + ) + else: + return TestModelWithEnumDefault( + test_enum = 'ONE', + ) + """ + + def testTestModelWithEnumDefault(self): + """Test TestModelWithEnumDefault""" + # 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_api.py b/samples/openapi3/client/petstore/python/tests/test_api.py index 8237969c494..643e0fc61b5 100644 --- a/samples/openapi3/client/petstore/python/tests/test_api.py +++ b/samples/openapi3/client/petstore/python/tests/test_api.py @@ -53,6 +53,9 @@ class TestErrorResponsesWithModels(unittest.TestCase): mock_resp.data = json.dumps({"reason400": "400 reason"}).encode("utf-8") mock_resp.getheaders.return_value = {} mock_resp.getheader.return_value = "" + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) with patch( "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp @@ -71,6 +74,9 @@ class TestErrorResponsesWithModels(unittest.TestCase): mock_resp.data = json.dumps({"reason404": "404 reason"}).encode("utf-8") mock_resp.getheaders.return_value = {} mock_resp.getheader.return_value = "" + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) with patch( "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp diff --git a/samples/openapi3/client/petstore/python/tests/test_api_client.py b/samples/openapi3/client/petstore/python/tests/test_api_client.py index 1d8ffebaca0..b444f326c67 100644 --- a/samples/openapi3/client/petstore/python/tests/test_api_client.py +++ b/samples/openapi3/client/petstore/python/tests/test_api_client.py @@ -10,6 +10,7 @@ $ pytest """ import unittest +from decimal import Decimal from enum import Enum from dateutil.parser import parse @@ -56,6 +57,33 @@ class ApiClientTests(unittest.TestCase): self.assertEqual('test_username', client.configuration.username) self.assertEqual('test_password', client.configuration.password) + def test_ignore_operation_servers(self): + config = petstore_api.Configuration(host=HOST) + client = petstore_api.ApiClient(config) + user_api_instance = petstore_api.api.user_api.UserApi(client) + + config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True) + client_ignore = petstore_api.ApiClient(config_ignore) + user_api_instance_ignore = petstore_api.api.user_api.UserApi(client_ignore) + + params_to_serialize = { + 'user': petstore_api.User(id=1, username='test'), + '_request_auth': None, + '_content_type': 'application/json', + '_headers': None, + '_host_index': 0 + } + + # operation servers should be used + _, url, *_ = user_api_instance._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url, 'http://petstore.swagger.io/v2/user') + + # operation servers should be ignored + _, url_ignore, *_ = user_api_instance_ignore._create_user_serialize(**params_to_serialize) + self.assertEqual(client.configuration.host, HOST) + self.assertEqual(url_ignore, HOST + '/user') + def test_select_header_accept(self): accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] accept = self.api_client.select_header_accept(accepts) @@ -153,6 +181,11 @@ class ApiClientTests(unittest.TestCase): result = self.api_client.sanitize_for_serialization(data) self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + def test_sanitize_for_serialization_decimal(self): + data = Decimal("1.0") + result = self.api_client.sanitize_for_serialization(data) + self.assertEquals(result, "1.0") + def test_sanitize_for_serialization_list_enum(self): class EnumSerialization(int, Enum): NUMBER_0 = 0 diff --git a/samples/openapi3/client/petstore/python/tests/test_configuration.py b/samples/openapi3/client/petstore/python/tests/test_configuration.py index d8084adafd2..af9fa6eef15 100644 --- a/samples/openapi3/client/petstore/python/tests/test_configuration.py +++ b/samples/openapi3/client/petstore/python/tests/test_configuration.py @@ -58,6 +58,18 @@ class TestConfiguration(unittest.TestCase): c1 = petstore_api.Configuration(access_token="12345") self.assertEqual(c1.access_token, "12345") + def test_ignore_operation_servers(self): + self.config.ignore_operation_servers = True + self.assertTrue(self.config.ignore_operation_servers) + self.config.ignore_operation_servers = False + self.assertFalse(self.config.ignore_operation_servers) + + c1 = petstore_api.Configuration(ignore_operation_servers=True) + self.assertTrue(c1.ignore_operation_servers) + + c2 = petstore_api.Configuration() + self.assertFalse(c2.ignore_operation_servers) + def test_get_host_settings(self): host_settings = self.config.get_host_settings() @@ -76,5 +88,14 @@ class TestConfiguration(unittest.TestCase): self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'})) self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'})) + def testConfigurationDebug(self): + for debug, expected in [(True, True), (False, False), (None, False)]: + with self.subTest('expicitly passing debug parameter', debug=debug, expected=expected): + c = petstore_api.Configuration(debug=debug) + self.assertEqual(expected, c.debug) + with self.subTest('not passing debug parameter'): + c = petstore_api.Configuration() + self.assertFalse(c.debug) + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests/test_deserialization.py b/samples/openapi3/client/petstore/python/tests/test_deserialization.py index 08e09edea26..11b2955015a 100644 --- a/samples/openapi3/client/petstore/python/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests/test_deserialization.py @@ -14,6 +14,7 @@ import os import time import unittest import datetime +from decimal import Decimal import pytest as pytest @@ -39,7 +40,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, 'Dict[str, EnumTest]') + deserialized = self.deserialize(response, 'Dict[str, EnumTest]', 'application/json') self.assertTrue(isinstance(deserialized, dict)) self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest)) self.assertEqual(deserialized['enum_test'], @@ -73,7 +74,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, 'Dict[str, Pet]') + deserialized = self.deserialize(response, 'Dict[str, Pet]', 'application/json') self.assertTrue(isinstance(deserialized, dict)) self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) @@ -90,7 +91,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, 'Dict[str, Animal]') + deserialized = self.deserialize(response, 'Dict[str, Animal]', 'application/json') self.assertTrue(isinstance(deserialized, dict)) self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog)) @@ -102,7 +103,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, 'Dict[str, int]') + deserialized = self.deserialize(response, 'Dict[str, int]', 'application/json') self.assertTrue(isinstance(deserialized, dict)) self.assertTrue(isinstance(deserialized['integer'], int)) @@ -111,7 +112,7 @@ class DeserializationTests(unittest.TestCase): data = "test str" response = data=json.dumps(data) - deserialized = self.deserialize(response, "str") + deserialized = self.deserialize(response, "str", 'application/json') self.assertTrue(isinstance(deserialized, str)) def test_deserialize_date(self): @@ -119,7 +120,7 @@ class DeserializationTests(unittest.TestCase): data = "1997-07-16" response = data=json.dumps(data) - deserialized = self.deserialize(response, "date") + deserialized = self.deserialize(response, "date", 'application/json') self.assertTrue(isinstance(deserialized, datetime.date)) def test_deserialize_datetime(self): @@ -127,9 +128,18 @@ class DeserializationTests(unittest.TestCase): data = "1997-07-16T19:20:30.45+01:00" response = json.dumps(data) - deserialized = self.deserialize(response, "datetime") + deserialized = self.deserialize(response, "datetime", 'application/json') self.assertTrue(isinstance(deserialized, datetime.datetime)) + def test_deserialize_decimal(self): + """ deserialize decimal """ + data = 1.1 + response = json.dumps(data) + + deserialized = self.deserialize(response, "decimal", 'application/json') + self.assertTrue(isinstance(deserialized, Decimal)) + self.assertEqual(deserialized, Decimal(1.1)) + def test_deserialize_pet(self): """ deserialize pet """ data = { @@ -152,7 +162,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, "Pet") + deserialized = self.deserialize(response, "Pet", 'application/json') self.assertTrue(isinstance(deserialized, petstore_api.Pet)) self.assertEqual(deserialized.id, 0) self.assertEqual(deserialized.name, "doggie") @@ -202,7 +212,7 @@ class DeserializationTests(unittest.TestCase): }] response = json.dumps(data) - deserialized = self.deserialize(response, "List[Pet]") + deserialized = self.deserialize(response, "List[Pet]", 'application/json') self.assertTrue(isinstance(deserialized, list)) self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) self.assertEqual(deserialized[0].id, 0) @@ -219,7 +229,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, "Dict[str, Dict[str, int]]") + deserialized = self.deserialize(response, "Dict[str, Dict[str, int]]", 'application/json') self.assertTrue(isinstance(deserialized, dict)) self.assertTrue(isinstance(deserialized["foo"], dict)) self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) @@ -229,7 +239,7 @@ class DeserializationTests(unittest.TestCase): data = [["foo"]] response = json.dumps(data) - deserialized = self.deserialize(response, "List[List[str]]") + deserialized = self.deserialize(response, "List[List[str]]", 'application/json') self.assertTrue(isinstance(deserialized, list)) self.assertTrue(isinstance(deserialized[0], list)) self.assertTrue(isinstance(deserialized[0][0], str)) @@ -238,7 +248,7 @@ class DeserializationTests(unittest.TestCase): """ deserialize None """ response = json.dumps(None) - deserialized = self.deserialize(response, "datetime") + deserialized = self.deserialize(response, "datetime", 'application/json') self.assertIsNone(deserialized) def test_deserialize_pig(self): @@ -249,7 +259,7 @@ class DeserializationTests(unittest.TestCase): } response = json.dumps(data) - deserialized = self.deserialize(response, "Pig") + deserialized = self.deserialize(response, "Pig", 'application/json') self.assertTrue(isinstance(deserialized.actual_instance, petstore_api.BasquePig)) self.assertEqual(deserialized.actual_instance.class_name, "BasqueBig") @@ -265,7 +275,7 @@ class DeserializationTests(unittest.TestCase): response = json.dumps(data) with pytest.raises(ValueError) as ex: - deserialized = self.deserialize(response, "Animal") + deserialized = self.deserialize(response, "Animal", 'application/json') assert str( ex.value) == 'Animal failed to lookup discriminator value from {"declawed": true, "className": ' \ '"Cat2222"}. Discriminator property name: className, mapping: {"Cat": "Cat", "Dog": "Dog"}' @@ -277,7 +287,7 @@ class DeserializationTests(unittest.TestCase): response = json.dumps(data) - deserialized = self.deserialize(response, "Animal") + deserialized = self.deserialize(response, "Animal", 'application/json') self.assertTrue(isinstance(deserialized, petstore_api.Cat)) self.assertEqual(deserialized.class_name, "Cat") self.assertEqual(deserialized.declawed, True) diff --git a/samples/openapi3/client/petstore/python/tests/test_fake_api.py b/samples/openapi3/client/petstore/python/tests/test_fake_api.py index dec2dcb4954..eade99256c5 100644 --- a/samples/openapi3/client/petstore/python/tests/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests/test_fake_api.py @@ -155,7 +155,7 @@ class TestFakeApi(unittest.TestCase): mock_resp.data = b'{"value": "0"}' mock_resp.getheaders.return_value = {} mock_resp.getheader = ( - lambda name: "text/plain" if name == "content-type" else Mock() + lambda name: "application/json" if name == "content-type" else Mock() ) with patch( "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp @@ -165,3 +165,78 @@ class TestFakeApi(unittest.TestCase): param=[OuterEnumInteger.NUMBER_0]) self.assertEqual(call_api_mock.call_args[0][1], 'http://petstore.swagger.io:80/v2/fake/property/enum-int?param=0') + + def testTopLevelStrJson(self): + """Test TopLevelStrJson""" + mock_resp = Mock() + mock_resp.status = 200 + mock_resp.data = b'"a"' + mock_resp.getheaders.return_value = {} + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) + with patch( + "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp + ): + returned = self.fake_api.fake_return_string() + self.assertEqual('a', returned) + + def testTopLevelIntJson(self): + """Test TopLevelIntJson""" + mock_resp = Mock() + mock_resp.status = 200 + mock_resp.data = b'1' + mock_resp.getheaders.return_value = {} + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) + with patch( + "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp + ): + returned = self.fake_api.fake_return_int() + self.assertEqual(1, returned) + + def testTopLevelFloatJson(self): + """Test TopLevelFloatJson""" + mock_resp = Mock() + mock_resp.status = 200 + mock_resp.data = b'3.4' + mock_resp.getheaders.return_value = {} + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) + with patch( + "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp + ): + returned = self.fake_api.fake_return_float() + self.assertEqual(3.4, returned) + + def testTopLevelBoolJson(self): + """Test TopLevelBoolJson""" + mock_resp = Mock() + mock_resp.status = 200 + mock_resp.data = b'true' + mock_resp.getheaders.return_value = {} + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) + with patch( + "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp + ): + returned = self.fake_api.fake_return_boolean() + self.assertEqual(True, returned) + + def testTopLevelEnumJson(self): + """Test TopLevelEnumJson""" + mock_resp = Mock() + mock_resp.status = 200 + mock_resp.data = b'"a"' + mock_resp.getheaders.return_value = {} + mock_resp.getheader = ( + lambda name: "application/json" if name == "content-type" else Mock() + ) + with patch( + "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp + ): + returned = self.fake_api.fake_return_enum() + self.assertEqual("a", returned) diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index 3a0502e4ed8..6049def8b88 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -408,7 +408,7 @@ class ModelTests(unittest.TestCase): self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123") # test sanitize for serialization with different data types - self.assertEquals(petstore_api.ApiClient().sanitize_for_serialization(a), {'byte': b'string', 'date': '2013-09-17', 'number': 123.45, 'password': 'testing09876', 'pattern_with_digits_and_delimiter': 'image_123'}) + self.assertEqual(petstore_api.ApiClient().sanitize_for_serialization(a), {'byte': b'string', 'date': '2013-09-17', 'number': 123.45, 'password': 'testing09876', 'pattern_with_digits_and_delimiter': 'image_123'}) # test sanitize for serialization with SecretStr (format: password) class LoginTest(BaseModel): diff --git a/samples/openapi3/client/petstore/python/tests/test_pet_api.py b/samples/openapi3/client/petstore/python/tests/test_pet_api.py index 396bdf0ce48..addfa801821 100644 --- a/samples/openapi3/client/petstore/python/tests/test_pet_api.py +++ b/samples/openapi3/client/petstore/python/tests/test_pet_api.py @@ -107,6 +107,25 @@ class PetApiTests(unittest.TestCase): self.pet_api.add_pet(self.pet, _request_timeout=5.0) self.pet_api.add_pet(self.pet, _request_timeout=(1.0, 2.0)) + def test_accept_header_serialization(self): + (_, _, headers, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers=None, + _host_index=0 + ) + self.assertEqual(headers['Accept'], 'application/json') + + (_, _, headers_overwritten, *_) = self.pet_api._get_pet_by_id_serialize( + pet_id=self.pet.id, + _request_auth=None, + _content_type=None, + _headers={'Accept': 'text/plain'}, + _host_index=0 + ) + self.assertEqual(headers_overwritten['Accept'], 'text/plain') + def test_separate_default_config_instances(self): # ensure the default api client is used pet_api = petstore_api.PetApi() diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java index d6c28e039b3..13e7b22776d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java @@ -32,7 +32,7 @@ public class Category { /** * Get id * @return id - */ + */ @JsonProperty("id") public Optional getId() { @@ -51,7 +51,7 @@ public class Category { /** * Get name * @return name - */ + */ @JsonProperty("name") public Optional<@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") String> getName() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java index 456d0a332b3..2ee58dba332 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -36,7 +36,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @JsonProperty("code") public Optional getCode() { @@ -55,7 +55,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @JsonProperty("type") public Optional getType() { @@ -74,7 +74,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @JsonProperty("message") public Optional getMessage() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java index 71e822cb223..45beb267243 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java @@ -81,7 +81,7 @@ public class Order { /** * Get id * @return id - */ + */ @JsonProperty("id") public Optional getId() { @@ -100,7 +100,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @JsonProperty("petId") public Optional getPetId() { @@ -119,7 +119,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @JsonProperty("quantity") public Optional getQuantity() { @@ -138,7 +138,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @JsonProperty("shipDate") public Optional getShipDate() { @@ -157,7 +157,7 @@ public class Order { /** * Order Status * @return status - */ + */ @JsonProperty("status") public Optional getStatus() { @@ -176,7 +176,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @JsonProperty("complete") public Optional getComplete() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index 27072e43b9e..8ef49846c79 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -98,7 +98,7 @@ public class Pet { /** * Get id * @return id - */ + */ @JsonProperty("id") public Optional getId() { @@ -117,7 +117,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @JsonProperty("category") public Optional getCategory() { @@ -136,7 +136,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { @@ -163,7 +163,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @JsonProperty("photoUrls") public List getPhotoUrls() { @@ -190,7 +190,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @JsonProperty("tags") public List<@Valid Tag> getTags() { @@ -210,7 +210,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @JsonProperty("status") @Deprecated @@ -220,7 +220,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(Optional status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java index 13ab1816e8b..8f03f3cd655 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java @@ -32,7 +32,7 @@ public class Tag { /** * Get id * @return id - */ + */ @JsonProperty("id") public Optional getId() { @@ -51,7 +51,7 @@ public class Tag { /** * Get name * @return name - */ + */ @JsonProperty("name") public Optional getName() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java index 4c6705fec80..0328cb983d0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java @@ -44,7 +44,7 @@ public class User { /** * Get id * @return id - */ + */ @JsonProperty("id") public Optional getId() { @@ -63,7 +63,7 @@ public class User { /** * Get username * @return username - */ + */ @JsonProperty("username") public Optional getUsername() { @@ -82,7 +82,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @JsonProperty("firstName") public Optional getFirstName() { @@ -101,7 +101,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @JsonProperty("lastName") public Optional getLastName() { @@ -120,7 +120,7 @@ public class User { /** * Get email * @return email - */ + */ @JsonProperty("email") public Optional getEmail() { @@ -139,7 +139,7 @@ public class User { /** * Get password * @return password - */ + */ @JsonProperty("password") public Optional getPassword() { @@ -158,7 +158,7 @@ public class User { /** * Get phone * @return phone - */ + */ @JsonProperty("phone") public Optional getPhone() { @@ -177,7 +177,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @JsonProperty("userStatus") public Optional getUserStatus() { diff --git a/samples/openapi3/client/petstore/spring-cloud-3/README.md b/samples/openapi3/client/petstore/spring-cloud-3/README.md index a462be951ac..417d91840cb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/README.md +++ b/samples/openapi3/client/petstore/spring-cloud-3/README.md @@ -1,26 +1,53 @@ -# OpenAPI generated API stub +# spring-cloud-oas3 -Spring Framework stub +## Requirements +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. -## Overview -This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. -This is an example of building API stub interfaces in Java using the Spring framework. +## Installation -The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints -by adding ```@Controller``` classes that implement the interface. Eg: -```java -@Controller -public class PetController implements PetApi { -// implement all PetApi methods -} +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install ``` -You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: -```java -@FeignClient(name="pet", url="http://petstore.swagger.io/v2") -public interface PetClient extends PetApi { +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: -} +```shell +mvn deploy ``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools.openapi3 + spring-cloud-oas3 + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools.openapi3:spring-cloud-oas3:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +mvn package + +Then manually install the following JARs: + +* target/spring-cloud-oas3-1.0.0.jar +* target/lib/*.jar diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java index 01e4a71f1f4..a41832ae1e1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java index b58cc2e1ca4..46d8a38019b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java index d0ec93aeef6..75e2d2bc8c1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 416742a9b8d..a83f5d7d645 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java index b41b5605237..56199a23b70 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java index 2275a4f0ec5..03dc160db2c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index ee81f18823a..b710397c3cf 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -58,7 +58,7 @@ public class Pet { /** * Get atType * @return atType - */ + */ @NotNull @Schema(name = "@type", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("@type") @@ -78,7 +78,7 @@ public class Pet { /** * Get age * @return age - */ + */ @Schema(name = "age", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("age") @@ -98,7 +98,7 @@ public class Pet { /** * Get happy * @return happy - */ + */ @Schema(name = "happy", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("happy") @@ -118,7 +118,7 @@ public class Pet { /** * Get price * @return price - */ + */ @Valid @Schema(name = "price", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("price") @@ -138,7 +138,7 @@ public class Pet { /** * Get lastFeed * @return lastFeed - */ + */ @Valid @Schema(name = "lastFeed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastFeed") @@ -158,7 +158,7 @@ public class Pet { /** * Get dateOfBirth * @return dateOfBirth - */ + */ @Valid @Schema(name = "dateOfBirth", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateOfBirth") diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 332e1728d35..0a466717fec 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 0f533aba144..3df9f8b5c20 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 214149113bf..7e0861de652 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 6610ca50204..71dd8b3bd89 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") @@ -102,7 +102,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") @@ -130,7 +130,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") @@ -158,7 +158,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_integer") @@ -214,7 +214,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_anytype") @@ -242,7 +242,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_string") @@ -270,7 +270,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_anytype") @@ -290,7 +290,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") @@ -310,7 +310,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") @@ -330,7 +330,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index cd8c69452de..47001548a99 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8f6eb4db8d7..b5ee81a8fd6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ce35826ad8c..2ce347d326c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1500b1ec945..98d2e98fc19 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") 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 ec607e8f31d..71096679605 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 @@ -51,7 +51,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") @@ -71,7 +71,7 @@ public class Animal { /** * Get color * @return color - */ + */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 96f9f9564dd..5a6e9c0babe 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayArrayNumber") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 0efc931e21b..0c037d0462f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayNumber") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java index 4f3b00c1086..e8e8978ddcc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_model") 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 a5a5dd1454d..8dc6928dcca 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 @@ -80,7 +80,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java index da1b264357a..f14de405450 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ATT_NAME") 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 df238580f57..fff004361d2 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 @@ -48,7 +48,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") 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 4459b47ce91..121ab573c02 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 @@ -37,7 +37,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -57,7 +57,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ChildWithNullable.java index a1986ba53a0..b88b53e1790 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -39,7 +39,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java index d26039e21c7..837c7effca2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java index 2f9386486a2..f991b0c969c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") 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 7f4b7483bef..a545f7110d8 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 @@ -58,7 +58,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") @@ -86,7 +86,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") @@ -114,7 +114,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("required_array") @@ -142,7 +142,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") 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 1b342995091..230cab206ea 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 @@ -40,7 +40,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java index 64f07502374..18e081ecf6b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_enum") 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 45eaff540b3..7522b0d891d 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 @@ -191,7 +191,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") @@ -211,7 +211,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("enum_string_required") @@ -231,7 +231,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") @@ -251,7 +251,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") @@ -271,7 +271,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java index 58bc3928303..b151c017927 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 00fba22d545..714333df226 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") 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 72c6e759c97..9005d11bacc 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 @@ -73,7 +73,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") @@ -95,7 +95,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") @@ -115,7 +115,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") @@ -137,7 +137,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number") @@ -159,7 +159,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") @@ -181,7 +181,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") @@ -201,7 +201,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") @@ -221,7 +221,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") @@ -241,7 +241,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") @@ -261,7 +261,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("date") @@ -281,7 +281,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -301,7 +301,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -321,7 +321,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("password") @@ -341,7 +341,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index af9f5535beb..ce297d81221 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java index e5d9def8561..4e546142262 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26e374689cf..aa854ba5491 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java index 8fef228de9f..2815efd5330 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java index 6c367770d65..de5384b1233 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java index e35473e0346..c1d4b57c57c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java index 406b19bb38b..0d18ff8ae40 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") 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 0d75ad23ed1..17f1463edca 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 @@ -42,7 +42,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -62,7 +62,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") @@ -82,7 +82,7 @@ public class Name { /** * Get property * @return property - */ + */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") @@ -102,7 +102,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java index 407a6a982ec..cca5d82a1df 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -45,7 +45,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java index 71e017f511d..233f904d840 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java index e0dc578c722..0c2918f40bd 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java index f390753132a..0b6658d7211 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") 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 bdcca7675d1..f78376f567f 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 @@ -82,7 +82,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -102,7 +102,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") 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 609a27e0260..15c86a5bd78 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 @@ -94,7 +94,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -114,7 +114,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -134,7 +134,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -162,7 +162,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -191,7 +191,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -212,7 +212,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -223,7 +223,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java index acd9dc3b53e..035e1091281 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 955ffd3352c..d83bad8c88e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java index c26381f9709..7d4c203bbe1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java index 34fce733199..9bf0e0595b5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") 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 af28fdde994..73c9d80a0b8 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 @@ -48,7 +48,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -68,7 +68,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -88,7 +88,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -108,7 +108,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -136,7 +136,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") 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 003970b51c1..481f354a8ed 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 @@ -50,7 +50,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -70,7 +70,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -90,7 +90,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") @@ -110,7 +110,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -130,7 +130,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -158,7 +158,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java index de733f4d43c..a0ff44b5ff2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java index 2b4a10ab6a7..8c279b3fd15 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java index 248fe995a53..5808453c1ee 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index ddb87089588..c77f9e18f4f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -99,7 +99,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -139,7 +139,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -167,7 +167,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -195,7 +195,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -215,7 +215,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/package.json b/samples/openapi3/client/petstore/typescript/builds/browser/package.json index 75f0bc16826..7f477ac29fd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/browser/package.json @@ -23,6 +23,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json index 8f6636e8cf8..ea8d9cce8ca 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/client/petstore/typescript/builds/default/package.json b/samples/openapi3/client/petstore/typescript/builds/default/package.json index f75fc96c282..a18e68426ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json index b6496f55d05..2bdd354cc1f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json index ea49a041e5b..aac146f2436 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json index f75fc96c282..a18e68426ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json @@ -22,6 +22,9 @@ "types": "./dist/index.d.js" } }, + "files": [ + "dist" + ], "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", diff --git a/samples/openapi3/server/petstore/go/go-petstore/README.md b/samples/openapi3/server/petstore/go/go-petstore/README.md index eab802e67bb..2d7b21a2406 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/README.md +++ b/samples/openapi3/server/petstore/go/go-petstore/README.md @@ -6,7 +6,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke 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: @@ -23,6 +22,8 @@ To run the server, follow these simple steps: go run main.go ``` +The server will be available on `http://localhost:8080`. + To run the server in a docker container ``` docker build --network=host -t petstoreserver . diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/model_category.go b/samples/openapi3/server/petstore/go/go-petstore/go/model_category.go index fe474de1c47..a8c835c0da4 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/model_category.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/model_category.go @@ -18,7 +18,7 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } // AssertCategoryRequired checks if the required fields are not zero-ed 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 005fb526e87..002443d8dd6 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 @@ -34,7 +34,7 @@ public class Addressable { /** * Hyperlink reference * @return href - */ + */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("href") @@ -54,7 +54,7 @@ public class Addressable { /** * unique identifier * @return id - */ + */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") 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 65ee38b291c..74ea46e7cab 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 @@ -49,7 +49,7 @@ public class Apple implements Fruit { /** * Get seeds * @return seeds - */ + */ @NotNull @Schema(name = "seeds", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("seeds") @@ -69,7 +69,7 @@ public class Apple implements Fruit { /** * Get fruitType * @return fruitType - */ + */ @NotNull @Valid @Schema(name = "fruitType", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("fruitType") 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 24f20957bf7..8ac090048b5 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 @@ -49,7 +49,7 @@ public class Banana implements Fruit { /** * Get length * @return length - */ + */ @NotNull @Schema(name = "length", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("length") @@ -69,7 +69,7 @@ public class Banana implements Fruit { /** * Get fruitType * @return fruitType - */ + */ @NotNull @Valid @Schema(name = "fruitType", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("fruitType") 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 f1df942761c..f32a0655742 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 @@ -55,7 +55,7 @@ public class Bar extends Entity implements BarRefOrValue { /** * Get id * @return id - */ + */ @NotNull @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") @@ -75,7 +75,7 @@ public class Bar extends Entity implements BarRefOrValue { /** * Get barPropA * @return barPropA - */ + */ @Schema(name = "barPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("barPropA") @@ -95,7 +95,7 @@ public class Bar extends Entity implements BarRefOrValue { /** * Get fooPropB * @return fooPropB - */ + */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("fooPropB") @@ -115,7 +115,7 @@ public class Bar extends Entity implements BarRefOrValue { /** * Get foo * @return foo - */ + */ @Valid @Schema(name = "foo", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") 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 58168243be4..37e6485b001 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 @@ -54,7 +54,7 @@ public class BarCreate extends Entity { /** * Get barPropA * @return barPropA - */ + */ @Schema(name = "barPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("barPropA") @@ -74,7 +74,7 @@ public class BarCreate extends Entity { /** * Get fooPropB * @return fooPropB - */ + */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("fooPropB") @@ -94,7 +94,7 @@ public class BarCreate extends Entity { /** * Get foo * @return foo - */ + */ @Valid @Schema(name = "foo", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") 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 058c8b1796b..cb77b0da2e4 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 @@ -67,7 +67,7 @@ public class Entity { /** * Hyperlink reference * @return href - */ + */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("href") @@ -87,7 +87,7 @@ public class Entity { /** * unique identifier * @return id - */ + */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -107,7 +107,7 @@ public class Entity { /** * A URI to a JSON-Schema file that defines additional attributes and relationships * @return atSchemaLocation - */ + */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@schemaLocation") @@ -127,7 +127,7 @@ public class Entity { /** * When sub-classing, this defines the super-class * @return atBaseType - */ + */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@baseType") @@ -147,7 +147,7 @@ public class Entity { /** * When sub-classing, this defines the sub-class Extensible name * @return atType - */ + */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("@type") 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 ab0d329bae2..e10d2f7b96b 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 @@ -68,7 +68,7 @@ public class EntityRef { /** * Name of the related entity. * @return name - */ + */ @Schema(name = "name", description = "Name of the related entity.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -88,7 +88,7 @@ public class EntityRef { /** * The actual type of the target instance when needed for disambiguation. * @return atReferredType - */ + */ @Schema(name = "@referredType", description = "The actual type of the target instance when needed for disambiguation.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@referredType") @@ -108,7 +108,7 @@ public class EntityRef { /** * Hyperlink reference * @return href - */ + */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("href") @@ -128,7 +128,7 @@ public class EntityRef { /** * unique identifier * @return id - */ + */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -148,7 +148,7 @@ public class EntityRef { /** * A URI to a JSON-Schema file that defines additional attributes and relationships * @return atSchemaLocation - */ + */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@schemaLocation") @@ -168,7 +168,7 @@ public class EntityRef { /** * When sub-classing, this defines the super-class * @return atBaseType - */ + */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@baseType") @@ -188,7 +188,7 @@ public class EntityRef { /** * When sub-classing, this defines the sub-class Extensible name * @return atType - */ + */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("@type") 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 2457d754d8a..f7dd4ca12e1 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 @@ -46,7 +46,7 @@ public class Extensible { /** * A URI to a JSON-Schema file that defines additional attributes and relationships * @return atSchemaLocation - */ + */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@schemaLocation") @@ -66,7 +66,7 @@ public class Extensible { /** * When sub-classing, this defines the super-class * @return atBaseType - */ + */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("@baseType") @@ -86,7 +86,7 @@ public class Extensible { /** * When sub-classing, this defines the sub-class Extensible name * @return atType - */ + */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("@type") 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 7ce6905492c..59e1ee2288e 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 @@ -49,7 +49,7 @@ public class Foo extends Entity implements FooRefOrValue { /** * Get fooPropA * @return fooPropA - */ + */ @Schema(name = "fooPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("fooPropA") @@ -69,7 +69,7 @@ public class Foo extends Entity implements FooRefOrValue { /** * Get fooPropB * @return fooPropB - */ + */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("fooPropB") 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 19d47b45135..ebcafb63b80 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 @@ -47,7 +47,7 @@ public class FooRef extends EntityRef implements FooRefOrValue { /** * Get foorefPropA * @return foorefPropA - */ + */ @Schema(name = "foorefPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foorefPropA") 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 52d567d3fe9..cd97fcf6dd4 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 @@ -47,7 +47,7 @@ public class Pasta extends Entity { /** * Get vendor * @return vendor - */ + */ @Schema(name = "vendor", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("vendor") 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 a92051434fe..54e7a51e4a1 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 @@ -56,7 +56,7 @@ public class Pizza extends Entity { /** * Get pizzaSize * @return pizzaSize - */ + */ @Valid @Schema(name = "pizzaSize", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("pizzaSize") 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 2eb670f60e9..c53254ae786 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 @@ -48,7 +48,7 @@ public class PizzaSpeziale extends Pizza { /** * Get toppings * @return toppings - */ + */ @Schema(name = "toppings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("toppings") diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") 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 97216ba5dad..23e3f420c5f 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 @@ -10,6 +10,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -25,7 +26,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "Category") @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Category { @@ -38,8 +38,8 @@ public class Category { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Category(Long id, String name) { this.id = id; this.name = name; @@ -53,11 +53,12 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -74,11 +75,12 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } 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 710b9d7bfed..617b3bab695 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 @@ -11,6 +11,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -27,7 +28,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "ModelApiResponse") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class ModelApiResponse { @@ -42,8 +42,8 @@ public class ModelApiResponse { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelApiResponse(Integer code, String type, String message) { this.code = code; this.type = type; @@ -58,11 +58,12 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @JacksonXmlProperty(localName = "code") + @XmlElement(name = "code") public Integer getCode() { return code; } @@ -79,11 +80,12 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @JacksonXmlProperty(localName = "type") + @XmlElement(name = "type") public String getType() { return type; } @@ -100,11 +102,12 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") @JacksonXmlProperty(localName = "message") + @XmlElement(name = "message") public String getMessage() { return message; } 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 115ebd1a5fe..e1a117ec600 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 @@ -13,6 +13,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -28,7 +29,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "Order") @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Order { @@ -87,8 +87,8 @@ public class Order { } /** - * Constructor with all args parameters - */ + * 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; @@ -106,11 +106,12 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -127,11 +128,12 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") + @XmlElement(name = "petId") public Long getPetId() { return petId; } @@ -148,11 +150,12 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") + @XmlElement(name = "quantity") public Integer getQuantity() { return quantity; } @@ -169,11 +172,12 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") + @XmlElement(name = "shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -190,11 +194,12 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @JacksonXmlProperty(localName = "status") + @XmlElement(name = "status") public StatusEnum getStatus() { return status; } @@ -211,11 +216,12 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") + @XmlElement(name = "complete") public Boolean getComplete() { return complete; } 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 eef9799ed6f..645213fa627 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 @@ -16,6 +16,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -31,7 +32,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "Pet") @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Pet { @@ -100,8 +100,8 @@ public class Pet { } /** - * Constructor with all args parameters - */ + * 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; @@ -119,11 +119,12 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -140,11 +141,12 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @JacksonXmlProperty(localName = "Category") + @XmlElement(name = "Category") public Category getCategory() { return category; } @@ -161,11 +163,12 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } @@ -190,11 +193,14 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") public List getPhotoUrls() { return photoUrls; } @@ -219,11 +225,14 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") - @JacksonXmlProperty(localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") public List<@Valid Tag> getTags() { return tags; } @@ -241,11 +250,12 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @JacksonXmlProperty(localName = "status") + @XmlElement(name = "status") @Deprecated public StatusEnum getStatus() { return status; @@ -253,7 +263,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; @@ -358,7 +368,6 @@ public class Pet { this.instance.status(status); return this; } - @Deprecated /** * returns a built Pet instance. 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 3e4f39d2539..18064482186 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 @@ -10,6 +10,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -25,7 +26,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "Tag") @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Tag { @@ -38,8 +38,8 @@ public class Tag { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Tag(Long id, String name) { this.id = id; this.name = name; @@ -53,11 +53,12 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -74,11 +75,12 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } 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 dc9b22aec54..1bb0b2a9f77 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 @@ -10,6 +10,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.xml.bind.annotation.*; @@ -25,7 +26,6 @@ import jakarta.annotation.Generated; @JacksonXmlRootElement(localName = "User") @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class User { @@ -50,8 +50,8 @@ public class User { } /** - * Constructor with all args parameters - */ + * 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; @@ -71,11 +71,12 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -92,11 +93,12 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @JacksonXmlProperty(localName = "username") + @XmlElement(name = "username") public String getUsername() { return username; } @@ -113,11 +115,12 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") + @XmlElement(name = "firstName") public String getFirstName() { return firstName; } @@ -134,11 +137,12 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") + @XmlElement(name = "lastName") public String getLastName() { return lastName; } @@ -155,11 +159,12 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @JacksonXmlProperty(localName = "email") + @XmlElement(name = "email") public String getEmail() { return email; } @@ -176,11 +181,12 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @JacksonXmlProperty(localName = "password") + @XmlElement(name = "password") public String getPassword() { return password; } @@ -197,11 +203,12 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") + @XmlElement(name = "phone") public String getPhone() { return phone; } @@ -218,11 +225,12 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") + @XmlElement(name = "userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 332e1728d35..0a466717fec 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 0f533aba144..3df9f8b5c20 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 214149113bf..7e0861de652 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 6610ca50204..71dd8b3bd89 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") @@ -102,7 +102,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") @@ -130,7 +130,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") @@ -158,7 +158,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_integer") @@ -214,7 +214,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_anytype") @@ -242,7 +242,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_string") @@ -270,7 +270,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_anytype") @@ -290,7 +290,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") @@ -310,7 +310,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") @@ -330,7 +330,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index cd8c69452de..47001548a99 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8f6eb4db8d7..b5ee81a8fd6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ce35826ad8c..2ce347d326c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1500b1ec945..98d2e98fc19 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 483081725d0..006ea146459 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 96f9f9564dd..5a6e9c0babe 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayArrayNumber") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 0efc931e21b..0c037d0462f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayNumber") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 4f3b00c1086..e8e8978ddcc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_model") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index 02ebbd15417..cc37e37705d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -87,7 +87,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index da1b264357a..f14de405450 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ATT_NAME") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index 9f5b19d63b2..d77636ad684 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -55,7 +55,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 45e80bc9010..29b1b6f638e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -44,7 +44,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -64,7 +64,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java index a1986ba53a0..b88b53e1790 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -39,7 +39,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index d26039e21c7..837c7effca2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index 2f9386486a2..f991b0c969c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 952dd142f34..8b4b1c08e20 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -66,7 +66,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") @@ -94,7 +94,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") @@ -122,7 +122,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("required_array") @@ -150,7 +150,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index c135c00f539..66d4aba200a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -47,7 +47,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index 64f07502374..18e081ecf6b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_enum") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index d17c282f192..38614dcf26d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -198,7 +198,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("enum_string_required") @@ -238,7 +238,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") @@ -258,7 +258,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") @@ -278,7 +278,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index 58bc3928303..b151c017927 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 00fba22d545..714333df226 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 721db7dec80..e58ac3efc56 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -83,7 +83,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") @@ -105,7 +105,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") @@ -125,7 +125,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") @@ -147,7 +147,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number") @@ -169,7 +169,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") @@ -191,7 +191,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") @@ -211,7 +211,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") @@ -231,7 +231,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") @@ -251,7 +251,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") @@ -271,7 +271,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("date") @@ -291,7 +291,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -311,7 +311,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -331,7 +331,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("password") @@ -351,7 +351,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index af9f5535beb..ce297d81221 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index e5d9def8561..4e546142262 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26e374689cf..aa854ba5491 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 8fef228de9f..2815efd5330 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 6c367770d65..de5384b1233 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index e35473e0346..c1d4b57c57c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 406b19bb38b..0d18ff8ae40 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index fdc7c4ae268..73cddebcf0f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -49,7 +49,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -69,7 +69,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - */ + */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") @@ -109,7 +109,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 407a6a982ec..cca5d82a1df 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -45,7 +45,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index 71e017f511d..233f904d840 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index e0dc578c722..0c2918f40bd 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index f390753132a..0b6658d7211 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") 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 bdcca7675d1..f78376f567f 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 @@ -82,7 +82,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -102,7 +102,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 0cb24024337..c4acd463485 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -102,7 +102,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -122,7 +122,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -142,7 +142,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -170,7 +170,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -199,7 +199,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -220,7 +220,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -231,7 +231,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index acd9dc3b53e..035e1091281 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 955ffd3352c..d83bad8c88e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index c26381f9709..7d4c203bbe1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 34fce733199..9bf0e0595b5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 91e113075c4..9270db6b06d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -59,7 +59,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -79,7 +79,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -99,7 +99,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -119,7 +119,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -147,7 +147,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 7acddbe0637..03b43cf31f3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -62,7 +62,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") @@ -122,7 +122,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -142,7 +142,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -170,7 +170,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index de733f4d43c..a0ff44b5ff2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 2b4a10ab6a7..8c279b3fd15 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 332e1728d35..0a466717fec 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 0f533aba144..3df9f8b5c20 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 214149113bf..7e0861de652 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 6610ca50204..71dd8b3bd89 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") @@ -102,7 +102,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") @@ -130,7 +130,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") @@ -158,7 +158,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_integer") @@ -214,7 +214,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_anytype") @@ -242,7 +242,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_string") @@ -270,7 +270,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_anytype") @@ -290,7 +290,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") @@ -310,7 +310,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") @@ -330,7 +330,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index cd8c69452de..47001548a99 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8f6eb4db8d7..b5ee81a8fd6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ce35826ad8c..2ce347d326c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1500b1ec945..98d2e98fc19 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 483081725d0..006ea146459 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 96f9f9564dd..5a6e9c0babe 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayArrayNumber") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 0efc931e21b..0c037d0462f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayNumber") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 4f3b00c1086..e8e8978ddcc 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_model") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 02ebbd15417..cc37e37705d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -87,7 +87,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index da1b264357a..f14de405450 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ATT_NAME") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index 9f5b19d63b2..d77636ad684 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -55,7 +55,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 45e80bc9010..29b1b6f638e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -44,7 +44,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -64,7 +64,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java index a1986ba53a0..b88b53e1790 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -39,7 +39,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index d26039e21c7..837c7effca2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index 2f9386486a2..f991b0c969c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 952dd142f34..8b4b1c08e20 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -66,7 +66,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") @@ -94,7 +94,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") @@ -122,7 +122,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("required_array") @@ -150,7 +150,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index c135c00f539..66d4aba200a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -47,7 +47,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index 64f07502374..18e081ecf6b 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_enum") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index d17c282f192..38614dcf26d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -198,7 +198,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("enum_string_required") @@ -238,7 +238,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") @@ -258,7 +258,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") @@ -278,7 +278,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index 58bc3928303..b151c017927 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 00fba22d545..714333df226 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 721db7dec80..e58ac3efc56 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -83,7 +83,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") @@ -105,7 +105,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") @@ -125,7 +125,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") @@ -147,7 +147,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number") @@ -169,7 +169,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") @@ -191,7 +191,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") @@ -211,7 +211,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") @@ -231,7 +231,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") @@ -251,7 +251,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") @@ -271,7 +271,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("date") @@ -291,7 +291,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -311,7 +311,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -331,7 +331,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("password") @@ -351,7 +351,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index af9f5535beb..ce297d81221 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index e5d9def8561..4e546142262 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26e374689cf..aa854ba5491 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 8fef228de9f..2815efd5330 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 6c367770d65..de5384b1233 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index e35473e0346..c1d4b57c57c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 406b19bb38b..0d18ff8ae40 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index fdc7c4ae268..73cddebcf0f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -49,7 +49,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -69,7 +69,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - */ + */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") @@ -109,7 +109,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index 407a6a982ec..cca5d82a1df 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -45,7 +45,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 71e017f511d..233f904d840 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index e0dc578c722..0c2918f40bd 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index f390753132a..0b6658d7211 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") 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 bdcca7675d1..f78376f567f 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 @@ -82,7 +82,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -102,7 +102,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 0cb24024337..c4acd463485 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -102,7 +102,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -122,7 +122,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -142,7 +142,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -170,7 +170,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -199,7 +199,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -220,7 +220,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -231,7 +231,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index acd9dc3b53e..035e1091281 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 955ffd3352c..d83bad8c88e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index c26381f9709..7d4c203bbe1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 34fce733199..9bf0e0595b5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 91e113075c4..9270db6b06d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -59,7 +59,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -79,7 +79,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -99,7 +99,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -119,7 +119,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -147,7 +147,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 7acddbe0637..03b43cf31f3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -62,7 +62,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") @@ -122,7 +122,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -142,7 +142,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -170,7 +170,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index de733f4d43c..a0ff44b5ff2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 2b4a10ab6a7..8c279b3fd15 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java index 4dc2d922aa8..20e9d6ce826 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java @@ -32,7 +32,7 @@ public class Category { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -51,7 +51,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @JsonProperty("name") public String getName() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java index 3cc96c6a214..c2430c862e7 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -36,7 +36,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @JsonProperty("code") public Integer getCode() { @@ -55,7 +55,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @JsonProperty("type") public String getType() { @@ -74,7 +74,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @JsonProperty("message") public String getMessage() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java index c1516077ebb..52e1840ae0a 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java @@ -81,7 +81,7 @@ public class Order { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -100,7 +100,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @JsonProperty("petId") public Long getPetId() { @@ -119,7 +119,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @JsonProperty("quantity") public Integer getQuantity() { @@ -138,7 +138,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @JsonProperty("shipDate") public OffsetDateTime getShipDate() { @@ -157,7 +157,7 @@ public class Order { /** * Order Status * @return status - */ + */ @JsonProperty("status") public StatusEnum getStatus() { @@ -176,7 +176,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @JsonProperty("complete") public Boolean getComplete() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index 61742dbf661..b2e7a470879 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -98,7 +98,7 @@ public class Pet { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -117,7 +117,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @JsonProperty("category") public Category getCategory() { @@ -136,7 +136,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { @@ -163,7 +163,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @JsonProperty("photoUrls") public List getPhotoUrls() { @@ -190,7 +190,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @JsonProperty("tags") public List<@Valid Tag> getTags() { @@ -210,7 +210,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @JsonProperty("status") @Deprecated @@ -220,7 +220,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java index 2fc755c070d..a5b81abb7b9 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java @@ -32,7 +32,7 @@ public class Tag { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -51,7 +51,7 @@ public class Tag { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java index 0d7b74c1c51..efe4a2da161 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java @@ -44,7 +44,7 @@ public class User { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -63,7 +63,7 @@ public class User { /** * Get username * @return username - */ + */ @JsonProperty("username") public String getUsername() { @@ -82,7 +82,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @JsonProperty("firstName") public String getFirstName() { @@ -101,7 +101,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @JsonProperty("lastName") public String getLastName() { @@ -120,7 +120,7 @@ public class User { /** * Get email * @return email - */ + */ @JsonProperty("email") public String getEmail() { @@ -139,7 +139,7 @@ public class User { /** * Get password * @return password - */ + */ @JsonProperty("password") public String getPassword() { @@ -158,7 +158,7 @@ public class User { /** * Get phone * @return phone - */ + */ @JsonProperty("phone") public String getPhone() { @@ -177,7 +177,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @JsonProperty("userStatus") public Integer getUserStatus() { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index eb67cfe820c..c02625ab644 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -34,7 +34,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index dc6ecc77030..eda5c1545c5 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 51239566396..06fa306e173 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index dc6f8881ee7..03d72bcfa90 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -100,7 +100,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -120,7 +120,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -140,7 +140,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -168,7 +168,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -196,7 +196,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -217,7 +217,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -228,7 +228,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 73510b92206..74f164b5f7b 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index dd3f087a2cb..fe54af7b275 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/server/echo_api/kotlin-wiremock/gradlew.bat b/samples/server/echo_api/kotlin-wiremock/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/server/echo_api/kotlin-wiremock/gradlew.bat +++ b/samples/server/echo_api/kotlin-wiremock/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega 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 index e08eaa35216..7ba415c978d 100644 --- a/samples/server/others/go-server/no-body-path-params/README.md +++ b/samples/server/others/go-server/no-body-path-params/README.md @@ -6,7 +6,6 @@ No description provided (generated by Openapi Generator https://github.com/opena 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: @@ -23,6 +22,8 @@ To run the server, follow these simple steps: go run main.go ``` +The server will be available on `http://localhost:8080`. + To run the server in a docker container ``` docker build --network=host -t petstoreserver . diff --git a/samples/server/others/haskell-servant-ping/.openapi-generator-ignore b/samples/server/others/haskell-servant-ping/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/others/haskell-servant-ping/.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/haskell-servant-ping/.openapi-generator/FILES b/samples/server/others/haskell-servant-ping/.openapi-generator/FILES new file mode 100644 index 00000000000..1814b863420 --- /dev/null +++ b/samples/server/others/haskell-servant-ping/.openapi-generator/FILES @@ -0,0 +1,6 @@ +README.md +Setup.hs +lib/PingTest/API.hs +lib/PingTest/Types.hs +ping-test.cabal +stack.yaml diff --git a/samples/server/others/haskell-servant-ping/.openapi-generator/VERSION b/samples/server/others/haskell-servant-ping/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/others/haskell-servant-ping/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/others/haskell-servant-ping/README.md b/samples/server/others/haskell-servant-ping/README.md new file mode 100644 index 00000000000..56539768e86 --- /dev/null +++ b/samples/server/others/haskell-servant-ping/README.md @@ -0,0 +1,128 @@ +# Auto-Generated OpenAPI Bindings to `PingTest` + +The library in `lib` provides auto-generated-from-OpenAPI bindings to the PingTest API. + +## Installation + +Installation follows the standard approach to installing Stack-based projects. + +1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README). +2. Run `stack install` to install this package. + +Otherwise, if you already have a Stack project, you can include this package under the `packages` key in your `stack.yaml`: +```yaml +packages: +- location: + git: https://github.com/yourGitOrg/yourGitRepo + commit: somecommit +``` + +## Main Interface + +The main interface to this library is in the `PingTest.API` module, which exports the PingTestBackend type. The PingTestBackend +type can be used to create and define servers and clients for the API. + +## Creating a Client + +A client can be created via the `createPingTestClient` function, which will generate a function for every endpoint of the API. +Then these functions can be invoked with `runPingTestClientWithManager` or more conveniently with `callPingTestClient` +(depending if you want an `Either` back or you want to catch) to access the API endpoint they refer to, if the API is served +at the `url` you specified. + +For example, if `localhost:8080` is serving the PingTest API, you can write: + +```haskell +{-# LANGUAGE RecordWildCards #-} + +import PingTest.API as API + +import Network.HTTP.Client (newManager) +import Network.HTTP.Client.TLS (tlsManagerSettings) +import Servant.Client (ClientEnv, mkClientEnv, parseBaseUrl) + + +main :: IO () +main = do + -- Configure the BaseUrl for the client + url <- parseBaseUrl "http://localhost:8080/" + + -- You probably want to reuse the Manager across calls, for performance reasons + manager <- newManager tlsManagerSettings + + -- Create the client (all endpoint functions will be available) + let PingTestBackend{..} = API.createPingTestClient + + -- Any PingTest API call can go here, e.g. here we call `getSomeEndpoint` + API.callPingTest (mkClientEnv manager url) getSomeEndpoint +``` + +## Creating a Server + +In order to create a server, you must use the `runPingTestMiddlewareServer` function. However, you unlike the client, in which case you *got* a `PingTestBackend` +from the library, you must instead *provide* a `PingTestBackend`. For example, if you have defined handler functions for all the +functions in `PingTest.Handlers`, you can write: + +```haskell +{-# LANGUAGE RecordWildCards #-} + +import PingTest.API +-- required dependency: wai +import Network.Wai (Middleware) +-- required dependency: wai-extra +import Network.Wai.Middleware.RequestLogger (logStdout) + +-- A module you wrote yourself, containing all handlers needed for the PingTestBackend type. +import PingTest.Handlers + +-- If you would like to not use any middlewares you could use runPingTestServer instead + +-- Combined middlewares +requestMiddlewares :: Middleware +requestMiddlewares = logStdout + +-- Run a PingTest server on localhost:8080 +main :: IO () +main = do + let server = PingTestBackend{..} + config = Config "http://localhost:8080/" + runPingTestMiddlewareServer config requestMiddlewares server +``` + +## Authentication + +Currently basic, bearer and API key authentication is supported. The API key must be provided +in the request header. + +For clients authentication the function `clientAuth` is generated automatically. For basic +authentication the argument is of type `BasicAuthData` provided by `Servant.API.BasicAuth`. +For bearer and API key authentication the argument is the key/token and is of type `Text`. +Protected endpoints on the client will receive an extra argument. The value returned by +`clientAuth keyTokenOrBasic` can then be used to make authenticated requests. + +For the server you are free to choose a custom data type. After you specified an instance of +`AuthServerData` it is automatically added as a first argument to protected endpoints: + +``` +newtype Account = Account {unAccount :: Text} +type instance AuthServerData Protected = Account +``` + +Additionally, you have to provide value for the `PingTestAuth` type provided by the +`PingTest.API` module: + +``` +auth :: PingTestAuth +auth = + PingTestAuth + { lookupUser = lookupAccount, + authError = \request -> err401 {errBody = "Missing header"} + } +``` + +`lookupAccount` is a user defined function used to verify the key, token or basic auth data. +`authError` takes a `Request` and returns a `ServerError`. The value is used by the server +functions: + +``` +runPingTestMiddlewareServer config requestMiddlewares auth server +``` diff --git a/samples/server/others/haskell-servant-ping/Setup.hs b/samples/server/others/haskell-servant-ping/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/samples/server/others/haskell-servant-ping/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/samples/server/others/haskell-servant-ping/lib/PingTest/API.hs b/samples/server/others/haskell-servant-ping/lib/PingTest/API.hs new file mode 100644 index 00000000000..85e9515d322 --- /dev/null +++ b/samples/server/others/haskell-servant-ping/lib/PingTest/API.hs @@ -0,0 +1,245 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE ViewPatterns #-} +{-# OPTIONS_GHC +-fno-warn-unused-binds -fno-warn-unused-imports -freduction-depth=328 #-} + +module PingTest.API + ( -- * Client and Server + Config(..) + , PingTestBackend(..) + , createPingTestClient + , runPingTestServer + , runPingTestMiddlewareServer + , runPingTestClient + , runPingTestClientWithManager + , callPingTest + , PingTestClient + , PingTestClientError(..) + -- ** Servant + , PingTestAPI + -- ** Plain WAI Application + , serverWaiApplicationPingTest + ) where + +import PingTest.Types + +import Control.Monad.Catch (Exception, MonadThrow, throwM) +import Control.Monad.Except (ExceptT, runExceptT) +import Control.Monad.IO.Class +import Control.Monad.Trans.Reader (ReaderT (..)) +import Data.Aeson (Value) +import qualified Data.Aeson as Aeson +import qualified Data.ByteString.Lazy as BSL +import Data.Coerce (coerce) +import Data.Data (Data) +import Data.Function ((&)) +import qualified Data.Map as Map +import Data.Monoid ((<>)) +import Data.Proxy (Proxy (..)) +import Data.Set (Set) +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import Data.Time +import Data.UUID (UUID) +import GHC.Exts (IsString (..)) +import GHC.Generics (Generic) +import Network.HTTP.Client (Manager, newManager) +import Network.HTTP.Client.TLS (tlsManagerSettings) +import Network.HTTP.Types.Method (methodOptions) +import Network.Wai (Middleware) +import qualified Network.Wai.Handler.Warp as Warp +import Servant (ServerError, serveWithContextT) +import Servant.API hiding (addHeader) +import Servant.API.Verbs (StdMethod (..), Verb) +import Servant.Client (ClientEnv, Scheme (Http), ClientError, client, + mkClientEnv, parseBaseUrl) +import Servant.Client.Core (baseUrlPort, baseUrlHost) +import Servant.Client.Internal.HttpClient (ClientM (..)) +import Servant.Server (Handler (..), Application, Context (EmptyContext)) +import Servant.Server.StaticFiles (serveDirectoryFileServer) +import Web.FormUrlEncoded +import Web.HttpApiData + + + + +-- | List of elements parsed from a query. +newtype QueryList (p :: CollectionFormat) a = QueryList + { fromQueryList :: [a] + } deriving (Functor, Applicative, Monad, Foldable, Traversable) + +-- | Formats in which a list can be encoded into a HTTP path. +data CollectionFormat + = CommaSeparated -- ^ CSV format for multiple parameters. + | SpaceSeparated -- ^ Also called "SSV" + | TabSeparated -- ^ Also called "TSV" + | PipeSeparated -- ^ `value1|value2|value2` + | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. Only for GET params. + +instance FromHttpApiData a => FromHttpApiData (QueryList 'CommaSeparated a) where + parseQueryParam = parseSeparatedQueryList ',' + +instance FromHttpApiData a => FromHttpApiData (QueryList 'TabSeparated a) where + parseQueryParam = parseSeparatedQueryList '\t' + +instance FromHttpApiData a => FromHttpApiData (QueryList 'SpaceSeparated a) where + parseQueryParam = parseSeparatedQueryList ' ' + +instance FromHttpApiData a => FromHttpApiData (QueryList 'PipeSeparated a) where + parseQueryParam = parseSeparatedQueryList '|' + +instance FromHttpApiData a => FromHttpApiData (QueryList 'MultiParamArray a) where + parseQueryParam = error "unimplemented FromHttpApiData for MultiParamArray collection format" + +parseSeparatedQueryList :: FromHttpApiData a => Char -> Text -> Either Text (QueryList p a) +parseSeparatedQueryList char = fmap QueryList . mapM parseQueryParam . T.split (== char) + +instance ToHttpApiData a => ToHttpApiData (QueryList 'CommaSeparated a) where + toQueryParam = formatSeparatedQueryList ',' + +instance ToHttpApiData a => ToHttpApiData (QueryList 'TabSeparated a) where + toQueryParam = formatSeparatedQueryList '\t' + +instance ToHttpApiData a => ToHttpApiData (QueryList 'SpaceSeparated a) where + toQueryParam = formatSeparatedQueryList ' ' + +instance ToHttpApiData a => ToHttpApiData (QueryList 'PipeSeparated a) where + toQueryParam = formatSeparatedQueryList '|' + +instance ToHttpApiData a => ToHttpApiData (QueryList 'MultiParamArray a) where + toQueryParam = error "unimplemented ToHttpApiData for MultiParamArray collection format" + +formatSeparatedQueryList :: ToHttpApiData a => Char -> QueryList p a -> Text +formatSeparatedQueryList char = T.intercalate (T.singleton char) . map toQueryParam . fromQueryList + +newtype JSONQueryParam a = JSONQueryParam + { fromJsonQueryParam :: a + } deriving (Functor, Foldable, Traversable) + +instance Aeson.ToJSON a => ToHttpApiData (JSONQueryParam a) where + toQueryParam = T.decodeUtf8 . BSL.toStrict . Aeson.encode . fromJsonQueryParam + +instance Aeson.FromJSON a => FromHttpApiData (JSONQueryParam a) where + parseQueryParam = either (Left . T.pack) (Right . JSONQueryParam) . Aeson.eitherDecodeStrict . T.encodeUtf8 + + +-- | Servant type-level API, generated from the OpenAPI spec for PingTest. +type PingTestAPI + = "ping" :> Verb 'GET 201 '[JSON] NoContent -- 'pingGet' route + :<|> Raw + + +-- | Server or client configuration, specifying the host and port to query or serve on. +data Config = Config + { configUrl :: String -- ^ scheme://hostname:port/path, e.g. "http://localhost:8080/" + } deriving (Eq, Ord, Show, Read) + + +-- | Custom exception type for our errors. +newtype PingTestClientError = PingTestClientError ClientError + deriving (Show, Exception) +-- | Configuration, specifying the full url of the service. + + +-- | Backend for PingTest. +-- The backend can be used both for the client and the server. The client generated from the PingTest OpenAPI spec +-- is a backend that executes actions by sending HTTP requests (see @createPingTestClient@). Alternatively, provided +-- a backend, the API can be served using @runPingTestMiddlewareServer@. +data PingTestBackend m = PingTestBackend + { pingGet :: m NoContent{- ^ -} + } + + +newtype PingTestClient a = PingTestClient + { runClient :: ClientEnv -> ExceptT ClientError IO a + } deriving Functor + +instance Applicative PingTestClient where + pure x = PingTestClient (\_ -> pure x) + (PingTestClient f) <*> (PingTestClient x) = + PingTestClient (\env -> f env <*> x env) + +instance Monad PingTestClient where + (PingTestClient a) >>= f = + PingTestClient (\env -> do + value <- a env + runClient (f value) env) + +instance MonadIO PingTestClient where + liftIO io = PingTestClient (\_ -> liftIO io) + +createPingTestClient :: PingTestBackend PingTestClient +createPingTestClient = PingTestBackend{..} + where + ((coerce -> pingGet) :<|> + _) = client (Proxy :: Proxy PingTestAPI) + +-- | Run requests in the PingTestClient monad. +runPingTestClient :: Config -> PingTestClient a -> ExceptT ClientError IO a +runPingTestClient clientConfig cl = do + manager <- liftIO $ newManager tlsManagerSettings + runPingTestClientWithManager manager clientConfig cl + +-- | Run requests in the PingTestClient monad using a custom manager. +runPingTestClientWithManager :: Manager -> Config -> PingTestClient a -> ExceptT ClientError IO a +runPingTestClientWithManager manager Config{..} cl = do + url <- parseBaseUrl configUrl + runClient cl $ mkClientEnv manager url + +-- | Like @runClient@, but returns the response or throws +-- a PingTestClientError +callPingTest + :: (MonadIO m, MonadThrow m) + => ClientEnv -> PingTestClient a -> m a +callPingTest env f = do + res <- liftIO $ runExceptT $ runClient f env + case res of + Left err -> throwM (PingTestClientError err) + Right response -> pure response + + +requestMiddlewareId :: Application -> Application +requestMiddlewareId a = a + +-- | Run the PingTest server at the provided host and port. +runPingTestServer + :: (MonadIO m, MonadThrow m) + => Config -> PingTestBackend (ExceptT ServerError IO) -> m () +runPingTestServer config backend = runPingTestMiddlewareServer config requestMiddlewareId backend + +-- | Run the PingTest server at the provided host and port. +runPingTestMiddlewareServer + :: (MonadIO m, MonadThrow m) + => Config -> Middleware -> PingTestBackend (ExceptT ServerError IO) -> m () +runPingTestMiddlewareServer Config{..} middleware backend = do + url <- parseBaseUrl configUrl + let warpSettings = Warp.defaultSettings + & Warp.setPort (baseUrlPort url) + & Warp.setHost (fromString $ baseUrlHost url) + liftIO $ Warp.runSettings warpSettings $ middleware $ serverWaiApplicationPingTest backend + +-- | Plain "Network.Wai" Application for the PingTest server. +-- +-- Can be used to implement e.g. tests that call the API without a full webserver. +serverWaiApplicationPingTest :: PingTestBackend (ExceptT ServerError IO) -> Application +serverWaiApplicationPingTest backend = serveWithContextT (Proxy :: Proxy PingTestAPI) context id (serverFromBackend backend) + where + context = serverContext + serverFromBackend PingTestBackend{..} = + (coerce pingGet :<|> + serveDirectoryFileServer "static") + + +serverContext :: Context ('[]) +serverContext = EmptyContext diff --git a/samples/server/others/haskell-servant-ping/lib/PingTest/Types.hs b/samples/server/others/haskell-servant-ping/lib/PingTest/Types.hs new file mode 100644 index 00000000000..5e6c493209e --- /dev/null +++ b/samples/server/others/haskell-servant-ping/lib/PingTest/Types.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DuplicateRecordFields #-} +{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module PingTest.Types ( + ) where + +import Data.Data (Data) +import Data.UUID (UUID) +import Data.List (lookup) +import Data.Maybe (fromMaybe) +import Data.Aeson (Value, FromJSON(..), ToJSON(..), genericToJSON, genericParseJSON) +import Data.Aeson.Types (Options(..), defaultOptions) +import Data.Set (Set) +import Data.Text (Text) +import Data.Time +import Data.Swagger (ToSchema, declareNamedSchema) +import qualified Data.Swagger as Swagger +import qualified Data.Char as Char +import qualified Data.Text as T +import qualified Data.Map as Map +import GHC.Generics (Generic) + diff --git a/samples/server/others/haskell-servant-ping/ping-test.cabal b/samples/server/others/haskell-servant-ping/ping-test.cabal new file mode 100644 index 00000000000..00b148c9a8d --- /dev/null +++ b/samples/server/others/haskell-servant-ping/ping-test.cabal @@ -0,0 +1,42 @@ +name: ping-test +version: 0.1.0.0 +synopsis: Auto-generated API bindings for ping-test +description: Please see README.md +homepage: https://openapi-generator.tech +author: Author Name Here +maintainer: author.name@email.com +copyright: YEAR - AUTHOR +category: Web +build-type: Simple +cabal-version: >=1.10 + +library + hs-source-dirs: lib + exposed-modules: PingTest.API + , PingTest.Types + ghc-options: -Wall + build-depends: base + , aeson + , text + , containers + , exceptions + , network-uri + , servant + , http-api-data + , servant + , servant-client + , servant-client-core + , servant-server + , servant + , wai + , warp + , transformers + , mtl + , time + , http-client + , http-client-tls + , http-types + , swagger2 + , uuid + , bytestring + default-language: Haskell2010 diff --git a/samples/server/others/haskell-servant-ping/stack.yaml b/samples/server/others/haskell-servant-ping/stack.yaml new file mode 100644 index 00000000000..7b4767b0ebf --- /dev/null +++ b/samples/server/others/haskell-servant-ping/stack.yaml @@ -0,0 +1,8 @@ +resolver: lts-22.12 +extra-deps: [] +packages: +- '.' +nix: + enable: false + packages: + - zlib diff --git a/samples/server/others/kotlin-server/jaxrs-spec-array-response/build.gradle b/samples/server/others/kotlin-server/jaxrs-spec-array-response/build.gradle index 1eb159881c5..aa51cb2d3b5 100644 --- a/samples/server/others/kotlin-server/jaxrs-spec-array-response/build.gradle +++ b/samples/server/others/kotlin-server/jaxrs-spec-array-response/build.gradle @@ -11,7 +11,7 @@ buildscript { ext.swagger_annotations_version = "1.5.3" ext.jakarta_annotations_version = "2.1.1" ext.jakarta_ws_rs_version = "3.1.0" - ext.jackson_version = "2.9.9" + ext.jackson_version = "2.17.1" repositories { maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } diff --git a/samples/server/others/kotlin-server/jaxrs-spec/build.gradle b/samples/server/others/kotlin-server/jaxrs-spec/build.gradle index 0200843b4be..8a4cd5aeac7 100644 --- a/samples/server/others/kotlin-server/jaxrs-spec/build.gradle +++ b/samples/server/others/kotlin-server/jaxrs-spec/build.gradle @@ -11,7 +11,7 @@ buildscript { ext.swagger_annotations_version = "1.5.3" ext.jakarta_annotations_version = "1.3.5" ext.jakarta_ws_rs_version = "2.1.6" - ext.jackson_version = "2.9.9" + ext.jackson_version = "2.17.1" repositories { maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES index ac21668e628..e04fd4c8e91 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Program.cs diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES index ac21668e628..e04fd4c8e91 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Program.cs diff --git a/samples/server/petstore/aspnetcore-3.1/README.md b/samples/server/petstore/aspnetcore-3.1/README.md index cb9541519ea..5da4721474e 100644 --- a/samples/server/petstore/aspnetcore-3.1/README.md +++ b/samples/server/petstore/aspnetcore-3.1/README.md @@ -1,4 +1,4 @@ -# Org.OpenAPITools - ASP.NET Core 3.1 Server +# Org.OpenAPITools - ASP.NET Core 8.0 Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile index 9fe18ee2ba3..c24f45dbc5a 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Dockerfile @@ -1,13 +1,13 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. # Container we use for final publish -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base WORKDIR /app EXPOSE 80 EXPOSE 443 # Build container -FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build # Copy the code into the container WORKDIR /src diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs index b684e16a2d9..0adda89acc0 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Startup.cs @@ -84,7 +84,7 @@ namespace Org.OpenAPITools c.SwaggerDoc("1.0.0", new OpenApiInfo { Title = "OpenAPI Petstore", - Description = "OpenAPI Petstore (ASP.NET Core 3.1)", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), Contact = new OpenApiContact { diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES index ac21668e628..e04fd4c8e91 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Program.cs diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/.openapi-generator/FILES index fe6225de0b2..5813de3b53b 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs index 155edd3e86f..6dd12a5fd68 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..18d3b5347c2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,138 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/.openapi-generator/FILES index fe6225de0b2..5813de3b53b 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..c07abecc09a --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string? Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string? NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES index fe6225de0b2..5813de3b53b 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..f2b9c2ebe47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES index 2836933eb2c..2f0226d29bc 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES @@ -14,6 +14,7 @@ src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj src/Org.OpenAPITools.Models/Pet.cs src/Org.OpenAPITools.Models/Tag.cs src/Org.OpenAPITools.Models/TestEnum.cs +src/Org.OpenAPITools.Models/TestNullable.cs src/Org.OpenAPITools.Models/User.cs src/Org.OpenAPITools/.gitignore src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES index 7d45629430c..8da23f0cd09 100644 --- a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES @@ -21,6 +21,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs index 07c44c86143..d1cc02582f7 100644 --- a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -25,6 +25,16 @@ namespace Org.OpenAPITools.Controllers [ApiController] public abstract class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(TestNullable))] + public abstract IActionResult FakeNullableExampleTest(); + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..d61290a27c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES index fe6225de0b2..5813de3b53b 100644 --- a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES @@ -24,6 +24,7 @@ src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs src/Org.OpenAPITools/Models/User.cs src/Org.OpenAPITools/OpenApi/TypeExtensions.cs src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/FakeApi.cs index 8e36c8d2be1..a0f2bd3b231 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -28,6 +28,30 @@ namespace Org.OpenAPITools.Controllers [ApiController] public class FakeApiController : ControllerBase { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + /// /// fake endpoint to test parameter example (object) /// diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index a117e88378f..b47dce3d2c6 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -812,6 +812,26 @@ "summary" : "fake endpoint to test parameter example (object)", "tags" : [ "fake" ] } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } } }, "components" : { @@ -852,6 +872,22 @@ "enum" : [ "A", "B" ], "type" : "string" }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, "Order" : { "description" : "An order for a pets from the pet store", "example" : { diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.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/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES new file mode 100644 index 00000000000..5813de3b53b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/FILES @@ -0,0 +1,38 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.Development.json +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/README.md b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/README.md new file mode 100644 index 00000000000..5da4721474e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.bat b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.sh b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..315555e2a44 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..3d7fbb77b0d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Text.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..6dd12a5fd68 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Text.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeParameterExampleTest")] + public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..d4230ca5a4c --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Text.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..2c52f026791 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Text.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonSerializer.Deserialize>(exampleJson) + : new Dictionary(); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..5a0951513f3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Text.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonSerializer.Deserialize(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..cdd3d463721 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using System.Text.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonSerializer.Deserialize(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 00000000000..c24f45dbc5a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..97ae99c9295 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..9eccd5c317f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..6172a1b27e9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..9362efa8367 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,152 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..01639d12eed --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..11eac79c541 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,139 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..c08f6b036d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..cbf41566ae1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,223 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..8b9f57ddc85 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,228 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..0a40e7f333e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,138 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 00000000000..8777bf97e8d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..18d3b5347c2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,138 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..49dd6ebe212 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,223 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using System.Text.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + + return JsonSerializer.Serialize(this, options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..9cc715ffd9f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,26 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs new file mode 100644 index 00000000000..00ed16ed675 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 00000000000..99cfeea4b91 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 00000000000..d2700aa1da7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,150 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using System.Text.Json; +using System.Text.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddJsonOptions(options => + { + options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)); + }); + services + .AddSwaggerGen(c => + { + c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); + + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 00000000000..e203e9407e7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 00000000000..def9159a7d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 00000000000..6a0b78471a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 00000000000..f3318bc90a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 00000000000..b47dce3d2c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + }, + "put" : { + "description" : "", + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/user/logout" : { + "get" : { + "description" : "", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "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" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "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" ] + }, + "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" ] + } + }, + "/fake/parameter_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_parameter_example_test", + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "data", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "style" : "form" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "summary" : "fake endpoint to test parameter example (object)", + "tags" : [ "fake" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } + } + }, + "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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, + "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" + }, + "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/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.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/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES new file mode 100644 index 00000000000..5813de3b53b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/FILES @@ -0,0 +1,38 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.Development.json +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/README.md b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/README.md new file mode 100644 index 00000000000..5da4721474e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.bat b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.sh b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..23d737e9bf0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object? args = null; + if (parameter.Name != null && context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object? args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid && parameter.Name != null) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..beabdde2fb1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..a0f2bd3b231 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeParameterExampleTest")] + public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..fae01d29a62 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string? apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string? name, [FromForm (Name = "status")]string? status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string? additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..b925426c761 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary(); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..6d7094c81a9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..32303e7a410 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 00000000000..c24f45dbc5a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..97ae99c9295 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..9eccd5c317f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..c9da013dc71 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string? Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..638c1313710 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string? Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string? Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..710b6a34d82 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool? Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..e9718bd5ca0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string? Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..5ea23a2f881 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string? Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..626ad7c4e84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime? ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool? Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..69a963a25f2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category? Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..4d7834b4c52 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string? Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 00000000000..10227a2a2c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..c07abecc09a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string? Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string? NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..4d07fc1ef74 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string? Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string? FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string? LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string? Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string? Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string? Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int? UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..734cc7dbef4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,28 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + annotations + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs new file mode 100644 index 00000000000..00ed16ed675 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 00000000000..99cfeea4b91 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 00000000000..0adda89acc0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + services + .AddSwaggerGen(c => + { + c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); + + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + services + .AddSwaggerGenNewtonsoftSupport(); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 00000000000..e203e9407e7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 00000000000..def9159a7d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 00000000000..6a0b78471a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 00000000000..f3318bc90a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 00000000000..b47dce3d2c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + }, + "put" : { + "description" : "", + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/user/logout" : { + "get" : { + "description" : "", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "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" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "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" ] + }, + "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" ] + } + }, + "/fake/parameter_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_parameter_example_test", + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "data", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "style" : "form" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "summary" : "fake endpoint to test parameter example (object)", + "tags" : [ "fake" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } + } + }, + "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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, + "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" + }, + "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/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.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/aspnetcore-8.0-pocoModels/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/FILES new file mode 100644 index 00000000000..5813de3b53b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/FILES @@ -0,0 +1,38 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.Development.json +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/README.md b/samples/server/petstore/aspnetcore-8.0-pocoModels/README.md new file mode 100644 index 00000000000..5da4721474e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/build.bat b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/build.sh b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..315555e2a44 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..beabdde2fb1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..a0f2bd3b231 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeParameterExampleTest")] + public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..7dded4e0f16 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..b925426c761 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary(); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..6d7094c81a9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..7d1a4ed4ffb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 00000000000..c24f45dbc5a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..97ae99c9295 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..9eccd5c317f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..c7a6ae09eaa --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,51 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..223b4a4d656 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,48 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..537c0f7f714 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..a453e45e115 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..f1a52695233 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..7a68506eaa4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,96 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..fa3ddfa5110 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,99 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..8dfa88aa9da --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/Tag.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 00000000000..10227a2a2c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..f2b9c2ebe47 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/TestNullable.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..fb756914eb5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Models/User.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..745c764b501 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs new file mode 100644 index 00000000000..00ed16ed675 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 00000000000..99cfeea4b91 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 00000000000..0adda89acc0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + services + .AddSwaggerGen(c => + { + c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); + + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + services + .AddSwaggerGenNewtonsoftSupport(); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 00000000000..e203e9407e7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 00000000000..def9159a7d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 00000000000..6a0b78471a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 00000000000..f3318bc90a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 00000000000..b47dce3d2c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + }, + "put" : { + "description" : "", + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/user/logout" : { + "get" : { + "description" : "", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "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" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "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" ] + }, + "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" ] + } + }, + "/fake/parameter_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_parameter_example_test", + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "data", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "style" : "form" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "summary" : "fake endpoint to test parameter example (object)", + "tags" : [ "fake" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } + } + }, + "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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, + "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" + }, + "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/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.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/aspnetcore-8.0-project4Models/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/FILES new file mode 100644 index 00000000000..2f0226d29bc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/FILES @@ -0,0 +1,40 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools.Models/.gitignore +src/Org.OpenAPITools.Models/Animal.cs +src/Org.OpenAPITools.Models/ApiResponse.cs +src/Org.OpenAPITools.Models/Cat.cs +src/Org.OpenAPITools.Models/Category.cs +src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools.Models/Dog.cs +src/Org.OpenAPITools.Models/Order.cs +src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj +src/Org.OpenAPITools.Models/Pet.cs +src/Org.OpenAPITools.Models/Tag.cs +src/Org.OpenAPITools.Models/TestEnum.cs +src/Org.OpenAPITools.Models/TestNullable.cs +src/Org.OpenAPITools.Models/User.cs +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.Development.json +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln new file mode 100644 index 00000000000..d229ac688de --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/Org.OpenAPITools.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools.Models", "src\Org.OpenAPITools.Models\Org.OpenAPITools.Models.csproj", "{B8D18F25-F379-4B87-ACCC-F8A17E0AED38}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8D18F25-F379-4B87-ACCC-F8A17E0AED38}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/README.md b/samples/server/petstore/aspnetcore-8.0-project4Models/README.md new file mode 100644 index 00000000000..5da4721474e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/build.bat b/samples/server/petstore/aspnetcore-8.0-project4Models/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/build.sh b/samples/server/petstore/aspnetcore-8.0-project4Models/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs new file mode 100644 index 00000000000..4b04346e358 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs new file mode 100644 index 00000000000..2358b07fa7d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs new file mode 100644 index 00000000000..ef5b1be3efb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs new file mode 100644 index 00000000000..7898abbb9ff --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..7d1a4ed4ffb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs new file mode 100644 index 00000000000..2dd6a7f4362 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs new file mode 100644 index 00000000000..5076e34732a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj new file mode 100644 index 00000000000..4ac779e720a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj @@ -0,0 +1,23 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Library + Org.OpenAPITools.Models + Org.OpenAPITools.Models + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs new file mode 100644 index 00000000000..31a57ea7735 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs new file mode 100644 index 00000000000..84ccb02359b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs new file mode 100644 index 00000000000..10227a2a2c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs new file mode 100644 index 00000000000..9155e7309fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools.Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..315555e2a44 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..beabdde2fb1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..a0f2bd3b231 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeParameterExampleTest")] + public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..7dded4e0f16 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..b925426c761 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary(); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..6d7094c81a9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 00000000000..c24f45dbc5a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..97ae99c9295 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..9eccd5c317f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..ffc93a97da3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs new file mode 100644 index 00000000000..00ed16ed675 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 00000000000..99cfeea4b91 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 00000000000..0adda89acc0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + services + .AddSwaggerGen(c => + { + c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); + + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + services + .AddSwaggerGenNewtonsoftSupport(); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 00000000000..e203e9407e7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 00000000000..def9159a7d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 00000000000..6a0b78471a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 00000000000..f3318bc90a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 00000000000..b47dce3d2c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + }, + "put" : { + "description" : "", + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/user/logout" : { + "get" : { + "description" : "", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "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" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "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" ] + }, + "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" ] + } + }, + "/fake/parameter_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_parameter_example_test", + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "data", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "style" : "form" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "summary" : "fake endpoint to test parameter example (object)", + "tags" : [ "fake" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } + } + }, + "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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, + "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" + }, + "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/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.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/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES new file mode 100644 index 00000000000..8da23f0cd09 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/FILES @@ -0,0 +1,28 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/README.md b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/README.md new file mode 100644 index 00000000000..9a7702f6979 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/README.md @@ -0,0 +1,43 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.sh b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..315555e2a44 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..7ef97038061 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,38 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + public abstract IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..d1cc02582f7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,48 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(TestNullable))] + public abstract IActionResult FakeNullableExampleTest(); + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + public abstract IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..20656c81638 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult AddPet([FromBody]Pet pet); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey); + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + public abstract IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status); + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + [Obsolete] + public abstract IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags); + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult UpdatePet([FromBody]Pet pet); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + public abstract IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status); + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(ApiResponse))] + public abstract IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..3ec0d549c4a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + public abstract IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId); + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Dictionary))] + public abstract IActionResult GetInventory(); + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult PlaceOrder([FromBody]Order order); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..2de74542f79 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUser([FromBody]User user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUsersWithArrayInput([FromBody]List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUsersWithListInput([FromBody]List user); + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + public abstract IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(User))] + public abstract IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(string))] + public abstract IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password); + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + public abstract IActionResult LogoutUser(); + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..7d1a4ed4ffb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..9dcb10746c9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,138 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + public class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..4963d2e9b8e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..916049da141 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..67a508071a7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..22dae6cd3d7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..5b3d6c1aaac --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..0b638a66b14 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..a9e492ebddf --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 00000000000..10227a2a2c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..d61290a27c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..ab41cb3843a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..9fa884cf930 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,26 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Library + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 00000000000..b1d83a35961 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,20 @@ + + + + $id$ + 1.0.0 + OpenAPI Library + OpenAPI + OpenAPI + https://www.apache.org/licenses/LICENSE-2.0.html + + false + A library generated from a OpenAPI doc + Summary of changes made in this release of the package. + No Copyright + Org.OpenAPITools + + diff --git a/samples/server/petstore/aspnetcore-8.0/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-8.0/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.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/aspnetcore-8.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/FILES new file mode 100644 index 00000000000..5813de3b53b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/FILES @@ -0,0 +1,38 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/DefaultApi.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Dockerfile +src/Org.OpenAPITools/Filters/BasePathFilter.cs +src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/TestEnum.cs +src/Org.OpenAPITools/Models/TestNullable.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Program.cs +src/Org.OpenAPITools/Properties/launchSettings.json +src/Org.OpenAPITools/Startup.cs +src/Org.OpenAPITools/appsettings.Development.json +src/Org.OpenAPITools/appsettings.json +src/Org.OpenAPITools/wwwroot/README.md +src/Org.OpenAPITools/wwwroot/index.html +src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-8.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-8.0/README.md b/samples/server/petstore/aspnetcore-8.0/README.md new file mode 100644 index 00000000000..5da4721474e --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/README.md @@ -0,0 +1,50 @@ +# Org.OpenAPITools - ASP.NET Core 8.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` +## Run in Docker + +``` +cd src/Org.OpenAPITools +docker build -t org.openapitools . +docker run -p 5000:8080 org.openapitools +``` diff --git a/samples/server/petstore/aspnetcore-8.0/build.bat b/samples/server/petstore/aspnetcore-8.0/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-8.0/build.sh b/samples/server/petstore/aspnetcore-8.0/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..315555e2a44 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,69 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + if (context.ActionDescriptor is ControllerActionDescriptor descriptor) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + if (attributeInstance is ValidationAttribute validationAttribute) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..bfbe6290f23 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,72 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs new file mode 100644 index 00000000000..beabdde2fb1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/DefaultApi.cs @@ -0,0 +1,49 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// Test API + /// + /// + /// OK + [HttpGet] + [Route("/v2/test")] + [ValidateModelState] + [SwaggerOperation("TestGet")] + public virtual IActionResult TestGet([FromQuery (Name = "testQuery")]TestEnum? testQuery) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..a0f2bd3b231 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class FakeApiController : ControllerBase + { + /// + /// Fake endpoint to test nullable example (object) + /// + /// Successful operation + [HttpGet] + [Route("/v2/fake/nullable_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeNullableExampleTest")] + [SwaggerResponse(statusCode: 200, type: typeof(TestNullable), description: "Successful operation")] + public virtual IActionResult FakeNullableExampleTest() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(TestNullable)); + string exampleJson = null; + exampleJson = "{\n \"nullableName\" : \"nullableName\",\n \"name\" : \"name\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(TestNullable); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + [SwaggerOperation("FakeParameterExampleTest")] + public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..7dded4e0f16 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,260 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult AddPet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader (Name = "api_key")]string apiKey) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + throw new NotImplementedException(); + } + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [SwaggerOperation("FindPetsByStatus")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [SwaggerOperation("FindPetsByTags")] + [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] + [Obsolete] + public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(List)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(List); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult UpdatePet([FromBody]Pet pet) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Pet)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + string exampleJson = null; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; + exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Pet); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) + { + + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(405); + + throw new NotImplementedException(); + } + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(ApiResponse)); + string exampleJson = null; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(ApiResponse); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..b925426c761 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,141 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase + { + /// + /// 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 + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("DeleteOrder")] + public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("GetInventory")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + public virtual IActionResult GetInventory() + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary(); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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 + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [SwaggerOperation("GetOrderById")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order order) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Order)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; + exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(Order); + //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..6d7094c81a9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List user) + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [SwaggerOperation("GetUserByName")] + [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] + public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(User)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + string exampleJson = null; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; + exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(User); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [SwaggerOperation("LoginUser")] + [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] + public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) + { + + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(string)); + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + string exampleJson = null; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(string); + //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [SwaggerOperation("LogoutUser")] + public virtual IActionResult LogoutUser() + { + + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(0); + + throw new NotImplementedException(); + } + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) + { + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + throw new NotImplementedException(); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..7d1a4ed4ffb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile new file mode 100644 index 00000000000..c24f45dbc5a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Dockerfile @@ -0,0 +1,32 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# Container we use for final publish +FROM mcr.microsoft.com/dotnet/core/aspnet:8.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +# Build container +FROM mcr.microsoft.com/dotnet/core/sdk:8.0-buster AS build + +# Copy the code into the container +WORKDIR /src +COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] + +# NuGet restore +RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" +COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] + +# Build the API +WORKDIR "Org.OpenAPITools" +RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build + +# Publish it +FROM build AS publish +RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish + +# Make the final image for publishing +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..97ae99c9295 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/BasePathFilter.cs @@ -0,0 +1,60 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.Linq; +using System.Text.RegularExpressions; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the OpenAPI Doc + /// + /// The BasePath of the OpenAPI Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) + { + //openapiDoc.BasePath = BasePath; + + var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); + + foreach (var (key, value) in pathsToModify) + { + if (key.StartsWith(BasePath)) + { + var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); + openapiDoc.Paths.Remove(key); + openapiDoc.Paths.Add(newKey, value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..9eccd5c317f --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,107 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Org.OpenAPITools.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(OpenApiOperation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); + + // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 + // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 + // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema + if (attributes.Any() && openapiParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + openapiParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + var regex = (string)regexAttr.ConstructorArguments[0].Value; + openapiParam.Schema.Pattern = regex; + } + + // String Length [StringLength] + int? minLength = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLength = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (minLength != null) + { + openapiParam.Schema.MinLength = minLength; + } + + if (maxLength != null) + { + openapiParam.Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + openapiParam.Schema.MinLength = rangeMin; + openapiParam.Schema.MaxLength = rangeMax; + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..18796da30fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,45 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + /// + public class InputFormatterStream : InputFormatter + { + /// + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + /// + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + + /// + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..4b04346e358 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Animal.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..2358b07fa7d --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..ef5b1be3efb --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..7898abbb9ff --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..2dd6a7f4362 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..5076e34732a --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=true)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..31a57ea7735 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// doggie + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..84ccb02359b --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs new file mode 100644 index 00000000000..10227a2a2c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestEnum.cs @@ -0,0 +1,43 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Gets or Sets TestEnum + /// + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TestEnum + { + + /// + /// Enum AEnum for A + /// + [EnumMember(Value = "A")] + AEnum = 1, + + /// + /// Enum BEnum for B + /// + [EnumMember(Value = "B")] + BEnum = 2 + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs new file mode 100644 index 00000000000..8db75f2dafd --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/TestNullable.cs @@ -0,0 +1,133 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class TestNullable : IEquatable + { + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets NullableName + /// + [DataMember(Name="nullableName", EmitDefaultValue=true)] + public string NullableName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TestNullable {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" NullableName: ").Append(NullableName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((TestNullable)obj); + } + + /// + /// Returns true if TestNullable instances are equal + /// + /// Instance of TestNullable to be compared + /// Boolean + public bool Equals(TestNullable other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + NullableName == other.NullableName || + NullableName != null && + NullableName.Equals(other.NullableName) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (NullableName != null) + hashCode = hashCode * 59 + NullableName.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(TestNullable left, TestNullable right) + { + return Equals(left, right); + } + + public static bool operator !=(TestNullable left, TestNullable right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..9155e7309fc --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..122f58cabe4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..745c764b501 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,27 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net8.0 + true + true + 1.0.0 + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs new file mode 100644 index 00000000000..00ed16ed675 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Program.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Org.OpenAPITools +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// Create the host builder. + /// + /// + /// IHostBuilder + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup() + .UseUrls("http://0.0.0.0:8080/"); + }); + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Properties/launchSettings.json new file mode 100644 index 00000000000..99cfeea4b91 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61788", + "sslPort": 44301 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "openapi", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OpenAPI": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "openapi", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", + "publishAllPorts": true, + "useSSL": true + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Startup.cs new file mode 100644 index 00000000000..0adda89acc0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/Startup.cs @@ -0,0 +1,155 @@ +/* + * 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 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.IO; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Org.OpenAPITools.Authentication; +using Org.OpenAPITools.Filters; +using Org.OpenAPITools.OpenApi; +using Org.OpenAPITools.Formatters; + +namespace Org.OpenAPITools +{ + /// + /// Startup + /// + public class Startup + { + /// + /// Constructor + /// + /// + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + /// + /// The application configuration. + /// + public IConfiguration Configuration { get; } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + services.AddTransient(); + services.AddAuthorization(authConfig => + { + authConfig.AddPolicy("api_key", policyBuilder => + { + policyBuilder + .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); + }); + }); + + // Add framework services. + services + // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ + .AddControllers(options => { + options.InputFormatters.Insert(0, new InputFormatterStream()); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter + { + NamingStrategy = new CamelCaseNamingStrategy() + }); + }); + services + .AddSwaggerGen(c => + { + c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); + + c.SwaggerDoc("1.0.0", new OpenApiInfo + { + Title = "OpenAPI Petstore", + Description = "OpenAPI Petstore (ASP.NET Core 8.0)", + TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), + Contact = new OpenApiContact + { + Name = "OpenAPI-Generator Contributors", + Url = new Uri("https://github.com/openapitools/openapi-generator"), + Email = "" + }, + License = new OpenApiLicense + { + Name = "NoLicense", + Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") + }, + Version = "1.0.0", + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); + // Sets the basePath property in the OpenAPI document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + services + .AddSwaggerGenNewtonsoftSupport(); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseSwagger(c => + { + c.RouteTemplate = "openapi/{documentName}/openapi.json"; + }) + .UseSwaggerUI(c => + { + // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html + c.RoutePrefix = "openapi"; + //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) + c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); + + //TODO: Or alternatively use the original OpenAPI contract that's included in the static files + // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); + }); + app.UseRouting(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.Development.json new file mode 100644 index 00000000000..e203e9407e7 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json new file mode 100644 index 00000000000..def9159a7d9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md new file mode 100644 index 00000000000..6a0b78471a3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/index.html new file mode 100644 index 00000000000..f3318bc90a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/index.html @@ -0,0 +1 @@ + diff --git a/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json new file mode 100644 index 00000000000..b47dce3d2c6 --- /dev/null +++ b/samples/server/petstore/aspnetcore-8.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -0,0 +1,1203 @@ +{ + "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" : { + "/test" : { + "get" : { + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "testQuery", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TestEnum" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "description" : "OK" + } + }, + "summary" : "Test API" + } + }, + "/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" ] + }, + "put" : { + "description" : "", + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + }, + "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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/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" ] + } + }, + "/user/logout" : { + "get" : { + "description" : "", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Logs out current logged in user session", + "tags" : [ "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" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "summary" : "Delete user", + "tags" : [ "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" ] + }, + "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" ] + } + }, + "/fake/parameter_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_parameter_example_test", + "parameters" : [ { + "explode" : true, + "in" : "query", + "name" : "data", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/Pet" + }, + "style" : "form" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "summary" : "fake endpoint to test parameter example (object)", + "tags" : [ "fake" ] + } + }, + "/fake/nullable_example_test" : { + "get" : { + "description" : "", + "operationId" : "fake_nullable_example_test", + "responses" : { + "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TestNullable" + } + } + }, + "description" : "Successful operation" + } + }, + "summary" : "Fake endpoint to test nullable example (object)", + "tags" : [ "fake" ] + } + } + }, + "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" : { + "TestEnum" : { + "enum" : [ "A", "B" ], + "type" : "string" + }, + "TestNullable" : { + "example" : { + "nullableName" : "nullableName", + "name" : "name" + }, + "properties" : { + "name" : { + "type" : "string" + }, + "nullableName" : { + "nullable" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "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" + }, + "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" + }, + "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/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 44fe2b0a0a2..5f7750b96b9 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/samples/server/petstore/go-api-server/README.md b/samples/server/petstore/go-api-server/README.md index eab802e67bb..2d7b21a2406 100644 --- a/samples/server/petstore/go-api-server/README.md +++ b/samples/server/petstore/go-api-server/README.md @@ -6,7 +6,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke 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: @@ -23,6 +22,8 @@ To run the server, follow these simple steps: go run main.go ``` +The server will be available on `http://localhost:8080`. + To run the server in a docker container ``` docker build --network=host -t petstoreserver . diff --git a/samples/server/petstore/go-api-server/go/model_category.go b/samples/server/petstore/go-api-server/go/model_category.go index fe474de1c47..a8c835c0da4 100644 --- a/samples/server/petstore/go-api-server/go/model_category.go +++ b/samples/server/petstore/go-api-server/go/model_category.go @@ -18,7 +18,7 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } // AssertCategoryRequired checks if the required fields are not zero-ed diff --git a/samples/server/petstore/go-chi-server/README.md b/samples/server/petstore/go-chi-server/README.md index eab802e67bb..2d7b21a2406 100644 --- a/samples/server/petstore/go-chi-server/README.md +++ b/samples/server/petstore/go-chi-server/README.md @@ -6,7 +6,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke 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: @@ -23,6 +22,8 @@ To run the server, follow these simple steps: go run main.go ``` +The server will be available on `http://localhost:8080`. + To run the server in a docker container ``` docker build --network=host -t petstoreserver . diff --git a/samples/server/petstore/go-chi-server/go/model_category.go b/samples/server/petstore/go-chi-server/go/model_category.go index fe474de1c47..a8c835c0da4 100644 --- a/samples/server/petstore/go-chi-server/go/model_category.go +++ b/samples/server/petstore/go-chi-server/go/model_category.go @@ -18,7 +18,7 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } // AssertCategoryRequired checks if the required fields are not zero-ed diff --git a/samples/server/petstore/go-echo-server/models/model_category.go b/samples/server/petstore/go-echo-server/models/model_category.go index e165eb44563..ea8cd109fde 100644 --- a/samples/server/petstore/go-echo-server/models/model_category.go +++ b/samples/server/petstore/go-echo-server/models/model_category.go @@ -5,5 +5,5 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } diff --git a/samples/server/petstore/go-gin-api-server-interface-only/go/model_category.go b/samples/server/petstore/go-gin-api-server-interface-only/go/model_category.go index 5e6f9d247fa..165983fbcaa 100644 --- a/samples/server/petstore/go-gin-api-server-interface-only/go/model_category.go +++ b/samples/server/petstore/go-gin-api-server-interface-only/go/model_category.go @@ -14,5 +14,5 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } diff --git a/samples/server/petstore/go-gin-api-server/go.sum b/samples/server/petstore/go-gin-api-server/go.sum index 5a6c9b3832c..3da8f838b87 100644 --- a/samples/server/petstore/go-gin-api-server/go.sum +++ b/samples/server/petstore/go-gin-api-server/go.sum @@ -76,24 +76,29 @@ golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/samples/server/petstore/go-gin-api-server/go/model_category.go b/samples/server/petstore/go-gin-api-server/go/model_category.go index 5e6f9d247fa..165983fbcaa 100644 --- a/samples/server/petstore/go-gin-api-server/go/model_category.go +++ b/samples/server/petstore/go-gin-api-server/go/model_category.go @@ -14,5 +14,5 @@ type Category struct { Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"` } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java index 2df48411981..f513a379c45 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -11,6 +11,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -26,7 +27,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "Category") @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Category { @@ -42,11 +42,12 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -63,11 +64,12 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index beae56a72e6..4afa867fe2d 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -28,7 +29,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "ModelApiResponse") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class ModelApiResponse { @@ -46,11 +46,12 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @JacksonXmlProperty(localName = "code") + @XmlElement(name = "code") public Integer getCode() { return code; } @@ -67,11 +68,12 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @JacksonXmlProperty(localName = "type") + @XmlElement(name = "type") public String getType() { return type; } @@ -88,11 +90,12 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") @JacksonXmlProperty(localName = "message") + @XmlElement(name = "message") public String getMessage() { return message; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java index 9f05a3a82fd..4c34df8f17d 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -29,7 +30,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "Order") @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Order { @@ -91,11 +91,12 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -112,11 +113,12 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") + @XmlElement(name = "petId") public Long getPetId() { return petId; } @@ -133,11 +135,12 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") + @XmlElement(name = "quantity") public Integer getQuantity() { return quantity; } @@ -154,11 +157,12 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") + @XmlElement(name = "shipDate") public Date getShipDate() { return shipDate; } @@ -175,11 +179,12 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @JacksonXmlProperty(localName = "status") + @XmlElement(name = "status") public StatusEnum getStatus() { return status; } @@ -196,11 +201,12 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") + @XmlElement(name = "complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index d877395e5c0..d45bd48fa56 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -17,6 +17,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -32,7 +33,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "Pet") @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Pet { @@ -108,11 +108,12 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -129,11 +130,12 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @JacksonXmlProperty(localName = "Category") + @XmlElement(name = "Category") public Category getCategory() { return category; } @@ -150,11 +152,12 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } @@ -179,11 +182,14 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") public List getPhotoUrls() { return photoUrls; } @@ -208,11 +214,14 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") - @JacksonXmlProperty(localName = "tag") + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") public List<@Valid Tag> getTags() { return tags; } @@ -230,11 +239,12 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @JacksonXmlProperty(localName = "status") + @XmlElement(name = "status") @Deprecated public StatusEnum getStatus() { return status; @@ -242,7 +252,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java index 9fe690f545e..13333f70805 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -11,6 +11,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -26,7 +27,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "Tag") @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Tag { @@ -42,11 +42,12 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -63,11 +64,12 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @JacksonXmlProperty(localName = "name") + @XmlElement(name = "name") public String getName() { return name; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java index 0087d955ddc..3bb28c2fcfd 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -11,6 +11,7 @@ import javax.validation.constraints.*; import org.hibernate.validator.constraints.*; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; @@ -26,7 +27,6 @@ import javax.annotation.Generated; @JacksonXmlRootElement(localName = "User") @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) - @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class User { @@ -54,11 +54,12 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @JacksonXmlProperty(localName = "id") + @XmlElement(name = "id") public Long getId() { return id; } @@ -75,11 +76,12 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @JacksonXmlProperty(localName = "username") + @XmlElement(name = "username") public String getUsername() { return username; } @@ -96,11 +98,12 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") + @XmlElement(name = "firstName") public String getFirstName() { return firstName; } @@ -117,11 +120,12 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") + @XmlElement(name = "lastName") public String getLastName() { return lastName; } @@ -138,11 +142,12 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @JacksonXmlProperty(localName = "email") + @XmlElement(name = "email") public String getEmail() { return email; } @@ -159,11 +164,12 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @JacksonXmlProperty(localName = "password") + @XmlElement(name = "password") public String getPassword() { return password; } @@ -180,11 +186,12 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") + @XmlElement(name = "phone") public String getPhone() { return phone; } @@ -201,11 +208,12 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") + @XmlElement(name = "userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml index 6fc0968bc33..a08bc26cc14 100644 --- a/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml index 6fc0968bc33..a08bc26cc14 100644 --- a/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: 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 index 6fc0968bc33..a08bc26cc14 100644 --- 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 @@ -1560,10 +1560,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java index 7c342fe75ae..d7d5c4164ca 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java @@ -51,7 +51,7 @@ public class Category { /** * Get id * @return id - **/ + */ @Nullable @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_ID) @@ -74,7 +74,7 @@ public class Category { /** * Get name * @return name - **/ + */ @Nullable @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java index d17b8859fc9..a6c23e8af57 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -56,7 +56,7 @@ public class ModelApiResponse { /** * Get code * @return code - **/ + */ @Nullable @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_CODE) @@ -79,7 +79,7 @@ public class ModelApiResponse { /** * Get type * @return type - **/ + */ @Nullable @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_TYPE) @@ -102,7 +102,7 @@ public class ModelApiResponse { /** * Get message * @return message - **/ + */ @Nullable @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_MESSAGE) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java index b212df2d544..0dac18b274b 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java @@ -102,7 +102,7 @@ public class Order { /** * Get id * @return id - **/ + */ @Nullable @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_ID) @@ -125,7 +125,7 @@ public class Order { /** * Get petId * @return petId - **/ + */ @Nullable @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_PET_ID) @@ -148,7 +148,7 @@ public class Order { /** * Get quantity * @return quantity - **/ + */ @Nullable @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_QUANTITY) @@ -171,7 +171,7 @@ public class Order { /** * Get shipDate * @return shipDate - **/ + */ @Nullable @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_SHIP_DATE) @@ -196,7 +196,7 @@ public class Order { /** * Order Status * @return status - **/ + */ @Nullable @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_STATUS) @@ -219,7 +219,7 @@ public class Order { /** * Get complete * @return complete - **/ + */ @Nullable @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_COMPLETE) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java index 2a9bc6df09f..7c99948ac92 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java @@ -108,7 +108,7 @@ public class Pet { /** * Get id * @return id - **/ + */ @Nullable @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_ID) @@ -131,7 +131,7 @@ public class Pet { /** * Get category * @return category - **/ + */ @Valid @Nullable @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @@ -155,7 +155,7 @@ public class Pet { /** * Get name * @return name - **/ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(JSON_PROPERTY_NAME) @@ -183,7 +183,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - **/ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @@ -214,7 +214,7 @@ public class Pet { /** * Get tags * @return tags - **/ + */ @Nullable @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_TAGS) @@ -237,7 +237,7 @@ public class Pet { /** * pet status in the store * @return status - **/ + */ @Nullable @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_STATUS) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java index dcf1b9741e2..94a23505dae 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java @@ -51,7 +51,7 @@ public class Tag { /** * Get id * @return id - **/ + */ @Nullable @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_ID) @@ -74,7 +74,7 @@ public class Tag { /** * Get name * @return name - **/ + */ @Nullable @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_NAME) diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java index 0b48bd2fb0e..e923fceef3f 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java @@ -75,7 +75,7 @@ public class User { /** * Get id * @return id - **/ + */ @Nullable @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_ID) @@ -98,7 +98,7 @@ public class User { /** * Get username * @return username - **/ + */ @Nullable @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_USERNAME) @@ -121,7 +121,7 @@ public class User { /** * Get firstName * @return firstName - **/ + */ @Nullable @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_FIRST_NAME) @@ -144,7 +144,7 @@ public class User { /** * Get lastName * @return lastName - **/ + */ @Nullable @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_LAST_NAME) @@ -167,7 +167,7 @@ public class User { /** * Get email * @return email - **/ + */ @Nullable @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_EMAIL) @@ -190,7 +190,7 @@ public class User { /** * Get password * @return password - **/ + */ @Nullable @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_PASSWORD) @@ -213,7 +213,7 @@ public class User { /** * Get phone * @return phone - **/ + */ @Nullable @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_PHONE) @@ -236,7 +236,7 @@ public class User { /** * User Status * @return userStatus - **/ + */ @Nullable @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty(JSON_PROPERTY_USER_STATUS) diff --git a/samples/server/petstore/java-microprofile/pom.xml b/samples/server/petstore/java-microprofile/pom.xml index 0d7f4876c41..21bc94702f2 100644 --- a/samples/server/petstore/java-microprofile/pom.xml +++ b/samples/server/petstore/java-microprofile/pom.xml @@ -151,8 +151,8 @@ 5.10.2 1.4.14 3.2.7 - 2.15.2 - 2.15.2 + 2.17.1 + 2.17.1 1.2.2 1.3.5 1.0.2 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 index 2437bd1de6d..27b1cee8d49 100644 --- 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 @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A category for a pet - **/ + */ public class Category { @@ -38,10 +38,10 @@ public class Category { private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -49,8 +49,8 @@ public class Category { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -62,10 +62,10 @@ public class Category { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -73,8 +73,8 @@ public class Category { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { @@ -88,8 +88,8 @@ public class Category { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 index 915f8a093e5..95ea601a2ed 100644 --- 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 @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ApiResponse") /** * Describes the result of uploading an image resource - **/ + */ public class ModelApiResponse { @@ -44,10 +44,10 @@ public class ModelApiResponse { private String message; - /** + /** * Get code * @return code - **/ + **/ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getCode() { @@ -55,8 +55,8 @@ public class ModelApiResponse { } /** - * Set code - **/ + * Set code + */ @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(Integer code) { @@ -68,10 +68,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get type * @return type - **/ + **/ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getType() { @@ -79,8 +79,8 @@ public class ModelApiResponse { } /** - * Set type - **/ + * Set type + */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { @@ -92,10 +92,10 @@ public class ModelApiResponse { return this; } - /** + /** * Get message * @return message - **/ + **/ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getMessage() { @@ -103,8 +103,8 @@ public class ModelApiResponse { } /** - * Set message - **/ + * Set message + */ @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { @@ -118,8 +118,8 @@ public class ModelApiResponse { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 index 977251b712e..2a4482666e1 100644 --- 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 @@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * An order for a pets from the pet store - **/ + */ public class Order { @@ -85,8 +85,8 @@ public class Order { public static final String JSON_PROPERTY_STATUS = "status"; /** - * Order Status - **/ + * Order Status + */ private StatusEnum status; @@ -94,10 +94,10 @@ public class Order { private Boolean complete = false; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -105,8 +105,8 @@ public class Order { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -118,10 +118,10 @@ public class Order { return this; } - /** + /** * Get petId * @return petId - **/ + **/ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getPetId() { @@ -129,8 +129,8 @@ public class Order { } /** - * Set petId - **/ + * Set petId + */ @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPetId(Long petId) { @@ -142,10 +142,10 @@ public class Order { return this; } - /** + /** * Get quantity * @return quantity - **/ + **/ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getQuantity() { @@ -153,8 +153,8 @@ public class Order { } /** - * Set quantity - **/ + * Set quantity + */ @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQuantity(Integer quantity) { @@ -166,10 +166,10 @@ public class Order { return this; } - /** + /** * Get shipDate * @return shipDate - **/ + **/ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Date getShipDate() { @@ -177,8 +177,8 @@ public class Order { } /** - * Set shipDate - **/ + * Set shipDate + */ @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipDate(Date shipDate) { @@ -190,10 +190,10 @@ public class Order { return this; } - /** + /** * Order Status * @return status - **/ + **/ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StatusEnum getStatus() { @@ -201,8 +201,8 @@ public class Order { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { @@ -214,10 +214,10 @@ public class Order { return this; } - /** + /** * Get complete * @return complete - **/ + **/ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getComplete() { @@ -225,8 +225,8 @@ public class Order { } /** - * Set complete - **/ + * Set complete + */ @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setComplete(Boolean complete) { @@ -240,8 +240,8 @@ public class Order { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 index 48be5c7f12f..881a1d6b516 100644 --- 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A pet for sale in the pet store - **/ + */ public class Pet { @@ -93,15 +93,15 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; /** - * pet status in the store - **/ + * 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() { @@ -109,8 +109,8 @@ public class Pet { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -122,10 +122,10 @@ public class Pet { return this; } - /** + /** * Get category * @return category - **/ + **/ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Category getCategory() { @@ -133,8 +133,8 @@ public class Pet { } /** - * Set category - **/ + * Set category + */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(Category category) { @@ -146,10 +146,10 @@ public class Pet { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { @@ -157,8 +157,8 @@ public class Pet { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(String name) { @@ -170,10 +170,10 @@ public class Pet { return this; } - /** + /** * Get photoUrls * @return photoUrls - **/ + **/ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getPhotoUrls() { @@ -181,8 +181,8 @@ public class Pet { } /** - * Set photoUrls - **/ + * Set photoUrls + */ @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPhotoUrls(List photoUrls) { @@ -202,10 +202,10 @@ public class Pet { return this; } - /** + /** * Get tags * @return tags - **/ + **/ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getTags() { @@ -213,8 +213,8 @@ public class Pet { } /** - * Set tags - **/ + * Set tags + */ @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTags(List tags) { @@ -234,11 +234,11 @@ public class Pet { return this; } - /** + /** * pet status in the store * @return status * @deprecated - **/ + **/ @Deprecated @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,8 +247,8 @@ public class Pet { } /** - * Set status - **/ + * Set status + */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { @@ -262,8 +262,8 @@ public class Pet { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 index fc166497373..662d5fbfa9c 100644 --- 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 @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A tag for a pet - **/ + */ public class Tag { @@ -38,10 +38,10 @@ public class Tag { private String name; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -49,8 +49,8 @@ public class Tag { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -62,10 +62,10 @@ public class Tag { return this; } - /** + /** * Get name * @return name - **/ + **/ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -73,8 +73,8 @@ public class Tag { } /** - * Set name - **/ + * Set name + */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { @@ -88,8 +88,8 @@ public class Tag { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 index f340936ab0c..85f00932850 100644 --- 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 @@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) /** * A User who is purchasing from the pet store - **/ + */ public class User { @@ -66,15 +66,15 @@ public class User { public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; /** - * User Status - **/ + * User Status + */ private Integer userStatus; - /** + /** * Get id * @return id - **/ + **/ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -82,8 +82,8 @@ public class User { } /** - * Set id - **/ + * Set id + */ @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(Long id) { @@ -95,10 +95,10 @@ public class User { return this; } - /** + /** * Get username * @return username - **/ + **/ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getUsername() { @@ -106,8 +106,8 @@ public class User { } /** - * Set username - **/ + * Set username + */ @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsername(String username) { @@ -119,10 +119,10 @@ public class User { return this; } - /** + /** * Get firstName * @return firstName - **/ + **/ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getFirstName() { @@ -130,8 +130,8 @@ public class User { } /** - * Set firstName - **/ + * Set firstName + */ @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { @@ -143,10 +143,10 @@ public class User { return this; } - /** + /** * Get lastName * @return lastName - **/ + **/ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getLastName() { @@ -154,8 +154,8 @@ public class User { } /** - * Set lastName - **/ + * Set lastName + */ @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { @@ -167,10 +167,10 @@ public class User { return this; } - /** + /** * Get email * @return email - **/ + **/ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getEmail() { @@ -178,8 +178,8 @@ public class User { } /** - * Set email - **/ + * Set email + */ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { @@ -191,10 +191,10 @@ public class User { return this; } - /** + /** * Get password * @return password - **/ + **/ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPassword() { @@ -202,8 +202,8 @@ public class User { } /** - * Set password - **/ + * Set password + */ @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassword(String password) { @@ -215,10 +215,10 @@ public class User { return this; } - /** + /** * Get phone * @return phone - **/ + **/ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPhone() { @@ -226,8 +226,8 @@ public class User { } /** - * Set phone - **/ + * Set phone + */ @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(String phone) { @@ -239,10 +239,10 @@ public class User { return this; } - /** + /** * User Status * @return userStatus - **/ + **/ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getUserStatus() { @@ -250,8 +250,8 @@ public class User { } /** - * Set userStatus - **/ + * Set userStatus + */ @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUserStatus(Integer userStatus) { @@ -265,8 +265,8 @@ public class User { /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index 0812837749e..e57fa5af72f 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -87,7 +87,7 @@ ${java.version} ${java.version} 4.0.4 - 2.15.2 + 2.17.1 1.3.5 UTF-8
    diff --git a/samples/server/petstore/java-undertow/pom.xml b/samples/server/petstore/java-undertow/pom.xml index 300e1ddd4e8..9aedbabf8bf 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.12.Final + 2.3.14.Final 2.2.0 4.5.13 4.1.2 diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java index b56d8735728..2ee153910e2 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java @@ -577,13 +577,13 @@ public interface PathHandlerInterface { *

    Response headers: [CodegenProperty{openApiType='string', baseName='Set-Cookie', complexType='null', getter='getSetCookie', setter='setSetCookie', description='Cookie authentication key for use with the `api_key` apiKey authentication.', dataType='String', datatypeWithEnum='String', dataFormat='null', name='setCookie', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.Set-Cookie;', baseType='String', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='Cookie authentication key for use with the `api_key` apiKey authentication.', maxLength=null, minLength=null, pattern='null', example='AUTH_KEY=abcde12345; Path=/; HttpOnly', jsonSchema='{ "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", "type" : "string" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='setCookie', nameInPascalCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isOptional=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='setCookie', nameInPascalCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "format" : "int32", "type" : "integer" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xRateLimit', nameInPascalCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isOptional=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xRateLimit', nameInPascalCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "format" : "date-time", "type" : "string" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xExpiresAfter', nameInPascalCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

    +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isOptional=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xExpiresAfter', nameInPascalCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

    * *

    Produces: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]

    *

    Returns: {@link String}

    diff --git a/samples/server/petstore/java-vertx-web/pom.xml b/samples/server/petstore/java-vertx-web/pom.xml index 9b69fe2b897..46834b3af62 100644 --- a/samples/server/petstore/java-vertx-web/pom.xml +++ b/samples/server/petstore/java-vertx-web/pom.xml @@ -20,7 +20,7 @@ 4.2.4 5.10.0 1.7.30 - 2.15.2 + 2.17.1 org.openapitools.vertxweb.server.HttpServerVerticle
    diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 94301277015..9e61cf65145 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -97,6 +97,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -217,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 - 2.15.2 - 1.3.5 + 3.5.9 + 2.17.1 + 1.3.5 UTF-8
    diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index 3b93fa95040..eba9703eb69 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -97,6 +97,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -217,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 - 2.15.2 - 1.3.5 + 3.5.9 + 2.17.1 + 1.3.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 338e801642d..8d20bbb7f1f 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -97,6 +97,17 @@ + + + + com.fasterxml.jackson + jackson-bom + ${jackson-jaxrs-version} + pom + import + + + io.swagger @@ -217,9 +228,9 @@ for this project used jakarta.validation-api --> 4.13.2 1.4.14 2.0.2 - 3.3.0 - 2.15.2 - 1.3.5 + 3.5.9 + 2.17.1 + 1.3.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index acda23ce006..bc26cad95f7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 2.0.2 9.2.9.v20150224 2.35 - 2.15.2 + 2.17.1 4.13.2 1.4.14 4.0.4 diff --git a/samples/server/petstore/jaxrs-jersey/pom.xml b/samples/server/petstore/jaxrs-jersey/pom.xml index 4f38605a7c9..bb5cad519c6 100644 --- a/samples/server/petstore/jaxrs-jersey/pom.xml +++ b/samples/server/petstore/jaxrs-jersey/pom.xml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 2.0.2 9.2.9.v20150224 2.35 - 2.15.2 + 2.17.1 4.13.2 1.4.14 4.0.4 diff --git a/samples/server/petstore/jaxrs-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index b2b276f2377..438e8e7a862 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -203,7 +203,7 @@ for this project used jakarta.validation-api --> UTF-8 1.5.22 - 2.15.2 + 2.17.1 9.2.9.v20150224 3.13.0.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Category.java index 7dad232aeea..7d83363a09c 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Category.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A category for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Category { diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java index 557a26ac7e4..e6ef762d72f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="Describes the result of uploading an image resource")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class ModelApiResponse { diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Order.java index b02de20e140..54c3689515d 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Order.java @@ -11,7 +11,6 @@ import java.util.Date; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="An order for a pets from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Order { diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java index 5656bb8cde2..54a20ea9f75 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Pet.java @@ -15,7 +15,6 @@ import org.openapitools.model.Tag; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A pet for sale in the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Pet { diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Tag.java index 997c7364a28..5d62eef4886 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/Tag.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A tag for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Tag { diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/User.java index 32157b79735..1563f41bcfe 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/model/User.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A User who is purchasing from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class User { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml index afd4d8e81dc..d750445934b 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml @@ -203,7 +203,7 @@ for this project used jakarta.validation-api --> UTF-8 1.5.22 - 2.15.2 + 2.17.1 9.2.9.v20150224 3.13.0.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Category.java index 7dad232aeea..7d83363a09c 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Category.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A category for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Category { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java index 557a26ac7e4..e6ef762d72f 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="Describes the result of uploading an image resource")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class ModelApiResponse { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Order.java index 92854a6d428..e903464b846 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Order.java @@ -11,7 +11,6 @@ import java.time.OffsetDateTime; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="An order for a pets from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Order { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java index 5656bb8cde2..54a20ea9f75 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java @@ -15,7 +15,6 @@ import org.openapitools.model.Tag; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A pet for sale in the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Pet { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Tag.java index 997c7364a28..5d62eef4886 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Tag.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A tag for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Tag { diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/User.java index 32157b79735..1563f41bcfe 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/User.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A User who is purchasing from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class User { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index ccaaff51bb9..d9e76994980 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -203,7 +203,7 @@ for this project used jakarta.validation-api --> UTF-8 1.5.22 - 2.15.2 + 2.17.1 9.2.9.v20150224 3.13.0.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Category.java index 7dad232aeea..7d83363a09c 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Category.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A category for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Category { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java index 557a26ac7e4..e6ef762d72f 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="Describes the result of uploading an image resource")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class ModelApiResponse { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Order.java index a03e85cd98d..c84853b9c22 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Order.java @@ -11,7 +11,6 @@ import org.joda.time.DateTime; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="An order for a pets from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Order { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java index 5656bb8cde2..54a20ea9f75 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Pet.java @@ -15,7 +15,6 @@ import org.openapitools.model.Tag; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A pet for sale in the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Pet { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Tag.java index 997c7364a28..5d62eef4886 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/Tag.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A tag for a pet")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Tag { diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/User.java index 32157b79735..1563f41bcfe 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/model/User.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; import javax.validation.Valid; import io.swagger.annotations.*; -import javax.validation.Valid; @ApiModel(description="A User who is purchasing from the pet store")@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class User { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index 67ece8e73f0..88c1ab93e48 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -99,7 +99,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 1.3.2 diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index f9ac6496192..8166f076205 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -99,7 +99,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 1.3.2 diff --git a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml index 0d0ce11b1b3..7dbebddcaa3 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml +++ b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml @@ -134,7 +134,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 2.1.1 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 index d456aa0a571..77a09d464d9 100644 --- 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 @@ -1650,10 +1650,11 @@ components: photoUrls: items: type: string + xml: + name: photoUrl type: array uniqueItems: true xml: - name: photoUrl wrapped: true tags: items: 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 0cd16dc39fd..a23bde46297 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 @@ -134,7 +134,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 1.3.2 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 f1c97ab0d21..4d009e6b522 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") - @NotNull public String getRequiredYesReadonlyYes() { + public String getRequiredYesReadonlyYes() { return requiredYesReadonlyYes; } diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 0cd16dc39fd..a23bde46297 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -134,7 +134,7 @@ ${java.version} ${java.version} UTF-8 - 2.15.2 + 2.17.1 4.13.2 2.10.13 1.3.2 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index e159ebf7ec1..27272cdee6b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 2.0.2 9.2.9.v20150224 2.35 - 2.15.2 + 2.17.1 4.13.2 1.4.14 4.0.4 diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index b6b5755dc5d..12699ccce64 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 2.0.2 9.2.9.v20150224 2.35 - 2.15.2 + 2.17.1 4.13.2 1.4.14 4.0.4 diff --git a/samples/server/petstore/jaxrs/jersey3/pom.xml b/samples/server/petstore/jaxrs/jersey3/pom.xml index 749bdab9d59..5e5457aef78 100644 --- a/samples/server/petstore/jaxrs/jersey3/pom.xml +++ b/samples/server/petstore/jaxrs/jersey3/pom.xml @@ -207,7 +207,7 @@ 3.0.2 11.0.15 3.1.3 - 2.15.2 + 2.17.1 4.13.2 1.4.14 5.0.0 diff --git a/samples/server/petstore/julia/src/apis/api_PetApi.jl b/samples/server/petstore/julia/src/apis/api_PetApi.jl index 5d05aa84fe2..074ddfdb084 100644 --- a/samples/server/petstore/julia/src/apis/api_PetApi.jl +++ b/samples/server/petstore/julia/src/apis/api_PetApi.jl @@ -63,7 +63,7 @@ function find_pets_by_status_read(handler) function find_pets_by_status_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["status"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "status", required=true, ) + openapi_params["status"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "status", required=true, style="form", is_explode=false) req.context[:openapi_params] = openapi_params return handler(req) @@ -91,7 +91,7 @@ function find_pets_by_tags_read(handler) function find_pets_by_tags_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["tags"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "tags", required=true, ) + openapi_params["tags"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "tags", required=true, style="form", is_explode=false) req.context[:openapi_params] = openapi_params return handler(req) diff --git a/samples/server/petstore/julia/src/apis/api_UserApi.jl b/samples/server/petstore/julia/src/apis/api_UserApi.jl index f8033b32330..5f2f35210ca 100644 --- a/samples/server/petstore/julia/src/apis/api_UserApi.jl +++ b/samples/server/petstore/julia/src/apis/api_UserApi.jl @@ -143,8 +143,8 @@ function login_user_read(handler) function login_user_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["username"] = OpenAPI.Servers.to_param(String, query_params, "username", required=true, ) - openapi_params["password"] = OpenAPI.Servers.to_param(String, query_params, "password", required=true, ) + openapi_params["username"] = OpenAPI.Servers.to_param(String, query_params, "username", required=true, style="form", is_explode=true) + openapi_params["password"] = OpenAPI.Servers.to_param(String, query_params, "password", required=true, style="form", is_explode=true) req.context[:openapi_params] = openapi_params return handler(req) diff --git a/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator-ignore b/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/.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-server/javalin-6/.openapi-generator/FILES b/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator/FILES new file mode 100644 index 00000000000..171ae436439 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator/FILES @@ -0,0 +1,20 @@ +README.md +build.gradle.kts +gradle.properties +settings.gradle +src/main/kotlin/org/openapitools/server/Main.kt +src/main/kotlin/org/openapitools/server/apis/PetApi.kt +src/main/kotlin/org/openapitools/server/apis/PetApiService.kt +src/main/kotlin/org/openapitools/server/apis/PetApiServiceImpl.kt +src/main/kotlin/org/openapitools/server/apis/StoreApi.kt +src/main/kotlin/org/openapitools/server/apis/StoreApiService.kt +src/main/kotlin/org/openapitools/server/apis/StoreApiServiceImpl.kt +src/main/kotlin/org/openapitools/server/apis/UserApi.kt +src/main/kotlin/org/openapitools/server/apis/UserApiService.kt +src/main/kotlin/org/openapitools/server/apis/UserApiServiceImpl.kt +src/main/kotlin/org/openapitools/server/models/Category.kt +src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/server/models/Order.kt +src/main/kotlin/org/openapitools/server/models/Pet.kt +src/main/kotlin/org/openapitools/server/models/Tag.kt +src/main/kotlin/org/openapitools/server/models/User.kt diff --git a/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-server/javalin-6/README.md b/samples/server/petstore/kotlin-server/javalin-6/README.md new file mode 100644 index 00000000000..b834cb85fcf --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/README.md @@ -0,0 +1,101 @@ +# org.openapitools.server - Kotlin Server library for 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. + +Generated by OpenAPI Generator 8.0.0-SNAPSHOT. + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Running + +The server builds as a fat jar with a main entrypoint. To start the service, run `java -jar ./build/libs/kotlin-server.jar`. + +You may also run in docker: + +``` +docker build -t kotlin-server . +docker run -p 8080:8080 kotlin-server +``` + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs (see ktor documentation for more info). +* ~Supports collection formats for query parameters: csv, tsv, ssv, pipes.~ +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. + + +## 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 + + - [org.openapitools.server.models.Category](docs/Category.md) + - [org.openapitools.server.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.server.models.Order](docs/Order.md) + - [org.openapitools.server.models.Pet](docs/Pet.md) + - [org.openapitools.server.models.Tag](docs/Tag.md) + - [org.openapitools.server.models.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 + diff --git a/samples/server/petstore/kotlin-server/javalin-6/build.gradle.kts b/samples/server/petstore/kotlin-server/javalin-6/build.gradle.kts new file mode 100644 index 00000000000..e2d7db33382 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + kotlin("jvm") version "2.0.0" +} + +group = "org.openapitools" +version = "1.0.0" + +kotlin { + jvmToolchain(21) +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } +} + +repositories { + mavenCentral() +} + +dependencies { + implementation("io.javalin:javalin:6.1.6") + implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1") + implementation("org.slf4j:slf4j-simple:2.0.13") + + testImplementation("org.jetbrains.kotlin:kotlin-test") +} + +tasks.test { + useJUnitPlatform() +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/gradle.properties b/samples/server/petstore/kotlin-server/javalin-6/gradle.properties new file mode 100644 index 00000000000..5f1ed7bbe02 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/javalin-6/settings.gradle b/samples/server/petstore/kotlin-server/javalin-6/settings.gradle new file mode 100644 index 00000000000..a09a58efab1 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'kotlin-server' \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/Main.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/Main.kt new file mode 100644 index 00000000000..29af342a158 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/Main.kt @@ -0,0 +1,48 @@ +package org.openapitools.server + +import io.javalin.Javalin +import io.javalin.apibuilder.ApiBuilder.* + +import org.openapitools.server.apis.PetApi +import org.openapitools.server.apis.PetApiServiceImpl +import org.openapitools.server.apis.StoreApi +import org.openapitools.server.apis.StoreApiServiceImpl +import org.openapitools.server.apis.UserApi +import org.openapitools.server.apis.UserApiServiceImpl + +fun main() { + val petApi = PetApi(PetApiServiceImpl()) + val storeApi = StoreApi(StoreApiServiceImpl()) + val userApi = UserApi(UserApiServiceImpl()) + + val app = Javalin + .create { config -> + config.router.apiBuilder { + path("/pet") { post(petApi::addPet) } + path("/pet/{petId}") { delete(petApi::deletePet) } + path("/pet/findByStatus") { get(petApi::findPetsByStatus) } + path("/pet/findByTags") { get(petApi::findPetsByTags) } + path("/pet/{petId}") { get(petApi::getPetById) } + path("/pet") { put(petApi::updatePet) } + path("/pet/{petId}") { post(petApi::updatePetWithForm) } + path("/pet/{petId}/uploadImage") { post(petApi::uploadFile) } + + path("/store/order/{orderId}") { delete(storeApi::deleteOrder) } + path("/store/inventory") { get(storeApi::getInventory) } + path("/store/order/{orderId}") { get(storeApi::getOrderById) } + path("/store/order") { post(storeApi::placeOrder) } + + path("/user") { post(userApi::createUser) } + path("/user/createWithArray") { post(userApi::createUsersWithArrayInput) } + path("/user/createWithList") { post(userApi::createUsersWithListInput) } + path("/user/{username}") { delete(userApi::deleteUser) } + path("/user/{username}") { get(userApi::getUserByName) } + path("/user/login") { get(userApi::loginUser) } + path("/user/logout") { get(userApi::logoutUser) } + path("/user/{username}") { put(userApi::updateUser) } + + } + } + + app.start() +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApi.kt new file mode 100644 index 00000000000..23014fe2f14 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -0,0 +1,97 @@ +package org.openapitools.server.apis + +import io.javalin.http.Context +import io.javalin.http.bodyAsClass +import io.javalin.http.pathParamAsClass +import io.javalin.http.queryParamAsClass + +import org.openapitools.server.models.ModelApiResponse +import org.openapitools.server.models.Pet + +class PetApi(private val service: PetApiService) { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + */ + fun addPet(ctx: Context) { + val result = service.addPet(ctx.bodyAsClass(), ctx) + ctx.status(200).json(result) + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + */ + fun deletePet(ctx: Context) { + val result = service.deletePet(ctx.pathParamAsClass("petId").get(), ctx.header("api_key"), ctx) + ctx.status(400).json(result) + } + + /** + * 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 + */ + fun findPetsByStatus(ctx: Context) { + val result = service.findPetsByStatus(ctx.queryParams("status"), ctx) + ctx.status(200).json(result) + } + + /** + * 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 + */ + fun findPetsByTags(ctx: Context) { + val result = service.findPetsByTags(ctx.queryParams("tags"), ctx) + ctx.status(200).json(result) + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + */ + fun getPetById(ctx: Context) { + val result = service.getPetById(ctx.pathParamAsClass("petId").get(), ctx) + ctx.status(200).json(result) + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + */ + fun updatePet(ctx: Context) { + val result = service.updatePet(ctx.bodyAsClass(), ctx) + ctx.status(200).json(result) + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + */ + fun updatePetWithForm(ctx: Context) { + val result = service.updatePetWithForm(ctx.pathParamAsClass("petId").get(), ctx.formParam("name"), ctx.formParam("status"), ctx) + ctx.status(405).json(result) + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + */ + fun uploadFile(ctx: Context) { + val result = service.uploadFile(ctx.pathParamAsClass("petId").get(), ctx.formParam("additionalMetadata"), ctx.uploadedFile("file"), ctx) + ctx.status(200).json(result) + } + +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiService.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiService.kt new file mode 100644 index 00000000000..6c06f129bea --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiService.kt @@ -0,0 +1,112 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.ModelApiResponse +import org.openapitools.server.models.Pet +import io.javalin.http.Context + +interface PetApiService { + + /** + * POST /pet : Add a new pet to the store + * + * + * @param pet Pet object that needs to be added to the store (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + fun addPet(pet: Pet, ctx: Context): Pet + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?, ctx: Context): Unit + + /** + * GET /pet/findByStatus : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + fun findPetsByStatus(status: kotlin.collections.List, ctx: Context): List + + /** + * GET /pet/findByTags : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + fun findPetsByTags(tags: kotlin.collections.List, ctx: Context): List + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + fun getPetById(petId: kotlin.Long, ctx: Context): Pet + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + * @see PetApi#updatePet + */ + fun updatePet(pet: Pet, ctx: Context): Pet + + /** + * POST /pet/{petId} : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?, ctx: Context): Unit + + /** + * POST /pet/{petId}/uploadImage : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.javalin.http.UploadedFile?, ctx: Context): ModelApiResponse +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiServiceImpl.kt new file mode 100644 index 00000000000..9bdc5356561 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/PetApiServiceImpl.kt @@ -0,0 +1,40 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.ModelApiResponse +import org.openapitools.server.models.Pet +import io.javalin.http.Context + +class PetApiServiceImpl : PetApiService { + + override fun addPet(pet: Pet, ctx: Context): Pet { + TODO("Implement me") + } + + override fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?, ctx: Context): Unit { + TODO("Implement me") + } + + override fun findPetsByStatus(status: kotlin.collections.List, ctx: Context): List { + TODO("Implement me") + } + + override fun findPetsByTags(tags: kotlin.collections.List, ctx: Context): List { + TODO("Implement me") + } + + override fun getPetById(petId: kotlin.Long, ctx: Context): Pet { + TODO("Implement me") + } + + override fun updatePet(pet: Pet, ctx: Context): Pet { + TODO("Implement me") + } + + override fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?, ctx: Context): Unit { + TODO("Implement me") + } + + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.javalin.http.UploadedFile?, ctx: Context): ModelApiResponse { + TODO("Implement me") + } +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt new file mode 100644 index 00000000000..9d04501a2f9 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt @@ -0,0 +1,50 @@ +package org.openapitools.server.apis + +import io.javalin.http.Context +import io.javalin.http.bodyAsClass +import io.javalin.http.pathParamAsClass +import io.javalin.http.queryParamAsClass + +import org.openapitools.server.models.Order + +class StoreApi(private val service: StoreApiService) { + /** + * 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 + */ + fun deleteOrder(ctx: Context) { + val result = service.deleteOrder(ctx.pathParamAsClass("orderId").get(), ctx) + ctx.status(400).json(result) + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ + fun getInventory(ctx: Context) { + val result = service.getInventory(ctx) + ctx.status(200).json(result) + } + + /** + * 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 + */ + fun getOrderById(ctx: Context) { + val result = service.getOrderById(ctx.pathParamAsClass("orderId").get(), ctx) + ctx.status(200).json(result) + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + */ + fun placeOrder(ctx: Context) { + val result = service.placeOrder(ctx.bodyAsClass(), ctx) + ctx.status(200).json(result) + } + +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiService.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiService.kt new file mode 100644 index 00000000000..684f0810140 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiService.kt @@ -0,0 +1,54 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.Order +import io.javalin.http.Context + +interface StoreApiService { + + /** + * DELETE /store/order/{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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + fun deleteOrder(orderId: kotlin.String, ctx: Context): Unit + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + fun getInventory(ctx: Context): Map + + /** + * GET /store/order/{orderId} : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + fun getOrderById(orderId: kotlin.Long, ctx: Context): Order + + /** + * POST /store/order : Place an order for a pet + * + * + * @param order order placed for purchasing the pet (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + fun placeOrder(order: Order, ctx: Context): Order +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiServiceImpl.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiServiceImpl.kt new file mode 100644 index 00000000000..fd499c8f4fb --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/StoreApiServiceImpl.kt @@ -0,0 +1,23 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.Order +import io.javalin.http.Context + +class StoreApiServiceImpl : StoreApiService { + + override fun deleteOrder(orderId: kotlin.String, ctx: Context): Unit { + TODO("Implement me") + } + + override fun getInventory(ctx: Context): Map { + TODO("Implement me") + } + + override fun getOrderById(orderId: kotlin.Long, ctx: Context): Order { + TODO("Implement me") + } + + override fun placeOrder(order: Order, ctx: Context): Order { + TODO("Implement me") + } +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApi.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApi.kt new file mode 100644 index 00000000000..cbf3648c647 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApi.kt @@ -0,0 +1,92 @@ +package org.openapitools.server.apis + +import io.javalin.http.Context +import io.javalin.http.bodyAsClass +import io.javalin.http.pathParamAsClass +import io.javalin.http.queryParamAsClass + +import org.openapitools.server.models.User + +class UserApi(private val service: UserApiService) { + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + */ + fun createUser(ctx: Context) { + val result = service.createUser(ctx.bodyAsClass(), ctx) + ctx.status(200).json(result) + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + */ + fun createUsersWithArrayInput(ctx: Context) { + val result = service.createUsersWithArrayInput(ctx.bodyAsClass>(), ctx) + ctx.status(200).json(result) + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + */ + fun createUsersWithListInput(ctx: Context) { + val result = service.createUsersWithListInput(ctx.bodyAsClass>(), ctx) + ctx.status(200).json(result) + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + */ + fun deleteUser(ctx: Context) { + val result = service.deleteUser(ctx.pathParamAsClass("username").get(), ctx) + ctx.status(400).json(result) + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + */ + fun getUserByName(ctx: Context) { + val result = service.getUserByName(ctx.pathParamAsClass("username").get(), ctx) + ctx.status(200).json(result) + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + */ + fun loginUser(ctx: Context) { + val result = service.loginUser(ctx.queryParamAsClass("username").get(), ctx.queryParamAsClass("password").get(), ctx) + ctx.status(200).json(result) + } + + /** + * Logs out current logged in user session + * + */ + fun logoutUser(ctx: Context) { + val result = service.logoutUser(ctx) + ctx.status(200).json(result) + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + */ + fun updateUser(ctx: Context) { + val result = service.updateUser(ctx.pathParamAsClass("username").get(), ctx.bodyAsClass(), ctx) + ctx.status(400).json(result) + } + +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiService.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiService.kt new file mode 100644 index 00000000000..b66d6d8d1e4 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiService.kt @@ -0,0 +1,101 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.User +import io.javalin.http.Context + +interface UserApiService { + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + fun createUser(user: User, ctx: Context): Unit + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + fun createUsersWithArrayInput(user: kotlin.collections.List, ctx: Context): Unit + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + fun createUsersWithListInput(user: kotlin.collections.List, ctx: Context): Unit + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + fun deleteUser(username: kotlin.String, ctx: Context): Unit + + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + fun getUserByName(username: kotlin.String, ctx: Context): User + + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + fun loginUser(username: kotlin.String, password: kotlin.String, ctx: Context): kotlin.String + + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + fun logoutUser(ctx: Context): Unit + + /** + * PUT /user/{username} : 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) + * @param ctx The Javalin context. Especially handy if you need to access things like authentication headers in your service. (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + fun updateUser(username: kotlin.String, user: User, ctx: Context): Unit +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiServiceImpl.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiServiceImpl.kt new file mode 100644 index 00000000000..60d3ab35d05 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/apis/UserApiServiceImpl.kt @@ -0,0 +1,39 @@ +package org.openapitools.server.apis + +import org.openapitools.server.models.User +import io.javalin.http.Context + +class UserApiServiceImpl : UserApiService { + + override fun createUser(user: User, ctx: Context): Unit { + TODO("Implement me") + } + + override fun createUsersWithArrayInput(user: kotlin.collections.List, ctx: Context): Unit { + TODO("Implement me") + } + + override fun createUsersWithListInput(user: kotlin.collections.List, ctx: Context): Unit { + TODO("Implement me") + } + + override fun deleteUser(username: kotlin.String, ctx: Context): Unit { + TODO("Implement me") + } + + override fun getUserByName(username: kotlin.String, ctx: Context): User { + TODO("Implement me") + } + + override fun loginUser(username: kotlin.String, password: kotlin.String, ctx: Context): kotlin.String { + TODO("Implement me") + } + + override fun logoutUser(ctx: Context): Unit { + TODO("Implement me") + } + + override fun updateUser(username: kotlin.String, user: User, ctx: Context): Unit { + TODO("Implement me") + } +} diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Category.kt new file mode 100644 index 00000000000..71098339bc8 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -0,0 +1,24 @@ +/** + * 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.models + + +/** + * A category for a pet + * @param id + * @param name + */ +data class Category( + val id: kotlin.Long? = null, + val name: kotlin.String? = null +) + diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt new file mode 100644 index 00000000000..9e80c50c660 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt @@ -0,0 +1,26 @@ +/** + * 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.models + + +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ModelApiResponse( + val code: kotlin.Int? = null, + val type: kotlin.String? = null, + val message: kotlin.String? = null +) + diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Order.kt new file mode 100644 index 00000000000..be802beb8d8 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -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. +*/ +package org.openapitools.server.models + + +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order( + val id: kotlin.Long? = null, + val petId: kotlin.Long? = null, + val quantity: kotlin.Int? = null, + val shipDate: java.time.OffsetDateTime? = null, + /* Order Status */ + val status: Order.Status? = null, + val complete: kotlin.Boolean? = false +) +{ + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String){ + placed("placed"), + approved("approved"), + delivered("delivered"); + } +} + diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Pet.kt new file mode 100644 index 00000000000..e5723fedd63 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -0,0 +1,46 @@ +/** + * 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.models + +import org.openapitools.server.models.Category +import org.openapitools.server.models.Tag + +/** + * A pet for sale in the pet store + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ +data class Pet( + val name: kotlin.String, + val photoUrls: kotlin.collections.List, + val id: kotlin.Long? = null, + val category: Category? = null, + val tags: kotlin.collections.List? = null, + /* pet status in the store */ + val status: Pet.Status? = null +) +{ + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String){ + available("available"), + pending("pending"), + sold("sold"); + } +} + diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Tag.kt new file mode 100644 index 00000000000..0a975290485 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -0,0 +1,24 @@ +/** + * 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.models + + +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag( + val id: kotlin.Long? = null, + val name: kotlin.String? = null +) + diff --git a/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/User.kt new file mode 100644 index 00000000000..a4742582f46 --- /dev/null +++ b/samples/server/petstore/kotlin-server/javalin-6/src/main/kotlin/org/openapitools/server/models/User.kt @@ -0,0 +1,37 @@ +/** + * 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.models + + +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +data class User( + val id: kotlin.Long? = null, + val username: kotlin.String? = null, + val firstName: kotlin.String? = null, + val lastName: kotlin.String? = null, + val email: kotlin.String? = null, + val password: kotlin.String? = null, + val phone: kotlin.String? = null, + /* User Status */ + val userStatus: kotlin.Int? = null +) + diff --git a/samples/server/petstore/kotlin-server/javalin/build.gradle.kts b/samples/server/petstore/kotlin-server/javalin/build.gradle.kts index 1b34f07ad15..fcee6e70403 100644 --- a/samples/server/petstore/kotlin-server/javalin/build.gradle.kts +++ b/samples/server/petstore/kotlin-server/javalin/build.gradle.kts @@ -20,8 +20,8 @@ dependencies { implementation("io.javalin:javalin:5.6.3") implementation("io.javalin.community.routing:routing-core:5.6.2-RC.1") implementation("io.javalin.community.routing:routing-dsl:5.6.2-RC.1") - implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.16.1") + implementation("com.fasterxml.jackson.core:jackson-databind:2.17.1") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1") implementation("org.slf4j:slf4j-simple:2.0.7") testImplementation("org.jetbrains.kotlin:kotlin-test") diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/build.gradle b/samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/build.gradle index d6fac3df1d3..2de9f7e23fb 100644 --- a/samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/build.gradle +++ b/samples/server/petstore/kotlin-server/jaxrs-spec-mutiny/build.gradle @@ -12,7 +12,7 @@ buildscript { ext.jakarta_annotations_version = "1.3.5" ext.jakarta_ws_rs_version = "2.1.6" ext.mutiny_version = "2.2.0" - ext.jackson_version = "2.9.9" + ext.jackson_version = "2.17.1" repositories { maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle b/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle index 0200843b4be..8a4cd5aeac7 100644 --- a/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle @@ -11,7 +11,7 @@ buildscript { ext.swagger_annotations_version = "1.5.3" ext.jakarta_annotations_version = "1.3.5" ext.jakarta_ws_rs_version = "2.1.6" - ext.jackson_version = "2.9.9" + ext.jackson_version = "2.17.1" repositories { maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } diff --git a/samples/server/petstore/kotlin-spring-cloud/build.gradle.kts b/samples/server/petstore/kotlin-spring-cloud/build.gradle.kts index b2c90c440cf..fd3524ba760 100644 --- a/samples/server/petstore/kotlin-spring-cloud/build.gradle.kts +++ b/samples/server/petstore/kotlin-spring-cloud/build.gradle.kts @@ -57,7 +57,7 @@ dependencies { implementation("org.springframework.cloud:spring-cloud-starter-openfeign") implementation("org.springframework.cloud:spring-cloud-starter-oauth2:2.2.5.RELEASE") - implementation("jakarta.validation:jakarta.validation-api") - implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + implementation("javax.validation:validation-api") + implementation("javax.annotation:javax.annotation-api:1.3.2") } diff --git a/samples/server/petstore/kotlin-spring-cloud/pom.xml b/samples/server/petstore/kotlin-spring-cloud/pom.xml index 94301618ac4..654de03c5e7 100644 --- a/samples/server/petstore/kotlin-spring-cloud/pom.xml +++ b/samples/server/petstore/kotlin-spring-cloud/pom.xml @@ -7,7 +7,7 @@ 1.0.0 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -119,13 +119,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/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 index 525d7311a0c..d6b9e188890 100644 --- a/samples/server/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 @@ -29,6 +29,7 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated interface PetApi { diff --git a/samples/server/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 index 023f010ab2f..7877247e1a6 100644 --- a/samples/server/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 @@ -28,6 +28,7 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated interface StoreApi { diff --git a/samples/server/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 index 6d9b2796450..3c3c0b089f3 100644 --- a/samples/server/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 @@ -28,6 +28,7 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated interface UserApi { diff --git a/samples/server/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 index 81d080e03d2..d0070c8bd13 100644 --- a/samples/server/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 @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +24,10 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/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 index 4b42c877edb..fffe28abf49 100644 --- a/samples/server/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 @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/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 index 61814bda584..e88107612a1 100644 --- a/samples/server/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 @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -35,18 +37,29 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/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 index dfd14601580..c18e094b919 100644 --- a/samples/server/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 @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -40,18 +42,29 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/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 index 0beafadd514..06e15fa7a03 100644 --- a/samples/server/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 @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -22,7 +23,10 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/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 index 8780ff0d2f2..9195c496c33 100644 --- a/samples/server/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 @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -40,7 +41,10 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES b/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES index c2417d94709..71096b46e21 100644 --- a/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES @@ -12,11 +12,15 @@ src/main/kotlin/org/openapitools/api/PetApiController.kt src/main/kotlin/org/openapitools/api/StoreApiController.kt src/main/kotlin/org/openapitools/api/UserApiController.kt src/main/kotlin/org/openapitools/model/Annotation.kt +src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt +src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt src/main/kotlin/org/openapitools/model/Category.kt src/main/kotlin/org/openapitools/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/model/Order.kt src/main/kotlin/org/openapitools/model/Pet.kt src/main/kotlin/org/openapitools/model/Tag.kt src/main/kotlin/org/openapitools/model/User.kt +src/main/kotlin/org/openapitools/model/UserOrPet.kt +src/main/kotlin/org/openapitools/model/UserOrPetOrArrayString.kt src/main/resources/application.yaml src/main/resources/openapi.yaml diff --git a/samples/server/petstore/kotlin-spring-default/build.gradle.kts b/samples/server/petstore/kotlin-spring-default/build.gradle.kts index 45a8ef30f3e..59eda31df62 100644 --- a/samples/server/petstore/kotlin-spring-default/build.gradle.kts +++ b/samples/server/petstore/kotlin-spring-default/build.gradle.kts @@ -40,9 +40,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-spring-default/pom.xml b/samples/server/petstore/kotlin-spring-default/pom.xml index a44254101c2..8b51baf52f5 100644 --- a/samples/server/petstore/kotlin-spring-default/pom.xml +++ b/samples/server/petstore/kotlin-spring-default/pom.xml @@ -8,7 +8,7 @@ 1.6.8 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -117,13 +117,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt new file mode 100644 index 00000000000..857abc14b17 --- /dev/null +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt @@ -0,0 +1,103 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Pet +import org.openapitools.model.Tag +import org.openapitools.model.User +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * + * @param username + * @param name + * @param photoUrls + * @param id + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + * @param category + * @param tags + * @param status pet status in the store + */ +data class AnyOfUserOrPet( + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: AnyOfUserOrPet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt new file mode 100644 index 00000000000..10b9afe6a13 --- /dev/null +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt @@ -0,0 +1,103 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Pet +import org.openapitools.model.Tag +import org.openapitools.model.User +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * + * @param username + * @param name + * @param photoUrls + * @param id + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + * @param category + * @param tags + * @param status pet status in the store + */ +data class AnyOfUserOrPetOrArrayString( + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: AnyOfUserOrPetOrArrayString.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt index 128eee7f628..0d3f1978748 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax @@ -48,11 +49,19 @@ data class Order( * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt index 12a5a585b40..128cd0840fd 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category @@ -53,11 +54,19 @@ data class Pet( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt index ef3d46afd3e..54e6eba1fee 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/User.kt @@ -15,8 +15,8 @@ import io.swagger.v3.oas.annotations.media.Schema /** * A User who is purchasing from the pet store - * @param id * @param username + * @param id * @param firstName * @param lastName * @param email @@ -26,11 +26,11 @@ import io.swagger.v3.oas.annotations.media.Schema */ data class User( - @Schema(example = "null", description = "") - @get:JsonProperty("id") val id: kotlin.Long? = null, + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, @Schema(example = "null", description = "") - @get:JsonProperty("username") val username: kotlin.String? = null, + @get:JsonProperty("id") val id: kotlin.Long? = null, @Schema(example = "null", description = "") @get:JsonProperty("firstName") val firstName: kotlin.String? = null, diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPet.kt new file mode 100644 index 00000000000..6f1df02b9ca --- /dev/null +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPet.kt @@ -0,0 +1,103 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Pet +import org.openapitools.model.Tag +import org.openapitools.model.User +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * + * @param username + * @param name + * @param photoUrls + * @param id + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + * @param category + * @param tags + * @param status pet status in the store + */ +data class UserOrPet( + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: UserOrPet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPetOrArrayString.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPetOrArrayString.kt new file mode 100644 index 00000000000..fcaaa92a2f1 --- /dev/null +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/UserOrPetOrArrayString.kt @@ -0,0 +1,103 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Pet +import org.openapitools.model.Tag +import org.openapitools.model.User +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * + * @param username + * @param name + * @param photoUrls + * @param id + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + * @param category + * @param tags + * @param status pet status in the store + */ +data class UserOrPetOrArrayString( + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: UserOrPetOrArrayString.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml index 8fd756455bf..d1313168e5d 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml @@ -702,6 +702,8 @@ components: description: User Status format: int32 type: integer + required: + - username title: a User type: object xml: @@ -800,6 +802,28 @@ components: format: uuid type: string type: object + UserOrPet: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + UserOrPetOrArrayString: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + - items: + type: string + type: array + AnyOfUserOrPet: + anyOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + AnyOfUserOrPetOrArrayString: + anyOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + - items: + type: string + type: array updatePetWithForm_request: properties: name: diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt index f66721e789e..14f6f0ae6d8 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -26,7 +26,6 @@ import kotlin.collections.Map @RestController @Validated -@RequestMapping("\${api.base-path:/v2}") class PetApiController(@Autowired(required = true) val service: PetApiService) { diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt index b47bad73d03..7a12f122864 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -25,7 +25,6 @@ import kotlin.collections.Map @RestController @Validated -@RequestMapping("\${api.base-path:/v2}") class StoreApiController(@Autowired(required = true) val service: StoreApiService) { diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt index 2f81b70eead..ce2c67c6042 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -25,7 +25,6 @@ import kotlin.collections.Map @RestController @Validated -@RequestMapping("\${api.base-path:/v2}") class UserApiController(@Autowired(required = true) val service: UserApiService) { diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt index 3cc63c511b1..6f12cdced49 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,7 +24,10 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 0abe67b0e8b..04e27bb81a9 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -25,7 +26,10 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt index 87667494f23..995c2c48498 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -35,18 +37,29 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 4db341ab1c4..cfeae46e08a 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -40,18 +42,29 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt index c1081aeaf97..99db89800dd 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -22,7 +23,10 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt index b819427eaf5..c6bed70a455 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -40,7 +41,10 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/build.gradle.kts b/samples/server/petstore/kotlin-springboot-bigdecimal-default/build.gradle.kts index 45a8ef30f3e..59eda31df62 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/build.gradle.kts @@ -40,9 +40,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml b/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml index a44254101c2..8b51baf52f5 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/pom.xml @@ -8,7 +8,7 @@ 1.6.8 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -117,13 +117,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator-ignore b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.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-springboot-delegate-nodefaults/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/FILES new file mode 100644 index 00000000000..c02ae2405be --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/FILES @@ -0,0 +1,23 @@ +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiController.kt +src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiController.kt +src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiController.kt +src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +src/main/kotlin/org/openapitools/model/Category.kt +src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +src/main/kotlin/org/openapitools/model/Order.kt +src/main/kotlin/org/openapitools/model/Pet.kt +src/main/kotlin/org/openapitools/model/Tag.kt +src/main/kotlin/org/openapitools/model/User.kt +src/main/resources/application.yaml diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md new file mode 100644 index 00000000000..b6865a08113 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/README.md @@ -0,0 +1,21 @@ +# openAPIPetstore + +This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). + +## Getting Started + +This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. + +By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). + +To build the project using maven, run: +```bash +mvn package && java -jar target/openapi-spring-1.0.0.jar +``` + +To build the project using gradle, run: +```bash +gradle build && java -jar build/libs/openapi-spring-1.0.0.jar +``` + +If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts new file mode 100644 index 00000000000..aed068708de --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/build.gradle.kts @@ -0,0 +1,43 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "org.openapitools" +version = "1.0.0" +java.sourceCompatibility = JavaVersion.VERSION_17 + +repositories { + mavenCentral() + maven { url = uri("https://repo.spring.io/milestone") } +} + +tasks.withType { + kotlinOptions.jvmTarget = "17" +} + +plugins { + val kotlinVersion = "1.7.10" + id("org.jetbrains.kotlin.jvm") version kotlinVersion + id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion + id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion + id("org.springframework.boot") version "3.0.2" + id("io.spring.dependency-management") version "1.0.14.RELEASE" +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("io.swagger.core.v3:swagger-annotations:2.2.0") + + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("jakarta.validation:jakarta.validation-api") + implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + + testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") + testImplementation("org.springframework.boot:spring-boot-starter-test") { + exclude(module = "junit") + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml new file mode 100644 index 00000000000..77ec6964518 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/pom.xml @@ -0,0 +1,149 @@ + + 4.0.0 + org.openapitools + openapi-spring + jar + openapi-spring + 1.0.0 + + 2.2.15 + 3.0.2 + 2.1.0 + 1.7.10 + + 1.7.10 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.3 + + + + repository.spring.milestone + Spring Milestone Repository + https://repo.spring.io/milestone + + + + + spring-milestones + https://repo.spring.io/milestone + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + + 17 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.springframework.boot + spring-boot-starter-web + + + + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + jakarta.validation + jakarta.validation-api + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} + provided + + + org.jetbrains.kotlin + kotlin-test-junit5 + ${kotlin-test-junit5.version} + test + + + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle new file mode 100644 index 00000000000..14844905cd4 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } +} +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt new file mode 100644 index 00000000000..2fe6de62479 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt @@ -0,0 +1,13 @@ +package org.openapitools + +import org.springframework.boot.runApplication +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan + +@SpringBootApplication +@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"]) +class Application + +fun main(args: Array) { + runApplication(*args) +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..03344e13b47 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import jakarta.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt new file mode 100644 index 00000000000..117161bf65b --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -0,0 +1,29 @@ +package org.openapitools.api + +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.ControllerAdvice +import org.springframework.web.bind.annotation.ExceptionHandler +import jakarta.servlet.http.HttpServletResponse +import jakarta.validation.ConstraintViolationException + +// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception +sealed class ApiException(msg: String, val code: Int) : Exception(msg) + +class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) + + +@ControllerAdvice +class DefaultExceptionHandler { + + @ExceptionHandler(value = [ApiException::class]) + fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = + response.sendError(ex.code, ex.message) + + @ExceptionHandler(value = [NotImplementedError::class]) + fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + + @ExceptionHandler(value = [ConstraintViolationException::class]) + fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt new file mode 100644 index 00000000000..9cc9d71a6d5 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -0,0 +1,205 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (8.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface PetApi { + + fun getDelegate(): PetApiDelegate + + @Operation( + tags = ["pet",], + summary = "Add a new pet to the store", + operationId = "addPet", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]), + ApiResponse(responseCode = "405", description = "Invalid input") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/pet"], + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) + fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { + return getDelegate().addPet(pet) + } + + @Operation( + tags = ["pet",], + summary = "Deletes a pet", + operationId = "deletePet", + description = """""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid pet value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/pet/{petId}"] + ) + fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity { + return getDelegate().deletePet(petId, apiKey) + } + + @Operation( + tags = ["pet",], + summary = "Finds Pets by status", + operationId = "findPetsByStatus", + description = """Multiple status values can be provided with comma separated strings""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]), + ApiResponse(responseCode = "400", description = "Invalid status value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"] + ) + fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List): ResponseEntity> { + return getDelegate().findPetsByStatus(status) + } + + @Operation( + tags = ["pet",], + summary = "Finds Pets by tags", + operationId = "findPetsByTags", + description = """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]), + ApiResponse(responseCode = "400", description = "Invalid tag value") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"] + ) + fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List): ResponseEntity> { + return getDelegate().findPetsByTags(tags) + } + + @Operation( + tags = ["pet",], + summary = "Find pet by ID", + operationId = "getPetById", + description = """Returns a single pet""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]), + ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + ApiResponse(responseCode = "404", description = "Pet not found") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"] + ) + fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity { + return getDelegate().getPetById(petId) + } + + @Operation( + tags = ["pet",], + summary = "Update an existing pet", + operationId = "updatePet", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]), + ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + ApiResponse(responseCode = "404", description = "Pet not found"), + ApiResponse(responseCode = "405", description = "Validation exception") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.PUT], + value = ["/pet"], + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) + fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { + return getDelegate().updatePet(pet) + } + + @Operation( + tags = ["pet",], + summary = "Updates a pet in the store with form data", + operationId = "updatePetWithForm", + description = """""", + responses = [ + ApiResponse(responseCode = "405", description = "Invalid input") + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"] + ) + fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity { + return getDelegate().updatePetWithForm(petId, name, status) + } + + @Operation( + tags = ["pet",], + summary = "uploads an image", + operationId = "uploadFile", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = ModelApiResponse::class))]) + ], + security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"] + ) + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { + return getDelegate().uploadFile(petId, additionalMetadata, file) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt new file mode 100644 index 00000000000..8fcf0c70c90 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +@Controller +class PetApiController( + private val delegate: PetApiDelegate +) : PetApi { + + override fun getDelegate(): PetApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt new file mode 100644 index 00000000000..2ec417e93e5 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -0,0 +1,74 @@ +package org.openapitools.api + +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +interface PetApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see PetApi#addPet + */ + fun addPet(pet: Pet): ResponseEntity + + + /** + * @see PetApi#deletePet + */ + fun deletePet(petId: kotlin.Long, + apiKey: kotlin.String?): ResponseEntity + + + /** + * @see PetApi#findPetsByStatus + */ + fun findPetsByStatus(status: kotlin.collections.List): ResponseEntity> + + + /** + * @see PetApi#findPetsByTags + */ + fun findPetsByTags(tags: kotlin.collections.List): ResponseEntity> + + + /** + * @see PetApi#getPetById + */ + fun getPetById(petId: kotlin.Long): ResponseEntity + + + /** + * @see PetApi#updatePet + */ + fun updatePet(pet: Pet): ResponseEntity + + + /** + * @see PetApi#updatePetWithForm + */ + fun updatePetWithForm(petId: kotlin.Long, + name: kotlin.String?, + status: kotlin.String?): ResponseEntity + + + /** + * @see PetApi#uploadFile + */ + fun uploadFile(petId: kotlin.Long, + additionalMetadata: kotlin.String?, + file: Resource?): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt new file mode 100644 index 00000000000..7d222611fc9 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -0,0 +1,119 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (8.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.Order +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface StoreApi { + + fun getDelegate(): StoreApiDelegate + + @Operation( + tags = ["store",], + summary = "Delete purchase order by ID", + operationId = "deleteOrder", + description = """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + ApiResponse(responseCode = "404", description = "Order not found") + ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/store/order/{orderId}"] + ) + fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String): ResponseEntity { + return getDelegate().deleteOrder(orderId) + } + + @Operation( + tags = ["store",], + summary = "Returns pet inventories by status", + operationId = "getInventory", + description = """Returns a map of status codes to quantities""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.collections.Map::class))]) + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/store/inventory"], + produces = ["application/json"] + ) + fun getInventory(): ResponseEntity> { + return getDelegate().getInventory() + } + + @Operation( + tags = ["store",], + summary = "Find purchase order by ID", + operationId = "getOrderById", + description = """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Order::class))]), + ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + ApiResponse(responseCode = "404", description = "Order not found") + ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"] + ) + fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long): ResponseEntity { + return getDelegate().getOrderById(orderId) + } + + @Operation( + tags = ["store",], + summary = "Place an order for a pet", + operationId = "placeOrder", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Order::class))]), + ApiResponse(responseCode = "400", description = "Invalid Order") + ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"] + ) + fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity { + return getDelegate().placeOrder(order) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt new file mode 100644 index 00000000000..9bc7d4f7cd8 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +@Controller +class StoreApiController( + private val delegate: StoreApiDelegate +) : StoreApi { + + override fun getDelegate(): StoreApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt new file mode 100644 index 00000000000..b5aa3ee7362 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -0,0 +1,44 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +interface StoreApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see StoreApi#deleteOrder + */ + fun deleteOrder(orderId: kotlin.String): ResponseEntity + + + /** + * @see StoreApi#getInventory + */ + fun getInventory(): ResponseEntity> + + + /** + * @see StoreApi#getOrderById + */ + fun getOrderById(orderId: kotlin.Long): ResponseEntity + + + /** + * @see StoreApi#placeOrder + */ + fun placeOrder(order: Order): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt new file mode 100644 index 00000000000..4572ad12154 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -0,0 +1,195 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (8.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.User +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:/v2}") +interface UserApi { + + fun getDelegate(): UserApiDelegate + + @Operation( + tags = ["user",], + summary = "Create user", + operationId = "createUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user"], + consumes = ["application/json"] + ) + fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity { + return getDelegate().createUser(user) + } + + @Operation( + tags = ["user",], + summary = "Creates list of users with given input array", + operationId = "createUsersWithArrayInput", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user/createWithArray"], + consumes = ["application/json"] + ) + fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { + return getDelegate().createUsersWithArrayInput(user) + } + + @Operation( + tags = ["user",], + summary = "Creates list of users with given input array", + operationId = "createUsersWithListInput", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/user/createWithList"], + consumes = ["application/json"] + ) + fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { + return getDelegate().createUsersWithListInput(user) + } + + @Operation( + tags = ["user",], + summary = "Delete user", + operationId = "deleteUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid username supplied"), + ApiResponse(responseCode = "404", description = "User not found") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.DELETE], + value = ["/user/{username}"] + ) + fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { + return getDelegate().deleteUser(username) + } + + @Operation( + tags = ["user",], + summary = "Get user by user name", + operationId = "getUserByName", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = User::class))]), + ApiResponse(responseCode = "400", description = "Invalid username supplied"), + ApiResponse(responseCode = "404", description = "User not found") + ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/user/{username}"], + produces = ["application/xml", "application/json"] + ) + fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { + return getDelegate().getUserByName(username) + } + + @Operation( + tags = ["user",], + summary = "Logs user into the system", + operationId = "loginUser", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = kotlin.String::class))]), + ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/user/login"], + produces = ["application/xml", "application/json"] + ) + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity { + return getDelegate().loginUser(username, password) + } + + @Operation( + tags = ["user",], + summary = "Logs out current logged in user session", + operationId = "logoutUser", + description = """""", + responses = [ + ApiResponse(responseCode = "200", description = "successful operation") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.GET], + value = ["/user/logout"] + ) + fun logoutUser(): ResponseEntity { + return getDelegate().logoutUser() + } + + @Operation( + tags = ["user",], + summary = "Updated user", + operationId = "updateUser", + description = """This can only be done by the logged in user.""", + responses = [ + ApiResponse(responseCode = "400", description = "Invalid user supplied"), + ApiResponse(responseCode = "404", description = "User not found") + ], + security = [ SecurityRequirement(name = "api_key") ] + ) + @RequestMapping( + method = [RequestMethod.PUT], + value = ["/user/{username}"], + consumes = ["application/json"] + ) + fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity { + return getDelegate().updateUser(username, user) + } +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt new file mode 100644 index 00000000000..900b64de4fd --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -0,0 +1,14 @@ +package org.openapitools.api + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import java.util.Optional + +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +@Controller +class UserApiController( + private val delegate: UserApiDelegate +) : UserApi { + + override fun getDelegate(): UserApiDelegate = delegate +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt new file mode 100644 index 00000000000..9a1fa363de1 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -0,0 +1,70 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.core.io.Resource + +import java.util.Optional + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@jakarta.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") +interface UserApiDelegate { + + fun getRequest(): Optional = Optional.empty() + + /** + * @see UserApi#createUser + */ + fun createUser(user: User): ResponseEntity + + + /** + * @see UserApi#createUsersWithArrayInput + */ + fun createUsersWithArrayInput(user: kotlin.collections.List): ResponseEntity + + + /** + * @see UserApi#createUsersWithListInput + */ + fun createUsersWithListInput(user: kotlin.collections.List): ResponseEntity + + + /** + * @see UserApi#deleteUser + */ + fun deleteUser(username: kotlin.String): ResponseEntity + + + /** + * @see UserApi#getUserByName + */ + fun getUserByName(username: kotlin.String): ResponseEntity + + + /** + * @see UserApi#loginUser + */ + fun loginUser(username: kotlin.String, + password: kotlin.String): ResponseEntity + + + /** + * @see UserApi#logoutUser + */ + fun logoutUser(): ResponseEntity + + + /** + * @see UserApi#updateUser + */ + fun updateUser(username: kotlin.String, + user: User): ResponseEntity + +} diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt new file mode 100644 index 00000000000..615e56c9b85 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Category.kt @@ -0,0 +1,32 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A category for a pet + * @param id + * @param name + */ +data class Category( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt new file mode 100644 index 00000000000..338a2d0f46e --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -0,0 +1,35 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +data class ModelApiResponse( + + @Schema(example = "null", description = "") + @get:JsonProperty("code") val code: kotlin.Int? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("type") val type: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("message") val message: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt new file mode 100644 index 00000000000..934a82a19cb --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt @@ -0,0 +1,68 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +data class Order( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("petId") val petId: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("quantity") val quantity: kotlin.Int? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + + @Schema(example = "null", description = "Order Status") + @get:JsonProperty("status") val status: Order.Status? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("complete") val complete: kotlin.Boolean? = false +) { + + /** + * Order Status + * Values: placed,approved,delivered + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt new file mode 100644 index 00000000000..2001adf693e --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt @@ -0,0 +1,73 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.Category +import org.openapitools.model.Tag +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A pet for sale in the pet store + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ +data class Pet( + + @Schema(example = "doggie", required = true, description = "") + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @Schema(example = "null", required = true, description = "") + @get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("category") val category: Category? = null, + + @field:Valid + @Schema(example = "null", description = "") + @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, + + @Schema(example = "null", description = "pet status in the store") + @Deprecated(message = "") + @get:JsonProperty("status") val status: Pet.Status? = null +) { + + /** + * pet status in the store + * Values: available,pending,sold + */ + enum class Status(@get:JsonValue val value: kotlin.String) { + + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt new file mode 100644 index 00000000000..a4357f8358e --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Tag.kt @@ -0,0 +1,31 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A tag for a pet + * @param id + * @param name + */ +data class Tag( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt new file mode 100644 index 00000000000..74a1c1056af --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/User.kt @@ -0,0 +1,55 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +data class User( + + @Schema(example = "null", description = "") + @get:JsonProperty("id") val id: kotlin.Long? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("username") val username: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("firstName") val firstName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("lastName") val lastName: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("email") val email: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("password") val password: kotlin.String? = null, + + @Schema(example = "null", description = "") + @get:JsonProperty("phone") val phone: kotlin.String? = null, + + @Schema(example = "null", description = "User Status") + @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml new file mode 100644 index 00000000000..8e2ebcde976 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/resources/application.yaml @@ -0,0 +1,10 @@ +spring: + application: + name: openAPIPetstore + + jackson: + serialization: + WRITE_DATES_AS_TIMESTAMPS: false + +server: + port: 8080 diff --git a/samples/server/petstore/kotlin-springboot-delegate/build.gradle.kts b/samples/server/petstore/kotlin-springboot-delegate/build.gradle.kts index 45a8ef30f3e..59eda31df62 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-delegate/build.gradle.kts @@ -40,9 +40,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-delegate/pom.xml b/samples/server/petstore/kotlin-springboot-delegate/pom.xml index a44254101c2..8b51baf52f5 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/pom.xml +++ b/samples/server/petstore/kotlin-springboot-delegate/pom.xml @@ -8,7 +8,7 @@ 1.6.8 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -117,13 +117,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 9a695b1c949..5060c316f7d 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -34,8 +35,8 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface PetApi { fun getDelegate(): PetApiDelegate = object: PetApiDelegate {} @@ -57,8 +58,8 @@ interface PetApi { produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) - fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { - return getDelegate().addPet(pet) + fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().addPet(pet, serverHttpRequest) } @Operation( @@ -75,8 +76,8 @@ interface PetApi { method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) - fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?): ResponseEntity { - return getDelegate().deletePet(petId, apiKey) + fun deletePet(@Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "", `in` = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) apiKey: kotlin.String?,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deletePet(petId, apiKey, serverHttpRequest) } @Operation( @@ -95,8 +96,8 @@ interface PetApi { value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) - fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List): ResponseEntity> { - return getDelegate().findPetsByStatus(status) + fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().findPetsByStatus(status, serverHttpRequest) } @Operation( @@ -115,8 +116,8 @@ interface PetApi { value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) - fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List): ResponseEntity> { - return getDelegate().findPetsByTags(tags) + fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().findPetsByTags(tags, serverHttpRequest) } @Operation( @@ -136,8 +137,8 @@ interface PetApi { value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) - fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long): ResponseEntity { - return getDelegate().getPetById(petId) + fun getPetById(@Parameter(description = "ID of pet to return", required = true) @PathVariable("petId") petId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getPetById(petId, serverHttpRequest) } @Operation( @@ -159,8 +160,8 @@ interface PetApi { produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) - fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity { - return getDelegate().updatePet(pet) + fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updatePet(pet, serverHttpRequest) } @Operation( @@ -178,8 +179,8 @@ interface PetApi { value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) - fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ): ResponseEntity { - return getDelegate().updatePetWithForm(petId, name, status) + fun updatePetWithForm(@Parameter(description = "ID of pet that needs to be updated", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Updated name of the pet") @RequestParam(value = "name", required = false) name: kotlin.String? ,@Parameter(description = "Updated status of the pet") @RequestParam(value = "status", required = false) status: kotlin.String? ,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updatePetWithForm(petId, name, status, serverHttpRequest) } @Operation( @@ -198,7 +199,7 @@ interface PetApi { produces = ["application/json"], consumes = ["multipart/form-data"] ) - fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity { - return getDelegate().uploadFile(petId, additionalMetadata, file) + fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().uploadFile(petId, additionalMetadata, file, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt index 798f8520270..0fcca287890 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -6,9 +6,8 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") @Controller -@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}") class PetApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: PetApiDelegate? + delegate: PetApiDelegate? ) : PetApi { private lateinit var delegate: PetApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 5ae2d907ac9..911de08f1d3 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -7,6 +7,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -22,7 +23,8 @@ interface PetApiDelegate { /** * @see PetApi#addPet */ - fun addPet(pet: Pet): ResponseEntity { + fun addPet(pet: Pet, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -44,7 +46,8 @@ interface PetApiDelegate { * @see PetApi#deletePet */ fun deletePet(petId: kotlin.Long, - apiKey: kotlin.String?): ResponseEntity { + apiKey: kotlin.String?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -53,7 +56,8 @@ interface PetApiDelegate { /** * @see PetApi#findPetsByStatus */ - fun findPetsByStatus(status: kotlin.collections.List): ResponseEntity> { + fun findPetsByStatus(status: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity> { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -74,7 +78,8 @@ interface PetApiDelegate { /** * @see PetApi#findPetsByTags */ - fun findPetsByTags(tags: kotlin.collections.List): ResponseEntity> { + fun findPetsByTags(tags: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity> { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -95,7 +100,8 @@ interface PetApiDelegate { /** * @see PetApi#getPetById */ - fun getPetById(petId: kotlin.Long): ResponseEntity { + fun getPetById(petId: kotlin.Long, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -116,7 +122,8 @@ interface PetApiDelegate { /** * @see PetApi#updatePet */ - fun updatePet(pet: Pet): ResponseEntity { + fun updatePet(pet: Pet, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -139,7 +146,8 @@ interface PetApiDelegate { */ fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, - status: kotlin.String?): ResponseEntity { + status: kotlin.String?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -150,7 +158,8 @@ interface PetApiDelegate { */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, - file: Resource?): ResponseEntity { + file: Resource?, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 20cd132672d..ecd670a5204 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -33,8 +34,8 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface StoreApi { fun getDelegate(): StoreApiDelegate = object: StoreApiDelegate {} @@ -53,8 +54,8 @@ interface StoreApi { method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) - fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String): ResponseEntity { - return getDelegate().deleteOrder(orderId) + fun deleteOrder(@Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deleteOrder(orderId, serverHttpRequest) } @Operation( @@ -72,8 +73,8 @@ interface StoreApi { value = ["/store/inventory"], produces = ["application/json"] ) - fun getInventory(): ResponseEntity> { - return getDelegate().getInventory() + fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity> { + return getDelegate().getInventory(serverHttpRequest) } @Operation( @@ -92,8 +93,8 @@ interface StoreApi { value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) - fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long): ResponseEntity { - return getDelegate().getOrderById(orderId) + fun getOrderById(@Min(1L) @Max(5L) @Parameter(description = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") orderId: kotlin.Long,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getOrderById(orderId, serverHttpRequest) } @Operation( @@ -112,7 +113,7 @@ interface StoreApi { produces = ["application/xml", "application/json"], consumes = ["application/json"] ) - fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity { - return getDelegate().placeOrder(order) + fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().placeOrder(order, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 341a93ed3e8..ed88bd38d6c 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -6,9 +6,8 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") @Controller -@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}") class StoreApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: StoreApiDelegate? + delegate: StoreApiDelegate? ) : StoreApi { private lateinit var delegate: StoreApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 74466e22e6d..1ef891cc6a6 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -6,6 +6,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -21,7 +22,8 @@ interface StoreApiDelegate { /** * @see StoreApi#deleteOrder */ - fun deleteOrder(orderId: kotlin.String): ResponseEntity { + fun deleteOrder(orderId: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -30,7 +32,7 @@ interface StoreApiDelegate { /** * @see StoreApi#getInventory */ - fun getInventory(): ResponseEntity> { + fun getInventory(serverHttpRequest: ServerHttpRequest): ResponseEntity> { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -39,7 +41,8 @@ interface StoreApiDelegate { /** * @see StoreApi#getOrderById */ - fun getOrderById(orderId: kotlin.Long): ResponseEntity { + fun getOrderById(orderId: kotlin.Long, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -60,7 +63,8 @@ interface StoreApiDelegate { /** * @see StoreApi#placeOrder */ - fun placeOrder(order: Order): ResponseEntity { + fun placeOrder(order: Order, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 5558a85df8f..35b1769c93f 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.security.* import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity +import org.springframework.http.server.reactive.ServerHttpRequest import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated @@ -33,8 +34,8 @@ import javax.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface UserApi { fun getDelegate(): UserApiDelegate = object: UserApiDelegate {} @@ -54,8 +55,8 @@ interface UserApi { value = ["/user"], consumes = ["application/json"] ) - fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity { - return getDelegate().createUser(user) + fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUser(user, serverHttpRequest) } @Operation( @@ -73,8 +74,8 @@ interface UserApi { value = ["/user/createWithArray"], consumes = ["application/json"] ) - fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { - return getDelegate().createUsersWithArrayInput(user) + fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUsersWithArrayInput(user, serverHttpRequest) } @Operation( @@ -92,8 +93,8 @@ interface UserApi { value = ["/user/createWithList"], consumes = ["application/json"] ) - fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List): ResponseEntity { - return getDelegate().createUsersWithListInput(user) + fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: kotlin.collections.List,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().createUsersWithListInput(user, serverHttpRequest) } @Operation( @@ -111,8 +112,8 @@ interface UserApi { method = [RequestMethod.DELETE], value = ["/user/{username}"] ) - fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { - return getDelegate().deleteUser(username) + fun deleteUser(@Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().deleteUser(username, serverHttpRequest) } @Operation( @@ -131,8 +132,8 @@ interface UserApi { value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) - fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String): ResponseEntity { - return getDelegate().getUserByName(username) + fun getUserByName(@Parameter(description = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") username: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().getUserByName(username, serverHttpRequest) } @Operation( @@ -150,8 +151,8 @@ interface UserApi { value = ["/user/login"], produces = ["application/xml", "application/json"] ) - fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity { - return getDelegate().loginUser(username, password) + fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().loginUser(username, password, serverHttpRequest) } @Operation( @@ -168,8 +169,8 @@ interface UserApi { method = [RequestMethod.GET], value = ["/user/logout"] ) - fun logoutUser(): ResponseEntity { - return getDelegate().logoutUser() + fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().logoutUser(serverHttpRequest) } @Operation( @@ -188,7 +189,7 @@ interface UserApi { value = ["/user/{username}"], consumes = ["application/json"] ) - fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity { - return getDelegate().updateUser(username, user) + fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User,serverHttpRequest: ServerHttpRequest): ResponseEntity { + return getDelegate().updateUser(username, user, serverHttpRequest) } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt index 4d969e5f6ce..45ed97f615e 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -6,9 +6,8 @@ import java.util.Optional @javax.annotation.Generated(value = ["org.openapitools.codegen.languages.KotlinSpringServerCodegen"], comments = "Generator version: 8.0.0-SNAPSHOT") @Controller -@RequestMapping("\${openapi.openAPIPetstore.base-path:/v2}") class UserApiController( - @org.springframework.beans.factory.annotation.Autowired(required = false) delegate: UserApiDelegate? + delegate: UserApiDelegate? ) : UserApi { private lateinit var delegate: UserApiDelegate diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index 9077727adb8..183f5aacfb8 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -6,6 +6,7 @@ import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.context.request.NativeWebRequest import org.springframework.core.io.Resource +import org.springframework.http.server.reactive.ServerHttpRequest import java.util.Optional @@ -21,7 +22,8 @@ interface UserApiDelegate { /** * @see UserApi#createUser */ - fun createUser(user: User): ResponseEntity { + fun createUser(user: User, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -30,7 +32,8 @@ interface UserApiDelegate { /** * @see UserApi#createUsersWithArrayInput */ - fun createUsersWithArrayInput(user: kotlin.collections.List): ResponseEntity { + fun createUsersWithArrayInput(user: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -39,7 +42,8 @@ interface UserApiDelegate { /** * @see UserApi#createUsersWithListInput */ - fun createUsersWithListInput(user: kotlin.collections.List): ResponseEntity { + fun createUsersWithListInput(user: kotlin.collections.List, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -48,7 +52,8 @@ interface UserApiDelegate { /** * @see UserApi#deleteUser */ - fun deleteUser(username: kotlin.String): ResponseEntity { + fun deleteUser(username: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -57,7 +62,8 @@ interface UserApiDelegate { /** * @see UserApi#getUserByName */ - fun getUserByName(username: kotlin.String): ResponseEntity { + fun getUserByName(username: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -79,7 +85,8 @@ interface UserApiDelegate { * @see UserApi#loginUser */ fun loginUser(username: kotlin.String, - password: kotlin.String): ResponseEntity { + password: kotlin.String, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -88,7 +95,7 @@ interface UserApiDelegate { /** * @see UserApi#logoutUser */ - fun logoutUser(): ResponseEntity { + fun logoutUser(serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } @@ -98,7 +105,8 @@ interface UserApiDelegate { * @see UserApi#updateUser */ fun updateUser(username: kotlin.String, - user: User): ResponseEntity { + user: User, + serverHttpRequest: ServerHttpRequest): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt index 128eee7f628..0d3f1978748 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax @@ -48,11 +49,19 @@ data class Order( * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 12a5a585b40..128cd0840fd 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category @@ -53,11 +54,19 @@ data class Pet( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator-ignore b/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/.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-springboot-integer-enum/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator/FILES new file mode 100644 index 00000000000..210f79aeeaa --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator/FILES @@ -0,0 +1,9 @@ +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/DefaultApi.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/model/ApiError.kt +src/main/kotlin/org/openapitools/model/ReasonCode.kt diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/README.md b/samples/server/petstore/kotlin-springboot-integer-enum/README.md new file mode 100644 index 00000000000..e45035f878f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/README.md @@ -0,0 +1,21 @@ +# openAPIStuffAPICreatedToReproduceIssue + +This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). + +## Getting Started + +This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. + +By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). + +To build the project using maven, run: +```bash +mvn package && java -jar target/openapi-spring-1.0.0.jar +``` + +To build the project using gradle, run: +```bash +gradle build && java -jar build/libs/openapi-spring-1.0.0.jar +``` + +If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/build.gradle.kts b/samples/server/petstore/kotlin-springboot-integer-enum/build.gradle.kts new file mode 100644 index 00000000000..02857aa8582 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/build.gradle.kts @@ -0,0 +1,46 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "org.openapitools" +version = "1.0.0" +java.sourceCompatibility = JavaVersion.VERSION_17 + +repositories { + mavenCentral() + maven { url = uri("https://repo.spring.io/milestone") } +} + +tasks.withType { + kotlinOptions.jvmTarget = "17" +} + +tasks.bootJar { + enabled = false +} + +plugins { + val kotlinVersion = "1.7.10" + id("org.jetbrains.kotlin.jvm") version kotlinVersion + id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion + id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion + id("org.springframework.boot") version "3.0.2" + id("io.spring.dependency-management") version "1.0.14.RELEASE" +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.springframework.boot:spring-boot-starter-web") + + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") + implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("jakarta.validation:jakarta.validation-api") + implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + + testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") + testImplementation("org.springframework.boot:spring-boot-starter-test") { + exclude(module = "junit") + } +} diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml b/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml new file mode 100644 index 00000000000..975b084d5a3 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/pom.xml @@ -0,0 +1,132 @@ + + 4.0.0 + org.openapitools + openapi-spring + jar + openapi-spring + 1.0.0 + + 3.0.2 + 2.1.0 + 1.7.10 + + 1.7.10 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.3 + + + + repository.spring.milestone + Spring Milestone Repository + https://repo.spring.io/milestone + + + + + spring-milestones + https://repo.spring.io/milestone + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + + 17 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.springframework.boot + spring-boot-starter-web + + + + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + jakarta.validation + jakarta.validation-api + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} + provided + + + org.jetbrains.kotlin + kotlin-test-junit5 + ${kotlin-test-junit5.version} + test + + + diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/settings.gradle b/samples/server/petstore/kotlin-springboot-integer-enum/settings.gradle new file mode 100644 index 00000000000..14844905cd4 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } +} +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..03344e13b47 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import jakarta.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt new file mode 100644 index 00000000000..cf88744035b --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt @@ -0,0 +1,42 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (8.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. +*/ +package org.openapitools.api + +import org.openapitools.model.ApiError +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +interface DefaultApi { + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/healthcheck"], + produces = ["application/json"] + ) + fun healthcheck(): ResponseEntity +} diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt new file mode 100644 index 00000000000..117161bf65b --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -0,0 +1,29 @@ +package org.openapitools.api + +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.ControllerAdvice +import org.springframework.web.bind.annotation.ExceptionHandler +import jakarta.servlet.http.HttpServletResponse +import jakarta.validation.ConstraintViolationException + +// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception +sealed class ApiException(msg: String, val code: Int) : Exception(msg) + +class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) + + +@ControllerAdvice +class DefaultExceptionHandler { + + @ExceptionHandler(value = [ApiException::class]) + fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = + response.sendError(ex.code, ex.message) + + @ExceptionHandler(value = [NotImplementedError::class]) + fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + + @ExceptionHandler(value = [ConstraintViolationException::class]) + fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) +} diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt new file mode 100644 index 00000000000..781c98346dd --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt @@ -0,0 +1,50 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonValue +import org.openapitools.model.ReasonCode +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** + * + * @param errorCode + * @param reasonCode + */ +data class ApiError( + + @get:JsonProperty("errorCode", required = true) val errorCode: ApiError.ErrorCode, + + @field:Valid + @get:JsonProperty("reasonCode") val reasonCode: ReasonCode? = null +) { + + /** + * + * Values: OK,ERROR + */ + enum class ErrorCode(@get:JsonValue val value: kotlin.Int) { + + OK(0), + ERROR(100); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.Int): ErrorCode { + return values().first{it -> it.value == value} + } + } + } + +} + diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt new file mode 100644 index 00000000000..45260d39027 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt @@ -0,0 +1,34 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonValue +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size +import jakarta.validation.Valid + +/** +* +* Values: _10,_20 +*/ +enum class ReasonCode(@get:JsonValue val value: kotlin.Int) { + + _10(10), + _20(20); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.Int): ReasonCode { + return values().first{it -> it.value == value} + } + } +} + diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts index 45a8ef30f3e..59eda31df62 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts @@ -40,9 +40,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml index a44254101c2..8b51baf52f5 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml @@ -8,7 +8,7 @@ 1.6.8 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -117,13 +117,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 95fa00f2636..9f5a2ba146d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Category( @Schema(example = "null", description = "") @get:JsonProperty("name") var name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 68d1ebf496b..66754a2a503 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -29,7 +30,10 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") var message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index b0ebd4f13c0..85a58b135ce 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,18 +44,29 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") var complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index a989737abc3..4fa40697432 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -46,18 +48,29 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @get:JsonProperty("status") var status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 1ad68021b89..f72e2335f6f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") var name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index b1d1cead418..eb180bafcbe 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -49,7 +50,10 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") var userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.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-springboot-multipart-request-model/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES new file mode 100644 index 00000000000..0afcf84b1ed --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES @@ -0,0 +1,14 @@ +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/HomeController.kt +src/main/kotlin/org/openapitools/SpringDocConfiguration.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt +src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt +src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt +src/main/resources/application.yaml +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md b/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md new file mode 100644 index 00000000000..15d74ea2ce2 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/README.md @@ -0,0 +1,21 @@ +# multipartFileTest + +This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). + +## Getting Started + +This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. + +By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). + +To build the project using maven, run: +```bash +mvn package && java -jar target/openapi-spring-1.0.0.jar +``` + +To build the project using gradle, run: +```bash +gradle build && java -jar build/libs/openapi-spring-1.0.0.jar +``` + +If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts b/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts new file mode 100644 index 00000000000..59eda31df62 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts @@ -0,0 +1,49 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.7") + } +} + +group = "org.openapitools" +version = "1.0.0" + +repositories { + mavenCentral() +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.8" +} + +plugins { + val kotlinVersion = "1.6.21" + id("org.jetbrains.kotlin.jvm") version kotlinVersion + id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion + id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion + id("org.springframework.boot") version "2.6.7" + id("io.spring.dependency-management") version "1.0.11.RELEASE" +} + +dependencies { + compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + compile("org.jetbrains.kotlin:kotlin-reflect") + compile("org.springframework.boot:spring-boot-starter-web") + compile("org.springdoc:springdoc-openapi-ui:1.6.8") + + compile("com.google.code.findbugs:jsr305:3.0.2") + compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") + compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") + compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + compile("com.fasterxml.jackson.module:jackson-module-kotlin") + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") + testCompile("org.jetbrains.kotlin:kotlin-test-junit5") + testCompile("org.springframework.boot:spring-boot-starter-test") { + exclude(module = "junit") + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml new file mode 100644 index 00000000000..8b51baf52f5 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml @@ -0,0 +1,136 @@ + + 4.0.0 + org.openapitools + openapi-spring + jar + openapi-spring + 1.0.0 + + 1.6.8 + 3.0.2 + 1.3.2 + 1.6.21 + + 1.6.21 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 2.7.15 + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + + 1.8 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + + org.springframework.boot + spring-boot-starter-web + + + + + org.springdoc + springdoc-openapi-ui + ${springdoc-openapi.version} + + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + javax.validation + validation-api + + + javax.annotation + javax.annotation-api + ${javax-annotation.version} + provided + + + org.jetbrains.kotlin + kotlin-test-junit5 + ${kotlin-test-junit5.version} + test + + + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle b/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle new file mode 100644 index 00000000000..14844905cd4 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } +} +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt new file mode 100644 index 00000000000..2fe6de62479 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt @@ -0,0 +1,13 @@ +package org.openapitools + +import org.springframework.boot.runApplication +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.context.annotation.ComponentScan + +@SpringBootApplication +@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"]) +class Application + +fun main(args: Array) { + runApplication(*args) +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt new file mode 100644 index 00000000000..0b75544d7a1 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt @@ -0,0 +1,17 @@ +package org.openapitools + +import org.springframework.context.annotation.Bean +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.ResponseBody +import org.springframework.web.bind.annotation.GetMapping + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +class HomeController { + + @RequestMapping("/") + fun index(): String = "redirect:swagger-ui.html" +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt new file mode 100644 index 00000000000..2e11661edd0 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt @@ -0,0 +1,26 @@ +package org.openapitools + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +import io.swagger.v3.oas.models.OpenAPI +import io.swagger.v3.oas.models.info.Info +import io.swagger.v3.oas.models.info.Contact +import io.swagger.v3.oas.models.info.License +import io.swagger.v3.oas.models.Components +import io.swagger.v3.oas.models.security.SecurityScheme + +@Configuration +class SpringDocConfiguration { + + @Bean + fun apiInfo(): OpenAPI { + return OpenAPI() + .info( + Info() + .title("MultipartFile test") + .description("No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)") + .version("1.0.0") + ) + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt new file mode 100644 index 00000000000..88e892d0f49 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/ApiUtil.kt @@ -0,0 +1,19 @@ +package org.openapitools.api + +import org.springframework.web.context.request.NativeWebRequest + +import javax.servlet.http.HttpServletResponse +import java.io.IOException + +object ApiUtil { + fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) { + try { + val res = req.getNativeResponse(HttpServletResponse::class.java) + res?.characterEncoding = "UTF-8" + res?.addHeader("Content-Type", contentType) + res?.writer?.print(example) + } catch (e: IOException) { + throw RuntimeException(e) + } + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt new file mode 100644 index 00000000000..44190af7a01 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -0,0 +1,29 @@ +package org.openapitools.api + +import org.springframework.http.HttpStatus +import org.springframework.web.bind.annotation.ControllerAdvice +import org.springframework.web.bind.annotation.ExceptionHandler +import javax.servlet.http.HttpServletResponse +import javax.validation.ConstraintViolationException + +// TODO Extend ApiException for custom exception handling, e.g. the below NotFound exception +sealed class ApiException(msg: String, val code: Int) : Exception(msg) + +class NotFoundException(msg: String, code: Int = HttpStatus.NOT_FOUND.value()) : ApiException(msg, code) + + +@ControllerAdvice +class DefaultExceptionHandler { + + @ExceptionHandler(value = [ApiException::class]) + fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = + response.sendError(ex.code, ex.message) + + @ExceptionHandler(value = [NotImplementedError::class]) + fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + + @ExceptionHandler(value = [ConstraintViolationException::class]) + fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt new file mode 100644 index 00000000000..a2b304ac2f2 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt @@ -0,0 +1,52 @@ +package org.openapitools.api + +import org.openapitools.model.MultipartMixedRequestMarker +import org.openapitools.model.MultipartMixedStatus +import io.swagger.v3.oas.annotations.* +import io.swagger.v3.oas.annotations.enums.* +import io.swagger.v3.oas.annotations.media.* +import io.swagger.v3.oas.annotations.responses.* +import io.swagger.v3.oas.annotations.security.* +import org.springframework.http.HttpStatus +import org.springframework.http.MediaType +import org.springframework.http.ResponseEntity + +import org.springframework.web.bind.annotation.* +import org.springframework.validation.annotation.Validated +import org.springframework.web.context.request.NativeWebRequest +import org.springframework.beans.factory.annotation.Autowired + +import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size + +import kotlin.collections.List +import kotlin.collections.Map + +@RestController +@Validated +@RequestMapping("\${api.base-path:}") +class MultipartMixedApiController() { + + @Operation( + summary = "", + operationId = "multipartMixed", + description = """Mixed MultipartFile test""", + responses = [ + ApiResponse(responseCode = "204", description = "Successful operation") ] + ) + @RequestMapping( + method = [RequestMethod.POST], + value = ["/multipart-mixed"], + consumes = ["multipart/form-data"] + ) + fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.core.io.Resource,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity { + return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) + } +} diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt new file mode 100644 index 00000000000..1a8f989c917 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt @@ -0,0 +1,27 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * additional object + * @param name + */ +data class MultipartMixedRequestMarker( + + @Schema(example = "null", description = "") + @get:JsonProperty("name") val name: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt new file mode 100644 index 00000000000..9f5236caf24 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt @@ -0,0 +1,36 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonValue +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** +* additional field as Enum +* Values: ALLOWED,IN_PROGRESS,REJECTED +*/ +enum class MultipartMixedStatus(@get:JsonValue val value: kotlin.String) { + + ALLOWED("ALLOWED"), + IN_PROGRESS("IN_PROGRESS"), + REJECTED("REJECTED"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): MultipartMixedStatus { + return values().first{it -> it.value == value} + } + } +} + diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml new file mode 100644 index 00000000000..51bc6d3fb4a --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/application.yaml @@ -0,0 +1,10 @@ +spring: + application: + name: multipartFileTest + + jackson: + serialization: + WRITE_DATES_AS_TIMESTAMPS: false + +server: + port: 8080 diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..4511aa31f49 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/resources/openapi.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.1 +info: + title: MultipartFile test + version: 1.0.0 +servers: +- url: / +paths: + /multipart-mixed: + post: + description: Mixed MultipartFile test + operationId: multipartMixed + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipartMixed_request' + responses: + "204": + description: Successful operation + tags: + - multipart +components: + schemas: + MultipartMixedStatus: + description: additional field as Enum + enum: + - ALLOWED + - IN_PROGRESS + - REJECTED + example: REJECTED + type: string + multipartMixed_request_marker: + description: additional object + properties: + name: + type: string + type: object + multipartMixed_request: + properties: + status: + $ref: '#/components/schemas/MultipartMixedStatus' + marker: + $ref: '#/components/schemas/multipartMixed_request_marker' + file: + description: a file + format: binary + type: string + required: + - file + - status + type: object diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt new file mode 100644 index 00000000000..6330073d743 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/test/kotlin/org/openapitools/api/MultipartMixedApiTest.kt @@ -0,0 +1,27 @@ +package org.openapitools.api + +import org.openapitools.model.MultipartMixedRequestMarker +import org.openapitools.model.MultipartMixedStatus +import org.junit.jupiter.api.Test +import org.springframework.http.ResponseEntity + +class MultipartMixedApiTest { + + private val api: MultipartMixedApiController = MultipartMixedApiController() + + /** + * To test MultipartMixedApiController.multipartMixed + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun multipartMixedTest() { + val status: MultipartMixedStatus = TODO() + val file: org.springframework.core.io.Resource = TODO() + val marker: MultipartMixedRequestMarker? = TODO() + val response: ResponseEntity = api.multipartMixed(status, file, marker) + + // TODO: test validations + } +} diff --git a/samples/server/petstore/kotlin-springboot-reactive/build.gradle.kts b/samples/server/petstore/kotlin-springboot-reactive/build.gradle.kts index 872f35a6e5f..34c8c1d1e11 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-reactive/build.gradle.kts @@ -43,9 +43,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-reactive/pom.xml b/samples/server/petstore/kotlin-springboot-reactive/pom.xml index fb9e3e28edd..f555dc75a07 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/pom.xml +++ b/samples/server/petstore/kotlin-springboot-reactive/pom.xml @@ -9,7 +9,7 @@ 1.6.1 1.6.8 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -128,13 +128,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 128eee7f628..0d3f1978748 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import javax.validation.constraints.DecimalMax @@ -48,11 +49,19 @@ data class Order( * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index cab156b8818..b16c5ecc2fa 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category @@ -52,11 +53,19 @@ data class Pet( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/build.gradle.kts b/samples/server/petstore/kotlin-springboot-request-cookie/build.gradle.kts index f8ef1123955..baf2f23d877 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-request-cookie/build.gradle.kts @@ -13,6 +13,10 @@ tasks.withType { kotlinOptions.jvmTarget = "17" } +tasks.bootJar { + enabled = false +} + plugins { val kotlinVersion = "1.7.10" id("org.jetbrains.kotlin.jvm") version kotlinVersion @@ -26,7 +30,7 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0-M5") + implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0") implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt index 46bebfb993b..91a5599e84a 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface FakeApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt index 22f799c6e82..a26d065bee9 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface FakeClassnameTestApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt index 75b4b2de4bd..c047af608b8 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface FooApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt index 009ee294d8e..52a4d99a0f1 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -35,8 +35,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface PetApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt index 8b541806f6e..c378b548c68 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface StoreApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt index ccca27fc8cd..7883bf8944f 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface UserApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt index 14135c9174a..ce5bc44289a 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import jakarta.validation.constraints.DecimalMax @@ -48,11 +49,19 @@ data class Order( * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt index 4c2dbad8ccd..daa58001722 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category @@ -52,11 +53,19 @@ data class Pet( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-request/build.gradle.kts b/samples/server/petstore/kotlin-springboot-request/build.gradle.kts index f8ef1123955..baf2f23d877 100644 --- a/samples/server/petstore/kotlin-springboot-request/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-request/build.gradle.kts @@ -13,6 +13,10 @@ tasks.withType { kotlinOptions.jvmTarget = "17" } +tasks.bootJar { + enabled = false +} + plugins { val kotlinVersion = "1.7.10" id("org.jetbrains.kotlin.jvm") version kotlinVersion @@ -26,7 +30,7 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0-M5") + implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0") implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/PetApi.kt index bbed75d8350..1db7283b6cb 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -35,8 +35,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface PetApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/StoreApi.kt index 63a295b14bf..d043248a000 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface StoreApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/UserApi.kt index bc90d088aff..3af01f6707f 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -34,8 +34,8 @@ import jakarta.validation.Valid import kotlin.collections.List import kotlin.collections.Map +@RestController @Validated -@RequestMapping("\${api.base-path:/v2}") interface UserApi { @Operation( diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Order.kt index 1ffd604abeb..934a82a19cb 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import jakarta.validation.constraints.DecimalMax @@ -48,11 +49,19 @@ data class Order( * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Pet.kt index 267ba7c318f..867ed6f4377 100644 --- a/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-request/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,6 +1,7 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category @@ -52,11 +53,19 @@ data class Pet( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/build.gradle.kts b/samples/server/petstore/kotlin-springboot-source-swagger1/build.gradle.kts index 4a6ad8eb5cf..a968d763ce0 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/build.gradle.kts @@ -42,9 +42,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml b/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml index fd47cf0b9d9..0b4b2ed3ab8 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/pom.xml @@ -9,7 +9,7 @@ 4.10.3 1.6.6 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -127,13 +127,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt index 926b412f109..2e034948613 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index be3714162c5..abbf4359e72 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -29,7 +30,10 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt index 8365af30903..b0ed69e5dd5 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,18 +44,29 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt index a1a910115db..9a0f10f1ae4 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -46,18 +48,29 @@ data class Pet( @ApiModelProperty(example = "null", value = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt index 5ffd22fa340..2aa44ca668f 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt index cd0997a8e22..a341780fe9f 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -49,7 +50,10 @@ data class User( @ApiModelProperty(example = "null", value = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/build.gradle.kts b/samples/server/petstore/kotlin-springboot-source-swagger2/build.gradle.kts index 06370a4ca4a..03467276413 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/build.gradle.kts @@ -42,9 +42,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml b/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml index 7da75fe3518..3e48c18fac3 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/pom.xml @@ -9,7 +9,7 @@ 4.10.3 2.2.0 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -127,13 +127,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt index f7ed3a1a970..91091c73422 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Category( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6af39346cf4..217847cafff 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -29,7 +30,10 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt index 128eee7f628..1eeebebaed2 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,18 +44,29 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt index cab156b8818..71e6bb48dab 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -46,18 +48,29 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt index 0f2b45edcf7..a86fddc893a 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt index ef3d46afd3e..ce3850825d2 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -49,7 +50,10 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/build.gradle.kts b/samples/server/petstore/kotlin-springboot-springfox/build.gradle.kts index da7303a83fd..49bb61f6306 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-springfox/build.gradle.kts @@ -42,9 +42,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot-springfox/pom.xml b/samples/server/petstore/kotlin-springboot-springfox/pom.xml index 040699b25a6..df16e753a7a 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/pom.xml +++ b/samples/server/petstore/kotlin-springboot-springfox/pom.xml @@ -9,7 +9,7 @@ 2.9.2 4.10.3 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -128,13 +128,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt index 926b412f109..2e034948613 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index be3714162c5..abbf4359e72 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -29,7 +30,10 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt index 8365af30903..b0ed69e5dd5 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,18 +44,29 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt index a1a910115db..9a0f10f1ae4 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -46,18 +48,29 @@ data class Pet( @ApiModelProperty(example = "null", value = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt index 5ffd22fa340..2aa44ca668f 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt index cd0997a8e22..a341780fe9f 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -49,7 +50,10 @@ data class User( @ApiModelProperty(example = "null", value = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/build.gradle.kts b/samples/server/petstore/kotlin-springboot/build.gradle.kts index 2eba4d51c61..99f6c18bffc 100644 --- a/samples/server/petstore/kotlin-springboot/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot/build.gradle.kts @@ -39,9 +39,8 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.module:jackson-module-kotlin") - compile("jakarta.validation:jakarta.validation-api") - compile("jakarta.annotation:jakarta.annotation-api:2.1.0") - + compile("javax.validation:validation-api") + compile("javax.annotation:javax.annotation-api:1.3.2") testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") diff --git a/samples/server/petstore/kotlin-springboot/pom.xml b/samples/server/petstore/kotlin-springboot/pom.xml index 00063afb94a..f4d469c3a09 100644 --- a/samples/server/petstore/kotlin-springboot/pom.xml +++ b/samples/server/petstore/kotlin-springboot/pom.xml @@ -7,7 +7,7 @@ 1.0.0 3.0.2 - 2.1.0 + 1.3.2 1.6.21 1.6.21 @@ -111,13 +111,13 @@ - jakarta.validation - jakarta.validation-api + javax.validation + validation-api - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} + javax.annotation + javax.annotation-api + ${javax-annotation.version} provided diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 7e906d10e10..58a60c08ccd 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -22,7 +23,10 @@ data class Category( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 4b42c877edb..fffe28abf49 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -25,7 +26,10 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 61814bda584..e88107612a1 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -1,8 +1,10 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -35,18 +37,29 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) { +) : Serializable{ /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("placed") placed("placed"), - @JsonProperty("approved") approved("approved"), - @JsonProperty("delivered") delivered("delivered") + placed("placed"), + approved("approved"), + delivered("delivered"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index ebebb0c1419..1467db4160b 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -1,10 +1,12 @@ package org.openapitools.model import java.util.Objects +import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -39,18 +41,29 @@ data class Pet( @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @get:JsonProperty("status") val status: Pet.Status? = null -) { +) : Serializable{ /** * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: kotlin.String) { + enum class Status(@get:JsonValue val value: kotlin.String) { - @JsonProperty("available") available("available"), - @JsonProperty("pending") pending("pending"), - @JsonProperty("sold") sold("sold") + available("available"), + pending("pending"), + sold("sold"); + + companion object { + @JvmStatic + @JsonCreator + fun forValue(value: kotlin.String): Status { + return values().first{it -> it.value == value} + } + } } + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 0beafadd514..06e15fa7a03 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -22,7 +23,10 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 8780ff0d2f2..9195c496c33 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -2,6 +2,7 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty +import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -40,7 +41,10 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) { +) : Serializable{ + companion object { + private const val serialVersionUID: kotlin.Long = 1 + } } diff --git a/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml b/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml index 0752eef611b..5b055dc12de 100644 --- a/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-vertx-modelMutable/pom.xml @@ -20,7 +20,7 @@ 3.10.0 1.0.2 3.2.4 - 2.15.2 + 2.17.1 diff --git a/samples/server/petstore/kotlin-wiremock/gradlew.bat b/samples/server/petstore/kotlin-wiremock/gradlew.bat index 9d0ce634cb1..107acd32c4e 100644 --- a/samples/server/petstore/kotlin-wiremock/gradlew.bat +++ b/samples/server/petstore/kotlin-wiremock/gradlew.bat @@ -1,249 +1,89 @@ -#!/bin/sh +@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 -# -# 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. -# +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## -############################################################################## -# -# 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/. -# -############################################################################## +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal -# Attempt to set APP_HOME +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% -# Resolve links: $0 may be a link -app_path=$0 +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi -# 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 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" -# 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 +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute -warn () { -echo "$*" -} >&2 +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. -die () { -echo -echo "$*" -echo -exit 1 -} >&2 +goto fail -# 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 +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +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 -# 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 +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* -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. +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi -fi +: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 -# 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 +:mainEnd +if "%OS%"=="Windows_NT" endlocal -# 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" "$@" +:omega diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index 0752eef611b..5b055dc12de 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -20,7 +20,7 @@ 3.10.0 1.0.2 3.2.4 - 2.15.2 + 2.17.1 diff --git a/samples/server/petstore/php-laravel/.openapi-generator/FILES b/samples/server/petstore/php-laravel/.openapi-generator/FILES index 25d212023fd..f749ee75ce2 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/FILES +++ b/samples/server/petstore/php-laravel/.openapi-generator/FILES @@ -100,7 +100,6 @@ lib/database/.gitignore lib/database/factories/UserFactory.php lib/database/migrations/2014_10_12_000000_create_users_table.php lib/database/migrations/2019_08_19_000000_create_failed_jobs_table.php -lib/database/migrations/2019_08_19_000000_create_failed_jobs_table.php lib/database/seeds/DatabaseSeeder.php lib/package.json lib/phpunit.xml diff --git a/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php b/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php index fae7317d455..9bb34597286 100644 --- a/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php +++ b/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php @@ -914,19 +914,19 @@ class RegisterRoutes 'header' => $authMethod['keyParamName'], 'parameter' => null, 'cookie' => null, - ] + ]; } else if ($authMethod['isKeyInQuery']) { $authenticatorConfig = [ 'header' => null, 'parameter' => $authMethod['keyParamName'], 'cookie' => null, - ] + ]; } else if ($authMethod['isKeyInCookie']) { $authenticatorConfig = [ 'header' => null, 'parameter' => null, 'cookie' => $authMethod['keyParamName'], - ] + ]; } $route->add(new TokenAuthentication($authenticatorConfig)); } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php index 69f4ccd2777..e7c2de6ce03 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php @@ -48,25 +48,25 @@ class ApiResponse /** * @var int|null * @SerializedName("code") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $code = null; /** * @var string|null * @SerializedName("type") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $type = null; /** * @var string|null * @SerializedName("message") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $message = null; /** @@ -92,15 +92,13 @@ class ApiResponse return $this->code; } - - /** - * Sets code. - * - * @param int|null $code - * - * @return $this - */ + * Sets code. + * + * @param int|null $code + * + * @return $this + */ public function setCode(?int $code = null): self { $this->code = $code; @@ -108,6 +106,9 @@ class ApiResponse return $this; } + + + /** * Gets type. * @@ -118,15 +119,13 @@ class ApiResponse return $this->type; } - - /** - * Sets type. - * - * @param string|null $type - * - * @return $this - */ + * Sets type. + * + * @param string|null $type + * + * @return $this + */ public function setType(?string $type = null): self { $this->type = $type; @@ -134,6 +133,9 @@ class ApiResponse return $this; } + + + /** * Gets message. * @@ -144,21 +146,22 @@ class ApiResponse return $this->message; } - - /** - * Sets message. - * - * @param string|null $message - * - * @return $this - */ + * Sets message. + * + * @param string|null $message + * + * @return $this + */ public function setMessage(?string $message = null): self { $this->message = $message; return $this; } + + + } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php index 8cecd5ca1a6..fc827e4ae73 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php @@ -48,18 +48,18 @@ class Category /** * @var int|null * @SerializedName("id") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $id = null; /** * @var string|null * @SerializedName("name") - * @Assert\Type("string") * @Type("string") - * @Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/") - */ + */ + #[Assert\Type("string")] + #[Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/")] protected ?string $name = null; /** @@ -84,15 +84,13 @@ class Category return $this->id; } - - /** - * Sets id. - * - * @param int|null $id - * - * @return $this - */ + * Sets id. + * + * @param int|null $id + * + * @return $this + */ public function setId(?int $id = null): self { $this->id = $id; @@ -100,6 +98,9 @@ class Category return $this; } + + + /** * Gets name. * @@ -110,21 +111,22 @@ class Category return $this->name; } - - /** - * Sets name. - * - * @param string|null $name - * - * @return $this - */ + * Sets name. + * + * @param string|null $name + * + * @return $this + */ public function setName(?string $name = null): self { $this->name = $name; return $this; } + + + } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php index ae3f8fb0c5d..6434aa9121f 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php @@ -48,33 +48,33 @@ class Order /** * @var int|null * @SerializedName("id") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $id = null; /** * @var int|null * @SerializedName("petId") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $petId = null; /** * @var int|null * @SerializedName("quantity") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $quantity = null; /** * @var \DateTime|null * @SerializedName("shipDate") - * @Assert\Type("\DateTime")) * @Type("DateTime") - */ + */ + #[Assert\Type("\DateTime")] protected ?\DateTime $shipDate = null; /** @@ -82,18 +82,18 @@ class Order * * @var string|null * @SerializedName("status") - * @Assert\Choice({ "placed", "approved", "delivered" }) - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Choice(["placed", "approved", "delivered"])] + #[Assert\Type("string")] protected ?string $status = null; /** * @var bool|null * @SerializedName("complete") - * @Assert\Type("bool") * @Type("bool") - */ + */ + #[Assert\Type("bool")] protected ?bool $complete = false; /** @@ -122,15 +122,13 @@ class Order return $this->id; } - - /** - * Sets id. - * - * @param int|null $id - * - * @return $this - */ + * Sets id. + * + * @param int|null $id + * + * @return $this + */ public function setId(?int $id = null): self { $this->id = $id; @@ -138,6 +136,9 @@ class Order return $this; } + + + /** * Gets petId. * @@ -148,15 +149,13 @@ class Order return $this->petId; } - - /** - * Sets petId. - * - * @param int|null $petId - * - * @return $this - */ + * Sets petId. + * + * @param int|null $petId + * + * @return $this + */ public function setPetId(?int $petId = null): self { $this->petId = $petId; @@ -164,6 +163,9 @@ class Order return $this; } + + + /** * Gets quantity. * @@ -174,15 +176,13 @@ class Order return $this->quantity; } - - /** - * Sets quantity. - * - * @param int|null $quantity - * - * @return $this - */ + * Sets quantity. + * + * @param int|null $quantity + * + * @return $this + */ public function setQuantity(?int $quantity = null): self { $this->quantity = $quantity; @@ -190,6 +190,9 @@ class Order return $this; } + + + /** * Gets shipDate. * @@ -200,15 +203,13 @@ class Order return $this->shipDate; } - - /** - * Sets shipDate. - * - * @param \DateTime|null $shipDate - * - * @return $this - */ + * Sets shipDate. + * + * @param \DateTime|null $shipDate + * + * @return $this + */ public function setShipDate(?\DateTime $shipDate = null): self { $this->shipDate = $shipDate; @@ -216,6 +217,9 @@ class Order return $this; } + + + /** * Gets status. * @@ -226,15 +230,13 @@ class Order return $this->status; } - - /** - * Sets status. - * - * @param string|null $status Order Status - * - * @return $this - */ + * Sets status. + * + * @param string|null $status Order Status + * + * @return $this + */ public function setStatus(?string $status = null): self { $this->status = $status; @@ -242,6 +244,9 @@ class Order return $this; } + + + /** * Gets complete. * @@ -252,21 +257,22 @@ class Order return $this->complete; } - - /** - * Sets complete. - * - * @param bool|null $complete - * - * @return $this - */ + * Sets complete. + * + * @param bool|null $complete + * + * @return $this + */ public function setComplete(?bool $complete = null): self { $this->complete = $complete; return $this; } + + + } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php index 2225627acf2..deda58c617e 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php @@ -48,47 +48,47 @@ class Pet /** * @var int|null * @SerializedName("id") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $id = null; /** * @var Category|null * @SerializedName("category") - * @Assert\Type("OpenAPI\Server\Model\Category") * @Type("OpenAPI\Server\Model\Category") - */ + */ + #[Assert\Type("OpenAPI\Server\Model\Category")] protected ?Category $category = null; /** * @var string|null * @SerializedName("name") - * @Assert\NotNull() - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\NotNull] + #[Assert\Type("string")] protected ?string $name = null; /** * @var string[]|null * @SerializedName("photoUrls") - * @Assert\NotNull() - * @Assert\All({ - * @Assert\Type("string") - * }) * @Type("array") - */ + */ + #[Assert\NotNull] + #[Assert\All([ + new Assert\Type("string"), + ])] protected ?array $photoUrls = null; /** * @var Tag[]|null * @SerializedName("tags") - * @Assert\All({ - * @Assert\Type("OpenAPI\Server\Model\Tag") - * }) * @Type("array") - */ + */ + #[Assert\All([ + new Assert\Type("OpenAPI\Server\Model\Tag"), + ])] protected ?array $tags = null; /** @@ -96,10 +96,10 @@ class Pet * * @var string|null * @SerializedName("status") - * @Assert\Choice({ "available", "pending", "sold" }) - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Choice(["available", "pending", "sold"])] + #[Assert\Type("string")] protected ?string $status = null; /** @@ -128,15 +128,13 @@ class Pet return $this->id; } - - /** - * Sets id. - * - * @param int|null $id - * - * @return $this - */ + * Sets id. + * + * @param int|null $id + * + * @return $this + */ public function setId(?int $id = null): self { $this->id = $id; @@ -144,6 +142,9 @@ class Pet return $this; } + + + /** * Gets category. * @@ -154,15 +155,13 @@ class Pet return $this->category; } - - /** - * Sets category. - * - * @param Category|null $category - * - * @return $this - */ + * Sets category. + * + * @param Category|null $category + * + * @return $this + */ public function setCategory(?Category $category = null): self { $this->category = $category; @@ -170,6 +169,9 @@ class Pet return $this; } + + + /** * Gets name. * @@ -180,15 +182,13 @@ class Pet return $this->name; } - - /** - * Sets name. - * - * @param string|null $name - * - * @return $this - */ + * Sets name. + * + * @param string|null $name + * + * @return $this + */ public function setName(?string $name): self { $this->name = $name; @@ -196,6 +196,9 @@ class Pet return $this; } + + + /** * Gets photoUrls. * @@ -206,15 +209,13 @@ class Pet return $this->photoUrls; } - - /** - * Sets photoUrls. - * - * @param string[]|null $photoUrls - * - * @return $this - */ + * Sets photoUrls. + * + * @param string[]|null $photoUrls + * + * @return $this + */ public function setPhotoUrls(?array $photoUrls): self { $this->photoUrls = $photoUrls; @@ -222,6 +223,9 @@ class Pet return $this; } + + + /** * Gets tags. * @@ -232,15 +236,13 @@ class Pet return $this->tags; } - - /** - * Sets tags. - * - * @param Tag[]|null $tags - * - * @return $this - */ + * Sets tags. + * + * @param Tag[]|null $tags + * + * @return $this + */ public function setTags(?array $tags = null): self { $this->tags = $tags; @@ -248,6 +250,9 @@ class Pet return $this; } + + + /** * Gets status. * @@ -258,21 +263,22 @@ class Pet return $this->status; } - - /** - * Sets status. - * - * @param string|null $status pet status in the store - * - * @return $this - */ + * Sets status. + * + * @param string|null $status pet status in the store + * + * @return $this + */ public function setStatus(?string $status = null): self { $this->status = $status; return $this; } + + + } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php index 5c242dff537..7d669ab9bb0 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php @@ -48,17 +48,17 @@ class Tag /** * @var int|null * @SerializedName("id") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $id = null; /** * @var string|null * @SerializedName("name") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $name = null; /** @@ -83,15 +83,13 @@ class Tag return $this->id; } - - /** - * Sets id. - * - * @param int|null $id - * - * @return $this - */ + * Sets id. + * + * @param int|null $id + * + * @return $this + */ public function setId(?int $id = null): self { $this->id = $id; @@ -99,6 +97,9 @@ class Tag return $this; } + + + /** * Gets name. * @@ -109,21 +110,22 @@ class Tag return $this->name; } - - /** - * Sets name. - * - * @param string|null $name - * - * @return $this - */ + * Sets name. + * + * @param string|null $name + * + * @return $this + */ public function setName(?string $name = null): self { $this->name = $name; return $this; } + + + } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php index db11613de25..b15d7fef65d 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php @@ -48,57 +48,57 @@ class User /** * @var int|null * @SerializedName("id") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $id = null; /** * @var string|null * @SerializedName("username") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $username = null; /** * @var string|null * @SerializedName("firstName") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $firstName = null; /** * @var string|null * @SerializedName("lastName") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $lastName = null; /** * @var string|null * @SerializedName("email") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $email = null; /** * @var string|null * @SerializedName("password") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $password = null; /** * @var string|null * @SerializedName("phone") - * @Assert\Type("string") * @Type("string") - */ + */ + #[Assert\Type("string")] protected ?string $phone = null; /** @@ -106,9 +106,9 @@ class User * * @var int|null * @SerializedName("userStatus") - * @Assert\Type("int") * @Type("int") - */ + */ + #[Assert\Type("int")] protected ?int $userStatus = null; /** @@ -139,15 +139,13 @@ class User return $this->id; } - - /** - * Sets id. - * - * @param int|null $id - * - * @return $this - */ + * Sets id. + * + * @param int|null $id + * + * @return $this + */ public function setId(?int $id = null): self { $this->id = $id; @@ -155,6 +153,9 @@ class User return $this; } + + + /** * Gets username. * @@ -165,15 +166,13 @@ class User return $this->username; } - - /** - * Sets username. - * - * @param string|null $username - * - * @return $this - */ + * Sets username. + * + * @param string|null $username + * + * @return $this + */ public function setUsername(?string $username = null): self { $this->username = $username; @@ -181,6 +180,9 @@ class User return $this; } + + + /** * Gets firstName. * @@ -191,15 +193,13 @@ class User return $this->firstName; } - - /** - * Sets firstName. - * - * @param string|null $firstName - * - * @return $this - */ + * Sets firstName. + * + * @param string|null $firstName + * + * @return $this + */ public function setFirstName(?string $firstName = null): self { $this->firstName = $firstName; @@ -207,6 +207,9 @@ class User return $this; } + + + /** * Gets lastName. * @@ -217,15 +220,13 @@ class User return $this->lastName; } - - /** - * Sets lastName. - * - * @param string|null $lastName - * - * @return $this - */ + * Sets lastName. + * + * @param string|null $lastName + * + * @return $this + */ public function setLastName(?string $lastName = null): self { $this->lastName = $lastName; @@ -233,6 +234,9 @@ class User return $this; } + + + /** * Gets email. * @@ -243,15 +247,13 @@ class User return $this->email; } - - /** - * Sets email. - * - * @param string|null $email - * - * @return $this - */ + * Sets email. + * + * @param string|null $email + * + * @return $this + */ public function setEmail(?string $email = null): self { $this->email = $email; @@ -259,6 +261,9 @@ class User return $this; } + + + /** * Gets password. * @@ -269,15 +274,13 @@ class User return $this->password; } - - /** - * Sets password. - * - * @param string|null $password - * - * @return $this - */ + * Sets password. + * + * @param string|null $password + * + * @return $this + */ public function setPassword(?string $password = null): self { $this->password = $password; @@ -285,6 +288,9 @@ class User return $this; } + + + /** * Gets phone. * @@ -295,15 +301,13 @@ class User return $this->phone; } - - /** - * Sets phone. - * - * @param string|null $phone - * - * @return $this - */ + * Sets phone. + * + * @param string|null $phone + * + * @return $this + */ public function setPhone(?string $phone = null): self { $this->phone = $phone; @@ -311,6 +315,9 @@ class User return $this; } + + + /** * Gets userStatus. * @@ -321,21 +328,22 @@ class User return $this->userStatus; } - - /** - * Sets userStatus. - * - * @param int|null $userStatus User Status - * - * @return $this - */ + * Sets userStatus. + * + * @param int|null $userStatus User Status + * + * @return $this + */ public function setUserStatus(?int $userStatus = null): self { $this->userStatus = $userStatus; return $this; } + + + } 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 12c69bab088..5abbc6de3fb 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php @@ -101,12 +101,16 @@ class JmsSerializer implements SerializerInterface case '\DateTime': return is_null($data) ? null :new DateTime($data); default: + if (is_null($data)) { + return null; + } + if (!class_exists($type)) { throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } $reflectionClass = new \ReflectionClass($type); - if (!$reflectionClass->implementsInterface('\BackedENum')) { + if (!$reflectionClass->implementsInterface('\BackedEnum')) { throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json index 258c6637103..fdce9d5c69c 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json @@ -20,6 +20,7 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", + "doctrine/annotations": "^2.0", "symfony/validator": "^6.4|^7.0", "jms/serializer-bundle": "^5.4", "symfony/framework-bundle": "^6.4|^7.0" diff --git a/samples/server/petstore/python-fastapi/requirements.txt b/samples/server/petstore/python-fastapi/requirements.txt index b54bc7478ed..4cdf1cc2c8e 100644 --- a/samples/server/petstore/python-fastapi/requirements.txt +++ b/samples/server/petstore/python-fastapi/requirements.txt @@ -2,7 +2,7 @@ aiofiles==23.1.0 aniso8601==7.0.0 async-exit-stack==1.0.1 async-generator==1.10 -certifi==2023.7.22 +certifi==2024.7.4 chardet==4.0.0 click==7.1.2 dnspython==2.6.1 @@ -29,7 +29,7 @@ Rx==1.6.1 starlette==0.36.3 typing-extensions==4.8.0 ujson==4.0.2 -urllib3==1.26.18 +urllib3==1.26.19 uvicorn==0.13.4 uvloop==0.19.0 watchgod==0.7 diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py index eb90fbbfbb0..d9ee44de690 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api.py @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -46,4 +47,6 @@ async def fake_query_param_default( no_default: str = Query(None, description="no default value", alias="noDefault"), ) -> None: """""" - return BaseFakeApi.subclasses[0]().fake_query_param_default(has_default, no_default) + if not BaseFakeApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseFakeApi.subclasses[0]().fake_query_param_default(has_default, no_default) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py index 6191845177f..5af08fcbd8e 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/fake_api_base.py @@ -10,7 +10,7 @@ class BaseFakeApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseFakeApi.subclasses = BaseFakeApi.subclasses + (cls,) - def fake_query_param_default( + async def fake_query_param_default( self, has_default: str, no_default: str, diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py index 1229ceeed19..70feda075f2 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -50,7 +51,9 @@ async def add_pet( ), ) -> Pet: """""" - return BasePetApi.subclasses[0]().add_pet(pet) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().add_pet(pet) @router.delete( @@ -70,7 +73,9 @@ async def delete_pet( ), ) -> None: """""" - return BasePetApi.subclasses[0]().delete_pet(petId, api_key) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().delete_pet(petId, api_key) @router.get( @@ -90,7 +95,9 @@ async def find_pets_by_status( ), ) -> List[Pet]: """Multiple status values can be provided with comma separated strings""" - return BasePetApi.subclasses[0]().find_pets_by_status(status) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().find_pets_by_status(status) @router.get( @@ -110,7 +117,9 @@ async def find_pets_by_tags( ), ) -> List[Pet]: """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.""" - return BasePetApi.subclasses[0]().find_pets_by_tags(tags) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().find_pets_by_tags(tags) @router.get( @@ -131,7 +140,9 @@ async def get_pet_by_id( ), ) -> Pet: """Returns a single pet""" - return BasePetApi.subclasses[0]().get_pet_by_id(petId) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().get_pet_by_id(petId) @router.put( @@ -153,7 +164,9 @@ async def update_pet( ), ) -> Pet: """""" - return BasePetApi.subclasses[0]().update_pet(pet) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().update_pet(pet) @router.post( @@ -174,7 +187,9 @@ async def update_pet_with_form( ), ) -> None: """""" - return BasePetApi.subclasses[0]().update_pet_with_form(petId, name, status) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().update_pet_with_form(petId, name, status) @router.post( @@ -195,4 +210,6 @@ async def upload_file( ), ) -> ApiResponse: """""" - return BasePetApi.subclasses[0]().upload_file(petId, additional_metadata, file) + if not BasePetApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BasePetApi.subclasses[0]().upload_file(petId, additional_metadata, file) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py index e8dfbc4f5c7..db77ff6c6a3 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api_base.py @@ -12,7 +12,7 @@ class BasePetApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BasePetApi.subclasses = BasePetApi.subclasses + (cls,) - def add_pet( + async def add_pet( self, pet: Pet, ) -> Pet: @@ -20,7 +20,7 @@ class BasePetApi: ... - def delete_pet( + async def delete_pet( self, petId: int, api_key: str, @@ -29,7 +29,7 @@ class BasePetApi: ... - def find_pets_by_status( + async def find_pets_by_status( self, status: List[str], ) -> List[Pet]: @@ -37,7 +37,7 @@ class BasePetApi: ... - def find_pets_by_tags( + async def find_pets_by_tags( self, tags: List[str], ) -> List[Pet]: @@ -45,7 +45,7 @@ class BasePetApi: ... - def get_pet_by_id( + async def get_pet_by_id( self, petId: int, ) -> Pet: @@ -53,7 +53,7 @@ class BasePetApi: ... - def update_pet( + async def update_pet( self, pet: Pet, ) -> Pet: @@ -61,7 +61,7 @@ class BasePetApi: ... - def update_pet_with_form( + async def update_pet_with_form( self, petId: int, name: str, @@ -71,7 +71,7 @@ class BasePetApi: ... - def upload_file( + async def upload_file( self, petId: int, additional_metadata: str, diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py index b583c10a625..8f492e32cef 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -46,7 +47,9 @@ async def delete_order( orderId: str = Path(..., description="ID of the order that needs to be deleted"), ) -> None: """For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors""" - return BaseStoreApi.subclasses[0]().delete_order(orderId) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().delete_order(orderId) @router.get( @@ -64,7 +67,9 @@ async def get_inventory( ), ) -> Dict[str, int]: """Returns a map of status codes to quantities""" - return BaseStoreApi.subclasses[0]().get_inventory() + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().get_inventory() @router.get( @@ -82,7 +87,9 @@ async def get_order_by_id( orderId: int = Path(..., description="ID of pet that needs to be fetched", ge=1, le=5), ) -> Order: """For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions""" - return BaseStoreApi.subclasses[0]().get_order_by_id(orderId) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().get_order_by_id(orderId) @router.post( @@ -99,4 +106,6 @@ async def place_order( order: Order = Body(None, description="order placed for purchasing the pet"), ) -> Order: """""" - return BaseStoreApi.subclasses[0]().place_order(order) + if not BaseStoreApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseStoreApi.subclasses[0]().place_order(order) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py index f4436a6f07e..40c01de8b94 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api_base.py @@ -11,7 +11,7 @@ class BaseStoreApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseStoreApi.subclasses = BaseStoreApi.subclasses + (cls,) - def delete_order( + async def delete_order( self, orderId: str, ) -> None: @@ -19,14 +19,14 @@ class BaseStoreApi: ... - def get_inventory( + async def get_inventory( self, ) -> Dict[str, int]: """Returns a map of status codes to quantities""" ... - def get_order_by_id( + async def get_order_by_id( self, orderId: int, ) -> Order: @@ -34,7 +34,7 @@ class BaseStoreApi: ... - def place_order( + async def place_order( self, order: Order, ) -> Order: diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py index 1ee291c2a02..f09f127ba51 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api.py @@ -14,6 +14,7 @@ from fastapi import ( # noqa: F401 Depends, Form, Header, + HTTPException, Path, Query, Response, @@ -48,7 +49,9 @@ async def create_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().create_user(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_user(user) @router.post( @@ -67,7 +70,9 @@ async def create_users_with_array_input( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().create_users_with_array_input(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_users_with_array_input(user) @router.post( @@ -86,7 +91,9 @@ async def create_users_with_list_input( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().create_users_with_list_input(user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().create_users_with_list_input(user) @router.delete( @@ -106,7 +113,9 @@ async def delete_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().delete_user(username) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().delete_user(username) @router.get( @@ -124,7 +133,9 @@ async def get_user_by_name( username: str = Path(..., description="The name that needs to be fetched. Use user1 for testing."), ) -> User: """""" - return BaseUserApi.subclasses[0]().get_user_by_name(username) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().get_user_by_name(username) @router.get( @@ -142,7 +153,9 @@ async def login_user( password: str = Query(None, description="The password for login in clear text", alias="password"), ) -> str: """""" - return BaseUserApi.subclasses[0]().login_user(username, password) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().login_user(username, password) @router.get( @@ -160,7 +173,9 @@ async def logout_user( ), ) -> None: """""" - return BaseUserApi.subclasses[0]().logout_user() + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().logout_user() @router.put( @@ -181,4 +196,6 @@ async def update_user( ), ) -> None: """This can only be done by the logged in user.""" - return BaseUserApi.subclasses[0]().update_user(username, user) + if not BaseUserApi.subclasses: + raise HTTPException(status_code=500, detail="Not implemented") + return await BaseUserApi.subclasses[0]().update_user(username, user) diff --git a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py index ee3314e7fa6..b260864f1ca 100644 --- a/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py +++ b/samples/server/petstore/python-fastapi/src/openapi_server/apis/user_api_base.py @@ -11,7 +11,7 @@ class BaseUserApi: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) BaseUserApi.subclasses = BaseUserApi.subclasses + (cls,) - def create_user( + async def create_user( self, user: User, ) -> None: @@ -19,7 +19,7 @@ class BaseUserApi: ... - def create_users_with_array_input( + async def create_users_with_array_input( self, user: List[User], ) -> None: @@ -27,7 +27,7 @@ class BaseUserApi: ... - def create_users_with_list_input( + async def create_users_with_list_input( self, user: List[User], ) -> None: @@ -35,7 +35,7 @@ class BaseUserApi: ... - def delete_user( + async def delete_user( self, username: str, ) -> None: @@ -43,7 +43,7 @@ class BaseUserApi: ... - def get_user_by_name( + async def get_user_by_name( self, username: str, ) -> User: @@ -51,7 +51,7 @@ class BaseUserApi: ... - def login_user( + async def login_user( self, username: str, password: str, @@ -60,14 +60,14 @@ class BaseUserApi: ... - def logout_user( + async def logout_user( self, ) -> None: """""" ... - def update_user( + async def update_user( self, username: str, user: User, diff --git a/samples/server/petstore/python-flask/.openapi-generator/FILES b/samples/server/petstore/python-flask/.openapi-generator/FILES index c08d341ed53..601faf45888 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/FILES +++ b/samples/server/petstore/python-flask/.openapi-generator/FILES @@ -7,6 +7,7 @@ git_push.sh openapi_server/__init__.py openapi_server/__main__.py openapi_server/controllers/__init__.py +openapi_server/controllers/fake_controller.py openapi_server/controllers/pet_controller.py openapi_server/controllers/security_controller.py openapi_server/controllers/store_controller.py @@ -16,10 +17,12 @@ openapi_server/models/__init__.py openapi_server/models/api_response.py openapi_server/models/base_model.py openapi_server/models/category.py -openapi_server/models/enum_model.py openapi_server/models/order.py openapi_server/models/pet.py openapi_server/models/tag.py +openapi_server/models/test_enum.py +openapi_server/models/test_enum_with_default.py +openapi_server/models/test_model.py openapi_server/models/user.py openapi_server/openapi/openapi.yaml openapi_server/test/__init__.py diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/fake_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/fake_controller.py new file mode 100644 index 00000000000..d9847d98d80 --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/controllers/fake_controller.py @@ -0,0 +1,21 @@ +import connexion +from typing import Dict +from typing import Tuple +from typing import Union + +from openapi_server import util + + +def fake_query_param_default(has_default=None, no_default=None): # noqa: E501 + """test query parameter default value + + # noqa: E501 + + :param has_default: has default value + :type has_default: str + :param no_default: no default value + :type no_default: str + + :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] + """ + return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py index 89086c54bd4..6b7d87f1b73 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/pet_controller.py @@ -8,18 +8,18 @@ from openapi_server.models.pet import Pet # noqa: E501 from openapi_server import util -def add_pet(body): # noqa: E501 +def add_pet(pet): # noqa: E501 """Add a new pet to the store # noqa: E501 - :param body: Pet object that needs to be added to the store - :type body: dict | bytes + :param pet: Pet object that needs to be added to the store + :type pet: dict | bytes - :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] + :rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]] """ if connexion.request.is_json: - body = Pet.from_dict(connexion.request.get_json()) # noqa: E501 + pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' @@ -77,18 +77,18 @@ def get_pet_by_id(pet_id): # noqa: E501 return 'do some magic!' -def update_pet(body): # noqa: E501 +def update_pet(pet): # noqa: E501 """Update an existing pet # noqa: E501 - :param body: Pet object that needs to be added to the store - :type body: dict | bytes + :param pet: Pet object that needs to be added to the store + :type pet: dict | bytes - :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] + :rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]] """ if connexion.request.is_json: - body = Pet.from_dict(connexion.request.get_json()) # noqa: E501 + pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py index 62887e7adac..1782980a90a 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/store_controller.py @@ -44,16 +44,16 @@ def get_order_by_id(order_id): # noqa: E501 return 'do some magic!' -def place_order(body): # noqa: E501 +def place_order(order): # noqa: E501 """Place an order for a pet # noqa: E501 - :param body: order placed for purchasing the pet - :type body: dict | bytes + :param order: order placed for purchasing the pet + :type order: dict | bytes :rtype: Union[Order, Tuple[Order, int], Tuple[Order, int, Dict[str, str]] """ if connexion.request.is_json: - body = Order.from_dict(connexion.request.get_json()) # noqa: E501 + order = Order.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py b/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py index 0acef475150..7510bacdca6 100644 --- a/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/controllers/user_controller.py @@ -7,48 +7,48 @@ from openapi_server.models.user import User # noqa: E501 from openapi_server import util -def create_user(body): # noqa: E501 +def create_user(user): # noqa: E501 """Create user This can only be done by the logged in user. # noqa: E501 - :param body: Created user object - :type body: dict | bytes + :param user: Created user object + :type user: dict | bytes :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ if connexion.request.is_json: - body = User.from_dict(connexion.request.get_json()) # noqa: E501 + user = User.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' -def create_users_with_array_input(body): # noqa: E501 +def create_users_with_array_input(user): # noqa: E501 """Creates list of users with given input array # noqa: E501 - :param body: List of user object - :type body: list | bytes + :param user: List of user object + :type user: list | bytes :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ if connexion.request.is_json: - body = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 + user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 return 'do some magic!' -def create_users_with_list_input(body): # noqa: E501 +def create_users_with_list_input(user): # noqa: E501 """Creates list of users with given input array # noqa: E501 - :param body: List of user object - :type body: list | bytes + :param user: List of user object + :type user: list | bytes :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ if connexion.request.is_json: - body = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 + user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 return 'do some magic!' @@ -104,18 +104,18 @@ def logout_user(): # noqa: E501 return 'do some magic!' -def update_user(username, body): # noqa: E501 +def update_user(username, user): # noqa: E501 """Updated user This can only be done by the logged in user. # noqa: E501 :param username: name that need to be deleted :type username: str - :param body: Updated user object - :type body: dict | bytes + :param user: Updated user object + :type user: dict | bytes :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] """ if connexion.request.is_json: - body = User.from_dict(connexion.request.get_json()) # noqa: E501 + user = User.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!' diff --git a/samples/server/petstore/python-flask/openapi_server/models/__init__.py b/samples/server/petstore/python-flask/openapi_server/models/__init__.py index 21d4d1aeb93..5f1925e5c79 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/__init__.py +++ b/samples/server/petstore/python-flask/openapi_server/models/__init__.py @@ -2,8 +2,10 @@ # import models into model package from openapi_server.models.api_response import ApiResponse from openapi_server.models.category import Category -from openapi_server.models.enum_model import EnumModel from openapi_server.models.order import Order from openapi_server.models.pet import Pet from openapi_server.models.tag import Tag +from openapi_server.models.test_enum import TestEnum +from openapi_server.models.test_enum_with_default import TestEnumWithDefault +from openapi_server.models.test_model import TestModel from openapi_server.models.user import User diff --git a/samples/server/petstore/python-flask/openapi_server/models/category.py b/samples/server/petstore/python-flask/openapi_server/models/category.py index 4bdec5b25c4..233e4db0d42 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/category.py +++ b/samples/server/petstore/python-flask/openapi_server/models/category.py @@ -3,8 +3,10 @@ from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from openapi_server.models.base_model import Model +import re from openapi_server import util +import re # noqa: E501 class Category(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -83,5 +85,7 @@ class Category(Model): :param name: The name of this Category. :type name: str """ + if name is not None and not re.search(r'^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$', name): # noqa: E501 + raise ValueError("Invalid value for `name`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/`") # noqa: E501 self._name = name diff --git a/samples/server/petstore/python-flask/openapi_server/models/status_enum.py b/samples/server/petstore/python-flask/openapi_server/models/status_enum.py new file mode 100644 index 00000000000..92ba0c556f8 --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/models/status_enum.py @@ -0,0 +1,40 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from openapi_server.models.base_model import Model +from openapi_server import util + + +class StatusEnum(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + AVAILABLE = 'available' + PENDING = 'pending' + SOLD = 'sold' + def __init__(self): # noqa: E501 + """StatusEnum - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'StatusEnum': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The statusEnum of this StatusEnum. # noqa: E501 + :rtype: StatusEnum + """ + return util.deserialize_model(dikt, cls) diff --git a/samples/server/petstore/python-flask/openapi_server/models/test_enum.py b/samples/server/petstore/python-flask/openapi_server/models/test_enum.py new file mode 100644 index 00000000000..d072a34c622 --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/models/test_enum.py @@ -0,0 +1,41 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from openapi_server.models.base_model import Model +from openapi_server import util + + +class TestEnum(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ONE = 'ONE' + TWO = 'TWO' + THREE = 'THREE' + FOUR = 'foUr' + def __init__(self): # noqa: E501 + """TestEnum - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TestEnum': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The TestEnum of this TestEnum. # noqa: E501 + :rtype: TestEnum + """ + return util.deserialize_model(dikt, cls) diff --git a/samples/server/petstore/python-flask/openapi_server/models/test_enum_with_default.py b/samples/server/petstore/python-flask/openapi_server/models/test_enum_with_default.py new file mode 100644 index 00000000000..cc715175635 --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/models/test_enum_with_default.py @@ -0,0 +1,40 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from openapi_server.models.base_model import Model +from openapi_server import util + + +class TestEnumWithDefault(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + EIN = 'EIN' + ZWEI = 'ZWEI' + DREI = 'DREI' + def __init__(self): # noqa: E501 + """TestEnumWithDefault - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TestEnumWithDefault': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The TestEnumWithDefault of this TestEnumWithDefault. # noqa: E501 + :rtype: TestEnumWithDefault + """ + return util.deserialize_model(dikt, cls) diff --git a/samples/server/petstore/python-flask/openapi_server/models/test_model.py b/samples/server/petstore/python-flask/openapi_server/models/test_model.py new file mode 100644 index 00000000000..3550f70389c --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/models/test_model.py @@ -0,0 +1,177 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from openapi_server.models.base_model import Model +from openapi_server.models.test_enum import TestEnum +from openapi_server.models.test_enum_with_default import TestEnumWithDefault +from openapi_server import util + +from openapi_server.models.test_enum import TestEnum # noqa: E501 +from openapi_server.models.test_enum_with_default import TestEnumWithDefault # noqa: E501 + +class TestModel(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, test_enum=None, test_string=None, test_enum_with_default=TestEnumWithDefault.ZWEI, test_string_with_default='ahoy matey', test_inline_defined_enum_with_default='B'): # noqa: E501 + """TestModel - a model defined in OpenAPI + + :param test_enum: The test_enum of this TestModel. # noqa: E501 + :type test_enum: TestEnum + :param test_string: The test_string of this TestModel. # noqa: E501 + :type test_string: str + :param test_enum_with_default: The test_enum_with_default of this TestModel. # noqa: E501 + :type test_enum_with_default: TestEnumWithDefault + :param test_string_with_default: The test_string_with_default of this TestModel. # noqa: E501 + :type test_string_with_default: str + :param test_inline_defined_enum_with_default: The test_inline_defined_enum_with_default of this TestModel. # noqa: E501 + :type test_inline_defined_enum_with_default: str + """ + self.openapi_types = { + 'test_enum': TestEnum, + 'test_string': str, + 'test_enum_with_default': TestEnumWithDefault, + 'test_string_with_default': str, + 'test_inline_defined_enum_with_default': str + } + + self.attribute_map = { + 'test_enum': 'test_enum', + 'test_string': 'test_string', + 'test_enum_with_default': 'test_enum_with_default', + 'test_string_with_default': 'test_string_with_default', + 'test_inline_defined_enum_with_default': 'test_inline_defined_enum_with_default' + } + + self._test_enum = test_enum + self._test_string = test_string + self._test_enum_with_default = test_enum_with_default + self._test_string_with_default = test_string_with_default + self._test_inline_defined_enum_with_default = test_inline_defined_enum_with_default + + @classmethod + def from_dict(cls, dikt) -> 'TestModel': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The TestModel of this TestModel. # noqa: E501 + :rtype: TestModel + """ + return util.deserialize_model(dikt, cls) + + @property + def test_enum(self) -> TestEnum: + """Gets the test_enum of this TestModel. + + + :return: The test_enum of this TestModel. + :rtype: TestEnum + """ + return self._test_enum + + @test_enum.setter + def test_enum(self, test_enum: TestEnum): + """Sets the test_enum of this TestModel. + + + :param test_enum: The test_enum of this TestModel. + :type test_enum: TestEnum + """ + if test_enum is None: + raise ValueError("Invalid value for `test_enum`, must not be `None`") # noqa: E501 + + self._test_enum = test_enum + + @property + def test_string(self) -> str: + """Gets the test_string of this TestModel. + + + :return: The test_string of this TestModel. + :rtype: str + """ + return self._test_string + + @test_string.setter + def test_string(self, test_string: str): + """Sets the test_string of this TestModel. + + + :param test_string: The test_string of this TestModel. + :type test_string: str + """ + + self._test_string = test_string + + @property + def test_enum_with_default(self) -> TestEnumWithDefault: + """Gets the test_enum_with_default of this TestModel. + + + :return: The test_enum_with_default of this TestModel. + :rtype: TestEnumWithDefault + """ + return self._test_enum_with_default + + @test_enum_with_default.setter + def test_enum_with_default(self, test_enum_with_default: TestEnumWithDefault): + """Sets the test_enum_with_default of this TestModel. + + + :param test_enum_with_default: The test_enum_with_default of this TestModel. + :type test_enum_with_default: TestEnumWithDefault + """ + + self._test_enum_with_default = test_enum_with_default + + @property + def test_string_with_default(self) -> str: + """Gets the test_string_with_default of this TestModel. + + + :return: The test_string_with_default of this TestModel. + :rtype: str + """ + return self._test_string_with_default + + @test_string_with_default.setter + def test_string_with_default(self, test_string_with_default: str): + """Sets the test_string_with_default of this TestModel. + + + :param test_string_with_default: The test_string_with_default of this TestModel. + :type test_string_with_default: str + """ + + self._test_string_with_default = test_string_with_default + + @property + def test_inline_defined_enum_with_default(self) -> str: + """Gets the test_inline_defined_enum_with_default of this TestModel. + + + :return: The test_inline_defined_enum_with_default of this TestModel. + :rtype: str + """ + return self._test_inline_defined_enum_with_default + + @test_inline_defined_enum_with_default.setter + def test_inline_defined_enum_with_default(self, test_inline_defined_enum_with_default: str): + """Sets the test_inline_defined_enum_with_default of this TestModel. + + + :param test_inline_defined_enum_with_default: The test_inline_defined_enum_with_default of this TestModel. + :type test_inline_defined_enum_with_default: str + """ + allowed_values = ["A", "B", "C"] # noqa: E501 + if test_inline_defined_enum_with_default not in allowed_values: + raise ValueError( + "Invalid value for `test_inline_defined_enum_with_default` ({0}), must be one of {1}" + .format(test_inline_defined_enum_with_default, allowed_values) + ) + + self._test_inline_defined_enum_with_default = test_inline_defined_enum_with_default diff --git a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index 21e70929a17..d99503c94ea 100644 --- a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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." @@ -7,6 +7,9 @@ info: 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: @@ -17,22 +20,54 @@ tags: - description: Operations about user name: user paths: + /fake/query_param_default: + get: + description: "" + operationId: fake_query_param_default + parameters: + - description: has default value + explode: true + in: query + name: hasDefault + required: false + schema: + default: Hello World + type: string + style: form + - description: no default value + explode: true + in: query + name: noDefault + required: false + schema: + type: string + style: form + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: test query parameter default value + tags: + - fake + x-openapi-router-controller: openapi_server.controllers.fake_controller /pet: post: + description: "" operationId: add_pet 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: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -41,29 +76,30 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.pet_controller put: + description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet operationId: update_pet 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: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -72,14 +108,14 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.pet_controller /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings operationId: find_pets_by_status 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 @@ -109,11 +145,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -151,11 +185,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -163,22 +195,27 @@ paths: x-openapi-router-controller: openapi_server.controllers.pet_controller /pet/{petId}: delete: + description: "" operationId: delete_pet 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: "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -193,12 +230,14 @@ paths: operationId: get_pet_by_id 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: @@ -210,10 +249,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -222,15 +259,18 @@ paths: - pet x-openapi-router-controller: openapi_server.controllers.pet_controller post: + description: "" operationId: update_pet_with_form 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: @@ -238,7 +278,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -250,15 +289,18 @@ paths: x-openapi-router-controller: openapi_server.controllers.pet_controller /pet/{petId}/uploadImage: post: + description: "" operationId: upload_file 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: @@ -301,10 +343,11 @@ paths: x-openapi-router-controller: openapi_server.controllers.store_controller /store/order: post: + description: "" operationId: place_order requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -320,12 +363,10 @@ 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-openapi-router-controller: openapi_server.controllers.store_controller /store/order/{orderId}: delete: @@ -334,17 +375,17 @@ paths: operationId: delete_order 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -356,6 +397,7 @@ paths: operationId: get_order_by_id parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -364,6 +406,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -375,10 +418,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: @@ -390,78 +431,72 @@ paths: operationId: create_user requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Create user tags: - user - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithArray: post: + description: "" operationId: create_users_with_array_input 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 + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithList: post: + description: "" operationId: create_users_with_list_input 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 + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.user_controller /user/login: get: + description: "" operationId: login_user 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: @@ -473,18 +508,29 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -492,11 +538,13 @@ paths: x-openapi-router-controller: openapi_server.controllers.user_controller /user/logout: get: + description: "" operationId: logout_user responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Logs out current logged in user session tags: - user @@ -507,31 +555,36 @@ paths: operationId: delete_user 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 + security: + - api_key: [] summary: Delete user tags: - user x-openapi-router-controller: openapi_server.controllers.user_controller get: + description: "" operationId: get_user_by_name 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: @@ -543,10 +596,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: @@ -557,31 +608,52 @@ paths: operationId: update_user 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 + security: + - api_key: [] summary: Updated user tags: - user - x-codegen-request-body-name: body x-openapi-router-controller: openapi_server.controllers.user_controller 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 @@ -636,6 +708,7 @@ components: title: id type: integer name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" title: name type: string title: Pet category @@ -747,6 +820,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -780,14 +854,45 @@ components: type: string title: An uploaded response type: object - EnumModel: + TestEnum: enum: - - available> - - pending< - - sold - - "1" - - "2" + - ONE + - TWO + - THREE + - foUr + title: TestEnum type: string + TestEnumWithDefault: + default: ZWEI + enum: + - EIN + - ZWEI + - DREI + title: TestEnumWithDefault + type: string + TestModel: + properties: + test_enum: + $ref: '#/components/schemas/TestEnum' + test_string: + example: Just some string + type: string + test_enum_with_default: + $ref: '#/components/schemas/TestEnumWithDefault' + test_string_with_default: + default: ahoy matey + example: More string + type: string + test_inline_defined_enum_with_default: + default: B + enum: + - A + - B + - C + type: string + required: + - test_enum + type: object updatePetWithForm_request: properties: name: @@ -823,4 +928,3 @@ components: name: api_key type: apiKey x-apikeyInfoFunc: openapi_server.controllers.security_controller.info_from_api_key -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/python-flask/openapi_server/test/test_fake_controller.py b/samples/server/petstore/python-flask/openapi_server/test/test_fake_controller.py new file mode 100644 index 00000000000..439698473a6 --- /dev/null +++ b/samples/server/petstore/python-flask/openapi_server/test/test_fake_controller.py @@ -0,0 +1,30 @@ +import unittest + +from flask import json + +from openapi_server.test import BaseTestCase + + +class TestFakeController(BaseTestCase): + """FakeController integration test stubs""" + + def test_fake_query_param_default(self): + """Test case for fake_query_param_default + + test query parameter default value + """ + query_string = [('hasDefault', 'Hello World'), + ('noDefault', 'no_default_example')] + headers = { + } + response = self.client.open( + '/v2/fake/query_param_default', + method='GET', + headers=headers, + query_string=query_string) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 68f1c75bf6c..72b7f696506 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 20b9a33bcac..17d0e3c07b2 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 cc8091d104d..8f4de4324d7 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 @@ -809,7 +809,6 @@ where Ok(rsp) => match rsp { apis::default::MultipleAuthSchemeGetResponse::Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks => { - let mut response = response.status(200); response.body(Body::empty()) }, @@ -1059,7 +1058,6 @@ where Ok(rsp) => match rsp { apis::default::ReadonlyAuthSchemeGetResponse::Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks => { - let mut response = response.status(200); response.body(Body::empty()) }, @@ -1278,7 +1276,6 @@ where response_headers.insert(HeaderName::from_static(""), object_header); } } - let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1335,7 +1332,6 @@ where response_headers.insert(HeaderName::from_static(""), failure_info); } } - let mut response = response.status(412); response.body(Body::empty()) } @@ -1511,7 +1507,6 @@ where Ok(rsp) => match rsp { apis::default::UntypedPropertyGetResponse::Status200_CheckThatUntypedPropertiesWorks => { - let mut response = response.status(200); response.body(Body::empty()) }, 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 9be673f9440..90792c9ce7c 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 69a87cb8bb1..a2e1c2ad4cb 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 281996e15e3..64726e87b25 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 @@ -2675,7 +2675,6 @@ where response_headers.insert(HeaderName::from_static(""), x_expires_after); } } - let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 a6f7c5cb19a..c6dc92709b7 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 097c6b1cd7c..ea7383de79f 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 @@ -1456,7 +1456,6 @@ where response_headers.insert(HeaderName::from_static(""), x_expires_after); } } - let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 49a2490640c..01b4c91fa03 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 index ecb21862b1e..7e7b8b9bc73 100644 --- 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 @@ -1 +1 @@ -7.6.0-SNAPSHOT +7.7.0-SNAPSHOT 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 index e99c9e7847f..b26f35abd83 100644 --- 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 @@ -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.1.9 -- Generator version: 7.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 ecb21862b1e..7e7b8b9bc73 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.6.0-SNAPSHOT +7.7.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 615ce4f4c74..4f4f5774baa 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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT 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 index ecb21862b1e..7e7b8b9bc73 100644 --- 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 @@ -1 +1 @@ -7.6.0-SNAPSHOT +7.7.0-SNAPSHOT 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 index a017ed146e0..e0e8006366b 100644 --- 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 @@ -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.6.0-SNAPSHOT +- Generator version: 7.7.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/pom.xml b/samples/server/petstore/rust-axum/pom.xml index 61e50dcc15a..4dde1f38bc6 100644 --- a/samples/server/petstore/rust-axum/pom.xml +++ b/samples/server/petstore/rust-axum/pom.xml @@ -66,6 +66,19 @@ + + fmt + integration-test + + exec + + + cargo + + fmt + + + 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 b10ec08a279..8c41db6313c 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 9e60692bed3..009a3183735 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 0830f40a6fa..02500e5701e 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 56cf8cabe73..866ce4e4654 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 db00984dad3..1e80dc87bb7 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 f7961bcc0d7..495d022b04a 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; 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 5b86a01acea..3adabd148d8 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 @@ -1,5 +1,4 @@ -#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] -#![allow(unused_imports, unused_attributes)] +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, unused_attributes, non_camel_case_types)] #![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 332e1728d35..0a466717fec 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 0f533aba144..3df9f8b5c20 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 214149113bf..7e0861de652 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 6610ca50204..71dd8b3bd89 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") @@ -102,7 +102,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") @@ -130,7 +130,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") @@ -158,7 +158,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_integer") @@ -214,7 +214,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_anytype") @@ -242,7 +242,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_string") @@ -270,7 +270,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_anytype") @@ -290,7 +290,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") @@ -310,7 +310,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") @@ -330,7 +330,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index cd8c69452de..47001548a99 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8f6eb4db8d7..b5ee81a8fd6 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ce35826ad8c..2ce347d326c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1500b1ec945..98d2e98fc19 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java index 483081725d0..006ea146459 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 96f9f9564dd..5a6e9c0babe 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 0efc931e21b..0c037d0462f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java index 4f3b00c1086..e8e8978ddcc 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java index 02ebbd15417..cc37e37705d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java @@ -87,7 +87,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java index da1b264357a..f14de405450 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java index 9f5b19d63b2..d77636ad684 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java @@ -55,7 +55,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java index 45e80bc9010..29b1b6f638e 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java @@ -44,7 +44,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -64,7 +64,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ChildWithNullable.java index a1986ba53a0..b88b53e1790 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -39,7 +39,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java index d26039e21c7..837c7effca2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java index 2f9386486a2..f991b0c969c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 952dd142f34..8b4b1c08e20 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -66,7 +66,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") @@ -94,7 +94,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") @@ -122,7 +122,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("required_array") @@ -150,7 +150,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java index c135c00f539..66d4aba200a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java @@ -47,7 +47,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java index 64f07502374..18e081ecf6b 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_enum") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java index d17c282f192..38614dcf26d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java @@ -198,7 +198,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("enum_string_required") @@ -238,7 +238,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") @@ -258,7 +258,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") @@ -278,7 +278,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java index 58bc3928303..b151c017927 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 00fba22d545..714333df226 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java index 721db7dec80..e58ac3efc56 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java @@ -83,7 +83,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") @@ -105,7 +105,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") @@ -125,7 +125,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") @@ -147,7 +147,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number") @@ -169,7 +169,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") @@ -191,7 +191,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") @@ -211,7 +211,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") @@ -231,7 +231,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") @@ -251,7 +251,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") @@ -271,7 +271,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("date") @@ -291,7 +291,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -311,7 +311,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -331,7 +331,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("password") @@ -351,7 +351,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index af9f5535beb..ce297d81221 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java index e5d9def8561..4e546142262 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26e374689cf..aa854ba5491 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java index 8fef228de9f..2815efd5330 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java index 6c367770d65..de5384b1233 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java index e35473e0346..c1d4b57c57c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java index 406b19bb38b..0d18ff8ae40 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java index fdc7c4ae268..73cddebcf0f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java @@ -49,7 +49,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -69,7 +69,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - */ + */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") @@ -109,7 +109,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NullableMapProperty.java index 407a6a982ec..cca5d82a1df 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -45,7 +45,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java index 71e017f511d..233f904d840 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java index e0dc578c722..0c2918f40bd 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java index f390753132a..0b6658d7211 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") 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 bdcca7675d1..f78376f567f 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 @@ -82,7 +82,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -102,7 +102,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java index 0cb24024337..c4acd463485 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java @@ -102,7 +102,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -122,7 +122,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -142,7 +142,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -170,7 +170,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -199,7 +199,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -220,7 +220,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -231,7 +231,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java index acd9dc3b53e..035e1091281 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 955ffd3352c..d83bad8c88e 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java index c26381f9709..7d4c203bbe1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java index 34fce733199..9bf0e0595b5 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java index 91e113075c4..9270db6b06d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -59,7 +59,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -79,7 +79,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -99,7 +99,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -119,7 +119,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -147,7 +147,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java index 7acddbe0637..03b43cf31f3 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -62,7 +62,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") @@ -122,7 +122,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -142,7 +142,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -170,7 +170,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java index de733f4d43c..a0ff44b5ff2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java index 2b4a10ab6a7..8c279b3fd15 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java index 7ac0b7228ae..2e36590f865 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -65,7 +65,7 @@ public class ObjectWithUniqueItems { /** * Get nullSet * @return nullSet - */ + */ @Schema(name = "nullSet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullSet") @@ -93,7 +93,7 @@ public class ObjectWithUniqueItems { /** * Get notNullSet * @return notNullSet - */ + */ @Schema(name = "notNullSet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("notNullSet") @@ -122,7 +122,7 @@ public class ObjectWithUniqueItems { /** * Get nullList * @return nullList - */ + */ @Schema(name = "nullList", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullList") @@ -150,7 +150,7 @@ public class ObjectWithUniqueItems { /** * Get notNullList * @return notNullList - */ + */ @Schema(name = "notNullList", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("notNullList") @@ -170,7 +170,7 @@ public class ObjectWithUniqueItems { /** * Get notNullDateField * @return notNullDateField - */ + */ @Valid @Schema(name = "notNullDateField", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("notNullDateField") @@ -190,7 +190,7 @@ public class ObjectWithUniqueItems { /** * Get nullDateField * @return nullDateField - */ + */ @Valid @Schema(name = "nullDateField", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullDateField") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 4ef2a1262a4..f079d90e5c1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 4efe0294b96..307247d0f08 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4edbafdfb16..f66d1bf46d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index bc8384ed5c1..c5dcbc9fada 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -71,7 +71,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -99,7 +99,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -127,7 +127,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -155,7 +155,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -183,7 +183,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -211,7 +211,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -239,7 +239,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -267,7 +267,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -287,7 +287,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -307,7 +307,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -327,7 +327,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 0636878be50..b5c5e3ef67d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e82ddcb7784..2bdd30a9722 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 02e5ac9ac5c..f6264688edf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 7dd24fc6a16..54e8f76f80d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index cca8afef907..a9600115a32 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 195365b5080..e45160ab114 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 3f68bcceed3..646dc4aaea0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index ebd6d84bad5..e847a36d3a3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index fd1de07d3f3..7145bcce7e0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -87,7 +87,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index cad9d12901a..96c45ef340e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index 65e0c64d9b6..ac5ad3c2786 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -55,7 +55,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index e5e6ac7a2f8..0a7d31d1c1c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -44,7 +44,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -64,7 +64,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java index b8210583376..847753d2a33 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -37,7 +37,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index cc34b1e9cab..67f95964175 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index db496d5faa5..2649aab8ad8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java index beebca32675..d84cabbe1bc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -64,7 +64,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -92,7 +92,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -120,7 +120,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -148,7 +148,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index fc79388ec2f..e1fbf3c8c85 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -47,7 +47,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index b64115b24f5..bd9ca736be2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index dc00beddf78..200ba850ea7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -198,7 +198,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -238,7 +238,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -258,7 +258,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -278,7 +278,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index 7661b3e1c6c..5d91b67be9a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 639c763e64a..4f96da61775 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index a77c5855b22..2937ef9d47f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -83,7 +83,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -105,7 +105,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -125,7 +125,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -147,7 +147,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -169,7 +169,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -191,7 +191,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -211,7 +211,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -231,7 +231,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -251,7 +251,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -271,7 +271,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -291,7 +291,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -311,7 +311,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -331,7 +331,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -351,7 +351,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 4813de962e9..a0c227ba63a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index b311ff4e510..ed3b0a5a528 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0addd8fad8c..67a5d39443c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 42a4db3fd6f..ed4bdaf0281 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 4d9174843be..5a4aff21ca6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 3adca2e907d..16b5fb30b6f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 6b497a2ef20..b36db85456e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index 56773a87824..64459f3a8b8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -49,7 +49,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -69,7 +69,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -109,7 +109,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java index 4b8a6e5741e..5f289ac85d0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -42,7 +42,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 3dd87f1f585..e72ccab6c38 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index f7d5f2b3067..ad48e39accc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 2bf4a091414..58e06dbc3e4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 da5e9fbf991..5459a169d59 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 @@ -79,7 +79,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -99,7 +99,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index e434a686187..98c8d96ffd8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -102,7 +102,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -122,7 +122,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -142,7 +142,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -170,7 +170,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -199,7 +199,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -220,7 +220,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -231,7 +231,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 872119a7f4d..7ae0c4d51b0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index c7a91c696cb..d1500898b1a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index fe5e6f78ec9..d7d04907fcb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 54f7e0d9425..7293a680f99 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 2925227d58c..64593f83d4d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -59,7 +59,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -79,7 +79,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -99,7 +99,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -119,7 +119,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -147,7 +147,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 0ab263f5f00..4ea087aa11e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -62,7 +62,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -122,7 +122,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -142,7 +142,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -170,7 +170,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index ba342b6f49e..fe6b1545d9d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 2f6976315f0..e04b9001596 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..7902f836112 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index a527775c759..842995df9f2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..4c5136be643 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..26f6cac320e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..4a001cf5a1f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..2c9c3ee62b0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..ed27fce8381 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 f7031df0cc7..5e425f84456 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..e70753050b6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..8d0a7c0edba 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ba3ea57aadf 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..6dd6f52b992 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..7902f836112 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index a527775c759..842995df9f2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..4c5136be643 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..26f6cac320e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..4a001cf5a1f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..2c9c3ee62b0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..ed27fce8381 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 f7031df0cc7..5e425f84456 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..e70753050b6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..8d0a7c0edba 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ba3ea57aadf 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..6dd6f52b992 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java index 4fef055be74..41657e13fc5 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java @@ -35,7 +35,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java index 08e835d2f13..38addbd62ab 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -39,7 +39,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -59,7 +59,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -79,7 +79,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java index db094aeeff2..77599a36e1e 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java @@ -84,7 +84,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -104,7 +104,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -124,7 +124,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -144,7 +144,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -164,7 +164,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -184,7 +184,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index e5b70ffeac8..32fb467c4d8 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -101,7 +101,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -121,7 +121,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -141,7 +141,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -169,7 +169,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -197,7 +197,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -218,7 +218,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -229,7 +229,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java index 69326d65d2a..472550a641e 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java @@ -35,7 +35,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -55,7 +55,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java index e3559b7509b..644719e5fbb 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java @@ -47,7 +47,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -67,7 +67,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -87,7 +87,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -107,7 +107,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -127,7 +127,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -147,7 +147,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -167,7 +167,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -187,7 +187,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") 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 0f8f98021d7..896cf6a37a6 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 @@ -33,8 +33,8 @@ public class AdditionalPropertiesAnyType { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesAnyType(String name) { this.name = name; } @@ -47,7 +47,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 15ce23f6fc7..c8183b7f4a9 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 @@ -34,8 +34,8 @@ public class AdditionalPropertiesArray { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesArray(String name) { this.name = name; } @@ -48,7 +48,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 f361faf2f08..3e27fe87690 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 @@ -33,8 +33,8 @@ public class AdditionalPropertiesBoolean { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesBoolean(String name) { this.name = name; } @@ -47,7 +47,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 86d18ee0b05..dccd2c27d1d 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 @@ -64,8 +64,8 @@ public class AdditionalPropertiesClass { } /** - * Constructor with all args parameters - */ + * 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; @@ -96,7 +96,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -124,7 +124,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -152,7 +152,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -180,7 +180,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -208,7 +208,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -236,7 +236,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -264,7 +264,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -292,7 +292,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -312,7 +312,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -332,7 +332,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -352,7 +352,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") 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 92cefc1e226..642991d3f14 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 @@ -33,8 +33,8 @@ public class AdditionalPropertiesInteger { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesInteger(String name) { this.name = name; } @@ -47,7 +47,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 8ef7223e68b..25b7b14c927 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 @@ -34,8 +34,8 @@ public class AdditionalPropertiesNumber { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesNumber(String name) { this.name = name; } @@ -48,7 +48,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 e1ba8ddecc5..42c4c3bf225 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 @@ -34,8 +34,8 @@ public class AdditionalPropertiesObject { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesObject(String name) { this.name = name; } @@ -48,7 +48,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 8db9d64cc45..5810847e964 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 @@ -33,8 +33,8 @@ public class AdditionalPropertiesString { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public AdditionalPropertiesString(String name) { this.name = name; } @@ -47,7 +47,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 05f372ee386..1672377c107 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 @@ -52,8 +52,8 @@ public class Animal { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Animal(String className, String color) { this.className = className; this.color = color; @@ -67,7 +67,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -87,7 +87,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") 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 48f6def46d1..95b917be3be 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 @@ -34,8 +34,8 @@ public class ArrayOfArrayOfNumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } @@ -56,7 +56,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") 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 beccfd0f352..3748c2a5741 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 @@ -34,8 +34,8 @@ public class ArrayOfNumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ArrayOfNumberOnly(List arrayNumber) { this.arrayNumber = arrayNumber; } @@ -56,7 +56,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") 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 aee8607f9ce..2145e38798f 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 @@ -40,8 +40,8 @@ public class ArrayTest { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ArrayTest(List arrayOfString, List> arrayArrayOfInteger, List> arrayArrayOfModel) { this.arrayOfString = arrayOfString; this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -64,7 +64,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -92,7 +92,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -120,7 +120,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") 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 476874427f9..b1f93863ac3 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 @@ -81,8 +81,8 @@ public class BigCat extends Cat { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public BigCat(KindEnum kind, Boolean declawed, String className, String color) { super(declawed, className, color); this.kind = kind; @@ -96,7 +96,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") 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 322ff2ae7ad..695052c0a37 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 @@ -39,8 +39,8 @@ public class Capitalization { } /** - * Constructor with all args parameters - */ + * 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; @@ -58,7 +58,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -78,7 +78,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -98,7 +98,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -118,7 +118,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -138,7 +138,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -158,7 +158,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") 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 597f32514ba..ad0b78ed45e 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 @@ -49,8 +49,8 @@ public class Cat extends Animal { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Cat(Boolean declawed, String className, String color) { super(className, color); this.declawed = declawed; @@ -64,7 +64,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") 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 e0f63c4a46e..9a46a39c9a4 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 @@ -38,8 +38,8 @@ public class Category { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Category(Long id, String name) { this.id = id; this.name = name; @@ -53,7 +53,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -73,7 +73,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") 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 3d02295a7e3..d52169a44ab 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 @@ -37,8 +37,8 @@ public class ChildWithNullable extends ParentWithNullable { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ChildWithNullable(String otherProperty, TypeEnum type, String nullableProperty) { super(type, nullableProperty); this.otherProperty = otherProperty; @@ -52,7 +52,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") 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 88b46634e8b..9dd443d364f 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 @@ -30,8 +30,8 @@ public class ClassModel { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ClassModel(String propertyClass) { this.propertyClass = propertyClass; } @@ -44,7 +44,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") 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 0edc810aed2..b0d76c7081b 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 @@ -29,8 +29,8 @@ public class Client { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Client(String client) { this.client = client; } @@ -43,7 +43,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") 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 050f9f38193..2c29d4a6dfa 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 @@ -52,8 +52,8 @@ public class ContainerDefaultValue { } /** - * Constructor with all args parameters - */ + * 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); @@ -77,7 +77,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -105,7 +105,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -133,7 +133,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -161,7 +161,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") 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 1ef5c388c1b..77b5c07d23c 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 @@ -41,8 +41,8 @@ public class Dog extends Animal { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Dog(String breed, String className, String color) { super(className, color); this.breed = breed; @@ -56,7 +56,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") 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 8c48286f0dd..3912f3dd994 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 @@ -106,8 +106,8 @@ public class EnumArrays { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public EnumArrays(JustSymbolEnum justSymbol, List arrayEnum) { this.justSymbol = justSymbol; this.arrayEnum = arrayEnum; @@ -121,7 +121,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -149,7 +149,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") 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 57997d3349a..fbe6d12db0d 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 @@ -192,8 +192,8 @@ public class EnumTest { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public EnumTest(EnumStringEnum enumString, EnumStringRequiredEnum enumStringRequired, EnumIntegerEnum enumInteger, EnumNumberEnum enumNumber, OuterEnum outerEnum) { this.enumString = enumString; this.enumStringRequired = enumStringRequired; @@ -210,7 +210,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -230,7 +230,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -250,7 +250,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -270,7 +270,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -290,7 +290,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") 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 d7fbd67e873..cec25a856ab 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 @@ -30,8 +30,8 @@ public class File { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public File(String sourceURI) { this.sourceURI = sourceURI; } @@ -44,7 +44,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") 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 0d6749e1b86..537d6de60b7 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 @@ -36,8 +36,8 @@ public class FileSchemaTestClass { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public FileSchemaTestClass(File file, List<@Valid File> files) { this.file = file; this.files = files; @@ -51,7 +51,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -79,7 +79,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") 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 f4d5cb78403..bd7e8837c0b 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 @@ -75,8 +75,8 @@ public class FormatTest { } /** - * Constructor with all args parameters - */ + * 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; @@ -104,7 +104,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -126,7 +126,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -146,7 +146,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -168,7 +168,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -190,7 +190,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -212,7 +212,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -372,7 +372,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") 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 1d0814c42ef..a6dfefb2c74 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 @@ -33,8 +33,8 @@ public class HasOnlyReadOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public HasOnlyReadOnly(String bar, String foo) { this.bar = bar; this.foo = foo; @@ -48,7 +48,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -68,7 +68,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") 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 e254672bf42..0edec084306 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 @@ -77,8 +77,8 @@ public class MapTest { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public MapTest(Map> mapMapOfString, Map mapOfEnumString, Map directMap, Map indirectMap) { this.mapMapOfString = mapMapOfString; this.mapOfEnumString = mapOfEnumString; @@ -102,7 +102,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -130,7 +130,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -158,7 +158,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -186,7 +186,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") 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 9b2f205b700..7bfbc0ea50e 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 @@ -41,8 +41,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public MixedPropertiesAndAdditionalPropertiesClass(UUID uuid, OffsetDateTime dateTime, Map map) { this.uuid = uuid; this.dateTime = dateTime; @@ -57,7 +57,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -77,7 +77,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -105,7 +105,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") 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 5410978075e..d37d034b131 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 @@ -34,8 +34,8 @@ public class Model200Response { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Model200Response(Integer name, String propertyClass) { this.name = name; this.propertyClass = propertyClass; @@ -49,7 +49,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -69,7 +69,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") 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 919ef135526..4d2aec80eaa 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 @@ -35,8 +35,8 @@ public class ModelApiResponse { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelApiResponse(Integer code, String type, String message) { this.code = code; this.type = type; @@ -51,7 +51,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -71,7 +71,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -91,7 +91,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") 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 efa5b68cde5..13d8cf641d1 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 @@ -31,8 +31,8 @@ public class ModelList { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelList(String _123list) { this._123list = _123list; } @@ -45,7 +45,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") 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 46e81203930..2b461aa7216 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 @@ -32,8 +32,8 @@ public class ModelReturn { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ModelReturn(Integer _return) { this._return = _return; } @@ -46,7 +46,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") 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 7ce745843db..4114d106381 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 @@ -43,8 +43,8 @@ public class Name { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Name(Integer name, Integer snakeCase, String property, Integer _123number) { this.name = name; this.snakeCase = snakeCase; @@ -60,7 +60,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -80,7 +80,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -100,7 +100,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -120,7 +120,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") 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 dff2ca40507..358f2c94f74 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 @@ -35,8 +35,8 @@ public class NullableMapProperty { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public NullableMapProperty(Map languageValues) { this.languageValues = JsonNullable.of(languageValues); } @@ -57,7 +57,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") 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 4b3634ed221..947e599cec7 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 @@ -30,8 +30,8 @@ public class NumberOnly { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public NumberOnly(BigDecimal justNumber) { this.justNumber = justNumber; } @@ -44,7 +44,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") 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 e4da1256a68..51c2a2c50b7 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 @@ -80,8 +80,8 @@ public class Order { } /** - * Constructor with all args parameters - */ + * 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; @@ -99,7 +99,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -119,7 +119,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -139,7 +139,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -159,7 +159,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -179,7 +179,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -199,7 +199,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") 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 a8577450430..dab484addae 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 @@ -34,8 +34,8 @@ public class OuterComposite { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public OuterComposite(BigDecimal myNumber, String myString, Boolean myBoolean) { this.myNumber = myNumber; this.myString = myString; @@ -50,7 +50,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -70,7 +70,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -90,7 +90,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 d7e0f1b886b..4506ce3bbc7 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 @@ -80,8 +80,8 @@ public class ParentWithNullable { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ParentWithNullable(TypeEnum type, String nullableProperty) { this.type = type; this.nullableProperty = JsonNullable.of(nullableProperty); @@ -95,7 +95,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -115,7 +115,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") 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 de82d64e065..1709ae8a46e 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 @@ -96,8 +96,8 @@ public class Pet { } /** - * Constructor with all args parameters - */ + * 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; @@ -115,7 +115,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -135,7 +135,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -155,7 +155,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -183,7 +183,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -212,7 +212,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -233,7 +233,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -244,7 +244,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; 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 c811e03a587..31dd9e95cf7 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 @@ -31,8 +31,8 @@ public class ReadOnlyFirst { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public ReadOnlyFirst(String bar, String baz) { this.bar = bar; this.baz = baz; @@ -46,7 +46,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -66,7 +66,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") 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 ae7a0e62866..30699a8cf8f 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 @@ -35,8 +35,8 @@ public class ResponseObjectWithDifferentFieldNames { } /** - * Constructor with all args parameters - */ + * 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; @@ -52,7 +52,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -72,7 +72,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -92,7 +92,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -112,7 +112,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") 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 ef4ad59351c..ac9f089ac2c 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 @@ -31,8 +31,8 @@ public class SpecialModelName { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public SpecialModelName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @@ -45,7 +45,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") 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 5c8ba983cb6..6fb96ee4e96 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 @@ -31,8 +31,8 @@ public class Tag { } /** - * Constructor with all args parameters - */ + * Constructor with all args parameters + */ public Tag(Long id, String name) { this.id = id; this.name = name; @@ -46,7 +46,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 7fcbbe68e96..bcb89c7a596 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 @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") 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 5d76d3e858a..43c37bb5460 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 @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") 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 34caf580683..a47d263a711 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 @@ -43,8 +43,8 @@ public class User { } /** - * Constructor with all args parameters - */ + * 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; @@ -64,7 +64,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -84,7 +84,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -104,7 +104,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -124,7 +124,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -144,7 +144,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -164,7 +164,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -184,7 +184,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -204,7 +204,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") 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 762a2f202ff..9737f720908 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 @@ -98,8 +98,8 @@ public class XmlItem { } /** - * Constructor with all args parameters - */ + * 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; @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -180,7 +180,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -200,7 +200,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -288,7 +288,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -308,7 +308,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -336,7 +336,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -424,7 +424,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -444,7 +444,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -472,7 +472,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -560,7 +560,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -580,7 +580,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -608,7 +608,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -696,7 +696,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -716,7 +716,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -744,7 +744,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -772,7 +772,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator-ignore b/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/.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/springboot-file-delegate-optional/.openapi-generator/FILES b/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator/FILES new file mode 100644 index 00000000000..a0c2e31c886 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/DummyApi.java +src/main/java/org/openapitools/api/DummyApiDelegate.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator/VERSION b/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/springboot-file-delegate-optional/README.md b/samples/server/petstore/springboot-file-delegate-optional/README.md new file mode 100644 index 00000000000..5cd22b6081a --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/README.md @@ -0,0 +1,21 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:8080/v3/api-docs/ + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-file-delegate-optional/pom.xml b/samples/server/petstore/springboot-file-delegate-optional/pom.xml new file mode 100644 index 00000000000..3afd4785fae --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/pom.xml @@ -0,0 +1,97 @@ + + 4.0.0 + org.openapitools + spring-boot-use-optional + jar + spring-boot-use-optional + 1.0.0 + + 17 + ${java.version} + ${java.version} + UTF-8 + 2.2.0 + 5.3.1 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.3 + + + + + + repository.spring.milestone + Spring Milestone Repository + https://repo.spring.io/milestone + + + + + spring-milestones + https://repo.spring.io/milestone + + + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 00000000000..97252a8a940 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,30 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; + +@SpringBootApplication( + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +@ComponentScan( + basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 00000000000..bcd3936d8b3 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +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/springboot-file-delegate-optional/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 00000000000..9bcd4f230ed --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java new file mode 100644 index 00000000000..ac2a8df32cb --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApi.java @@ -0,0 +1,66 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (8.0.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@Validated +@Tag(name = "dummy", description = "the dummy API") +public interface DummyApi { + + default DummyApiDelegate getDelegate() { + return new DummyApiDelegate() {}; + } + + /** + * POST /dummy + * + * + * @param body (optional) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "uploadFile", + description = "", + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/dummy", + consumes = { "application/octet-stream" } + ) + + default ResponseEntity uploadFile( + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) Optional body + ) { + return getDelegate().uploadFile(body); + } + +} diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiController.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiController.java new file mode 100644 index 00000000000..673f6e628da --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiController.java @@ -0,0 +1,43 @@ +package org.openapitools.api; + + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.issue18345.base-path:}") +public class DummyApiController implements DummyApi { + + private final DummyApiDelegate delegate; + + public DummyApiController(@Autowired(required = false) DummyApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new DummyApiDelegate() {}); + } + + @Override + public DummyApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiDelegate.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiDelegate.java new file mode 100644 index 00000000000..bfb092059c0 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/api/DummyApiDelegate.java @@ -0,0 +1,40 @@ +package org.openapitools.api; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + +/** + * A delegate to be called by the {@link DummyApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface DummyApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /dummy + * + * + * @param body (optional) + * @return successful operation (status code 200) + * @see DummyApi#uploadFile + */ + default ResponseEntity uploadFile(Optional body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 00000000000..9aa29284ab5 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,20 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui.html"; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 00000000000..f710be63714 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java @@ -0,0 +1,27 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.security.SecurityScheme; + +@Configuration +public class SpringDocConfiguration { + + @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") + OpenAPI apiInfo() { + return new OpenAPI() + .info( + new Info() + .title("Issue 18345") + .description("No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)") + .version("1.0.0") + ) + ; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/application.properties b/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/application.properties new file mode 100644 index 00000000000..7e90813e59b --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=8080 +spring.jackson.date-format=org.openapitools.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..a7945845ef6 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/main/resources/openapi.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.3 +info: + description: "" + title: Issue 18345 + version: 1.0.0 +servers: +- url: / +paths: + /dummy: + post: + description: "" + operationId: uploadFile + requestBody: + content: + application/octet-stream: + schema: + format: binary + type: string + responses: + "200": + description: successful operation + x-content-type: application/octet-stream + x-accepts: + - application/json +components: + schemas: {} diff --git a/samples/server/petstore/springboot-file-delegate-optional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-file-delegate-optional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 00000000000..3681f67e770 --- /dev/null +++ b/samples/server/petstore/springboot-file-delegate-optional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java index 4dc2d922aa8..20e9d6ce826 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java @@ -32,7 +32,7 @@ public class Category { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -51,7 +51,7 @@ public class Category { /** * Get name * @return name - */ + */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java index 3cc96c6a214..c2430c862e7 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -36,7 +36,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @JsonProperty("code") public Integer getCode() { @@ -55,7 +55,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @JsonProperty("type") public String getType() { @@ -74,7 +74,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @JsonProperty("message") public String getMessage() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java index c1516077ebb..52e1840ae0a 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java @@ -81,7 +81,7 @@ public class Order { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -100,7 +100,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @JsonProperty("petId") public Long getPetId() { @@ -119,7 +119,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @JsonProperty("quantity") public Integer getQuantity() { @@ -138,7 +138,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @JsonProperty("shipDate") public OffsetDateTime getShipDate() { @@ -157,7 +157,7 @@ public class Order { /** * Order Status * @return status - */ + */ @JsonProperty("status") public StatusEnum getStatus() { @@ -176,7 +176,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @JsonProperty("complete") public Boolean getComplete() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index 61742dbf661..b2e7a470879 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -98,7 +98,7 @@ public class Pet { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -117,7 +117,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @JsonProperty("category") public Category getCategory() { @@ -136,7 +136,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @JsonProperty("name") public String getName() { @@ -163,7 +163,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @JsonProperty("photoUrls") public List getPhotoUrls() { @@ -190,7 +190,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @JsonProperty("tags") public List<@Valid Tag> getTags() { @@ -210,7 +210,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @JsonProperty("status") @Deprecated @@ -220,7 +220,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java index 2fc755c070d..a5b81abb7b9 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java @@ -32,7 +32,7 @@ public class Tag { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -51,7 +51,7 @@ public class Tag { /** * Get name * @return name - */ + */ @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java index 0d7b74c1c51..efe4a2da161 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java @@ -44,7 +44,7 @@ public class User { /** * Get id * @return id - */ + */ @JsonProperty("id") public Long getId() { @@ -63,7 +63,7 @@ public class User { /** * Get username * @return username - */ + */ @JsonProperty("username") public String getUsername() { @@ -82,7 +82,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @JsonProperty("firstName") public String getFirstName() { @@ -101,7 +101,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @JsonProperty("lastName") public String getLastName() { @@ -120,7 +120,7 @@ public class User { /** * Get email * @return email - */ + */ @JsonProperty("email") public String getEmail() { @@ -139,7 +139,7 @@ public class User { /** * Get password * @return password - */ + */ @JsonProperty("password") public String getPassword() { @@ -158,7 +158,7 @@ public class User { /** * Get phone * @return phone - */ + */ @JsonProperty("phone") public String getPhone() { @@ -177,7 +177,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @JsonProperty("userStatus") public Integer getUserStatus() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..7902f836112 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index a527775c759..842995df9f2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..4c5136be643 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..26f6cac320e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..4a001cf5a1f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..2c9c3ee62b0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..ed27fce8381 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 f7031df0cc7..5e425f84456 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..e70753050b6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..8d0a7c0edba 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ba3ea57aadf 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..6dd6f52b992 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..7902f836112 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index a527775c759..842995df9f2 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..4c5136be643 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..26f6cac320e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..4a001cf5a1f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..2c9c3ee62b0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..ed27fce8381 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 f7031df0cc7..5e425f84456 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..e70753050b6 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..8d0a7c0edba 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ba3ea57aadf 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..6dd6f52b992 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..7902f836112 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index a527775c759..842995df9f2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..4c5136be643 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..26f6cac320e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..4a001cf5a1f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..2c9c3ee62b0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..ed27fce8381 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 f7031df0cc7..5e425f84456 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..e70753050b6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..8d0a7c0edba 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ba3ea57aadf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..6dd6f52b992 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9e2aeef8f85..262efa6c7c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -100,7 +100,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -128,7 +128,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -156,7 +156,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -212,7 +212,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -240,7 +240,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -268,7 +268,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -288,7 +288,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -308,7 +308,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -328,7 +328,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index f2662d588ad..a1b4f199270 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index 0a0bfbbc0a7..676394efe69 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -48,7 +48,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index ff5b4b6a735..1f6b06a3c06 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -99,7 +99,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -139,7 +139,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -167,7 +167,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -195,7 +195,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -215,7 +215,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 0b12dbab970..c66f64b1ac4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 54038543bf1..a1aa3eb3bf9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9e2aeef8f85..262efa6c7c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -100,7 +100,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -128,7 +128,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -156,7 +156,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -212,7 +212,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -240,7 +240,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -268,7 +268,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -288,7 +288,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -308,7 +308,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -328,7 +328,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index f2662d588ad..a1b4f199270 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java index 0a0bfbbc0a7..676394efe69 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java @@ -48,7 +48,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index ff5b4b6a735..1f6b06a3c06 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -99,7 +99,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -139,7 +139,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -167,7 +167,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -195,7 +195,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -215,7 +215,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index 0b12dbab970..c66f64b1ac4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index 54038543bf1..a1aa3eb3bf9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9e2aeef8f85..262efa6c7c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -100,7 +100,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -128,7 +128,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -156,7 +156,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -212,7 +212,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -240,7 +240,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -268,7 +268,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -288,7 +288,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -308,7 +308,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -328,7 +328,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index f2662d588ad..a1b4f199270 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index 0a0bfbbc0a7..676394efe69 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -48,7 +48,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index ff5b4b6a735..1f6b06a3c06 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -99,7 +99,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -139,7 +139,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -167,7 +167,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -195,7 +195,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -215,7 +215,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 0b12dbab970..c66f64b1ac4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 54038543bf1..a1aa3eb3bf9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..d51b4691578 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..d101076b336 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..d470c1ce79f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9e2aeef8f85..262efa6c7c1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -72,7 +72,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -100,7 +100,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -128,7 +128,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -156,7 +156,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -212,7 +212,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -240,7 +240,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -268,7 +268,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -288,7 +288,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -308,7 +308,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -328,7 +328,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..aad95045fc2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..837f0ebe2ec 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..5f8752d09a0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..ca9aef3df7a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index f2662d588ad..a1b4f199270 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..f36a4bb364a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..58cc7db5f72 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..b157d9277d7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..59de672813e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java index 0a0bfbbc0a7..676394efe69 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -48,7 +48,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..bb6b2bc510d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..e36d9b8a399 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java index 23928e99bab..8cdcef04367 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..f96ddc8df21 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..45320122a9f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..afb61a3571c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..ec781bc8c1a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..227549de104 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..af6c9733da8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..267e2e061ec 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..0e2361fd825 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..5f52ef4ac5a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..a9d8aeabba6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..63f2172df32 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..3a1c30ec221 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..ee9ccf36572 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..9a17bbbf7ab 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..5301b06f634 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e99edc99249 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a473e4297c4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index ff5b4b6a735..1f6b06a3c06 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -99,7 +99,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -119,7 +119,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -139,7 +139,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -167,7 +167,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -195,7 +195,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -215,7 +215,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..2b8f2ad4a60 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 0b12dbab970..c66f64b1ac4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..ab755f89a74 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 54038543bf1..a1aa3eb3bf9 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..6f80bdb79fe 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..7c6441250f0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..15c1de28658 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Category.java index ae5c7145afd..bbe8364be10 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Category.java @@ -33,7 +33,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Category { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/ModelApiResponse.java index 6c367770d65..de5384b1233 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Order.java index 58f27e17a5a..1a55001b4f9 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java index b1171d32900..7ecb41ef21a 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Pet.java @@ -98,7 +98,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -118,7 +118,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -138,7 +138,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -166,7 +166,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -194,7 +194,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -214,7 +214,7 @@ public class Pet { /** * pet status in the store * @return status - */ + */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Tag.java index 34fce733199..9bf0e0595b5 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/User.java index de733f4d43c..a0ff44b5ff2 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") 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 2289c9e795f..e9b2aba73bf 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 @@ -36,7 +36,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 396a5924f1b..d13139606c9 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 @@ -37,7 +37,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 65c82890a47..656e7cf28fd 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 @@ -36,7 +36,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 af93588acac..2377c2d7c06 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 @@ -75,7 +75,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -103,7 +103,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -131,7 +131,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -159,7 +159,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -187,7 +187,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -215,7 +215,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -243,7 +243,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -291,7 +291,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -311,7 +311,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -331,7 +331,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") 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 c83877b0723..a3558ed819d 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 @@ -36,7 +36,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 1b298faa0f0..daefe4a4854 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 @@ -37,7 +37,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 26145852143..5b1f4b4812e 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 @@ -37,7 +37,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 36caf9fef90..33105e047f6 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 @@ -36,7 +36,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 4353ddc4c6a..1a67737cbab 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 @@ -59,7 +59,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -79,7 +79,7 @@ public class Animal { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") 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 9a712a49e8c..af68a3b4407 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 @@ -45,7 +45,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") 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 d403e0fac43..3f28658fb83 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 @@ -45,7 +45,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") 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 d0b90cf2fb2..83aaa7bdc40 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 @@ -51,7 +51,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -79,7 +79,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -107,7 +107,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") 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 efc47684d4e..670d01b8e9c 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 @@ -88,7 +88,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") 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 ad48299bc3b..2a5b3f08d4b 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 @@ -42,7 +42,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -62,7 +62,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -82,7 +82,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -102,7 +102,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -122,7 +122,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -142,7 +142,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") 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 8e642cf4cb9..6b43a537b7d 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 @@ -56,7 +56,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") 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 cb969bf5925..d1b3de390d9 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 @@ -45,7 +45,7 @@ public class Category { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -65,7 +65,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") 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 18ac7cfb271..e55a697bc46 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 @@ -40,7 +40,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") 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 90354be2682..fe71bb04787 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 @@ -33,7 +33,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") 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 0b544690e0c..2b377b21012 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 @@ -32,7 +32,7 @@ public class Client { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") 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 b6c7cbc9da7..7d6975161dd 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 @@ -67,7 +67,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -95,7 +95,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -123,7 +123,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -151,7 +151,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") 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 57fe55cf1bc..4a0b74a8c2e 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 @@ -48,7 +48,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") 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 f5c08ab1788..20e8c0d9a63 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 @@ -109,7 +109,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -137,7 +137,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") 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 9ec2703c2a4..30ecffc2d27 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 @@ -199,7 +199,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") 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 721036abc8d..08fbae70f13 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 @@ -33,7 +33,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") 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 3890105dd98..870095d4e37 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -67,7 +67,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") 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 52ecdf2e253..673d7b9e376 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 @@ -84,7 +84,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") 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 dad6816f9bf..a213b246a20 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 @@ -36,7 +36,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") 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 97cc5f96ec3..178e7f59e50 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 @@ -88,7 +88,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -116,7 +116,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -144,7 +144,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -172,7 +172,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") 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 cf705f3878e..a5123bb3383 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 @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -64,7 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -92,7 +92,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") 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 00f11ffd296..b4db26f61c0 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 @@ -37,7 +37,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") 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 6bfd79baf0a..67c95f61716 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 @@ -38,7 +38,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") 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 5d8a9e3180f..4c69331690c 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 @@ -34,7 +34,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") 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 74f8e788de6..7bd39095c24 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 @@ -35,7 +35,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") 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 a74933d4ff5..53471aa37f4 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 @@ -50,7 +50,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -70,7 +70,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -90,7 +90,7 @@ public class Name { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -110,7 +110,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") 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 d018473ee5c..602974bb4c3 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 @@ -46,7 +46,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") 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 7756074ae88..89fd5435f8f 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 @@ -33,7 +33,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") 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 4f1bd73dd86..51f74b00c48 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 @@ -83,7 +83,7 @@ public class Order { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -103,7 +103,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -123,7 +123,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -143,7 +143,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -163,7 +163,7 @@ public class Order { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -183,7 +183,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") 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 35bf6021136..4376b4447e7 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 @@ -37,7 +37,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -57,7 +57,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -77,7 +77,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 11da2d842b7..40a1f3c76c5 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 @@ -83,7 +83,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -103,7 +103,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") 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 2a8d513a460..613689ce938 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 @@ -103,7 +103,7 @@ public class Pet { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -123,7 +123,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -143,7 +143,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -171,7 +171,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -200,7 +200,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -221,7 +221,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -232,7 +232,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(Optional status) { this.status = status; @@ -337,7 +337,6 @@ public class Pet { this.instance.status(status); return this; } - @Deprecated /** * returns a built Pet instance. 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 ec43a291e88..a3d8bc5a4a9 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 @@ -34,7 +34,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -54,7 +54,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") 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 5602b3a973d..a09682e914e 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 @@ -38,7 +38,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -58,7 +58,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -78,7 +78,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -98,7 +98,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") 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 fed007bb06f..de9ddca1383 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 @@ -34,7 +34,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") 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 e96fa45e045..f346e7e6e80 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 @@ -34,7 +34,7 @@ public class Tag { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -54,7 +54,7 @@ public class Tag { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") 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 e583e780e7d..156f3cb247f 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 @@ -60,7 +60,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -80,7 +80,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -100,7 +100,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -120,7 +120,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -148,7 +148,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") 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 d2d73fcfb8b..2a6fea3afd6 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 @@ -63,7 +63,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -83,7 +83,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -103,7 +103,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -123,7 +123,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -143,7 +143,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -171,7 +171,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") 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 910d18e5aaa..cf1d88a892e 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 @@ -46,7 +46,7 @@ public class User { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -66,7 +66,7 @@ public class User { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -86,7 +86,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -106,7 +106,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -126,7 +126,7 @@ public class User { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -146,7 +146,7 @@ public class User { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -166,7 +166,7 @@ public class User { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -186,7 +186,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") 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 c62eee266d3..35bc8d12a2e 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 @@ -101,7 +101,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -121,7 +121,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -141,7 +141,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -161,7 +161,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -189,7 +189,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -209,7 +209,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -229,7 +229,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -249,7 +249,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -269,7 +269,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -297,7 +297,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -325,7 +325,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -345,7 +345,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -365,7 +365,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -385,7 +385,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -405,7 +405,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -433,7 +433,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -461,7 +461,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -481,7 +481,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -501,7 +501,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -521,7 +521,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -541,7 +541,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -569,7 +569,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -597,7 +597,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -617,7 +617,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -637,7 +637,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -657,7 +657,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -677,7 +677,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -705,7 +705,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -733,7 +733,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java index 0fcd948698b..5045b9c35d8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesAnyType { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java index f9b67e46a42..2e65f9b6e92 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesArray { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java index 028b6e217ec..6af6dd476a8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesBoolean { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index 7d8db4091dd..500a8d98a8c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -74,7 +74,7 @@ public class AdditionalPropertiesClass { /** * Get mapString * @return mapString - */ + */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") @@ -102,7 +102,7 @@ public class AdditionalPropertiesClass { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") @@ -130,7 +130,7 @@ public class AdditionalPropertiesClass { /** * Get mapInteger * @return mapInteger - */ + */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") @@ -158,7 +158,7 @@ public class AdditionalPropertiesClass { /** * Get mapBoolean * @return mapBoolean - */ + */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") @@ -186,7 +186,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_integer") @@ -214,7 +214,7 @@ public class AdditionalPropertiesClass { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_array_anytype") @@ -242,7 +242,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_string") @@ -270,7 +270,7 @@ public class AdditionalPropertiesClass { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_anytype") @@ -290,7 +290,7 @@ public class AdditionalPropertiesClass { /** * Get anytype1 * @return anytype1 - */ + */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") @@ -310,7 +310,7 @@ public class AdditionalPropertiesClass { /** * Get anytype2 * @return anytype2 - */ + */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") @@ -330,7 +330,7 @@ public class AdditionalPropertiesClass { /** * Get anytype3 * @return anytype3 - */ + */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java index cf7036d74d9..e82b2a40aee 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesInteger { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java index 5fcde50252e..b33412d9a39 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesNumber { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java index bd3a4c517f1..124389545c9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java @@ -36,7 +36,7 @@ public class AdditionalPropertiesObject { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java index 2209f8a231c..953bab6e8e8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java @@ -35,7 +35,7 @@ public class AdditionalPropertiesString { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index cf58ed8de73..9eaddac9342 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { /** * Get className * @return className - */ + */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") @@ -78,7 +78,7 @@ public class Animal { /** * Get color * @return color - */ + */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java index 7295fc87694..37b16f82c71 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnly { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index 2bb20a34eec..5c364e582b0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -44,7 +44,7 @@ public class ArrayOfNumberOnly { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index cada4e6c979..399cb56ad95 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -50,7 +50,7 @@ public class ArrayTest { /** * Get arrayOfString * @return arrayOfString - */ + */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") @@ -78,7 +78,7 @@ public class ArrayTest { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_integer") @@ -106,7 +106,7 @@ public class ArrayTest { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java index bde492acf14..d1364aee15f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java @@ -87,7 +87,7 @@ public class BigCat extends Cat { /** * Get kind * @return kind - */ + */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java index 2d4f29a9502..05d6d6dc75d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java @@ -41,7 +41,7 @@ public class Capitalization { /** * Get smallCamel * @return smallCamel - */ + */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") @@ -61,7 +61,7 @@ public class Capitalization { /** * Get capitalCamel * @return capitalCamel - */ + */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") @@ -81,7 +81,7 @@ public class Capitalization { /** * Get smallSnake * @return smallSnake - */ + */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") @@ -101,7 +101,7 @@ public class Capitalization { /** * Get capitalSnake * @return capitalSnake - */ + */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") @@ -121,7 +121,7 @@ public class Capitalization { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") @@ -141,7 +141,7 @@ public class Capitalization { /** * Name of the pet * @return ATT_NAME - */ + */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java index 246e6b2b250..2fc8aea1080 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java @@ -55,7 +55,7 @@ public class Cat extends Animal { /** * Get declawed * @return declawed - */ + */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index 8f6dfe0539c..b253e4320a0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -44,7 +44,7 @@ public class Category { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -64,7 +64,7 @@ public class Category { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ChildWithNullable.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ChildWithNullable.java index 1cf1870824d..7203526dac7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ChildWithNullable.java @@ -39,7 +39,7 @@ public class ChildWithNullable extends ParentWithNullable { /** * Get otherProperty * @return otherProperty - */ + */ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java index 7c87a68746e..f73f0f8a6c7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java @@ -32,7 +32,7 @@ public class ClassModel { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java index a0eaa5b9d35..b36448a6f1f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java @@ -31,7 +31,7 @@ public class Client { /** * Get client * @return client - */ + */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java index 72651a49384..859301fdecb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java @@ -66,7 +66,7 @@ public class ContainerDefaultValue { /** * Get nullableArray * @return nullableArray - */ + */ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") @@ -94,7 +94,7 @@ public class ContainerDefaultValue { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") @@ -122,7 +122,7 @@ public class ContainerDefaultValue { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("required_array") @@ -150,7 +150,7 @@ public class ContainerDefaultValue { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java index e35597ea4fa..12048fe9726 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java @@ -47,7 +47,7 @@ public class Dog extends Animal { /** * Get breed * @return breed - */ + */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index 18aae9f23ee..9c3e52231a4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { /** * Get justSymbol * @return justSymbol - */ + */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") @@ -136,7 +136,7 @@ public class EnumArrays { /** * Get arrayEnum * @return arrayEnum - */ + */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 758fc514ad6..e1913ce6197 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -198,7 +198,7 @@ public class EnumTest { /** * Get enumString * @return enumString - */ + */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") @@ -218,7 +218,7 @@ public class EnumTest { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("enum_string_required") @@ -238,7 +238,7 @@ public class EnumTest { /** * Get enumInteger * @return enumInteger - */ + */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") @@ -258,7 +258,7 @@ public class EnumTest { /** * Get enumNumber * @return enumNumber - */ + */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") @@ -278,7 +278,7 @@ public class EnumTest { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java index 95c38693b9e..a0bb679712e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java @@ -32,7 +32,7 @@ public class File { /** * Test capitalization * @return sourceURI - */ + */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index 5b64dd7f647..25d5ae8b6a2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -38,7 +38,7 @@ public class FileSchemaTestClass { /** * Get file * @return file - */ + */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") @@ -66,7 +66,7 @@ public class FileSchemaTestClass { /** * Get files * @return files - */ + */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index 19104e7067d..baf5f265a40 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -83,7 +83,7 @@ public class FormatTest { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") @@ -105,7 +105,7 @@ public class FormatTest { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") @@ -125,7 +125,7 @@ public class FormatTest { /** * Get int64 * @return int64 - */ + */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") @@ -147,7 +147,7 @@ public class FormatTest { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number") @@ -169,7 +169,7 @@ public class FormatTest { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") @@ -191,7 +191,7 @@ public class FormatTest { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") @@ -211,7 +211,7 @@ public class FormatTest { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") @@ -231,7 +231,7 @@ public class FormatTest { /** * Get _byte * @return _byte - */ + */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") @@ -251,7 +251,7 @@ public class FormatTest { /** * Get binary * @return binary - */ + */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") @@ -271,7 +271,7 @@ public class FormatTest { /** * Get date * @return date - */ + */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("date") @@ -291,7 +291,7 @@ public class FormatTest { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -311,7 +311,7 @@ public class FormatTest { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -331,7 +331,7 @@ public class FormatTest { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("password") @@ -351,7 +351,7 @@ public class FormatTest { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index 6ccb6f09da1..f61cafccb96 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -35,7 +35,7 @@ public class HasOnlyReadOnly { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -55,7 +55,7 @@ public class HasOnlyReadOnly { /** * Get foo * @return foo - */ + */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index 434847fd62d..44f7d8c97fe 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -87,7 +87,7 @@ public class MapTest { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_map_of_string") @@ -115,7 +115,7 @@ public class MapTest { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_of_enum_string") @@ -143,7 +143,7 @@ public class MapTest { /** * Get directMap * @return directMap - */ + */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("direct_map") @@ -171,7 +171,7 @@ public class MapTest { /** * Get indirectMap * @return indirectMap - */ + */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index f6e9d443965..c07c384921a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get uuid * @return uuid - */ + */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get dateTime * @return dateTime - */ + */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") @@ -91,7 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Get map * @return map - */ + */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index dfd374993d6..1f597788146 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -36,7 +36,7 @@ public class Model200Response { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") @@ -56,7 +56,7 @@ public class Model200Response { /** * Get propertyClass * @return propertyClass - */ + */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index c86c21c8039..ea70f47532e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -37,7 +37,7 @@ public class ModelApiResponse { /** * Get code * @return code - */ + */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") @@ -57,7 +57,7 @@ public class ModelApiResponse { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -77,7 +77,7 @@ public class ModelApiResponse { /** * Get message * @return message - */ + */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java index 9d312680a35..7935078eb42 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java @@ -33,7 +33,7 @@ public class ModelList { /** * Get _123list * @return _123list - */ + */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index 957789c4f43..c4dcb7c5ae6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -34,7 +34,7 @@ public class ModelReturn { /** * Get _return * @return _return - */ + */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index ed8827b8751..253014e1c3f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -49,7 +49,7 @@ public class Name { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -69,7 +69,7 @@ public class Name { /** * Get snakeCase * @return snakeCase - */ + */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") @@ -89,7 +89,7 @@ public class Name { /** * Get property * @return property - */ + */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") @@ -109,7 +109,7 @@ public class Name { /** * Get _123number * @return _123number - */ + */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java index 83949639eba..4dc23729dc1 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NullableMapProperty.java @@ -45,7 +45,7 @@ public class NullableMapProperty { /** * Get languageValues * @return languageValues - */ + */ @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java index 33ca902677d..1ba3900b873 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java @@ -32,7 +32,7 @@ public class NumberOnly { /** * Get justNumber * @return justNumber - */ + */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java index 84b39575b0a..2073110c3d2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java @@ -82,7 +82,7 @@ public class Order { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -102,7 +102,7 @@ public class Order { /** * Get petId * @return petId - */ + */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") @@ -122,7 +122,7 @@ public class Order { /** * Get quantity * @return quantity - */ + */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") @@ -142,7 +142,7 @@ public class Order { /** * Get shipDate * @return shipDate - */ + */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") @@ -162,7 +162,7 @@ public class Order { /** * Order Status * @return status - */ + */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -182,7 +182,7 @@ public class Order { /** * Get complete * @return complete - */ + */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java index 94b65388493..8c722c83107 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java @@ -36,7 +36,7 @@ public class OuterComposite { /** * Get myNumber * @return myNumber - */ + */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") @@ -56,7 +56,7 @@ public class OuterComposite { /** * Get myString * @return myString - */ + */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") @@ -76,7 +76,7 @@ public class OuterComposite { /** * Get myBoolean * @return myBoolean - */ + */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") 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 0cbb5de0db9..3ae9494e0be 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 @@ -82,7 +82,7 @@ public class ParentWithNullable { /** * Get type * @return type - */ + */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") @@ -102,7 +102,7 @@ public class ParentWithNullable { /** * Get nullableProperty * @return nullableProperty - */ + */ @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index e2cc689695e..7be792cbcf1 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -102,7 +102,7 @@ public class Pet { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -122,7 +122,7 @@ public class Pet { /** * Get category * @return category - */ + */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") @@ -142,7 +142,7 @@ public class Pet { /** * Get name * @return name - */ + */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") @@ -170,7 +170,7 @@ public class Pet { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") @@ -199,7 +199,7 @@ public class Pet { /** * Get tags * @return tags - */ + */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") @@ -220,7 +220,7 @@ public class Pet { * pet status in the store * @return status * @deprecated - */ + */ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") @@ -231,7 +231,7 @@ public class Pet { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java index db03129427f..6f1b8b94195 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java @@ -33,7 +33,7 @@ public class ReadOnlyFirst { /** * Get bar * @return bar - */ + */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") @@ -53,7 +53,7 @@ public class ReadOnlyFirst { /** * Get baz * @return baz - */ + */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java index 75b7fe0d370..07a85004244 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java @@ -37,7 +37,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") @@ -57,7 +57,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -77,7 +77,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") @@ -97,7 +97,7 @@ public class ResponseObjectWithDifferentFieldNames { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index 23dea9399b0..9cd358ba024 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -33,7 +33,7 @@ public class SpecialModelName { /** * Get $specialPropertyName * @return $specialPropertyName - */ + */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java index b520dbb4597..020e9949831 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java @@ -33,7 +33,7 @@ public class Tag { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -53,7 +53,7 @@ public class Tag { /** * Get name * @return name - */ + */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index ba70f6caa69..346f3850ef6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -59,7 +59,7 @@ public class TypeHolderDefault { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -79,7 +79,7 @@ public class TypeHolderDefault { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -99,7 +99,7 @@ public class TypeHolderDefault { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -119,7 +119,7 @@ public class TypeHolderDefault { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -147,7 +147,7 @@ public class TypeHolderDefault { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index b57f9e6d514..b72c779a92c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -62,7 +62,7 @@ public class TypeHolderExample { /** * Get stringItem * @return stringItem - */ + */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderExample { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderExample { /** * Get floatItem * @return floatItem - */ + */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") @@ -122,7 +122,7 @@ public class TypeHolderExample { /** * Get integerItem * @return integerItem - */ + */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") @@ -142,7 +142,7 @@ public class TypeHolderExample { /** * Get boolItem * @return boolItem - */ + */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") @@ -170,7 +170,7 @@ public class TypeHolderExample { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java index 12fa204fbd6..06a5d2455b3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java @@ -45,7 +45,7 @@ public class User { /** * Get id * @return id - */ + */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") @@ -65,7 +65,7 @@ public class User { /** * Get username * @return username - */ + */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") @@ -85,7 +85,7 @@ public class User { /** * Get firstName * @return firstName - */ + */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") @@ -105,7 +105,7 @@ public class User { /** * Get lastName * @return lastName - */ + */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") @@ -125,7 +125,7 @@ public class User { /** * Get email * @return email - */ + */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") @@ -145,7 +145,7 @@ public class User { /** * Get password * @return password - */ + */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") @@ -165,7 +165,7 @@ public class User { /** * Get phone * @return phone - */ + */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") @@ -185,7 +185,7 @@ public class User { /** * User Status * @return userStatus - */ + */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index 0ab4c9ee356..888b7f64bcf 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -100,7 +100,7 @@ public class XmlItem { /** * Get attributeString * @return attributeString - */ + */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") @@ -120,7 +120,7 @@ public class XmlItem { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") @@ -140,7 +140,7 @@ public class XmlItem { /** * Get attributeInteger * @return attributeInteger - */ + */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") @@ -160,7 +160,7 @@ public class XmlItem { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") @@ -188,7 +188,7 @@ public class XmlItem { /** * Get wrappedArray * @return wrappedArray - */ + */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") @@ -208,7 +208,7 @@ public class XmlItem { /** * Get nameString * @return nameString - */ + */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") @@ -228,7 +228,7 @@ public class XmlItem { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") @@ -248,7 +248,7 @@ public class XmlItem { /** * Get nameInteger * @return nameInteger - */ + */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") @@ -268,7 +268,7 @@ public class XmlItem { /** * Get nameBoolean * @return nameBoolean - */ + */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") @@ -296,7 +296,7 @@ public class XmlItem { /** * Get nameArray * @return nameArray - */ + */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") @@ -324,7 +324,7 @@ public class XmlItem { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") @@ -344,7 +344,7 @@ public class XmlItem { /** * Get prefixString * @return prefixString - */ + */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") @@ -364,7 +364,7 @@ public class XmlItem { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") @@ -384,7 +384,7 @@ public class XmlItem { /** * Get prefixInteger * @return prefixInteger - */ + */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") @@ -404,7 +404,7 @@ public class XmlItem { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") @@ -432,7 +432,7 @@ public class XmlItem { /** * Get prefixArray * @return prefixArray - */ + */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") @@ -460,7 +460,7 @@ public class XmlItem { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") @@ -480,7 +480,7 @@ public class XmlItem { /** * Get namespaceString * @return namespaceString - */ + */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") @@ -500,7 +500,7 @@ public class XmlItem { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") @@ -520,7 +520,7 @@ public class XmlItem { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") @@ -540,7 +540,7 @@ public class XmlItem { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") @@ -568,7 +568,7 @@ public class XmlItem { /** * Get namespaceArray * @return namespaceArray - */ + */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") @@ -596,7 +596,7 @@ public class XmlItem { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") @@ -616,7 +616,7 @@ public class XmlItem { /** * Get prefixNsString * @return prefixNsString - */ + */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") @@ -636,7 +636,7 @@ public class XmlItem { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") @@ -656,7 +656,7 @@ public class XmlItem { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") @@ -676,7 +676,7 @@ public class XmlItem { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") @@ -704,7 +704,7 @@ public class XmlItem { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") @@ -732,7 +732,7 @@ public class XmlItem { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index faf56f050c1..f26422f84eb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 7b0e1e0bb18..b521bf3f13e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesAnyTypeDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index ec96b8285e5..f557293d31a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -39,7 +39,7 @@ public class AdditionalPropertiesArrayDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 2633f0597f0..c56d57ddaa5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesBooleanDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 7f9523caade..62593d95b3b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -77,7 +77,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapString * @return mapString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_string") @@ -105,7 +105,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapNumber * @return mapNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_number") @@ -133,7 +133,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapInteger * @return mapInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_integer") @@ -161,7 +161,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapBoolean * @return mapBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_boolean") @@ -189,7 +189,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapArrayInteger * @return mapArrayInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_integer") @@ -217,7 +217,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapArrayAnytype * @return mapArrayAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") @@ -245,7 +245,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapMapString * @return mapMapString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_string") @@ -273,7 +273,7 @@ public class AdditionalPropertiesClassDto { /** * Get mapMapAnytype * @return mapMapAnytype - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") @@ -293,7 +293,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype1 * @return anytype1 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_1") @@ -313,7 +313,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype2 * @return anytype2 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_2") @@ -333,7 +333,7 @@ public class AdditionalPropertiesClassDto { /** * Get anytype3 * @return anytype3 - */ + */ @ApiModelProperty(value = "") @JsonProperty("anytype_3") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index a725885423a..143ba4c94e2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesIntegerDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index 8db4dffda5c..14496033d63 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -39,7 +39,7 @@ public class AdditionalPropertiesNumberDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index b941c04dc47..249bfadf2e5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -39,7 +39,7 @@ public class AdditionalPropertiesObjectDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 6581423cc4d..36d43c5abbf 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -38,7 +38,7 @@ public class AdditionalPropertiesStringDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java index 6050b6f6200..e4fe0590e02 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -60,7 +60,7 @@ public class AnimalDto { /** * Get className * @return className - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("className") @@ -80,7 +80,7 @@ public class AnimalDto { /** * Get color * @return color - */ + */ @ApiModelProperty(value = "") @JsonProperty("color") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java index 1eb2b096b26..e76238ed98b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -38,7 +38,7 @@ public class ApiResponseDto { /** * Get code * @return code - */ + */ @ApiModelProperty(value = "") @JsonProperty("code") @@ -58,7 +58,7 @@ public class ApiResponseDto { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -78,7 +78,7 @@ public class ApiResponseDto { /** * Get message * @return message - */ + */ @ApiModelProperty(value = "") @JsonProperty("message") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 57c0c4ce680..37d02aba9e3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -47,7 +47,7 @@ public class ArrayOfArrayOfNumberOnlyDto { /** * Get arrayArrayNumber * @return arrayArrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 13d775b9ec8..0bb0c45c637 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -47,7 +47,7 @@ public class ArrayOfNumberOnlyDto { /** * Get arrayNumber * @return arrayNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java index cd960289966..80a883dfd50 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -53,7 +53,7 @@ public class ArrayTestDto { /** * Get arrayOfString * @return arrayOfString - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_of_string") @@ -81,7 +81,7 @@ public class ArrayTestDto { /** * Get arrayArrayOfInteger * @return arrayArrayOfInteger - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") @@ -109,7 +109,7 @@ public class ArrayTestDto { /** * Get arrayArrayOfModel * @return arrayArrayOfModel - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java index 3dd7aa5cb71..6f378548392 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java @@ -90,7 +90,7 @@ public class BigCatDto extends CatDto { /** * Get kind * @return kind - */ + */ @ApiModelProperty(value = "") @JsonProperty("kind") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java index 54ff482ecc3..159cfbc054b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -44,7 +44,7 @@ public class CapitalizationDto { /** * Get smallCamel * @return smallCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("smallCamel") @@ -64,7 +64,7 @@ public class CapitalizationDto { /** * Get capitalCamel * @return capitalCamel - */ + */ @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") @@ -84,7 +84,7 @@ public class CapitalizationDto { /** * Get smallSnake * @return smallSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("small_Snake") @@ -104,7 +104,7 @@ public class CapitalizationDto { /** * Get capitalSnake * @return capitalSnake - */ + */ @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") @@ -124,7 +124,7 @@ public class CapitalizationDto { /** * Get scAETHFlowPoints * @return scAETHFlowPoints - */ + */ @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") @@ -144,7 +144,7 @@ public class CapitalizationDto { /** * Name of the pet * @return ATT_NAME - */ + */ @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java index bae14499a21..880f1dc5d7d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java @@ -57,7 +57,7 @@ public class CatDto extends AnimalDto { /** * Get declawed * @return declawed - */ + */ @ApiModelProperty(value = "") @JsonProperty("declawed") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java index 4709a05ec4b..a71d7fa2937 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java @@ -47,7 +47,7 @@ public class CategoryDto { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -67,7 +67,7 @@ public class CategoryDto { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 5b2f3749da0..cad1b8482b2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -42,7 +42,7 @@ public class ChildWithNullableDto extends ParentWithNullableDto { /** * Get otherProperty * @return otherProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("otherProperty") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java index dcacbad3fa0..8dcdaeb92a2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java @@ -35,7 +35,7 @@ public class ClassModelDto { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("_class") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java index de735248077..9a65b3999a3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java @@ -34,7 +34,7 @@ public class ClientDto { /** * Get client * @return client - */ + */ @ApiModelProperty(value = "") @JsonProperty("client") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index d53609f528b..e1be03319ba 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -69,7 +69,7 @@ public class ContainerDefaultValueDto { /** * Get nullableArray * @return nullableArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array") @@ -97,7 +97,7 @@ public class ContainerDefaultValueDto { /** * Get nullableRequiredArray * @return nullableRequiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("nullable_required_array") @@ -125,7 +125,7 @@ public class ContainerDefaultValueDto { /** * Get requiredArray * @return requiredArray - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("required_array") @@ -153,7 +153,7 @@ public class ContainerDefaultValueDto { /** * Get nullableArrayWithDefault * @return nullableArrayWithDefault - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullable_array_with_default") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java index 040f5870a72..aec4145fa7c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java @@ -50,7 +50,7 @@ public class DogDto extends AnimalDto { /** * Get breed * @return breed - */ + */ @ApiModelProperty(value = "") @JsonProperty("breed") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java index 739b85c3a2b..05d7c3ef66f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -111,7 +111,7 @@ public class EnumArraysDto { /** * Get justSymbol * @return justSymbol - */ + */ @ApiModelProperty(value = "") @JsonProperty("just_symbol") @@ -139,7 +139,7 @@ public class EnumArraysDto { /** * Get arrayEnum * @return arrayEnum - */ + */ @ApiModelProperty(value = "") @JsonProperty("array_enum") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java index 1ea195f30c5..c828fd6e4ef 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -199,7 +199,7 @@ public class EnumTestDto { /** * Get enumString * @return enumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_string") @@ -219,7 +219,7 @@ public class EnumTestDto { /** * Get enumStringRequired * @return enumStringRequired - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("enum_string_required") @@ -239,7 +239,7 @@ public class EnumTestDto { /** * Get enumInteger * @return enumInteger - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_integer") @@ -259,7 +259,7 @@ public class EnumTestDto { /** * Get enumNumber * @return enumNumber - */ + */ @ApiModelProperty(value = "") @JsonProperty("enum_number") @@ -279,7 +279,7 @@ public class EnumTestDto { /** * Get outerEnum * @return outerEnum - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("outerEnum") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java index a9cd428c8b0..b0fca6a811f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java @@ -35,7 +35,7 @@ public class FileDto { /** * Test capitalization * @return sourceURI - */ + */ @ApiModelProperty(value = "Test capitalization") @JsonProperty("sourceURI") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index c19266d0596..dd62b6831e4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -41,7 +41,7 @@ public class FileSchemaTestClassDto { /** * Get file * @return file - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("file") @@ -69,7 +69,7 @@ public class FileSchemaTestClassDto { /** * Get files * @return files - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("files") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java index c658a02e74a..d632f7e215c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java @@ -84,7 +84,7 @@ public class FormatTestDto { * minimum: 10 * maximum: 100 * @return integer - */ + */ @Min(10) @Max(100) @ApiModelProperty(value = "") @JsonProperty("integer") @@ -106,7 +106,7 @@ public class FormatTestDto { * minimum: 20 * maximum: 200 * @return int32 - */ + */ @Min(20) @Max(200) @ApiModelProperty(value = "") @JsonProperty("int32") @@ -126,7 +126,7 @@ public class FormatTestDto { /** * Get int64 * @return int64 - */ + */ @ApiModelProperty(value = "") @JsonProperty("int64") @@ -148,7 +148,7 @@ public class FormatTestDto { * minimum: 32.1 * maximum: 543.2 * @return number - */ + */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") @JsonProperty("number") @@ -170,7 +170,7 @@ public class FormatTestDto { * minimum: 54.3 * maximum: 987.6 * @return _float - */ + */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") @JsonProperty("float") @@ -192,7 +192,7 @@ public class FormatTestDto { * minimum: 67.8 * maximum: 123.4 * @return _double - */ + */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") @JsonProperty("double") @@ -212,7 +212,7 @@ public class FormatTestDto { /** * Get string * @return string - */ + */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") @JsonProperty("string") @@ -232,7 +232,7 @@ public class FormatTestDto { /** * Get _byte * @return _byte - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("byte") @@ -252,7 +252,7 @@ public class FormatTestDto { /** * Get binary * @return binary - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("binary") @@ -272,7 +272,7 @@ public class FormatTestDto { /** * Get date * @return date - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("date") @@ -292,7 +292,7 @@ public class FormatTestDto { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -312,7 +312,7 @@ public class FormatTestDto { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") @@ -332,7 +332,7 @@ public class FormatTestDto { /** * Get password * @return password - */ + */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") @JsonProperty("password") @@ -352,7 +352,7 @@ public class FormatTestDto { /** * Get bigDecimal * @return bigDecimal - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("BigDecimal") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index ef11a456fb1..05b85b509e7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -36,7 +36,7 @@ public class HasOnlyReadOnlyDto { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class HasOnlyReadOnlyDto { /** * Get foo * @return foo - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("foo") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java index 7b3ddaf5eef..4221eb5747e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java @@ -34,7 +34,7 @@ public class ListDto { /** * Get _123List * @return _123List - */ + */ @ApiModelProperty(value = "") @JsonProperty("123-list") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java index 4ea171927fb..5faa090cebb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java @@ -90,7 +90,7 @@ public class MapTestDto { /** * Get mapMapOfString * @return mapMapOfString - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") @@ -118,7 +118,7 @@ public class MapTestDto { /** * Get mapOfEnumString * @return mapOfEnumString - */ + */ @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") @@ -146,7 +146,7 @@ public class MapTestDto { /** * Get directMap * @return directMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("direct_map") @@ -174,7 +174,7 @@ public class MapTestDto { /** * Get indirectMap * @return indirectMap - */ + */ @ApiModelProperty(value = "") @JsonProperty("indirect_map") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index ca97a23a2fd..51676758fda 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -46,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get uuid * @return uuid - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("uuid") @@ -66,7 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get dateTime * @return dateTime - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("dateTime") @@ -94,7 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { /** * Get map * @return map - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("map") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java index 23b2df79300..c919abe77b9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -37,7 +37,7 @@ public class Model200ResponseDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") @@ -57,7 +57,7 @@ public class Model200ResponseDto { /** * Get propertyClass * @return propertyClass - */ + */ @ApiModelProperty(value = "") @JsonProperty("class") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java index 84f0509c925..0780e1b9029 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java @@ -52,7 +52,7 @@ public class NameDto { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("name") @@ -72,7 +72,7 @@ public class NameDto { /** * Get snakeCase * @return snakeCase - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("snake_case") @@ -92,7 +92,7 @@ public class NameDto { /** * Get property * @return property - */ + */ @ApiModelProperty(value = "") @JsonProperty("property") @@ -112,7 +112,7 @@ public class NameDto { /** * Get _123Number * @return _123Number - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("123Number") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index 4264917eb95..ce204ae6207 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -48,7 +48,7 @@ public class NullableMapPropertyDto { /** * Get languageValues * @return languageValues - */ + */ @ApiModelProperty(value = "") @JsonProperty("languageValues") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java index 5c17d5583f7..32de9679a46 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -35,7 +35,7 @@ public class NumberOnlyDto { /** * Get justNumber * @return justNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("JustNumber") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java index 672452b13ed..35f29b64046 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java @@ -85,7 +85,7 @@ public class OrderDto { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -105,7 +105,7 @@ public class OrderDto { /** * Get petId * @return petId - */ + */ @ApiModelProperty(value = "") @JsonProperty("petId") @@ -125,7 +125,7 @@ public class OrderDto { /** * Get quantity * @return quantity - */ + */ @ApiModelProperty(value = "") @JsonProperty("quantity") @@ -145,7 +145,7 @@ public class OrderDto { /** * Get shipDate * @return shipDate - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("shipDate") @@ -165,7 +165,7 @@ public class OrderDto { /** * Order Status * @return status - */ + */ @ApiModelProperty(value = "Order Status") @JsonProperty("status") @@ -185,7 +185,7 @@ public class OrderDto { /** * Get complete * @return complete - */ + */ @ApiModelProperty(value = "") @JsonProperty("complete") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java index 9f920547acb..ddc93734c0b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -39,7 +39,7 @@ public class OuterCompositeDto { /** * Get myNumber * @return myNumber - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("my_number") @@ -59,7 +59,7 @@ public class OuterCompositeDto { /** * Get myString * @return myString - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_string") @@ -79,7 +79,7 @@ public class OuterCompositeDto { /** * Get myBoolean * @return myBoolean - */ + */ @ApiModelProperty(value = "") @JsonProperty("my_boolean") 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 9c08046a256..1aed4f549bf 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 @@ -84,7 +84,7 @@ public class ParentWithNullableDto { /** * Get type * @return type - */ + */ @ApiModelProperty(value = "") @JsonProperty("type") @@ -104,7 +104,7 @@ public class ParentWithNullableDto { /** * Get nullableProperty * @return nullableProperty - */ + */ @ApiModelProperty(value = "") @JsonProperty("nullableProperty") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 17511cbbb27..002669613e8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -105,7 +105,7 @@ public class PetDto { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -125,7 +125,7 @@ public class PetDto { /** * Get category * @return category - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("category") @@ -145,7 +145,7 @@ public class PetDto { /** * Get name * @return name - */ + */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") @@ -173,7 +173,7 @@ public class PetDto { /** * Get photoUrls * @return photoUrls - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @@ -202,7 +202,7 @@ public class PetDto { /** * Get tags * @return tags - */ + */ @Valid @ApiModelProperty(value = "") @JsonProperty("tags") @@ -223,7 +223,7 @@ public class PetDto { * pet status in the store * @return status * @deprecated - */ + */ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") @@ -234,7 +234,7 @@ public class PetDto { /** * @deprecated - */ + */ @Deprecated public void setStatus(StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 8b908d3045b..54a4b3f70be 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -36,7 +36,7 @@ public class ReadOnlyFirstDto { /** * Get bar * @return bar - */ + */ @ApiModelProperty(readOnly = true, value = "") @JsonProperty("bar") @@ -56,7 +56,7 @@ public class ReadOnlyFirstDto { /** * Get baz * @return baz - */ + */ @ApiModelProperty(value = "") @JsonProperty("baz") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index ce63b54729c..51a8e0eea10 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -40,7 +40,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get normalPropertyName * @return normalPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("normalPropertyName") @@ -60,7 +60,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get UPPER_CASE_PROPERTY_SNAKE * @return UPPER_CASE_PROPERTY_SNAKE - */ + */ @ApiModelProperty(value = "") @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") @@ -80,7 +80,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get lowerCasePropertyDashes * @return lowerCasePropertyDashes - */ + */ @ApiModelProperty(value = "") @JsonProperty("lower-case-property-dashes") @@ -100,7 +100,7 @@ public class ResponseObjectWithDifferentFieldNamesDto { /** * Get propertyNameWithSpaces * @return propertyNameWithSpaces - */ + */ @ApiModelProperty(value = "") @JsonProperty("property name with spaces") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java index 6936018c054..50b73c3370f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java @@ -35,7 +35,7 @@ public class ReturnDto { /** * Get _return * @return _return - */ + */ @ApiModelProperty(value = "") @JsonProperty("return") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 7939b42772e..ceee7ac96df 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -34,7 +34,7 @@ public class SpecialModelNameDto { /** * Get $SpecialPropertyName * @return $SpecialPropertyName - */ + */ @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java index 851d5e516e4..f38e76aab73 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java @@ -36,7 +36,7 @@ public class TagDto { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -56,7 +56,7 @@ public class TagDto { /** * Get name * @return name - */ + */ @ApiModelProperty(value = "") @JsonProperty("name") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 61d60b9c468..c0714f7df83 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -62,7 +62,7 @@ public class TypeHolderDefaultDto { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("string_item") @@ -82,7 +82,7 @@ public class TypeHolderDefaultDto { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(required = true, value = "") @JsonProperty("number_item") @@ -102,7 +102,7 @@ public class TypeHolderDefaultDto { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("integer_item") @@ -122,7 +122,7 @@ public class TypeHolderDefaultDto { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("bool_item") @@ -150,7 +150,7 @@ public class TypeHolderDefaultDto { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 07106237e2c..83e552f1024 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -65,7 +65,7 @@ public class TypeHolderExampleDto { /** * Get stringItem * @return stringItem - */ + */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty("string_item") @@ -85,7 +85,7 @@ public class TypeHolderExampleDto { /** * Get numberItem * @return numberItem - */ + */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("number_item") @@ -105,7 +105,7 @@ public class TypeHolderExampleDto { /** * Get floatItem * @return floatItem - */ + */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty("float_item") @@ -125,7 +125,7 @@ public class TypeHolderExampleDto { /** * Get integerItem * @return integerItem - */ + */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty("integer_item") @@ -145,7 +145,7 @@ public class TypeHolderExampleDto { /** * Get boolItem * @return boolItem - */ + */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty("bool_item") @@ -173,7 +173,7 @@ public class TypeHolderExampleDto { /** * Get arrayItem * @return arrayItem - */ + */ @NotNull @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") @JsonProperty("array_item") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java index 0b1b6c9b085..42a4374de53 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java @@ -48,7 +48,7 @@ public class UserDto { /** * Get id * @return id - */ + */ @ApiModelProperty(value = "") @JsonProperty("id") @@ -68,7 +68,7 @@ public class UserDto { /** * Get username * @return username - */ + */ @ApiModelProperty(value = "") @JsonProperty("username") @@ -88,7 +88,7 @@ public class UserDto { /** * Get firstName * @return firstName - */ + */ @ApiModelProperty(value = "") @JsonProperty("firstName") @@ -108,7 +108,7 @@ public class UserDto { /** * Get lastName * @return lastName - */ + */ @ApiModelProperty(value = "") @JsonProperty("lastName") @@ -128,7 +128,7 @@ public class UserDto { /** * Get email * @return email - */ + */ @ApiModelProperty(value = "") @JsonProperty("email") @@ -148,7 +148,7 @@ public class UserDto { /** * Get password * @return password - */ + */ @ApiModelProperty(value = "") @JsonProperty("password") @@ -168,7 +168,7 @@ public class UserDto { /** * Get phone * @return phone - */ + */ @ApiModelProperty(value = "") @JsonProperty("phone") @@ -188,7 +188,7 @@ public class UserDto { /** * User Status * @return userStatus - */ + */ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java index b237b4b1e84..404f73b50d4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java @@ -103,7 +103,7 @@ public class XmlItemDto { /** * Get attributeString * @return attributeString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("attribute_string") @@ -123,7 +123,7 @@ public class XmlItemDto { /** * Get attributeNumber * @return attributeNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("attribute_number") @@ -143,7 +143,7 @@ public class XmlItemDto { /** * Get attributeInteger * @return attributeInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("attribute_integer") @@ -163,7 +163,7 @@ public class XmlItemDto { /** * Get attributeBoolean * @return attributeBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("attribute_boolean") @@ -191,7 +191,7 @@ public class XmlItemDto { /** * Get wrappedArray * @return wrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("wrapped_array") @@ -211,7 +211,7 @@ public class XmlItemDto { /** * Get nameString * @return nameString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("name_string") @@ -231,7 +231,7 @@ public class XmlItemDto { /** * Get nameNumber * @return nameNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("name_number") @@ -251,7 +251,7 @@ public class XmlItemDto { /** * Get nameInteger * @return nameInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("name_integer") @@ -271,7 +271,7 @@ public class XmlItemDto { /** * Get nameBoolean * @return nameBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("name_boolean") @@ -299,7 +299,7 @@ public class XmlItemDto { /** * Get nameArray * @return nameArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_array") @@ -327,7 +327,7 @@ public class XmlItemDto { /** * Get nameWrappedArray * @return nameWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("name_wrapped_array") @@ -347,7 +347,7 @@ public class XmlItemDto { /** * Get prefixString * @return prefixString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_string") @@ -367,7 +367,7 @@ public class XmlItemDto { /** * Get prefixNumber * @return prefixNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_number") @@ -387,7 +387,7 @@ public class XmlItemDto { /** * Get prefixInteger * @return prefixInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_integer") @@ -407,7 +407,7 @@ public class XmlItemDto { /** * Get prefixBoolean * @return prefixBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_boolean") @@ -435,7 +435,7 @@ public class XmlItemDto { /** * Get prefixArray * @return prefixArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_array") @@ -463,7 +463,7 @@ public class XmlItemDto { /** * Get prefixWrappedArray * @return prefixWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_wrapped_array") @@ -483,7 +483,7 @@ public class XmlItemDto { /** * Get namespaceString * @return namespaceString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("namespace_string") @@ -503,7 +503,7 @@ public class XmlItemDto { /** * Get namespaceNumber * @return namespaceNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("namespace_number") @@ -523,7 +523,7 @@ public class XmlItemDto { /** * Get namespaceInteger * @return namespaceInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("namespace_integer") @@ -543,7 +543,7 @@ public class XmlItemDto { /** * Get namespaceBoolean * @return namespaceBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("namespace_boolean") @@ -571,7 +571,7 @@ public class XmlItemDto { /** * Get namespaceArray * @return namespaceArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_array") @@ -599,7 +599,7 @@ public class XmlItemDto { /** * Get namespaceWrappedArray * @return namespaceWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("namespace_wrapped_array") @@ -619,7 +619,7 @@ public class XmlItemDto { /** * Get prefixNsString * @return prefixNsString - */ + */ @ApiModelProperty(example = "string", value = "") @JsonProperty("prefix_ns_string") @@ -639,7 +639,7 @@ public class XmlItemDto { /** * Get prefixNsNumber * @return prefixNsNumber - */ + */ @Valid @ApiModelProperty(example = "1.234", value = "") @JsonProperty("prefix_ns_number") @@ -659,7 +659,7 @@ public class XmlItemDto { /** * Get prefixNsInteger * @return prefixNsInteger - */ + */ @ApiModelProperty(example = "-2", value = "") @JsonProperty("prefix_ns_integer") @@ -679,7 +679,7 @@ public class XmlItemDto { /** * Get prefixNsBoolean * @return prefixNsBoolean - */ + */ @ApiModelProperty(example = "true", value = "") @JsonProperty("prefix_ns_boolean") @@ -707,7 +707,7 @@ public class XmlItemDto { /** * Get prefixNsArray * @return prefixNsArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_array") @@ -735,7 +735,7 @@ public class XmlItemDto { /** * Get prefixNsWrappedArray * @return prefixNsWrappedArray - */ + */ @ApiModelProperty(value = "") @JsonProperty("prefix_ns_wrapped_array") diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index f9880b8dee5..8e4565fad64 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1609,6 +1609,7 @@ components: uuid: example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid + maxLength: 36 type: string password: format: password diff --git a/website/src/dynamic/sponsors.yml b/website/src/dynamic/sponsors.yml old mode 100644 new mode 100755 index 0ddf0d18606..56057721fe7 --- a/website/src/dynamic/sponsors.yml +++ b/website/src/dynamic/sponsors.yml @@ -121,5 +121,10 @@ - caption: "it@m" image: "img/companies/itm.png" - infoLink: "https://opensource.muenchen.de/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship" + infoLink: "https://opensource.muenchen.de/software/openapi-generator.html?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship" + bronze: true +- + caption: "Kong" + image: "img/companies/kong.png" + infoLink: "https://konghq.com/products/kong-konnect?utm_medium=referral&utm_source=github&utm_campaign=platform&utm_content=openapi-generator" bronze: true diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml old mode 100644 new mode 100755 index edaa7c613ab..c2cacb84f8b --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -48,6 +48,11 @@ image: "img/companies/logo-askul-01.gif" infoLink: "https://www.askul.co.jp/" pinned: true +- + caption: aspectivo + image: "img/companies/aspectivo.png" + infoLink: "https://aspectivo.ai/" + pinned: false - caption: Amazon Web Services (AWS) image: "img/companies/aws.png" @@ -301,7 +306,7 @@ - caption: "Landeshauptstadt München - it@M" image: "img/companies/it-at-m.png" - infoLink: "https://muenchen.digital/it-at-m/" + infoLink: "https://opensource.muenchen.de/software/openapi-generator.html" pinned: false - caption: "Linode" diff --git a/website/static/img/companies/aspectivo.png b/website/static/img/companies/aspectivo.png new file mode 100644 index 00000000000..24df02b7f7f Binary files /dev/null and b/website/static/img/companies/aspectivo.png differ diff --git a/website/static/img/companies/kong.png b/website/static/img/companies/kong.png new file mode 100644 index 00000000000..5e40445ce3b Binary files /dev/null and b/website/static/img/companies/kong.png differ